/* The image stays on screen; primary tools and zoom never sit inside a menu. */
.refiner{width:min(1060px,calc(100vw - 32px));height:min(900px,calc(100dvh - 32px))}
.refiner .studio-header{min-height:64px;padding:10px 20px;gap:12px}.refiner .studio-header h2{font-size:21px}.refiner .studio-header .mono{display:none}.refiner .studio-header .dialog-close{position:static;flex-shrink:0}.refiner #image-undo{margin-left:auto;min-height:44px;padding:8px 12px;font-size:12px}
.refiner .image-editor-layout{display:flex;flex-direction:column;overflow:hidden}.refiner .image-editor-main{order:0;flex:1;min-height:0}.refiner .image-editor-tools{order:1;display:block;height:auto;flex:none;padding:8px 18px;border:0;border-top:1px solid #dce1e5;overflow:visible;background:white}
.refiner .studio-board-toolbar{order:1;padding:5px 16px;display:flex;gap:8px;min-height:54px;background:white;border-top:1px solid #dce1e5}.refiner .studio-board-toolbar label{margin:0;font-size:11px;gap:7px}.refiner .studio-board-toolbar select{font-size:12px;min-height:44px;width:90px}.refiner .studio-board-toolbar [hidden]{display:none!important}.refiner-zoom{display:flex;align-items:center;gap:3px}.refiner-zoom button{min-width:44px;min-height:44px;border-radius:8px;font-size:23px}.refiner-zoom output{width:44px;text-align:center;font:11px 'IBM Plex Mono',monospace}.refiner-zoom #image-fit{font-size:12px;padding:7px 10px}
.refiner .image-canvas-scroll{position:relative;flex:1;min-height:0;overflow:hidden;padding:0;touch-action:none}.refiner .image-canvas-scroll canvas{position:absolute;inset:0;width:100%;height:100%;margin:0;background-color:#fafbfd;background-image:conic-gradient(#e5e9ee 25%,transparent 0 50%,#e5e9ee 0 75%,transparent 0);background-size:18px 18px}.refiner #image-editor-status{order:2;min-height:30px;padding:6px 16px;font-size:11px;line-height:1.4;text-align:center;color:#626d7a;background:#f8f9fc}
.refiner-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.refiner-tools button{min-height:56px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;border-radius:9px;font-size:11px;padding:5px 2px}.refiner-tools button span{display:grid;place-items:center;height:23px}.refiner-tools svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}.refiner-tools button[aria-pressed=true]{background:#edf0ff;color:#354ab7}
.refiner-context{min-height:58px;display:flex;align-items:center}.refiner-context>[data-refiner-control]{width:100%;display:flex;gap:18px;align-items:center;margin:0}.refiner [hidden]{display:none!important}.refiner-context label{flex:1;margin:0;gap:0;min-width:0;font-size:11px}.refiner-context input[type=range]{min-height:34px}.refiner-context button{min-height:44px;padding:8px 16px;border:1px solid #d7deec;border-radius:8px;font-size:12px}.refiner #image-remove-bg{background:#edf0ff;color:#354ab7}.refiner-context p{font-size:11px;color:#687482;line-height:1.5;text-align:center;justify-content:center}
.refiner .studio-footer{min-height:62px;gap:12px;padding:8px 18px calc(8px + env(safe-area-inset-bottom));border-top:1px solid #e3e6ed;background:white}.refiner #image-effects{min-height:44px;min-width:72px;padding:8px 12px;font-size:12px}.refiner #image-commit{flex:1;min-height:46px;font-size:14px;border-radius:8px}.refiner[data-effects=true] .refiner-tools,.refiner[data-effects=true] .refiner-context{display:none}
.refiner-effect-tabs{display:flex;gap:6px;margin-bottom:6px}.refiner-effect-tabs button{flex:1;min-height:40px;border-radius:8px;font-size:12px}.refiner-effect-tabs button[aria-pressed=true]{background:#edf0ff}.refiner [data-effect-page]{display:grid;grid-template-columns:1fr 1fr;gap:6px}.refiner [data-effect-page]>.studio-properties-grid{grid-column:1/-1}.refiner [data-effect-page] label{margin:0;gap:3px;font-size:11px}.refiner [data-effect-page] button{border:1px solid #dce1eb;min-height:42px;border-radius:8px;padding:6px;font-size:11px}.refiner [data-effect-page] input[type=color]{height:36px}
@media(max-width:760px){.refiner{width:100vw;height:100dvh;margin:0;border:0;border-radius:0}.refiner .studio-header{min-height:56px;padding:6px 10px;gap:6px}.refiner .studio-header h2{font-size:17px}.refiner .image-editor-tools{padding:5px 8px}.refiner .studio-board-toolbar{padding:3px 6px;gap:0}.refiner .studio-board-toolbar label{font-size:0;gap:0}.refiner .studio-board-toolbar select{width:87px;font-size:12px;padding:5px}.refiner #image-editor-status{min-height:34px;padding:5px 10px;font-size:10px}.refiner-tools{gap:2px}.refiner-tools button{font-size:10px;min-height:54px}.refiner-context{min-height:58px}.refiner-context>[data-refiner-control]{gap:10px}.refiner-context button{font-size:11px;padding:8px 10px}.refiner-context label{font-size:10px}.refiner .studio-footer{min-height:58px;padding:6px 10px calc(6px + env(safe-area-inset-bottom))}.refiner .studio-footer #image-commit{font-size:13px}.refiner-zoom #image-fit{padding:7px;font-size:11px}}
@media(max-width:760px) and (orientation:landscape) and (max-height:480px){.refiner .studio-header{min-height:46px;padding-block:1px}.refiner .studio-header h2{font-size:16px}.refiner .image-editor-layout{flex-direction:row}.refiner .image-editor-tools{width:44%;border-left:1px solid #dce1e5;border-top:0;padding:6px}.refiner .studio-board-toolbar{padding:0 4px;min-height:44px}.refiner .studio-board-toolbar label{display:none}.refiner #image-editor-status{min-height:27px;padding:5px;font-size:9px}.refiner-context>[data-refiner-control]{flex-wrap:wrap;gap:3px}.refiner-context label{min-width:85px}.refiner-tools button{font-size:9px}.refiner .studio-footer{min-height:50px;padding:2px 12px}.refiner [data-effect-page] button{min-height:34px;font-size:10px}.refiner-effect-tabs{margin-bottom:3px}.refiner-effect-tabs button{min-height:34px}.refiner [data-effect-page] input[type=color]{height:30px}}
.refiner #image-cancel-process{display:none;order:2;min-height:44px;font-size:12px;color:#354ab7;background:#edf0ff}.refiner[data-processing=true] #image-cancel-process{display:block}.refiner[data-processing=true] #image-editor-status:before{content:'';display:inline-block;width:9px;height:9px;margin-right:6px;border:1px solid #bdc7de;border-top-color:#354ab7;border-radius:50%;animation:loading-turn .8s linear infinite}
