.image-frame-dialog{box-sizing:border-box;width:min(620px,calc(100vw - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right))));max-width:calc(100vw - 24px);max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)));margin:auto;padding:20px;border:1px solid #ffffff45;border-radius:22px;background:#111118;color:#f4f3fa;overflow:auto;overscroll-behavior:contain;font:14px/1.45 system-ui,sans-serif;box-shadow:0 16px 60px #0009;}
.image-frame-dialog::backdrop{background:#030306ce;backdrop-filter:blur(5px);}
.image-frame-dialog *{box-sizing:border-box;}
.image-frame-dialog h2{margin:0 0 7px;font:650 clamp(19px,5vw,25px)/1.2 system-ui;overflow-wrap:anywhere;}
.image-frame-help,.image-frame-status{margin:7px 0 12px;font-size:12px;line-height:1.5;color:#c9c7d3;overflow-wrap:anywhere;}
.image-frame-stage{display:flex;align-items:center;justify-content:center;min-width:0;min-height:60px;width:100%;margin:12px 0;overflow:hidden;border:1px solid #ffffff35;border-radius:14px;background:#08090d;}
.image-frame-preview{display:block;width:auto;height:auto;max-width:100%;max-height:min(44dvh,440px);touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;}
.image-frame-preview.image-frame-circle{border-radius:50%;}
.image-frame-preview:active{cursor:grabbing;}
.image-frame-zoom{display:grid;grid-template-columns:42px minmax(0,1fr) 42px 54px;align-items:center;gap:8px;min-width:0;margin:12px 0;}
.image-frame-dialog button{min-width:0;min-height:42px;max-width:100%;padding:9px 12px;border:1px solid #ffffff4a;border-radius:13px;background:#ffffff18;color:#f6f5fb;font:600 13px/1.3 system-ui;white-space:normal;overflow-wrap:anywhere;cursor:pointer;}
.image-frame-zoom button{width:42px;height:42px;padding:0;font-size:22px;}
.image-frame-zoom input[type=range]{width:100%;min-width:0;max-width:100%;margin:0;accent-color:#c2b5f5;}
.image-frame-zoom output{font:600 12px/1 system-ui;font-variant-numeric:tabular-nums;text-align:center;}
.image-frame-presets,.image-frame-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;min-width:0;}
.image-frame-actions{margin-top:12px;}
.image-frame-dialog .image-frame-apply{border-color:#e2d6ff99;background:#a88fdb4d;}
.image-frame-dialog button:disabled,.image-frame-dialog input:disabled{opacity:.45;cursor:wait;}
.image-frame-dialog :is(button,input):focus-visible{outline:2px solid #d9cbff;outline-offset:3px;}
@media(max-width:420px){.image-frame-dialog{padding:16px 12px;border-radius:18px;}.image-frame-zoom{grid-template-columns:40px minmax(0,1fr) 40px 48px;gap:5px;}.image-frame-zoom button{width:40px;}.image-frame-help,.image-frame-status{font-size:11px;}.image-frame-preview{max-height:40dvh;}}
@media(max-height:560px){.image-frame-dialog{padding:12px;}.image-frame-preview{max-height:32dvh;}.image-frame-help{margin-bottom:5px;}.image-frame-zoom{margin-block:7px;}.image-frame-status{margin-bottom:5px;}}
@media(prefers-reduced-motion:reduce){.image-frame-dialog,.image-frame-dialog *{scroll-behavior:auto;}}

/* Live cover keeps only its crop viewport, zoom and essential actions. */
.image-frame-dialog.image-frame-minimal{display:flex;flex-direction:column;gap:10px;padding:12px;}
.image-frame-minimal .image-frame-stage{margin:0;}
.image-frame-minimal .image-frame-preview{max-height:min(68dvh,calc(100dvh - 152px));}
.image-frame-minimal .image-frame-zoom{display:flex;min-height:44px;margin:0;}
.image-frame-minimal .image-frame-zoom input[type=range]{min-height:44px;}
.image-frame-minimal .image-frame-actions{margin:0;}
.image-frame-minimal .image-frame-actions button{min-height:44px;}
.image-frame-dialog .image-frame-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;}

/* Centered image preparation: the preview is the only zoom surface.
   No layout or pixels outside this editor are changed. */
.image-frame-dialog.image-frame-auto{display:flex;flex-direction:column;gap:10px;}
.image-frame-auto .image-frame-stage{margin:0;}
.image-frame-auto .image-frame-preview,
.image-frame-auto .image-frame-preview:active{cursor:default;}
.image-frame-auto .image-frame-actions{margin:0;}
.image-frame-auto .image-frame-actions button{min-height:44px;}
.image-frame-auto .image-frame-preview:focus-visible{outline:2px solid #d9cbff;outline-offset:-3px;}

