/* Cleanup draft UI follows the default stlMolds purple theme. */
.review-controls .free-cleanup-entry{display:flex;align-items:center;gap:10px;box-sizing:border-box;width:100%;margin:18px 0 0;padding:18px 16px;border:1px solid #d9c7f5;border-radius:11px;background:#faf7ff;color:var(--text,#30263e);font:inherit;text-align:left;cursor:pointer;box-shadow:0 8px 24px #5f2cb80a}.free-cleanup-entry[hidden]{display:none!important}.free-cleanup-entry .review-section-icon{width:28px;height:40px;background:transparent}.free-cleanup-entry .review-section-copy{flex:1}.review-controls .free-cleanup-entry .review-section-copy strong{font-size:14px}.free-cleanup-entry .free-cleanup-plus{flex:none;color:var(--dim,#817393);font-size:20px;font-weight:400}.free-cleanup-entry:focus-visible{outline:2px solid #7030e8;outline-offset:3px}.free-cleanup-entry:hover{border-color:#b795ed}.free-cleanup-entry:disabled{opacity:.5;cursor:wait}
.free-cleanup-dialog,.cleanup-paint-dialog{--cleanup-accent:var(--accent,#7030e8);--cleanup-text:var(--text,#30263e);--cleanup-muted:var(--dim,#817393);--cleanup-line:#e5ddf0;--cleanup-wash:#faf7ff;position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(1480px,calc(100vw - 48px));max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);padding:0;border:1px solid #e5ddf0;border-radius:22px;background:white;color:var(--cleanup-text);box-shadow:0 24px 90px #27143e40;font-family:inherit}.free-cleanup-dialog::backdrop,.cleanup-paint-dialog::backdrop{background:#25163777;backdrop-filter:blur(3px)}.free-cleanup-dialog [hidden],.cleanup-paint-dialog [hidden]{display:none!important}.free-cleanup-dialog button,.cleanup-paint-dialog button{font:inherit;color:inherit;cursor:pointer}.free-cleanup-dialog button:disabled,.cleanup-paint-dialog button:disabled{opacity:.45;cursor:not-allowed}.free-cleanup-dialog button:focus-visible,.free-cleanup-dialog input:focus-visible,.free-cleanup-dialog select:focus-visible,.cleanup-paint-dialog button:focus-visible{outline:2px solid var(--cleanup-accent);outline-offset:3px}
.free-cleanup-shell{display:flex;flex-direction:column;max-height:calc(100vh - 50px);max-height:calc(100dvh - 50px)}.free-cleanup-shell>.cleanup-header,.cleanup-paint-shell>header{position:static;display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:30px 36px 22px;background:white;border:0;box-shadow:none;min-height:0}.cleanup-header h2,.cleanup-paint-shell h2{margin:0;color:var(--cleanup-text);font-size:34px;line-height:1.15;letter-spacing:-1px}.cleanup-header p,.cleanup-paint-shell header p{margin:7px 0 0;font-size:15px;color:var(--cleanup-muted)}#freeCleanupClose,#cleanupPaintClose{flex:none;border:0;background:transparent;color:var(--cleanup-muted);font-size:30px;line-height:1;padding:0 4px}
.cleanup-workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:26px;padding:0 36px 18px;min-height:0;overflow:auto}.cleanup-preview-area{min-width:0}.free-cleanup-comparison{display:grid;grid-template-columns:1fr 1fr;gap:20px}.free-cleanup-comparison figure{min-width:0;margin:0}.free-cleanup-comparison img{display:block;width:100%;height:clamp(280px,calc(100dvh - 340px),560px);object-fit:contain;box-sizing:border-box;border:1px solid var(--cleanup-line);border-radius:10px;background:repeating-conic-gradient(#f0edf5 0% 25%,#fff 0% 50%) 0/16px 16px}.free-cleanup-comparison figcaption{margin-top:10px;min-height:36px;color:#756886;font-size:12px;line-height:1.4}.cleanup-cleaned-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.cleanup-cleaned-caption>span{flex:1;min-width:140px}#freeCleanupPaint{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;border:0;border-radius:8px;background:var(--cleanup-accent);color:white;font-size:12px;font-weight:650;padding:9px 12px;margin-left:auto}#freeCleanupPaint svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.cleanup-status-row{display:flex;align-items:center;gap:12px;margin-top:16px;padding:14px 16px;border:1px solid var(--cleanup-line);border-radius:9px;background:var(--cleanup-wash);color:#756886}.cleanup-status-row>span{font-size:22px;color:var(--cleanup-accent)}#freeCleanupStatus{margin:0;flex:1;font-size:13px;line-height:1.5}.cleanup-paint-note button{border:0;background:none;padding:2px;color:var(--cleanup-accent);text-decoration:underline;font-size:12px}.free-cleanup-note{margin:10px 0 0;font-size:12px;color:var(--cleanup-muted)}.cleanup-paint-note{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:12px;border-radius:9px;background:var(--cleanup-wash);font-size:12px;color:#756886}
.cleanup-adjustments{border-left:1px solid var(--cleanup-line);padding-left:26px;min-width:0}.cleanup-adjustments>h3{margin:4px 0 26px;font-size:21px;letter-spacing:-.4px}.cleanup-control{display:block;margin:0 0 28px;padding:0;border:0;min-width:0}.cleanup-control legend,.cleanup-control>label{display:block;margin:0 0 12px;font-size:13px;font-weight:650}.cleanup-segments{display:flex;padding:3px;border:1px solid var(--cleanup-line);border-radius:9px;background:var(--cleanup-wash)}.cleanup-segments button{flex:1;min-width:0;padding:9px 3px;border:0;border-radius:7px;background:transparent;font-size:12px;color:#817393}.cleanup-segments button[aria-pressed=true]{background:var(--cleanup-accent);color:white;box-shadow:0 2px 5px #5727a02b}.cleanup-thickness-row{display:flex;align-items:center;gap:12px}.cleanup-thickness-row input{width:100%;min-width:0;accent-color:var(--cleanup-accent);margin:8px 0}.cleanup-thickness-row output{flex:none;min-width:78px;font-size:11px;color:var(--cleanup-muted);text-align:right}.cleanup-control small{display:block;font-size:11px;line-height:1.5;color:var(--cleanup-muted);margin-top:8px}.cleanup-switches{padding:20px 0;border-top:1px solid var(--cleanup-line);border-bottom:1px solid var(--cleanup-line)}.cleanup-switches label{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;font-size:13px;color:#756886;cursor:pointer}.cleanup-switches input{position:absolute;right:0;opacity:0;width:44px;height:26px;margin:0}.cleanup-switch{position:relative;flex:none;width:44px;height:26px;border-radius:20px;background:#c8bfd3;transition:background .15s}.cleanup-switch::after{content:"";position:absolute;left:4px;top:4px;width:18px;height:18px;border-radius:50%;background:white;box-shadow:0 1px 3px #35204730;transition:transform .15s}.cleanup-switches input:checked+.cleanup-switch{background:var(--cleanup-accent)}.cleanup-switches input:checked+.cleanup-switch::after{transform:translateX(18px)}.cleanup-switches input:focus-visible+.cleanup-switch{outline:2px solid var(--cleanup-accent);outline-offset:3px}.cleanup-switches input:disabled+.cleanup-switch{opacity:.45}.cleanup-advanced{margin:0;border:0;background:transparent}.cleanup-advanced>summary{position:relative;display:block;padding:22px 0 16px 26px;list-style:none;font-size:13px;color:#756886;cursor:pointer}.cleanup-advanced>summary::-webkit-details-marker{display:none}.cleanup-advanced>summary::after{content:"⌄"!important;position:absolute;left:0;top:19px;font-size:20px;color:#817393}.cleanup-advanced[open]>summary::after{transform:rotate(180deg)}.cleanup-advanced summary small{display:block;margin-top:5px;font-size:11px;font-weight:400;color:var(--cleanup-muted)}.free-cleanup-measurements{font-size:12px;padding-bottom:16px}.free-cleanup-measurements h4{font-size:13px;margin:0 0 14px}.cleanup-size-label{display:flex;align-items:center;gap:8px;color:#756886}.cleanup-size-label input{width:65px}.free-cleanup-measurements input[type=number],.free-cleanup-measurements select{padding:6px;border:1px solid #d6c9e8;border-radius:6px;font:inherit;background:white;color:var(--cleanup-text)}.free-cleanup-widths{display:grid;grid-template-columns:1fr 1fr;gap:14px 10px;margin:18px 0;font-size:11px;color:var(--cleanup-muted)}.free-cleanup-widths strong{display:block;color:var(--cleanup-text);font-size:15px;margin-top:5px}.free-cleanup-measurements p,.free-cleanup-measurements>small{display:block;font-size:11px;line-height:1.5;color:var(--cleanup-muted)}.free-cleanup-highlight{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.free-cleanup-highlight label{display:flex;align-items:center;gap:6px;font-size:11px}.free-cleanup-highlight input{accent-color:var(--cleanup-accent)}
.free-cleanup-shell>.cleanup-footer{position:static;display:flex;align-items:center;flex-wrap:wrap;gap:12px;flex:none;margin:0;padding:18px 36px;border-top:1px solid var(--cleanup-line);background:white;box-shadow:none;min-height:0;width:auto;max-width:none;color:var(--cleanup-text)}.cleanup-footer-spacer{flex:1}.cleanup-footer button,.cleanup-paint-shell footer button{padding:11px 17px;border:1px solid #d9cdef;border-radius:9px;background:white;font-size:13px}#freeCleanupApply,#cleanupPaintApply{border-color:var(--cleanup-accent);background:var(--cleanup-accent);color:white;font-weight:600}#freeCleanupEnhance{padding:0;border:0;background:none;color:var(--cleanup-accent);text-decoration:underline;font-size:12px}#freeCleanupRestore{padding:7px 10px;font-size:12px;color:var(--cleanup-accent)}
.cleanup-paint-dialog{width:min(1100px,calc(100vw - 48px))}.cleanup-paint-shell{display:flex;flex-direction:column;max-height:calc(100dvh - 50px)}.cleanup-paint-shell h2{font-size:28px}.cleanup-paint-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:0 28px 16px}.cleanup-paint-tools>div{display:flex;gap:5px;padding:3px;border:1px solid var(--cleanup-line);border-radius:9px;background:var(--cleanup-wash)}.cleanup-paint-tools button{display:flex;align-items:center;gap:6px;border:0;border-radius:6px;background:none;padding:8px 12px;font-size:13px}.cleanup-paint-tools button[aria-pressed=true]{background:var(--cleanup-accent);color:white}.cleanup-paint-tools i{width:13px;height:13px;border:1px solid #b5a5c8;border-radius:50%}.paint-black{background:black}.paint-white{background:white}.cleanup-paint-tools label{display:flex;align-items:center;gap:8px;font-size:12px}.cleanup-paint-tools input{accent-color:var(--cleanup-accent);max-width:120px}.cleanup-paint-stage{min-height:0;overflow:auto;margin:0 28px;display:grid;place-items:center;border:1px solid var(--cleanup-line);border-radius:9px;background:repeating-conic-gradient(#f0edf5 0% 25%,white 0% 50%) 0/16px 16px}.cleanup-paint-stage canvas{display:block;max-width:100%;max-height:55dvh;object-fit:contain;touch-action:none;cursor:crosshair;image-rendering:auto}#cleanupPaintStatus{font-size:12px;color:var(--cleanup-muted);margin:12px 28px}.cleanup-paint-shell>footer{position:static;display:flex;align-items:center;gap:10px;margin:0;padding:14px 28px 20px;border:0;background:white;box-shadow:none;min-height:0;color:var(--cleanup-text)}.cleanup-paint-shell footer>span{flex:1}
@media(max-width:1050px){.cleanup-workspace{grid-template-columns:minmax(0,1fr) 260px;gap:20px;padding-left:24px;padding-right:24px}.cleanup-adjustments{padding-left:20px}.cleanup-header h2{font-size:28px}.cleanup-cleaned-caption>span{min-width:100px}}
@media(max-width:850px){.cleanup-workspace{grid-template-columns:1fr}.cleanup-adjustments{border-left:0;border-top:1px solid var(--cleanup-line);padding:24px 0 0}.cleanup-adjustments>h3{margin-top:0}.cleanup-control{margin-bottom:20px}.free-cleanup-comparison img{height:340px}.cleanup-switches{padding:12px 0}}
@media(max-width:560px){.free-cleanup-dialog,.cleanup-paint-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:16px}.free-cleanup-shell,.cleanup-paint-shell{max-height:calc(100dvh - 22px)}.free-cleanup-shell>.cleanup-header,.cleanup-paint-shell>header{padding:20px 18px 16px}.cleanup-header h2{font-size:25px}.cleanup-header p{font-size:13px}.cleanup-workspace{padding:0 18px 18px}.free-cleanup-comparison{grid-template-columns:1fr;gap:18px}.free-cleanup-comparison img{height:300px}.cleanup-cleaned-caption>span{min-width:140px}.free-cleanup-comparison figure:first-child img{height:220px}.cleanup-status-row{padding:12px}.free-cleanup-shell>.cleanup-footer{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 18px}.cleanup-footer-spacer{display:none}#freeCleanupEnhance{grid-column:1/-1;text-align:left;padding:3px 0}#freeCleanupRestore{grid-column:1/-1;text-align:left}.cleanup-footer button{font-size:12px;padding:11px 8px}.cleanup-paint-tools{padding:0 16px 14px;gap:8px}.cleanup-paint-stage{margin:0 16px}.cleanup-paint-shell>footer{padding:12px 16px;gap:7px;flex-wrap:wrap}.cleanup-paint-shell footer button{padding:9px 10px;font-size:12px}#cleanupPaintStatus{margin:10px 16px}.cleanup-paint-tools button{padding:8px 10px}}
.cleanup-switch{pointer-events:none}

/* The surface grows inside a bounded viewport so zoomed edges remain reachable. */
.cleanup-paint-tools{flex:none}.cleanup-paint-tools output{align-self:center;min-width:46px;text-align:center;font-size:12px;color:var(--cleanup-muted);font-variant-numeric:tabular-nums}
.cleanup-paint-stage{display:block;flex:0 1 55dvh;height:55dvh;min-height:120px;position:relative;overscroll-behavior:contain;touch-action:none}
.cleanup-paint-surface{display:flex;align-items:center;justify-content:center;min-width:100%;min-height:100%}
.cleanup-paint-stage canvas{max-width:none;max-height:none;flex:none;object-fit:initial}
.cleanup-paint-stage[data-tool=pan],.cleanup-paint-stage[data-tool=pan] canvas{cursor:grab}.cleanup-paint-stage.is-panning,.cleanup-paint-stage.is-panning canvas{cursor:grabbing}
.cleanup-paint-shell>header,.cleanup-paint-shell>footer,#cleanupPaintStatus{flex:none}

/* Keep the previous preview visible while the next result is prepared. */
.cleanup-preview-frame{position:relative;isolation:isolate;overflow:hidden;border-radius:10px}
.cleanup-preview-frame[aria-busy=true] img{opacity:.28;filter:blur(1px)}
.cleanup-preview-frame img{transition:opacity .18s,filter .18s}
.cleanup-preview-frame img:not([src]){visibility:hidden}
.cleanup-preview-loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:20px;text-align:center;background:#faf7ffb8;color:var(--cleanup-text)}
.cleanup-preview-loading strong{font-size:14px;font-weight:650}.cleanup-preview-loading small{font-size:12px;color:var(--cleanup-muted)}
.cleanup-loading-orbit{position:relative;display:grid;place-items:center;width:64px;height:64px;margin-bottom:4px;border-radius:50%;background:white;box-shadow:0 4px 24px #7030e81a}
.cleanup-loading-orbit::before{content:"";position:absolute;inset:0;border:3px solid #e9defa;border-top-color:var(--cleanup-accent);border-right-color:var(--cleanup-accent);border-radius:50%;animation:cleanup-orbit 1.2s linear infinite}
.cleanup-loading-orbit svg{width:26px;height:26px;fill:#eee4ff;stroke:var(--cleanup-accent);stroke-width:1.5}
@keyframes cleanup-orbit{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.cleanup-loading-orbit::before{animation:none}.cleanup-preview-frame img{transition:none}}

/* Use the same type scale and row geometry for both artwork tools. */
.review-controls .free-cleanup-entry,.review-controls .auto-artwork>summary{font-family:inherit;font-size:14px;font-weight:650;line-height:1.2;letter-spacing:0;gap:12px;min-height:76px;box-sizing:border-box}
.review-controls .free-cleanup-entry .review-section-copy strong,.review-controls .auto-artwork .review-section-copy strong{font-family:inherit;font-size:14px;font-weight:650;line-height:1.15;letter-spacing:0}
.review-controls .free-cleanup-entry .review-section-copy small,.review-controls .auto-artwork .review-section-copy small{font-family:inherit;font-size:11.5px;font-weight:500;line-height:1.2;letter-spacing:0}

.review-controls .free-cleanup-entry{min-height:78px}

/* Cleanup review: display-only overlays and reversible adjustments. */
.cleanup-review-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px;font-size:var(--type-control);line-height:1.5}
.cleanup-review-toolbar label{display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.cleanup-review-toolbar input{accent-color:var(--cleanup-accent)}
#freeCleanupUndo{margin-left:auto;border:1px solid var(--cleanup-line);border-radius:8px;background:white;padding:8px 14px;font-size:var(--type-control);font-weight:600;min-height:40px}
#freeCleanupOverlayLegend{display:inline-flex;align-items:center;gap:6px;font-size:var(--type-caption)}
#freeCleanupOverlayLegend i{display:inline-block;width:12px;height:12px;border-radius:3px;background:#6437dc}
.cleanup-concerns{display:grid;gap:8px;margin-top:12px}
.cleanup-concerns>div{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 12px;background:var(--cleanup-wash);border:1px solid var(--cleanup-line);border-radius:8px;font-size:var(--type-control);line-height:1.5}
.cleanup-concerns button{border:0;background:transparent;color:var(--cleanup-accent);padding:4px 0;font-size:var(--type-control);font-weight:600;text-decoration:underline;min-height:32px}
.cleanup-threshold output{min-width:3ch;text-align:right;font-variant-numeric:tabular-nums;font-size:var(--type-control)}
.cleanup-threshold small{display:block;margin-top:8px;font-size:var(--type-control);line-height:1.5;color:var(--cleanup-muted)}

.free-cleanup-shell>.cleanup-header,.free-cleanup-shell>.cleanup-footer{flex-shrink:0}
.free-cleanup-shell>.cleanup-workspace{flex:1}
.cleanup-preview-area>.cleanup-threshold{margin-bottom:10px}
.cleanup-preview-area>.cleanup-review-toolbar{margin:8px 0 14px}
.cleanup-preview-area>.cleanup-concerns{margin:0 0 14px}
.free-cleanup-shell{height:calc(100dvh - 50px)}
@media(max-width:560px){.free-cleanup-shell{height:calc(100dvh - 22px)}}

/* Shape and raised-detail selection use distinct source masks. */
.cleanup-shape-control{margin-bottom:14px;font-size:var(--type-control);line-height:1.5}
.cleanup-shape-control label{display:flex;align-items:center;gap:8px;font-weight:600}
.cleanup-shape-control small{display:block;margin-top:6px;font-size:var(--type-control);color:var(--cleanup-muted)}
.cleanup-shape-control input{accent-color:var(--cleanup-accent)}
