/* Local image editor: fixed output guide, original control layout and view-only zoom. */
.image-editor.on{display:flex;flex-direction:column;overflow:hidden;padding-bottom:env(safe-area-inset-bottom);z-index:105;background:var(--page-bg)}
.image-editor .detail-head{flex:none;padding:12px 18px;gap:12px}
.editor-size{margin-left:auto;font-size:11px;color:var(--text-weak);font-variant-numeric:tabular-nums}
.editor-tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:0 14px 10px;flex:none}
.editor-tools button,.editor-options button,.editor-zoom button,.editor-actions button,.editor-context button{border:1px solid var(--border);border-radius:10px;background:var(--card-bg);color:var(--text-strong);font:inherit;font-size:13px;line-height:1.4;padding:9px 5px;cursor:pointer}
.editor-tools button[aria-pressed="true"]{color:var(--brand);border-color:var(--brand);background:var(--brand-soft);font-weight:650}
.editor-stage{flex:1;min-height:140px;position:relative;overflow:hidden;margin:0 14px;background:#303236;border:1px solid #43454a;border-radius:12px}
#editorCanvas{width:100%;height:100%;display:block;touch-action:none;user-select:none;-webkit-user-select:none}
.editor-brush-ring{position:absolute;pointer-events:none;box-sizing:border-box;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #292b2f,0 0 6px #0007;opacity:0}
.editor-pan-track{position:absolute;z-index:2;opacity:0;transition:opacity .7s ease;pointer-events:none;border-radius:12px;background:#0003;touch-action:none}
.editor-pan-track.is-visible,.editor-pan-track:focus-within{opacity:1;transition-duration:.12s}
.editor-pan-x{left:12px;right:26px;bottom:8px;height:20px}
.editor-pan-y{top:12px;bottom:26px;right:8px;width:20px}
.editor-pan-thumb{position:absolute;display:block;padding:0;border:0;border-radius:12px;background:transparent;cursor:grab;pointer-events:auto;touch-action:none;min-width:0;min-height:0}
.editor-pan-thumb::after{content:"";position:absolute;border-radius:8px;background:#f7f8f9b8;box-shadow:0 1px 3px #0006}
.editor-pan-x .editor-pan-thumb{height:20px;top:0}
.editor-pan-x .editor-pan-thumb::after{inset:6px 0}
.editor-pan-y .editor-pan-thumb{width:20px;left:0}
.editor-pan-y .editor-pan-thumb::after{inset:0 6px}
.editor-pan-thumb:active{cursor:grabbing}
.editor-pan-thumb:focus-visible{outline:2px solid #fff;outline-offset:1px}
@media(prefers-reduced-motion:reduce){.editor-pan-track{transition:none}}
.editor-hint{font-size:11px;line-height:1.5;color:var(--text-weak);padding:5px 16px 0;margin:0;flex:none}
.editor-options{padding:7px 16px 0;display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:none;font-size:11px;line-height:1.5;color:var(--text-weak)}
.editor-options label{display:flex;align-items:center;gap:8px;color:var(--text);min-width:0;flex:1}
.image-editor input[type="range"]{min-width:0;flex:1;accent-color:var(--brand);padding:0;margin:0;height:30px;touch-action:pan-x;cursor:ew-resize}
.editor-controls-slot{height:252px;flex:none;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.editor-parameter-slot{height:auto}
.editor-context{flex:none;margin:8px 14px 0;padding:9px 12px;background:var(--card-bg);border:1px solid var(--border);border-radius:12px}
.editor-context-head{display:flex;align-items:center;justify-content:space-between;color:var(--text-weak);font-size:11px;min-height:24px;gap:8px}
.editor-context-head button{border:0;border-radius:6px;background:var(--brand-soft);color:var(--brand);padding:4px 10px;font-size:11px}
.editor-ratio-options{display:flex;gap:10px;padding-top:8px}
.editor-ratio-options button{flex:1;padding:8px}
.editor-ratio-options button[aria-pressed="true"],.editor-mode-options button[aria-pressed="true"]{color:var(--brand);border-color:var(--brand);background:var(--brand-soft);font-weight:650}
.editor-mode-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:8px}
.editor-mode-options button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px;font-size:12px;text-align:center}
.editor-correction-diagram{width:56px;height:36px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.editor-correction-diagram .diagram-guide{stroke:var(--text-weak);stroke-opacity:.5;stroke-dasharray:2 2}
.editor-rotation-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:8px}
.editor-rotation-options button{font-size:12px;padding:7px}
.editor-adjustment{margin-top:10px;padding:8px 10px 2px;background:var(--page-bg);border-radius:9px;display:flex;flex-direction:column}
.editor-adjustment-heading{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--text-weak)}
.editor-adjustment output{font-size:13px;font-weight:650;color:var(--brand);font-variant-numeric:tabular-nums}
.editor-range-ends{display:flex;justify-content:space-between;font-size:9px;color:var(--text-weak);margin-top:-2px}
.editor-zoom{display:flex;align-items:center;gap:8px;padding:8px 16px 0;flex:none}
.editor-zoom button{min-width:30px;min-height:32px;padding:5px 7px;font-size:12px}
.editor-zoom input{width:0}
.editor-zoom span{min-width:39px;text-align:center;font-size:11px;color:var(--text-weak);font-variant-numeric:tabular-nums}
.editor-actions{display:grid;grid-template-columns:1fr 1.35fr;gap:8px;padding:9px 14px 12px;flex:none}
.editor-actions button{font-size:12px;min-height:42px}
#editorSave{background:var(--brand);color:var(--on-brand,#fff);border-color:var(--brand);font-weight:650}
.image-actions{flex-wrap:wrap;gap:10px 18px}
@media(max-height:620px){.image-editor .detail-head{padding-block:6px}.editor-tools{gap:4px;padding-bottom:6px}.editor-tools button{padding-block:6px}.editor-actions{padding-block:6px}.editor-zoom{padding-top:4px}.editor-hint{padding-top:3px}.editor-stage{min-height:100px}.editor-context{margin-top:5px;padding-block:6px}}
@media(max-width:360px){.editor-zoom{gap:5px}.editor-mode-options button{padding-inline:5px}}
@media(max-height:460px){.image-editor.on{overflow-y:auto}.editor-stage{flex:none;height:100px;min-height:100px}}
/* A separate reserved slot anchors the canvas and zoom bar; each card sizes to its own controls. */
.editor-context{box-sizing:border-box}
.editor-rotation-options{grid-template-columns:repeat(4,minmax(0,1fr))}
.editor-rotation-options button{font-size:10px;padding:8px 3px}
#editorEraseOptions{padding:18px 0 0;gap:12px}
#editorEraseOptions label{flex-basis:100%}

.editor-hint{height:34px;box-sizing:border-box}

.editor-history-actions{display:flex;align-items:center;gap:5px;flex:none}
.editor-history-actions button{min-width:32px;min-height:30px;padding:4px 7px}
.editor-history-actions svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.editor-history-actions button:disabled{opacity:.32;cursor:default}
@media(max-width:360px){.editor-context-head{font-size:10px}.editor-history-actions{gap:3px}.editor-history-actions button{min-width:28px;padding-inline:5px}}
