/* Source-preserving crop display. The original img remains available to gallery code. */
.crop-frame-display{position:relative;overflow:hidden}
.crop-frame-original{visibility:hidden!important}
.crop-frame-render{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:hidden;pointer-events:none}
.crop-frame-render[hidden],.crop-frame-detail[hidden]{display:none!important}
.photo-frame>.crop-frame-render{z-index:0}
.photo-frame>.photo-open{z-index:1}
.crop-frame-detail{width:min(100%,calc(65dvh * var(--crop-frame-aspect,1)));max-height:65dvh;aspect-ratio:var(--crop-frame-aspect,1);margin:auto;background:#e5e7df}
.crop-frame-detail>#photo-full,.crop-frame-detail>.crop-frame-original{position:absolute;inset:0;width:100%;height:100%;margin:0;max-height:100%;object-fit:contain}
/* This editor is mounted only by the protected owner interface. */
.crop-frame-editor{color:var(--ink,#2b3029);font:13px/1.55 system-ui,sans-serif;min-width:0;--crop-accent:#59674c;--crop-ring:#fbf8ee}
.crop-frame-help{max-width:66ch;margin:0 0 18px;color:var(--muted,#65695e);font-size:12px}
.crop-frame-stage{position:relative;isolation:isolate;overflow:hidden;width:min(100%,calc(54dvh * var(--crop-source-aspect,.754)));max-width:560px;aspect-ratio:var(--crop-source-aspect,.754);margin:0 auto;background:#e3e1d7;border-radius:9px;box-shadow:0 12px 32px -24px #1e2c1d70;touch-action:none}
.crop-frame-source{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;pointer-events:none}
.crop-frame-selection{position:absolute;box-sizing:border-box;outline:1px solid #293627;border:2px solid var(--crop-ring);box-shadow:0 0 0 100vmax #17201675;cursor:move;touch-action:none;visibility:hidden}
.crop-frame-loaded .crop-frame-selection{visibility:visible}
.crop-frame-selection::before,.crop-frame-selection::after{content:'';position:absolute;inset:33.333% 0;border-block:1px solid #fff6;pointer-events:none}
.crop-frame-selection::after{inset:0 33.333%;border-block:0;border-inline:1px solid #fff6}
.crop-frame-selection:focus-visible{outline:3px solid #dbb96d;outline-offset:3px}
.crop-frame-handle{position:absolute!important;display:grid!important;place-items:center!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;max-width:none!important;padding:0!important;border:0!important;border-radius:50%!important;background:transparent!important;box-shadow:none!important;touch-action:none;z-index:2;transform:translate(-50%,-50%)}
.crop-frame-handle::after{content:'';width:13px;height:13px;background:var(--crop-ring);border:2px solid #45583e;box-shadow:0 1px 4px #15211280;border-radius:50%}
.crop-frame-handle-nw{left:0;top:0;transform:none;cursor:nwse-resize}.crop-frame-handle-ne{left:100%;top:0;transform:translate(-100%,0);cursor:nesw-resize}.crop-frame-handle-sw{left:0;top:100%;transform:translate(0,-100%);cursor:nesw-resize}.crop-frame-handle-se{left:100%;top:100%;transform:translate(-100%,-100%);cursor:nwse-resize}
.crop-frame-handle:focus-visible{outline:3px solid #e2bd67!important;outline-offset:-5px}
.crop-frame-dragging .crop-frame-selection{cursor:grabbing}
.crop-frame-status{min-height:1.6em;margin:14px 0 18px;text-align:center;font-size:11px;color:var(--muted,#65695e)}
.crop-frame-sliders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 24px;padding-top:18px;border-top:1px solid var(--line,#d6d8cc)}
.crop-frame-slider{display:block!important;min-width:0;margin:0!important;font-size:12px}
.crop-frame-slider-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.crop-frame-slider output{font:11px/1.4 system-ui,sans-serif;color:var(--muted,#65695e);font-variant-numeric:tabular-nums}
.crop-frame-slider input[type=range]{display:block;width:100%;height:44px;min-height:44px;margin:1px 0 0;padding:0;accent-color:var(--crop-accent);cursor:pointer;border:0;background:transparent;box-shadow:none}
.crop-frame-slider input:focus-visible{outline:3px solid #8a7354;outline-offset:3px;border-radius:8px}
@media(max-width:440px){.crop-frame-sliders{grid-template-columns:1fr;gap:8px}.crop-frame-stage{max-height:49dvh;width:min(100%,calc(49dvh * var(--crop-source-aspect,.754)))}.crop-frame-help{font-size:11px}}
@media(prefers-reduced-motion:reduce){.crop-frame-editor *,.crop-frame-render{animation:none!important;transition:none!important}}
@media(forced-colors:active){.crop-frame-selection{border-color:Highlight;outline-color:CanvasText}.crop-frame-handle::after{background:Highlight;border-color:CanvasText}.crop-frame-slider input:focus-visible,.crop-frame-selection:focus-visible{outline-color:Highlight}}

.crop-frame-viewport{overflow:auto;max-height:52dvh;overscroll-behavior:contain;border:1px solid var(--line,#b8aaa0)}.crop-frame-viewport .crop-frame-stage{max-width:none!important;transform:none!important}.crop-frame-view-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0}.crop-frame-view-tools button{min-width:44px;min-height:44px;border:1px solid currentColor;border-radius:22px;background:transparent;color:inherit;padding:8px 12px}.crop-frame-view-tools output{font-variant-numeric:tabular-nums;min-width:48px;text-align:center}.crop-frame-view-help{font:12px/1.5 Arial,sans-serif;margin:6px 0 10px}

.crop-frame-viewport .crop-frame-stage{max-height:none!important}.crop-frame-pan .crop-frame-stage{touch-action:pan-x pan-y}.crop-frame-pan .crop-frame-selection{pointer-events:none}.crop-frame-pan .crop-frame-stage{cursor:grab}
