:root{font-family:Arial,Helvetica,sans-serif;color:#283347;background:#f8f9fb;font-synthesis:none;--blue:#254ce5;--blue-soft:#edf2ff;--border:#e8ebf0;--muted:#8b94a3;--header-height:56px;--status-height:28px}
*{box-sizing:border-box}body{margin:0;height:100vh;height:100dvh;overflow:hidden}button,input{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .15s,color .15s,border-color .15s}button:disabled{opacity:.38;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #a7baff;outline-offset:3px}button,a,input{touch-action:manipulation}[hidden]{display:none!important}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icons{position:absolute;width:0;height:0;overflow:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-header{height:var(--header-height);display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 16px;background:#fff;border-bottom:1px solid var(--border);position:relative;z-index:10}.brand-group{display:flex;align-items:center;gap:14px;flex-shrink:0}.brand{display:flex;align-items:center;text-decoration:none;flex-shrink:0}.brand img{display:block;width:auto;height:30px;max-width:130px;object-fit:contain}.ai-link{display:flex;align-items:center;gap:6px;min-height:28px;padding-left:14px;border-left:1px solid #dce3ed;color:#3b4b63;font-size:14px;font-weight:600;text-decoration:none;white-space:nowrap}.ai-link svg{width:16px;height:16px}.ai-link:hover{color:var(--blue)}.tool-title{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;flex:1;font-size:16px;font-weight:600;letter-spacing:-.25px;white-space:nowrap}.tool-title>svg{width:20px;height:20px}.local{font-size:9px;font-weight:600;letter-spacing:1px;color:#4762ae;background:var(--blue-soft);border-radius:5px;padding:5px 7px}.primary{min-height:48px;padding:12px 24px;display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--blue);color:#fff;font-weight:600;font-size:14px;border:0;border-radius:14px}.primary:hover:not(:disabled){background:#193bc2}.primary svg{width:23px;height:23px}.header-actions{display:flex;align-items:center;gap:9px;flex-shrink:0}.app-header .download{min-width:110px;min-height:36px;padding:8px 14px;border-radius:9px;font-size:12px}.app-header .download svg{width:18px;height:18px}.header-upload{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:8px 13px;border:1px solid #cedafa;border-radius:9px;background:#f4f7ff;color:#264dcd;font-size:12px;font-weight:600;white-space:nowrap}.header-upload svg{width:18px;height:18px}.header-upload:hover:not(:disabled){background:#eaf0ff;border-color:#afc1f8}
main{height:calc(100% - var(--header-height));display:flex;flex-direction:column;min-height:0}.statusbar{min-height:var(--status-height);height:var(--status-height);display:flex;justify-content:space-between;align-items:center;gap:20px;padding:0 26px;color:#788393;background:#fff;border-bottom:1px solid var(--border);font-size:11px;flex-shrink:0}#status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.privacy{display:flex;gap:7px;align-items:center;white-space:nowrap}.privacy i{width:6px;height:6px;border-radius:50%;background:#38a67d}.editor{display:grid;grid-template-columns:304px minmax(0,1fr) 104px;min-height:0;flex:1}
.settings-panel{background:#fff;border-right:1px solid var(--border);overflow-y:auto;overscroll-behavior:contain;padding:25px 24px 18px;scrollbar-width:thin;scrollbar-color:#d7dce5 transparent}.panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px}.panel-heading h1{margin:0;font-size:17px;font-weight:600;letter-spacing:-.2px}.text-button{padding:6px 0;border:0;background:none;color:var(--blue);font-size:12px}.text-button:hover:not(:disabled){color:#1533a4}.setting{margin-bottom:27px}.setting label{display:flex;justify-content:space-between;align-items:center;gap:10px;color:#47556b;font-size:14px}.setting label span{color:#98a1ad;font-size:10px}.range-row{display:flex;align-items:center;gap:15px;margin-top:13px}input[type=range]{accent-color:var(--blue)}.range-row input{width:100%;min-width:0;height:4px;margin:8px 0;cursor:pointer}.range-row input:disabled{cursor:default}.range-row output{min-width:29px;color:#506179;font-size:14px;text-align:right;font-variant-numeric:tabular-nums}
.manual-panel{border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:21px 0 14px;margin:4px 0 22px}.section-heading{display:flex;align-items:center;justify-content:space-between}.section-heading h2{margin:0;font-size:14px;font-weight:600}.section-badge{background:#f1f4fa;color:#738199;font-size:9px;font-weight:600;border-radius:4px;padding:3px 6px;letter-spacing:.8px}.section-caption{color:#8a94a3;font-size:11px;line-height:1.5;margin:7px 0 14px}.tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:18px}.tool-button{min-height:48px;border:1px solid #e5e9f1;border-radius:10px;background:#fff;color:#5a687d;display:flex;align-items:center;justify-content:flex-start;gap:9px;padding:10px 12px;font-size:12px;white-space:nowrap}.tool-button svg{width:18px;height:18px}.tool-button:hover:not(:disabled){background:#f7f9fd;border-color:#cbd5eb}.tool-button.active,.tool-button[aria-pressed=true]{background:var(--blue-soft);color:#254cdb;border-color:#acbef8}.brush-options{padding:0 1px}.setting.compact{margin-bottom:17px}.setting.compact label{font-size:12px}.setting.compact .range-row{margin-top:7px}.setting.compact output{font-size:12px}.manual-note{color:#8b95a4;font-size:11px;line-height:1.7;margin:5px 0 8px}.manual-footer{display:flex;align-items:center;justify-content:space-between;gap:8px}#manual-count{color:#929baa;font-size:10px}.manual-footer .text-button{font-size:11px}
.panel-download{width:100%;border-radius:13px}.export-note{margin:11px 0 23px;color:#9aa2ae;font-size:10px;text-align:center}.inspection-panel{margin-top:2px}.check-row{display:flex;align-items:center;gap:9px;font-size:12px;color:#637189;line-height:1.6;margin-bottom:15px;cursor:pointer}.check-row input{width:14px;height:14px;margin:0;accent-color:var(--blue);flex-shrink:0}.overlay-note{margin:-6px 0 15px 23px;font-size:11px;line-height:1.65;color:#927d54}.photo-info{margin-top:21px;padding:16px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);color:#8994a5;font-size:11px;line-height:1.85}.photo-info span{display:block}.tip{display:flex;gap:9px;color:#99a2b1;margin-top:20px}.tip svg{width:17px;height:17px;margin-top:2px}.tip p{margin:0;font-size:11px;line-height:1.8}.clear-button{padding:8px 0;margin-top:20px;border:0;background:none;color:#8d98a8;font-size:11px}.clear-button:hover:not(:disabled){color:#d04949}.session-note{color:#acb3bf;font-size:9px;line-height:1.7;margin:12px 0 0}
.workspace{position:relative;min-width:0;min-height:0;overflow:hidden;background:#f8f9fb}.viewport{position:absolute;inset:0 0 86px;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:28px;overscroll-behavior:contain}.has-image .viewport{touch-action:none}.has-image .viewport.pan-mode,.has-image .viewport.pan-mode *{cursor:grab!important}.canvas-dimensions{position:absolute;z-index:5;top:15px;right:16px;background:#59606c;color:#fff;font-size:10px;font-variant-numeric:tabular-nums;border-radius:5px;padding:6px 9px;pointer-events:none}.empty{text-align:center;margin:auto;color:#8792a2;padding:18px 8px;width:100%;max-width:490px}.empty-icon{width:62px;height:62px;border-radius:20px;background:#edf2ff;color:var(--blue);margin:0 auto 22px;display:grid;place-items:center}.empty-icon svg{width:31px;height:31px}.eyebrow{color:#8e9bb1;font-weight:600;font-size:9px;letter-spacing:2px}.empty h2{margin:13px 0 16px;font-size:clamp(23px,2.1vw,32px);letter-spacing:-.85px;line-height:1.32;font-weight:500;color:#36445b}.empty>p{font-size:13px;line-height:1.8}.upload-card{margin:24px auto 0;padding:20px 15px 15px;border:1px dashed #d9e0ed;border-radius:16px;background:#ffffff6b;max-width:370px}.drop-inner{display:flex;flex-direction:column;align-items:center;gap:12px}.upload{min-width:184px}.drop-inner>span{font-size:11px;color:#929bac}.file-help{color:#a0a8b6;font-size:9px;line-height:1.6;margin:12px 0 0}.upload-card.dragover{border-color:var(--blue);background:#edf2ff}.empty>.text-button{font-size:11px;color:#8c99af;margin-top:9px}.empty .text-button span{margin-left:4px}.has-image #dropzone{display:none}
.comparison{position:absolute;left:50%;top:50%;margin:0;transform:translate(-50%,-50%);line-height:0;touch-action:none;user-select:none;box-shadow:0 1px 3px #2635530a;background-color:#fff;background-image:linear-gradient(45deg,#eee 25%,transparent 25%),linear-gradient(-45deg,#eee 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eee 75%),linear-gradient(-45deg,transparent 75%,#eee 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.comparison img{width:100%;height:100%;object-fit:contain;display:block;pointer-events:none}.comparison #after{position:absolute;inset:0;clip-path:inset(0 0 0 50%)}#selection-overlay{position:absolute;inset:0;pointer-events:none}.labels{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;pointer-events:none;line-height:1;z-index:2}.labels span{background:#252b336b;color:#fff;padding:7px 10px;border-radius:5px;font-size:10px}.result-only .labels>span:first-child,.brushing .labels>span:first-child{visibility:hidden}.divider{position:absolute;top:0;bottom:0;left:50%;width:2px;background:white;pointer-events:none;filter:drop-shadow(0 0 2px #0003);z-index:2}.divider span{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:40px;min-width:40px;border:2px solid white;border-radius:50%;background:#ffffff26;display:grid;place-items:center;font-size:22px;color:white;white-space:nowrap}#compare{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:ew-resize;z-index:3}.comparison:focus-within{outline:2px solid #93aaff;outline-offset:3px}.brush-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:4;touch-action:none;cursor:crosshair}.brush-cursor{position:absolute;z-index:5;pointer-events:none;border-radius:50%;border:1px solid #fff;box-shadow:0 0 0 1px #25344a99;transform:translate(-50%,-50%)}
.canvas-toolbar{position:absolute;z-index:6;bottom:16px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;height:54px;padding:7px 12px;border:1px solid #ffffff;border-radius:16px;box-shadow:0 5px 20px #26324a13,0 1px 4px #26324a0a;background:#fffffff5;max-width:calc(100% - 28px)}.toolbar-group{display:flex;align-items:center;gap:4px}.icon-button{width:34px;height:34px;padding:7px;border:0;border-radius:8px;display:grid;place-items:center;background:transparent;color:#617087}.icon-button svg{width:20px;height:20px}.icon-button:hover:not(:disabled){background:#eff3fa;color:#2b4fc4}.icon-button[aria-pressed=true]{background:#edf2ff;color:var(--blue)}.toolbar-divider{width:1px;height:22px;background:#e9edf3;flex-shrink:0}.zoom-control{display:flex;align-items:center;gap:10px}#zoom{width:105px;height:4px;margin:0;cursor:pointer}.zoom-value{border:1px solid #e8ebf1;background:white;border-radius:9px;height:32px;min-width:59px;padding:6px 8px;color:#46536a;font-size:12px;font-variant-numeric:tabular-nums}.zoom-value:hover:not(:disabled){background:#f6f8fd}.actual-size{height:32px;padding:6px;border:0;background:none;color:#8a95a6;font-size:11px;white-space:nowrap}.actual-size:hover:not(:disabled){color:var(--blue)}.busy{position:absolute;inset:0;z-index:8;background:#f8f9fbeb;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:17px;padding:25px;text-align:center}.busy strong{font-size:16px;font-weight:500}.busy span{font-size:11px;color:#8a94a4}.spinner{width:34px;height:34px;border:3px solid #dce5fc;border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.gallery{background:#fff;border-left:1px solid var(--border);padding:14px 10px;display:flex;flex-direction:column;align-items:stretch;gap:14px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#d7dce5 transparent}.add-photo{min-height:82px;flex-shrink:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px dashed #d9dfe9;border-radius:13px;background:#f8f9fc;color:#8b97a9}.add-photo svg{width:30px;height:30px;stroke-width:1.4}.add-photo span{font-size:9px}.add-photo:hover:not(:disabled){color:var(--blue);border-color:#97aff5;background:#f0f4ff}.gallery-items{display:flex;flex-direction:column;gap:12px}.photo-thumb{width:100%;aspect-ratio:1;display:block;position:relative;padding:3px;border:2px solid transparent;border-radius:13px;background:transparent;overflow:hidden}.photo-thumb img{width:100%;height:100%;display:block;object-fit:cover;border-radius:8px}.photo-thumb.active,.photo-thumb[aria-current=true],.photo-thumb[aria-selected=true]{border-color:var(--blue)}.photo-thumb:hover:not(:disabled){background:#edf2ff}.photo-thumb>span{position:absolute;bottom:7px;right:7px;min-width:16px;height:16px;line-height:16px;background:#27334b80;border-radius:4px;color:#fff;font-size:9px;text-align:center}.gallery-note{font-size:9px;color:#b0b7c3;text-align:center;line-height:1.5}
@media(min-width:1600px){.editor{grid-template-columns:324px minmax(0,1fr) 112px}.settings-panel{padding:28px 27px 20px}.app-header{padding:0 20px}.gallery{padding:16px 11px}}
@media(max-width:1100px){.editor{grid-template-columns:272px minmax(0,1fr) 86px}.settings-panel{padding:22px 18px 18px}.gallery{padding:13px 8px}.add-photo{min-height:68px}.canvas-toolbar{gap:7px;padding-left:8px;padding-right:8px}#zoom{width:72px}.actual-size{display:none}}
@media(max-width:800px){:root{--status-height:28px}body{height:auto;min-height:100dvh;overflow:auto}.app-header{padding:0 16px;gap:12px;position:sticky;top:0}.brand img{width:auto;height:28px;max-width:112px}.tool-title{font-size:13px;gap:6px}.tool-title>svg{width:18px;height:18px}.local{display:none}.app-header .download{min-width:96px;min-height:34px;padding:8px 11px;font-size:12px;gap:7px;border-radius:9px}.app-header .download svg{width:18px;height:18px}main{height:auto;min-height:calc(100dvh - var(--header-height))}.statusbar{padding:0 16px;font-size:10px}.privacy{display:none}.editor{display:grid;grid-template-columns:minmax(0,1fr) 76px;grid-template-rows:minmax(390px,66dvh) auto}.workspace{grid-column:1;grid-row:1}.gallery{grid-column:2;grid-row:1;border-bottom:1px solid var(--border)}.settings-panel{grid-column:1 / -1;grid-row:2;border-top:1px solid var(--border);border-right:0;overflow:visible;padding:24px}.viewport{inset:0 0 76px;padding:28px}.canvas-toolbar{bottom:14px;height:48px;padding:6px;gap:5px;border-radius:13px;max-width:calc(100% - 20px)}.icon-button{width:30px;height:32px;padding:5px}.icon-button svg{width:19px;height:19px}.toolbar-group{gap:1px}.toolbar-divider{height:18px}.zoom-control{gap:6px}#zoom{width:56px}.zoom-value{min-width:49px;padding:5px;font-size:11px;height:30px}.add-photo{min-height:58px;border-radius:10px}.add-photo svg{width:24px;height:24px}.add-photo span{font-size:8px}.gallery{gap:11px}.photo-thumb{border-radius:10px;padding:2px}.photo-thumb img{border-radius:6px}.gallery-note{font-size:8px}.canvas-dimensions{top:10px;right:10px;font-size:9px;padding:5px 7px}.empty{padding:8px 0}.empty-icon{width:47px;height:47px;border-radius:15px;margin-bottom:13px}.empty-icon svg{width:25px;height:25px}.empty h2{font-size:22px;letter-spacing:-.5px;margin:12px 0}.empty>p{font-size:11px}.upload-card{margin-top:17px;padding:14px 10px}.empty>.text-button{display:none}.tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.tool-button{justify-content:center}.automatic-panel,.brush-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.brush-options .setting{margin-bottom:8px}.panel-heading{margin-bottom:22px}.manual-panel{margin-top:0}.photo-info{margin-top:14px}.tip{max-width:600px}.session-note{font-size:10px}}
@media(max-width:480px){.app-header{padding:7px 10px}.brand img{width:auto;height:27px;max-width:104px}.tool-title{font-size:12px}.tool-title>svg{display:none}.app-header .download{min-width:90px;padding:7px 10px}.editor{grid-template-columns:minmax(0,1fr) 66px;grid-template-rows:minmax(385px,61dvh) auto}.gallery{padding:10px 6px}.add-photo{min-height:52px}#zoom{display:none}.canvas-toolbar{gap:5px}.zoom-control{gap:0}.toolbar-group{gap:0}.zoom-value{min-width:45px}.empty h2{font-size:19px}.eyebrow{font-size:8px}.empty>p br{display:none}.empty>p{font-size:11px}.upload{min-width:0;width:100%;font-size:13px}.file-help{font-size:8px}.settings-panel{padding:22px 20px}.automatic-panel{display:block}.tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tool-button{justify-content:flex-start}.brush-options{gap:18px}.setting.compact label{flex-wrap:wrap;gap:4px}.range-row{gap:10px}}
.viewport.panning,.viewport.panning *{cursor:grabbing!important}
@media(prefers-reduced-motion:reduce){button{transition:none}.spinner{animation-duration:2s}}

/* Compact header and direct canvas navigation. */
body:not(.has-image) .viewport{overflow:auto}
.zoom-step{width:28px;padding:5px}.zoom-step svg{width:18px;height:18px}
@media(min-width:801px) and (max-width:980px){#zoom{display:none}.canvas-toolbar{gap:5px}.zoom-control{gap:5px}.toolbar-group{gap:1px}.icon-button{width:30px}.zoom-value{min-width:49px}}
@media(max-width:640px){
  :root{--header-height:88px}
  .app-header{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:30px 34px;gap:6px 10px;padding:8px 12px}
  .brand-group{grid-column:1;grid-row:1;gap:10px}
  .ai-link{padding-left:10px;font-size:13px;gap:4px}
  .ai-link svg{width:14px;height:14px}
  .tool-title{grid-column:2;grid-row:1;justify-content:flex-end;font-size:13px;gap:6px}
  .tool-title>svg{display:none}
  .header-actions{grid-column:1 / -1;grid-row:2;gap:9px}
  .header-actions>button{flex:1;min-height:34px}
  .header-upload{padding:7px 12px}
}
@media(max-width:480px){
  .viewport{bottom:116px}
  .canvas-toolbar{display:grid;grid-template-columns:auto auto;gap:4px 10px;height:auto;padding:6px 9px;width:max-content}
  .canvas-toolbar>.toolbar-divider{display:none}
  .canvas-toolbar>.toolbar-group{justify-content:center}
  .zoom-control{grid-column:1 / -1;justify-content:center;gap:8px}
  .zoom-step{width:30px}
  .canvas-toolbar .zoom-value{min-width:54px}
}
