[hidden]{display:none!important}
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#202630;background:#f6f7fb;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-height:100vh}button,input,textarea{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(1.55rem,2.7vw,2.4rem);letter-spacing:-.045em;line-height:1.18;margin-bottom:10px}h2{font-size:1.08rem;letter-spacing:-.025em;margin:5px 0 0}strong{font-weight:inherit}button:disabled{cursor:not-allowed;opacity:.47}.muted{color:#7a8394}.small{font-size:.79rem}.eyebrow{font-size:.69rem;letter-spacing:.13em;color:#6a768a}.topbar{height:77px;padding:0 clamp(16px,4vw,56px);display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e7ebf2;background:#fff;gap:14px}.brand{display:flex;align-items:center;gap:11px}.brand-icon{display:grid;place-items:center;width:37px;height:37px;background:#315bf5;color:white;border-radius:12px;font-size:23px}.brand-text{display:flex;flex-direction:column;line-height:1.13;letter-spacing:.02em}.brand-text span{font-size:.96rem}.brand-text small{font-size:.63rem;color:#7c879b;letter-spacing:.15em;margin-top:3px}.topbar-right{display:flex;align-items:center;gap:22px}.top-pill,.small-pill{font-size:.75rem;border-radius:999px;padding:7px 11px;border:1px solid #e7eaf2;background:#f8faff;color:#657288}.pulse{display:inline-block;width:7px;height:7px;border-radius:50%;background:#32b982;margin-right:6px}.text-button{border:0;background:none;color:#606a80;padding:7px;font-size:.85rem}.text-button:hover{color:#264bda}.workspace{max-width:1370px;margin:0 auto;padding:38px clamp(16px,4vw,50px) 30px}.intro{display:flex;align-items:end;justify-content:space-between;margin-bottom:27px}.intro .eyebrow{margin-bottom:13px}.intro p{font-size:.9rem;max-width:630px;line-height:1.55;margin-bottom:0}.workspace-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(335px,.8fr);gap:20px;align-items:stretch}.panel{background:#fff;border:1px solid #e8ebf1;border-radius:20px;padding:21px;min-width:0;box-shadow:0 5px 20px rgba(25,40,80,.025)}.photo-panel,.command-panel{min-height:560px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:19px}.small-pill{white-space:nowrap}.photo-stage{position:relative;aspect-ratio:1.45;width:100%;border:1px dashed #dce2ee;background:#f5f7fa;border-radius:15px;overflow:hidden}.photo-stage canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:fill}.photo-stage canvas[hidden]{display:none}.mask-overlay{touch-action:none;opacity:.5;cursor:crosshair}.empty-stage,.empty-result{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:25px;color:#98a2b4;gap:9px}.empty-stage strong{color:#667288;font-size:.96rem}.empty-stage span{max-width:280px;line-height:1.5;font-size:.82rem}.upload-glyph{display:grid;place-items:center;background:#eaf0ff;border-radius:16px;width:66px;height:66px;color:#315bf5;font-size:2.3rem;margin-bottom:3px}.action-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px;flex-wrap:wrap}.upload-buttons{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.button{display:inline-flex;justify-content:center;align-items:center;gap:9px;padding:11px 17px;min-height:42px;border-radius:11px;border:1px solid transparent;font-size:.84rem;transition:background .15s,border .15s}.button.primary{background:#315bf5;color:#fff}.button.primary:hover:not(:disabled){background:#2348d7}.button.secondary{border:1px solid #d9e2fd;background:#edf2ff;color:#254cd4}.button.secondary:hover{background:#e2ebff}.button.ghost{border-color:#e4e9f1;background:#fff;color:#64718b}.button.ghost:hover:not(:disabled){background:#f5f7fc}.button.wide{width:100%;margin-top:23px;min-height:49px;font-size:.93rem}.button.compact{min-height:35px;padding:7px 11px;font-size:.76rem}.toolbar{margin-top:26px;padding-top:20px;border-top:1px solid #eceef4}.tool-label{font-size:.83rem;margin-bottom:12px}.tool-label span{color:#a0a9ba}.brush-row{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.tool,.icon-button{border:1px solid #e5eaf3;background:#fff;color:#62728b;border-radius:9px;min-height:34px;padding:6px 11px;font-size:.78rem}.tool.selected{background:#edf2ff;border-color:#b9cbfc;color:#2a51de}.brush-size-label{font-size:.76rem;color:#798497;margin-left:4px;white-space:nowrap}.brush-size-label span{color:#4f5e73}.brush-row input[type="range"]{width:105px;accent-color:#315bf5}.icon-button{font-size:1.1rem;padding:4px 12px}.hint{font-size:.74rem;color:#99a2b2;line-height:1.55;margin:11px 0 0}.command-panel label:not(.checkbox-row){display:block;font-size:.8rem;color:#657187;margin-bottom:10px}.command-panel textarea{resize:vertical;min-height:163px;width:100%;outline:none;border:1px solid #dfe5f0;border-radius:12px;padding:14px 15px;background:#fbfcff;color:#283042;font-size:.87rem;line-height:1.65;transition:border .15s}.command-panel textarea:focus,.login-form input:focus{border-color:#85a2fc;box-shadow:0 0 0 3px #315bf518}.command-panel textarea::placeholder{color:#a2adbd}.prompt-meta{display:flex;justify-content:space-between;gap:8px;font-size:.69rem;color:#9ba5b5;margin:7px 0 14px}.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}.chips button{border:1px solid #e5e9f3;background:#f8faff;border-radius:999px;font-size:.73rem;color:#6b7587;padding:7px 10px}.chips button:hover{border-color:#aabffa;color:#315bf5}.checkbox-row{display:flex;gap:11px;align-items:flex-start;font-size:.78rem;margin:17px 0 0;color:#49556c;line-height:1.35}.checkbox-row input{width:16px;height:16px;min-width:16px;accent-color:#315bf5;margin:2px 0 0}.checkbox-row span{display:flex;flex-direction:column;gap:4px}.checkbox-row small{color:#9aa4b5;line-height:1.43}.consent-row{margin-top:15px;padding-top:15px;border-top:1px solid #edf0f5}.status{font-size:.76rem;line-height:1.55;min-height:34px;padding-top:13px;color:#8c96aa}.status.error{color:#d23852}.status.success{color:#178a64}.result-panel{grid-column:1/-1}.result-actions{display:flex;gap:8px;flex-wrap:wrap}.result-box{position:relative;display:flex;align-items:center;justify-content:center;border:1px dashed #dce2ee;background:#f8faff;min-height:280px;border-radius:15px;overflow:hidden}.result-box img{display:block;object-fit:contain;max-width:100%;max-height:620px}.result-box img[hidden]{display:none}.result-box .empty-result[hidden]{display:none}.empty-result span{font-size:2.4rem;color:#c1cae1}.empty-result p{font-size:.85rem}.history-section{margin-top:38px}.history-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.history-card{background:white;border:1px solid #e8ebf1;border-radius:14px;overflow:hidden}.history-card img{width:100%;aspect-ratio:1.22;object-fit:cover;background:#f0f3f8;display:block}.history-card p{padding:12px 12px 0;font-size:.75rem;color:#606e85;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0}.history-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:11px 12px 13px}.history-buttons a,.history-buttons button{border:0;background:none;padding:0;font-size:.72rem;color:#2b54da}.history-buttons .history-delete{color:#bd6675}footer{text-align:center;color:#a3acbc;font-size:.7rem;padding:36px 0 0}.login-body{background:#f6f7fb;display:grid;place-items:center;padding:20px}.login-card{background:white;border:1px solid #e6eaf1;border-radius:22px;max-width:410px;width:100%;padding:33px;box-shadow:0 10px 40px rgba(24,36,65,.05)}.login-card .brand-icon{margin-bottom:20px}.login-card h1{font-size:1.65rem;margin:10px 0}.login-card .muted{font-size:.83rem;line-height:1.5}.login-form{display:grid;gap:11px;margin-top:25px}.login-form label{font-size:.8rem;color:#69748b}.login-form input{width:100%;border:1px solid #dce3ee;border-radius:10px;padding:12px 13px;outline:none}.login-form .button{margin-top:9px}.footnote{font-size:.71rem;color:#a0aabb;text-align:center;margin:22px 0 0}.notice{border-radius:9px;padding:11px;font-size:.8rem}.notice-error{color:#b4324c;background:#fff0f2}
@media(max-width:900px){.workspace-grid{grid-template-columns:1fr}.photo-panel,.command-panel{min-height:auto}.history-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:620px){.topbar{padding:0 16px;height:65px}.top-pill{display:none}.topbar-right{gap:8px}.workspace{padding:24px 13px}.intro{margin-bottom:22px}.intro h1{font-size:1.55rem}.intro p{font-size:.81rem}.panel{border-radius:15px;padding:16px}.photo-stage{aspect-ratio:1.05}.section-head{margin-bottom:16px;align-items:flex-start}.section-head h2{font-size:1rem}.small-pill{font-size:.65rem}.brush-row{gap:7px}.brush-row input[type="range"]{width:70px}.tool,.icon-button{padding:6px 8px}.history-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.history-buttons{gap:9px}.result-actions{justify-content:flex-end}.result-box{min-height:220px}.login-card{padding:25px}}
/* Mobile Safari auto-zooms when form text is smaller than 16px. */
@media(max-width:900px){.command-panel textarea,.login-form input{font-size:16px}}

/* Lightweight photo preview: keep the existing editor layout. */
.empty-stage[role="button"]{cursor:pointer}
.empty-stage[role="button"]:focus-visible{outline:3px solid #7090fa;outline-offset:-5px}
.photo-zoom{position:absolute;z-index:5;right:12px;top:12px;display:grid;place-items:center;width:38px;height:38px;border:1px solid #dfe5f2;border-radius:11px;background:rgba(255,255,255,.94);box-shadow:0 2px 9px rgba(20,34,70,.13);color:#315bf5;font-size:1.35rem;cursor:zoom-in}
.photo-zoom:hover{background:#edf2ff}
.result-box img#resultImage{cursor:zoom-in}
.result-box img#resultImage:focus-visible{outline:3px solid #315bf5;outline-offset:-3px}
.result-box .preview-loading{position:absolute;inset:0;display:grid;place-items:center;text-align:center;color:#718096;font-size:.83rem;background:#f8faff;z-index:1;padding:15px}
.result-box .preview-loading[hidden]{display:none}
.history-preview{display:block;width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}
.history-preview:focus-visible{outline:3px solid #315bf5;outline-offset:-3px}
.photo-viewer{max-width:min(98vw,1300px);max-height:97dvh;max-height:97vh;margin:auto;padding:13px;border:0;border-radius:15px;background:#141924;color:#e4e9f6;box-shadow:0 30px 70px #0007;overflow:auto}
.photo-viewer::backdrop{background:rgba(10,17,33,.88)}
.photo-viewer img{display:block;max-width:calc(98vw - 26px);max-height:85vh;max-height:85dvh;object-fit:contain;margin:auto;border-radius:8px}
.photo-viewer p{text-align:center;font-size:.74rem;color:#c2c9d8;margin:8px 45px 0}
.photo-viewer-close{position:sticky;top:0;z-index:1;margin:0 0 5px auto;display:block;width:38px;height:38px;border:0;background:#ffffff26;color:white;border-radius:10px;font-size:27px;line-height:1;cursor:pointer}
.photo-viewer-close:hover{background:#ffffff45}
@media(max-width:620px){.photo-viewer{padding:8px;border-radius:10px}.photo-viewer img{max-width:calc(100vw - 18px)}.photo-viewer p{font-size:.69rem;margin:8px 5px 0}.photo-zoom{top:8px;right:8px;width:36px;height:36px}}

@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
