html[data-theme="light"]{--ui-bg:#f5f7fa;--ui-panel:#fff;--ui-soft:#edf3f6;--ui-text:#172d3b;--ui-muted:#526875;--ui-line:#cbd7df;--ui-accent:#087465;--ui-hero:#e7f2f1;color-scheme:light}
html[data-theme="dark"]{--ui-bg:#0b1119;--ui-panel:#14212d;--ui-soft:#1b303b;--ui-text:#e7eff5;--ui-muted:#b1c4cf;--ui-line:#3b5362;--ui-accent:#9ce5c8;--ui-hero:#19313c;color-scheme:dark}
html[data-theme],html[data-theme] body{background:var(--ui-bg)!important;color:var(--ui-text)!important}
html[data-theme] :is(.hero,.project,.week-card,.lesson-card,.panel,.concept,.card,.login-panel,.catalog-jump,.week-stepper,.course-session-nav,.lab,.example,.note,.feedback,.source-item,.question,.report-item,.readout,.legend,dialog){background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
html[data-theme] :is(.hero,.project-icon,.formula,.formula-box,.table-wrap th,.table-scroll th,.hero-meta span,.pill,.tag,.resume-control,.course-session-week){background:var(--ui-hero)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
html[data-theme] :is(.topbar,.sidebar){background:var(--ui-bg)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
html[data-theme] :is(h1,h2,h3,h4,strong,legend,label,.lead,.prompt,.brand,.lesson-body,.status-label){color:var(--ui-text)!important}
html[data-theme] :is(p,small,.muted,.caption,.identity,.connection,.crumb,.eyebrow,.section-title>span,.week-label span,.status-note,.folder-progress,.lesson-body p,.week-card p,.project p,.project small,.readout small){color:var(--ui-muted)!important}
html[data-theme] :is(a,.back,.course-path-nav a,.course-session-nav a,.score){color:var(--ui-accent)!important}
html[data-theme] :is(input,select,textarea){background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;accent-color:var(--ui-accent)}
html[data-theme] :is(button,.primary){background:var(--ui-accent);color:var(--ui-bg);border-color:var(--ui-accent)}
html[data-theme] :is(button.secondary,button.quiet,.theme-toggle){background:var(--ui-panel)!important;color:var(--ui-accent)!important;border:1px solid var(--ui-line)!important}
html[data-theme] :is(table,th,td,fieldset,.account-bar,.folder-progress,.lesson-status,footer){border-color:var(--ui-line)!important}
html[data-theme] :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--ui-accent)!important;outline-offset:3px}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:0 0 auto;min-height:36px;padding:6px 12px!important;margin-left:auto;border-radius:9px;font:600 13px/1.3 system-ui!important;cursor:pointer;white-space:nowrap}
.theme-floating{position:fixed;right:16px;top:16px;z-index:1000}
html[data-theme="dark"] :is(.diagram,.optical-svg,.lab-output,.zoomCanvas){background:#eef4f6!important;color:#163b40!important;border-radius:10px}
html[data-theme] .course-extra-navigation{color:var(--ui-muted)!important}
@media(max-width:450px){.theme-toggle{padding:7px 9px!important}.theme-toggle span{display:none}}
@media(prefers-reduced-motion:no-preference){html[data-theme] body{transition:background-color .15s,color .15s}}
