.image-editor-dialog{width:min(1040px,calc(100vw - 44px));max-height:calc(100dvh - 44px);padding:0;margin:auto;border:1px solid var(--line,#e5e3ec);border-radius:24px;background:var(--surface,#fff);color:var(--text,#25252e);box-shadow:var(--shadow,0 24px 80px #27203725);overflow:hidden;animation:ie-appear .2s ease-out}
.image-editor-dialog::backdrop{background:#15101f66;backdrop-filter:blur(9px)}
.image-editor-shell{display:flex;flex-direction:column;height:min(820px,calc(100dvh - 46px));max-height:calc(100dvh - 46px);min-height:min(300px,calc(100dvh - 46px))}
.image-editor-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 22px 17px;border-bottom:1px solid var(--line,#e5e3ec)}
.image-editor-heading{display:flex;align-items:center;gap:15px;min-width:0;flex-wrap:wrap}.image-editor-heading h2{font-size:15px;font-weight:650;letter-spacing:-.4px;margin:0}.image-editor-status{font-size:11px;color:var(--muted,#8a8896)}.image-editor-status[data-state=error]{color:#b45166}.image-editor-status[data-state=saving]{opacity:.6;animation:ie-save 1.2s ease-in-out infinite}
.image-editor-actions,.image-editor-tools,.image-editor-color{display:flex;align-items:center;gap:5px}.image-editor-actions{gap:6px}.ie-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:36px;min-height:36px;padding:8px;border:1px solid transparent;border-radius:11px;color:var(--secondary,#666371);background:transparent;transition:background .18s,color .18s,box-shadow .18s,transform .18s}.ie-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.ie-button span{font-size:11px;white-space:nowrap}.ie-button:hover{background:var(--field,#f0eff4);color:var(--text,#25252e)}.ie-button:active{transform:scale(.96)}.ie-button[aria-pressed=true]{color:var(--accent-text,#7146bd);background:var(--accent-light,#eee6fb);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent,#8257ce) 20%,transparent)}.ie-button:disabled{opacity:.35;cursor:default}.ie-button:focus-visible{outline:2px solid var(--accent,#8257ce);outline-offset:2px}
.image-editor-toolbar{display:flex;align-items:center;gap:18px;padding:12px 18px;flex-wrap:wrap;border-bottom:1px solid var(--line,#e5e3ec);background:color-mix(in srgb,var(--surface-alt,#f5f4f8) 58%,transparent)}.image-editor-tools{gap:3px}.image-editor-color{gap:10px;min-height:36px;border-left:1px solid var(--line,#e5e3ec);padding-left:16px}.image-editor-swatch{width:27px;height:27px;min-width:27px;border-radius:50%;overflow:hidden;cursor:pointer;box-shadow:0 0 0 3px var(--surface,#fff),0 0 0 4px var(--line,#e5e3ec)}.image-editor-swatch::-webkit-color-swatch-wrapper{padding:0}.image-editor-swatch::-webkit-color-swatch{border:0;border-radius:50%}.image-editor-hue{appearance:none;-webkit-appearance:none;width:140px;height:9px;border-radius:99px;background:linear-gradient(90deg,#ff4545,#ffde45,#62de70,#45d4ff,#6958ff,#ed45df,#ff4545);cursor:pointer}.image-editor-hue::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:14px;height:14px;border:3px solid #fff;border-radius:50%;background:transparent;box-shadow:0 1px 5px #0006}.image-editor-hue::-moz-range-thumb{width:10px;height:10px;border:3px solid #fff;border-radius:50%;background:transparent;box-shadow:0 1px 5px #0006}
.image-editor-thickness{position:relative;display:flex;align-items:center;gap:8px;margin-left:auto;width:120px;height:36px;padding-right:25px}.image-editor-crescendo{position:absolute;left:0;right:27px;top:7px;bottom:7px;clip-path:polygon(0 48%,100% 0,100% 100%,0 52%);background:color-mix(in srgb,var(--accent,#8257ce) 28%,var(--surface,#fff));pointer-events:none}.image-editor-thickness input{position:relative;z-index:1;appearance:none;-webkit-appearance:none;width:100%;height:28px;background:transparent;margin:0;cursor:ew-resize}.image-editor-thickness input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:10px;height:28px;border:2px solid var(--surface,#fff);border-radius:4px;background:var(--accent,#8257ce);box-shadow:0 2px 7px #0002}.image-editor-thickness input::-moz-range-thumb{width:7px;height:24px;border:2px solid var(--surface,#fff);border-radius:4px;background:var(--accent,#8257ce)}.image-editor-thickness output{position:absolute;right:0;font-size:11px;font-variant-numeric:tabular-nums;color:var(--secondary,#666371)}
.image-editor-stage{flex:1;min-height:120px;padding:24px;display:flex;align-items:center;justify-content:center;overflow:auto;background:repeating-conic-gradient(color-mix(in srgb,var(--line,#e5e3ec) 45%,transparent) 0 25%,transparent 0 50%) 0 / 18px 18px,var(--surface-alt,#f5f4f8)}.image-editor-canvas{display:block;max-width:100%;max-height:min(58dvh,620px);width:auto;height:auto;object-fit:contain;background:transparent;touch-action:none;cursor:crosshair;border-radius:2px;box-shadow:0 7px 30px #18101e22;outline:none;user-select:none}.image-editor-canvas[data-tool=eraser]{cursor:cell}.image-editor-canvas[data-tool=eyedropper]{cursor:crosshair}.image-editor-canvas:focus-visible{outline:2px solid var(--accent,#8257ce);outline-offset:4px}.image-editor-footer{min-height:53px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 20px;border-top:1px solid var(--line,#e5e3ec)}.image-editor-hint{font-size:11px;color:var(--muted,#8a8896);line-height:1.5}.image-editor-crop-actions{display:flex;gap:8px}.image-editor-footer .button{padding:8px 13px;font-size:11px}.ie-sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:root:is([data-theme=glass],[data-theme=custom]) .image-editor-dialog{background:linear-gradient(125deg,#ffffffd9,#ffffff91),var(--surface,#ffffffb8);border-color:#fff9;box-shadow:inset 0 1px 0 #fff,0 30px 100px #39234e40;backdrop-filter:blur(42px) saturate(155%)}:root:is([data-theme=glass],[data-theme=custom]) .image-editor-toolbar{background:#ffffff38}:root:is([data-theme=glass],[data-theme=custom]) .image-editor-stage{background:repeating-conic-gradient(#ffffff30 0 25%,transparent 0 50%) 0 / 18px 18px,color-mix(in srgb,var(--accent,#8257ce) 5%,transparent)}:root:is([data-theme=glass],[data-theme=custom]) .ie-button:hover{background:#ffffff68}:root:is([data-theme=glass],[data-theme=custom]) .ie-button[aria-pressed=true]{background:color-mix(in srgb,var(--accent-light,#eee6fb) 65%,#ffffff65);box-shadow:inset 0 1px 0 #fff9,inset 0 0 0 1px color-mix(in srgb,var(--accent,#8257ce) 20%,#fff8)}
@keyframes ie-appear{from{opacity:0;transform:translateY(9px) scale(.985)}to{opacity:1;transform:none}}@keyframes ie-save{50%{opacity:1}}
@media(max-width:700px){.image-editor-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:19px}.image-editor-shell{max-height:calc(100dvh - 22px)}.image-editor-header{padding:14px}.image-editor-heading{gap:5px;flex-direction:column;align-items:flex-start}.image-editor-toolbar{padding:9px 11px;gap:10px}.image-editor-tools{width:100%;justify-content:space-between}.image-editor-tools .ie-button{flex:1}.image-editor-color{padding-left:0;border-left:0}.image-editor-hue{width:110px}.image-editor-thickness{width:100px}.image-editor-stage{padding:14px}.image-editor-canvas{max-height:50dvh}.image-editor-footer{padding:10px 14px}.ie-button span{font-size:10px}}
@media(prefers-reduced-motion:reduce){.image-editor-dialog,.image-editor-status[data-state=saving]{animation:none}.ie-button{transition:none}}

.image-editor-color .editor-select-trigger.image-editor-swatch{padding:4px;border:0;width:28px;height:28px;min-height:28px;box-shadow:none;overflow:visible;border-radius:8px}
/* Zoom changes CSS viewport geometry only. Export pixels, layers and history
   never contain the surrounding note surface. */
.image-editor-header,.image-editor-toolbar,.image-editor-footer{flex:none}
.image-editor-stage{position:relative;display:block;min-height:100px;padding:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;background:var(--image-note-paper,var(--surface,#fff))}
.image-editor-plane{position:relative;min-width:100%;min-height:100%}
.image-editor-canvas{position:absolute;max-width:none;max-height:none;object-fit:initial;flex:none}
.image-editor-footer{flex-wrap:wrap;gap:8px 12px}
.image-editor-hint{flex:1 1 180px;min-width:0}
.image-editor-hint:empty{display:none}
.image-editor-zoom{display:flex;align-items:center;gap:3px;margin-left:auto}
.image-editor-zoom .ie-button{min-width:36px;font-size:18px;line-height:1}
.image-editor-zoom .image-editor-fit{font-size:11px;white-space:nowrap;padding:8px 10px}
.image-editor-zoom-value{min-width:46px;text-align:center;font-size:11px;color:var(--secondary,#666371);font-variant-numeric:tabular-nums}
.image-editor-thickness input:disabled{opacity:.4;cursor:default}
:root:is([data-theme=glass],[data-theme=custom]) .image-editor-stage{background:linear-gradient(125deg,color-mix(in srgb,var(--image-note-paper,var(--surface,#fff)) 96%,transparent),color-mix(in srgb,var(--image-note-paper,var(--surface,#fff)) 88%,transparent));backdrop-filter:blur(36px) saturate(135%);box-shadow:inset 0 1px 0 #ffffff9c}
@media(max-width:700px){.image-editor-shell{height:calc(100dvh - 22px);max-height:calc(100dvh - 22px);min-height:0}.image-editor-stage{padding:0;min-height:100px}.image-editor-canvas{max-height:none}.image-editor-footer{padding:7px 11px}.image-editor-hint{flex-basis:100%;font-size:10px}.image-editor-zoom .ie-button{min-height:38px}.image-editor-crop-actions{margin-left:auto}.image-editor-crop-actions .button{white-space:normal}}
@media(max-height:480px){.image-editor-header{padding:7px 12px}.image-editor-toolbar{padding:5px 10px;gap:8px}.image-editor-footer{padding:4px 10px;min-height:42px}.image-editor-hint{flex-basis:160px}.image-editor-stage{min-height:70px}}
