:root{color-scheme:light;--surface:#fff;--input-surface:#fff}
.topbar-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px}
.theme-toggle{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font:inherit;font-size:12px;font-weight:650;white-space:nowrap}
.theme-toggle:hover{border-color:var(--primary)}
.theme-toggle[aria-pressed=true]{border-color:var(--primary);background:var(--tint)}
.theme-toggle:after{content:"";display:block;width:24px;height:14px;border-radius:12px;background:var(--muted);box-shadow:inset 11px 0 0 2px var(--surface)}
.theme-toggle[aria-pressed=true]:after{background:var(--primary);box-shadow:inset -11px 0 0 2px var(--surface)}
html[data-theme=dark]{color-scheme:dark;--ink:#f2eaf0;--muted:#bbafb9;--primary:#ff8296;--tint:#39212b;--paper:#141217;--surface:#201c24;--input-surface:#19161e;--line:#423541;--on-primary:#fff}
html[data-theme=dark] :is(.sidebar,.topbar,.surface,.course,.stat,.empty,.chip,.search,.badge,.btn.secondary){background:var(--surface)}
html[data-theme=dark] :is(.field input,.field select,.field textarea){background:var(--input-surface)}
html[data-theme=dark] :is(.sidebar-note,.callout,.question-editor,.notice,.preview-badge){background:var(--tint)}
html[data-theme=dark] :is(.notice,.preview-badge,.eyebrow,.small-icon,.course-meta,.cover .motif,.form-error){color:var(--primary)}
html[data-theme=dark] .workspace-label{color:var(--muted)}
html[data-theme=dark] nav a:hover{background:var(--tint)}
html[data-theme=dark] :is(.btn:not(.secondary):not(.gold),.chip.selected,.admin-tabs a.active,.brand-icon,.hero){background:#b7243c;color:#fff}
html[data-theme=dark] .btn.gold{background:#fff;color:#9d2035}
html[data-theme=dark] .hero p{color:#fff0f2}
html[data-theme=dark] .hero .eyebrow{color:#ffe2e7}
html[data-theme=dark] .admin-table th{background:#2a202a}
.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px}.topbar-auth{border:1px solid var(--primary);border-radius:9px;padding:9px 15px;color:var(--primary);font-weight:700;white-space:nowrap}.topbar-auth:hover{background:var(--tint)}
.mode-toggle{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:9px;padding:8px 12px;font-size:11px;font-weight:700;white-space:nowrap}.mode-toggle.is-on{background:var(--tint);border-color:var(--primary);color:var(--primary)}
html[data-theme=dark] .form-actions{background:var(--surface)}
html[data-theme=dark] :is(.course-bottom,.below-note){border-color:var(--line)}
html[data-theme=dark] .progress-track{background:var(--tint)}
html[data-theme=dark] .cover{background:#39232d}
html[data-theme=dark] .cover.sand{background:#412832}
html[data-theme=dark] .cover.blue{background:#30232e}
html[data-theme=dark] .cover.rose{background:#422331}
html[data-theme=dark] .cover .type{background:var(--surface);color:var(--primary)}
html[data-theme=dark] .status{background:#35303a;color:var(--ink)}
html[data-theme=dark] .status.review{background:#46341e;color:#f3c486}
html[data-theme=dark] .status.archived{background:#302b34;color:#bbafb9}
html[data-theme=dark] .status.published{background:var(--tint);color:var(--primary)}
html[data-theme=dark] input::placeholder{color:#a797a5}
@media(max-width:720px){.topbar-actions{width:100%;justify-content:space-between;gap:8px}.theme-toggle{min-height:40px}.topbar-actions .preview-badge{white-space:normal}}
