:root{color-scheme:light}
.theme-switch{position:relative;display:inline-flex;flex:0 0 64px;align-items:center;justify-content:space-between;width:64px;height:36px;min-height:36px;padding:0 8px;border:1px solid #d7a4be;border-radius:99px;background:#f5d9e7;color:#79415d;box-shadow:none;margin:0;touch-action:manipulation}
.theme-switch .theme-sun,.theme-switch .theme-moon{font-size:18px;line-height:1;z-index:1}
.theme-knob{position:absolute;left:3px;top:3px;width:28px;height:28px;border-radius:50%;background:#fff;box-shadow:0 2px 5px #43233730;transition:transform .2s}
.theme-switch[aria-checked=true] .theme-knob{transform:translateX(28px);background:#f486ba}
.theme-switch:focus-visible{outline:3px solid #e34286;outline-offset:4px}
html[data-theme=dark]{color-scheme:dark;--bg:#17141b;--ink:#f4edf3;--muted:#bdb0bd;--pink:#ff8abd;background:var(--bg);color:var(--ink)}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] :is(aside,.panel,.editor-layout,.profile-card,.work-card,.plan-card,.plan-card:last-child,.card,.prompt-editor,.work-prompt,.reference-card,.shadow-person){background:#231e28;border-color:#493747;box-shadow:none;color:var(--ink)}
html[data-theme=dark] :is(dialog,#work-dialog,#photo-viewer,#account-dialog,#save-video-dialog){background:#231e28;color:var(--ink);border-color:#614357}
html[data-theme=dark] :is(dialog)::backdrop{background:#09070bc4}
html[data-theme=dark] :is(input,textarea,select,#profile-name,#login-email,#email-code,.shadow-panel select){background:#1a171f;color:var(--ink);border-color:#604359;accent-color:var(--pink)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#ab9aab}
html[data-theme=dark] :is(.chip,.format,.account-button,.work-delete,.work-close,.account-close,.reference-remove,.profile-action,.history-filters button){background:#302535;border-color:#604359;color:#f3d8e8;box-shadow:none}
html[data-theme=dark] :is(.chip.selected,.format.selected,.history-filters .selected,nav button.active){background:#64304d;border-color:#c76c97;color:#ffe8f4;box-shadow:none}
html[data-theme=dark] nav button{color:#c7b8c6}
html[data-theme=dark] :is(.balance,.mark,.icon,.icon.purple,.profile-avatar,.photo-close,.demo,.profile-status,.owner,.stat,.plan-mix,.model-controls,.note,#trend-photo-guide li,#shadow-submit-status:not(:empty)){background:#352532;border-color:#66455a;color:#f5b4d4;box-shadow:none}
html[data-theme=dark] :is(.upload,#add-reference,.trend-mode #add-reference,.upload-cover){background:#2b202b;border-color:#995c7d;color:#f5b4d4}
html[data-theme=dark] :is(.hero,.trends-entry,.create-card){background:linear-gradient(120deg,#392433,#512a43);border-color:#6b3c56;box-shadow:none;color:var(--ink)}
html[data-theme=dark] .hero:after{color:#814467;text-shadow:14px 14px 0 #48283c}
html[data-theme=dark] :is(.hero p,.eyebrow,.create-card b,.create-card small,.trends-entry small){color:#e3b8d0}
html[data-theme=dark] :is(.sub,.crumb,.trend small,.work-card>small,.work-sidebar>p,.profile-card p,.profile-card dt,.profile-card dd,.plan-intro,.plan-price small,.plan-examples small,.plan-mix p,.plans-explanation,.job-card>p,.generation-timer,.generation-hint,.generation-stages,.duration-range,.cost-label,.photo-tip,#account-summary,#trend-overview p,#generation-note,#work-detail .work-main>small,.reference-card>span){color:var(--muted)}
html[data-theme=dark] :is(.note strong,.plans-explanation h3,.empty h3,.crumb .mobile-logo){color:var(--ink)}
html[data-theme=dark] :is(.result-link,.text-btn,.generation-price,.plan-tokens,.plan-examples strong,.plan-tag,.profile-kicker,.reference-tag,#duration-value,#reference-count,#profile-save-status,.mention-warning){color:var(--pink)}
html[data-theme=dark] :is(.badge,.play,.work-badge){background:#2c2134ed;color:#ffe7f3}
html[data-theme=dark] :is(.work-preview,.art,.work-main .generated-image,.work-references img,.shadow-person img,#trend-catalog .trend-cover){background:#302734;border-color:#493747}
html[data-theme=dark] .photo-toolbar{background:#231e28f2}
html[data-theme=dark] .prompt-editor #prompt{background:transparent;color:transparent;-webkit-text-fill-color:transparent;caret-color:#f4edf3}
html[data-theme=dark] #prompt-highlight{color:#f4edf3}
html[data-theme=dark] .prompt-mention{color:#ffb3d6;background:#66345180}
html[data-theme=dark] .mention-card{color:#ffc1df!important;background:#352532!important;border-color:#85546e!important}
html[data-theme=dark] .mention-card span{color:#ffc1df}
html[data-theme=dark] :is(.editor-settings,.plan-examples li,.job-card){border-color:#493747}
html[data-theme=dark] .generation-loader{background:#493044}
html[data-theme=dark] .generation-stages .current{color:#ff9dcc}
html[data-theme=dark] .generation-stages .done{color:#d7aaca}
html[data-theme=dark] .theme-switch{background:#3d2d44;border-color:#8e5c7a;color:#ffe5f3}
html[data-theme=dark] .primary{background:linear-gradient(#d54a8e,#b72d70);border-color:#e57eaf;color:#fff;box-shadow:inset 0 1px 0 #ffffff30,0 4px 0 #75204a;text-shadow:none}
html[data-theme=dark] .avatar{background:#493044;border-color:#604359;color:#ffd6ee}
html[data-theme=dark] .admin-page header{background:#231e28;border-color:#493747}
html[data-theme=dark] .admin-page :is(p,.stat small){color:var(--muted)}
html[data-theme=dark] .admin-page :is(button,a,#status){color:var(--pink)}
html[data-theme=dark] .admin-page button{background:#302535;border-color:#604359}
html[data-theme=dark] .admin-page :is(.primary,nav .active){background:#a62c68;color:#fff}
html[data-theme=dark] #save-bar{background:#302535f5;border-color:#604359}
@media(max-width:650px){.theme-switch{flex-basis:60px;width:60px;min-width:60px;height:36px}.theme-switch[aria-checked=true] .theme-knob{transform:translateX(24px)}header{gap:8px;flex-wrap:wrap}.account{gap:8px}.admin-page header{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.theme-knob{transition:none}}
@media(forced-colors:active){.theme-switch{border:1px solid ButtonText}.theme-knob{background:ButtonText}html[data-theme=dark] .prompt-editor #prompt{color:CanvasText;-webkit-text-fill-color:CanvasText}}

.theme-switch .theme-sun{display:grid;place-items:center;width:18px;height:18px;flex-shrink:0}.theme-switch .theme-sun svg{display:block}
