.editor-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:12px 14px;border-bottom:1px solid var(--line,#e5e7eb)}
.editor-retouch-dialog{width:min(1180px,96vw);height:min(860px,94dvh);max-width:96vw;max-height:94dvh;box-sizing:border-box;padding:18px;border:1px solid #dce0e8;border-radius:16px;background:#f5f6fa;color:#232b40;overflow:auto}
.editor-retouch-dialog[open]{display:grid;grid-template-rows:auto auto auto minmax(180px,1fr) auto auto;gap:10px}.editor-retouch-dialog::backdrop{background:#15182ecc}.editor-retouch-dialog header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}.editor-retouch-dialog h2{font-size:20px;margin:0}.editor-retouch-dialog header span{font-size:12px;color:#667084}.editor-retouch-dialog button{padding:8px 12px;border:1px solid #cdd3e1;border-radius:8px;background:white;color:#27314a;font:inherit;cursor:pointer;min-height:40px}.editor-retouch-dialog footer{display:flex;justify-content:flex-end;gap:10px}.editor-retouch-dialog #retouchDone{background:#4f46e5;border-color:#4f46e5;color:#fff;min-width:110px}.editor-retouch-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.editor-retouch-navigation label{display:flex;align-items:center;gap:4px;font-size:13px}.editor-retouch-navigation input[type=range]{flex:1;min-width:80px;max-width:220px}.editor-retouch-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.editor-retouch-controls label{display:flex;align-items:center;gap:8px;font-size:12px}.editor-retouch-controls input[type=range]{width:110px;accent-color:#6f61e8}.editor-retouch-controls input[type=color]{width:40px;height:32px;padding:0;border:0}.editor-retouch-controls select{min-height:32px;padding:4px;font:inherit}.editor-retouch-controls output{min-width:24px;font-variant-numeric:tabular-nums}.editor-retouch-stage{position:relative;min-width:0;min-height:180px;overflow:hidden;background:#262b36;border-radius:10px}.editor-retouch-stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair;outline-offset:-3px}.editor-retouch-status{margin:0;font-size:12px;line-height:1.5;min-height:18px;color:#596379;overflow-wrap:anywhere}.editor-retouch-navigation:has(#retouchPan:checked)~.editor-retouch-stage canvas{cursor:grab}
@media(max-width:650px){.editor-retouch-dialog{padding:10px;width:98vw;max-width:98vw;height:96dvh;max-height:96dvh}.editor-retouch-dialog[open]{gap:8px}.editor-retouch-navigation{gap:6px}.editor-retouch-navigation button{padding:6px 10px}.editor-retouch-controls{gap:8px}.editor-retouch-controls label{font-size:11px}.editor-retouch-controls input[type=range]{width:90px}.editor-retouch-dialog h2{font-size:18px}}
.editor-toolbar button{padding:7px 9px;min-height:36px;border:1px solid #dce0e8;border-radius:8px;background:#fff;line-height:1.3}
.editor-toolbar button[aria-pressed="true"]{background:#e8e5ff;color:#4f46e5}.editor-toolbar button:disabled{opacity:.38;cursor:default}
.editor-controls{display:grid;gap:10px;padding:14px 0}.editor-control{display:grid;grid-template-columns:32px minmax(0,1fr) 32px 64px;gap:6px;align-items:center}
.editor-control label{grid-column:1/-1;display:flex;justify-content:space-between;gap:10px;font-size:13px;font-weight:650}.editor-control label small{font-weight:400;color:#72798a}
.editor-control input[type=range]{width:100%;min-width:0;accent-color:#6f61e8}.editor-control input[type=number],.editor-number-row input[type=number],.editor-layout-fields input,.editor-inspect input{min-width:0;border:1px solid #dce0e8;border-radius:8px;padding:7px 6px;background:#fff;color:#202336;font:inherit;text-align:right;width:100%}
.editor-control button{min-width:32px;min-height:36px;border:1px solid #dce0e8;border-radius:8px;background:#fff;color:#353c50;font-size:20px;cursor:pointer}
.editor-control input:invalid,.editor-number-row input:invalid{border-color:#d54747}.editor-number-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 0;font-size:13px}.editor-number-row label{flex:1}.editor-number-row input[type=number]{width:80px}.editor-number-row input[type=range]{flex:1;min-width:80px}.editor-number-row small{flex-basis:100%;color:#72798a}
.editor-liquify,.editor-decoration{padding:12px 0;border-top:1px solid #e4e6ee}.editor-liquify summary,.editor-decoration summary{font-weight:650;cursor:pointer;margin-bottom:12px}.editor-liquify>small{display:block;line-height:1.5;color:#747b8e;margin-top:8px}.editor-warning{border-radius:10px;background:#fff5df;color:#71501a;padding:10px 12px;font-size:12px;line-height:1.55}.editor-warning[hidden]{display:none}.editor-layout-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.editor-layout-fields label{display:grid;gap:5px;font-size:12px;color:#667084}.editor-layout{margin-top:14px}.editor-layout .field{margin-top:12px}
.editor-inspect{padding:16px;width:min(1100px,94vw);max-height:92dvh;border:1px solid #dfe3ee;border-radius:16px;background:#f5f6fa;color:#232b40}.editor-inspect::backdrop{background:#15182eaa}.editor-inspect-head{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:10px}.editor-inspect-head label{display:flex;gap:6px;align-items:center;font-size:12px}.editor-inspect input{width:70px}.editor-inspect-scroll{max-height:74dvh;overflow:auto;background:#dfe3ec;display:block}.editor-inspect-scroll img{display:block;max-width:none;height:auto;margin:auto}.editor-inspect>small{display:block;margin-top:10px;color:#6c7488}.crop-stage:has(canvas[data-liquify="true"]){cursor:crosshair}.crop-stage canvas[data-liquify="true"]{cursor:crosshair;touch-action:none}
.editor-warning-setting{grid-column:1/-1}.editor-output-preview{padding:14px;border-top:1px solid var(--line,#e5e7eb);min-width:0}.editor-output-switch{display:flex;justify-content:center;gap:6px;margin-bottom:12px}.editor-output-switch button{border:1px solid #dce0e8;border-radius:8px;background:#fff;color:#353c50;font:inherit;padding:8px 14px;min-height:40px;cursor:pointer}.editor-output-switch button[aria-pressed="true"]{background:#e8e5ff;color:#4f46e5;border-color:#b5aeef}.editor-output-frame{display:flex;align-items:center;justify-content:center;min-height:160px;background:#eef0f6;border-radius:10px;padding:12px;overflow:hidden}.editor-output-frame img{display:block;max-width:100%;max-height:330px;width:auto;height:auto;object-fit:contain;box-shadow:0 2px 12px #18223b22}.editor-output-frame img[hidden]{display:none}.editor-output-caption{margin:10px 0 0;font-size:12px;line-height:1.5;color:#667084;overflow-wrap:anywhere}
@media(max-width:650px){.editor-toolbar{padding:8px;gap:6px}.editor-toolbar button{font-size:11px}.editor-control{grid-template-columns:36px minmax(0,1fr) 36px 65px}.editor-control button{min-height:42px}.editor-inspect{padding:10px}.editor-inspect-head{flex-wrap:wrap}.editor-layout-fields{gap:10px}}
.editor-tool-section{padding:12px 0;border-top:1px solid #e4e6ee;min-width:0}.editor-tool-section>summary,.editor-output-preview>summary{font-weight:650;cursor:pointer;list-style-position:inside;padding:4px 0}.editor-tool-section[open]>summary{margin-bottom:12px}.editor-tool-section>small{display:block;font-size:12px;color:#667084;line-height:1.5;margin-top:8px}.editor-tool-section>button,.editor-overlay-choice{border:1px solid #dce0e8;border-radius:8px;background:#fff;color:#293349;padding:8px 10px;min-height:38px;margin:4px 5px 4px 0;cursor:pointer;font:inherit;font-size:12px}.editor-tool-section button[aria-pressed=true]{border-color:#1677ff;background:#edf5ff;color:#1254a4}.editor-tool-field{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 3px;font-size:13px;min-width:0}.editor-tool-field>span{flex:1;min-width:100px}.editor-tool-field>input[type=range]{flex:1;width:100%;min-width:100px;accent-color:#1677ff}.editor-tool-field>select{max-width:65%;font:inherit;border:1px solid #dce0e8;border-radius:8px;padding:8px;color:#293349;background:#fff}.editor-tool-field>input[type=color]{width:54px;height:36px;padding:2px;border:1px solid #dce0e8;background:white;border-radius:6px}.editor-tool-field>input[type=number]{width:72px;border:1px solid #dce0e8;border-radius:8px;padding:7px;font:inherit}.editor-tool-field>output{font-size:12px;color:#667084;min-width:42px;text-align:right}.editor-control,.editor-number-row,.ctlrow,.editor-tool-field{border:2px solid transparent;border-radius:10px}.editor-control{padding:5px}.editor-control.is-active,.editor-number-row.is-active,.ctlrow.is-active,.editor-tool-field.is-active{border-color:#1677ff;background:#f2f7ff;box-shadow:0 0 0 1px #1677ff15}.editor-overlay-list{display:flex;flex-wrap:wrap;gap:4px}.editor-tool-section button:disabled,.editor-tool-section input:disabled{opacity:.45;cursor:default}.editor-ruler-stage{position:relative;padding:24px 0 0 24px;overflow:hidden}.editor-ruler{position:absolute;z-index:3;touch-action:none;cursor:crosshair}.editor-ruler[hidden],.editor-guide-layer[hidden],.editor-tool-cursor[hidden]{display:none}.editor-guide-layer{position:absolute;pointer-events:none;z-index:4;overflow:visible}.editor-guide-handle{position:absolute;padding:0;border:0;background:transparent;pointer-events:auto;touch-action:none;min-width:0;min-height:0}.editor-guide-x{width:14px;height:100%;top:0;transform:translateX(-7px);cursor:ew-resize}.editor-guide-y{height:14px;width:100%;left:0;transform:translateY(-7px);cursor:ns-resize}.editor-guide-x::before,.editor-guide-y::before{content:'';position:absolute;background:#1677ff99}.editor-guide-x::before{width:1px;height:100%;left:7px;top:0}.editor-guide-y::before{height:1px;width:100%;top:7px;left:0}.editor-guide-x::after,.editor-guide-y::after{content:'';position:absolute;width:12px;height:12px;border-radius:3px;background:#1677ff;border:1px solid white;box-shadow:0 1px 3px #10213d33}.editor-guide-x::after{left:1px;top:1px}.editor-guide-y::after{left:1px;top:1px}.editor-tool-cursor{position:fixed;pointer-events:none;border:1px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #172b47,0 0 0 2px #ffffff44;transform:translate(-50%,-50%);z-index:1000}.crop-stage canvas[data-editor-tool=brush],.crop-stage canvas[data-editor-tool=liquify]{cursor:none}.crop-stage canvas[data-editor-tool=eyedropper]{cursor:crosshair}.crop-stage canvas[data-editor-tool=overlay]{cursor:move}.editor-output-preview:not([open]){padding:10px 14px}.editor-output-preview[open]>summary{margin-bottom:10px}
@media(max-width:650px){.editor-tool-field{font-size:12px}.editor-tool-section>button{min-height:42px}.editor-control input[type=range]{min-height:34px}.editor-ruler-stage{padding-top:22px;padding-left:22px}.editor-tool-section>summary{padding:8px 0}}
/* The ready-output preview replaces the working image inside the same sticky
 * pane. Opening it never adds a second image-height above the editor controls. */
.crop-pane.editor-preview-open>.crop-stage,.crop-pane.editor-preview-open>.canvas-tip{display:none}
.editor-output-preview[open]{height:min(var(--editor-preview-height,360px),calc(100dvh - 230px));min-height:180px;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px;padding:10px 12px;overflow:hidden}
.editor-output-preview[open]>summary{margin:0;line-height:1.35;min-width:0;overflow-wrap:anywhere}.editor-output-preview[open] .editor-output-switch{margin:0;gap:5px}.editor-output-preview[open] .editor-output-switch button{min-height:34px;padding:6px 10px;font-size:12px}.editor-output-preview[open] .editor-output-frame{min-height:0;max-height:none;padding:6px;overflow:hidden}.editor-output-preview[open] .editor-output-frame img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}.editor-output-preview[open] .editor-output-caption{margin:0;font-size:11px;line-height:1.35;max-height:3.8em;overflow:auto;overscroll-behavior:contain}
@media(max-width:720px),(pointer:coarse) and (max-width:1024px){.editor-output-preview[open]{height:min(var(--editor-preview-height,260px),calc(30svh + 60px),calc(100dvh - 215px));min-height:160px;padding:6px 8px;gap:4px}.editor-output-preview>summary{font-size:11px}.editor-output-preview[open] .editor-output-switch button{min-height:30px;padding:4px 9px;font-size:11px}.editor-output-preview[open] .editor-output-caption{font-size:10px;max-height:2.7em}.editor-output-preview:not([open]){padding:6px 8px}}
@media(max-width:720px),(pointer:coarse) and (max-width:1024px){.crop-grid .crop-panel :is(button,input,select,summary){scroll-margin-top:calc(var(--header-h,0px) + var(--editor-sticky-pane-height,45svh) + 16px);scroll-margin-bottom:100px}}
/* Reserve the inspection viewport before the worker returns its image. */
.editor-inspect[open]{display:flex;flex-direction:column;height:min(860px,92dvh)}.editor-inspect-head,.editor-inspect>small{flex:none}.editor-inspect-scroll{flex:1;min-height:0;max-height:none}
.editor-control input[type=number],.editor-number-row input[type=number],.editor-tool-field>input[type=number],.editor-layout-fields input,.editor-inspect input{min-height:38px;line-height:1.25}
@media(max-width:720px),(pointer:coarse) and (max-width:1024px){.editor-control input[type=number],.editor-number-row input[type=number],.editor-tool-field>input[type=number],.editor-tool-field>select,.editor-layout-fields input,.editor-inspect input{font-size:16px}}
@media(max-width:720px),(pointer:coarse) and (max-width:1024px){.crop-grid .crop-panel :is(button,input,select,summary,.editor-control,.editor-number-row,.editor-tool-field,.ctlrow){scroll-margin-top:calc(var(--header-h,0px) + var(--editor-save-error-height,0px) + var(--editor-sticky-pane-height,32svh) + 28px)}}
.editor-head-size{display:grid;gap:5px;padding:12px;margin-bottom:14px;border:1px solid var(--line,#dce0e8);border-radius:8px;font-size:13px;line-height:1.4}
.editor-head-size strong{font-size:14px;font-variant-numeric:tabular-nums}.editor-head-size small{color:var(--muted,#667084);font-size:12px}
.editor-toolbar .editor-history-button{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;padding:8px;flex-shrink:0}
.editor-history-button svg{pointer-events:none}.editor-toolbar button:focus-visible,.editor-inspect :focus-visible{outline:2px solid #1677ff;outline-offset:2px}
.editor-inspect-body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;flex:1;min-height:0;overflow:hidden}
.editor-inspect-compare .editor-inspect-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.editor-inspect-pane{display:flex;flex-direction:column;min-height:0;min-width:0;margin:0;gap:8px}.editor-inspect-pane[hidden]{display:none}.editor-inspect-pane figcaption{font-weight:650;font-size:14px;flex:none}
.editor-inspect-pane .editor-inspect-scroll{flex:1;min-height:0;overscroll-behavior:contain}
@media(max-width:650px){.editor-inspect-body{gap:8px}.editor-inspect-pane figcaption{font-size:12px;min-height:2.6em}.editor-inspect-head{gap:8px}.editor-inspect-head strong{flex:1;min-width:120px}.editor-inspect-head label{order:3;flex-basis:100%}.editor-toolbar .editor-history-button{min-width:36px;min-height:36px}}
/* Details has its own content box in both Blink and WebKit. Make the bounded
   content wrapper the grid, instead of relying on its children being grid items. */
.editor-output-preview[open]{display:block;overflow:hidden}
.editor-output-preview[open]>summary{margin-bottom:6px}
.editor-output-body{display:none}
.editor-output-preview[open]>.editor-output-body{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;min-width:0;min-height:0;height:var(--editor-preview-body-height,100px);overflow:auto;overscroll-behavior:contain}
.editor-output-preview[open] .editor-output-frame{display:grid;place-items:center;height:auto;box-sizing:border-box;min-width:0;min-height:0;overflow:hidden}
.editor-output-preview[open] .editor-output-frame img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;box-shadow:none}
@media(max-width:720px),(pointer:coarse) and (max-width:1024px){.editor-output-preview[open]>.editor-output-body{gap:4px}.editor-output-preview[open] .editor-output-caption{max-height:2.7em}}

/* Give every adjustment its own full-width track. Values and fine-step buttons
   stay above it, so pointer travel is useful even in the narrow side panel. */
.editor-control{grid-template-columns:minmax(0,1fr) 32px 64px 32px;column-gap:6px;row-gap:4px}
.editor-control>label{grid-column:1;grid-row:1;min-width:0;flex-direction:column;align-items:flex-start;gap:2px;line-height:1.3;overflow-wrap:anywhere}
.editor-control>label small{font-size:11px;line-height:1.2}
.editor-control>button:first-of-type{grid-column:2;grid-row:1}
.editor-control>input[type=number]{grid-column:3;grid-row:1}
.editor-control>button:last-of-type{grid-column:4;grid-row:1}
.editor-control>input[type=range]{grid-column:1/-1;grid-row:2;width:100%;min-width:0;margin:0;height:30px}
.editor-tool-field:has(>input[type=range]),.editor-number-row:has(>input[type=range]){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px}
.editor-tool-field:has(>input[type=range])>span,.editor-number-row:has(>input[type=range])>label{grid-column:1;grid-row:1;min-width:0}
.editor-tool-field:has(>input[type=range])>output,.editor-number-row:has(>input[type=range])>:is(output,input[type=number]){grid-column:2;grid-row:1}
.editor-tool-field>input[type=range],.editor-number-row>input[type=range]{grid-column:1/-1;grid-row:2;width:100%;min-width:0;margin:0;height:30px}
.editor-number-row:has(>input[type=range])>small{grid-column:1/-1;grid-row:3}
.crop-controls .ctl-block:has(>.ctl-row){display:grid;grid-template-columns:minmax(0,1fr) 36px 36px;gap:4px 6px;align-items:center}
.crop-controls .ctl-block:has(>.ctl-row)>.ctl-head{grid-column:1;grid-row:1}
.crop-controls .ctl-block>.ctl-row{display:contents}
.crop-controls .ctl-row>input[type=range]{grid-column:1/-1;grid-row:2;margin:0;height:30px;min-width:0}
.crop-controls .ctl-row>button:first-of-type{grid-column:2;grid-row:1}
.crop-controls .ctl-row>button:last-of-type{grid-column:3;grid-row:1}
@media(max-width:720px),(pointer:coarse){.editor-control>input[type=range],.editor-tool-field>input[type=range],.editor-number-row>input[type=range],.crop-controls .ctl-row>input[type=range]{min-height:36px}}
.photo-decoration{margin-top:14px;min-width:0}.photo-decoration>summary{min-height:36px;display:list-item;list-style-position:inside;margin:0;line-height:1.5}.photo-decoration[open]>summary{margin-bottom:12px}.photo-decoration .field{margin:0 0 12px}.photo-decoration-toggle{min-height:40px;align-items:center}.photo-decoration-hint{display:block;color:#667084;font-size:12px;line-height:1.5;margin:6px 0}.photo-decoration-strength{padding:6px}.photo-decoration-strength[hidden],.editor-tool-field[hidden],#editorReadyPhotoHint[hidden]{display:none}.photo-decoration select{max-width:100%}
@media(max-width:720px),(pointer:coarse) and (max-width:1024px){.photo-decoration>summary{min-height:40px}.photo-decoration select{font-size:16px}}
.editor-inspect-zoom{display:grid;grid-template-columns:auto 36px minmax(100px,auto) 36px minmax(80px,1fr);gap:8px;align-items:center;flex:none;margin-bottom:12px;min-width:0}.editor-inspect-zoom button{min-height:38px;border:1px solid #bfc8d5;border-radius:8px;background:#fff;color:#25344b;padding:7px 10px;font:inherit;cursor:pointer}.editor-inspect-zoom .editor-inspect-percent{display:flex;gap:5px;align-items:center;font-size:13px}.editor-inspect-zoom input[type=number]{width:64px}.editor-inspect-zoom input[type=range]{width:100%;min-width:0;min-height:36px;padding:0;accent-color:#1677ff}.editor-inspect-zoom>small{grid-column:1/-1;color:#667084;font-size:12px}.editor-inspect-head strong{min-width:0;overflow-wrap:anywhere}.editor-inspect-scroll img{max-width:none;max-height:none}
@media(max-width:650px){.editor-inspect-zoom{grid-template-columns:minmax(0,1fr) 36px 36px;gap:6px;margin-bottom:8px}.editor-inspect-zoom #inspectFit{grid-column:1/-1}.editor-inspect-zoom input[type=range]{grid-column:1/-1;grid-row:3}.editor-inspect-zoom .editor-inspect-percent{grid-column:1;grid-row:2;justify-content:flex-start}.editor-inspect-zoom input[type=number]{flex-shrink:0}.editor-inspect-zoom #inspectZoomOut{grid-column:2;grid-row:2;width:36px}.editor-inspect-zoom #inspectZoomIn{grid-column:3;grid-row:2}.editor-inspect-zoom>small{font-size:11px}.editor-inspect-head{margin-bottom:6px}}
