/* Midnight studio. Light mode keeps the original paper palette. */
:root { color-scheme: light; }
.topbar-actions { display:flex; align-items:center; gap:22px; }
.theme-toggle { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid var(--line); border-radius:6px; background:var(--white); color:var(--ink); font-size:10px; letter-spacing:0; white-space:nowrap; }
.theme-toggle:hover { border-color:var(--rust); }
#theme-icon { font-size:16px; line-height:1; }

:root[data-theme="dark"] {
 color-scheme:dark;
 --paper:#101318;
 --white:#181d24;
 --ink:#e7eaf0;
 --muted:#a0a9b6;
 --line:#2c3440;
 --rust:#e6b27c;
 --rust-light:#382c23;
 --green:#a7ccae;
}
:root[data-theme="dark"] body { background:var(--paper); }
:root[data-theme="dark"] ::selection { color:#fff3df; background:#7c5939; }
:root[data-theme="dark"] .sidebar { background:#13171d; }
:root[data-theme="dark"] .brand-mark { color:#211910; background:#e6b27c; }
:root[data-theme="dark"] .nav-link { color:#a7b0bf; }
:root[data-theme="dark"] .nav-link.active { color:#f2c995; background:#2c2723; box-shadow:inset 2px 0 #e6b27c; }
:root[data-theme="dark"] .nav-link:hover { background:#222832; }
:root[data-theme="dark"] .plant { color:#9aaf9f; }
:root[data-theme="dark"] :is(.sidebar-note p,.sidebar-note>span,.sidebar-bottom,.topbar,.text-button) { color:#a0a9b6; }
:root[data-theme="dark"] .note-line { background:#36413e; }
:root[data-theme="dark"] .local-dot { background:#9fc2a7; }
:root[data-theme="dark"] .pace-stamp { border-color:#343b43; }
:root[data-theme="dark"] .pace-stamp>span:last-child { color:#a8acaa; }
:root[data-theme="dark"] .sun { color:#d4ac7c; }
:root[data-theme="dark"] :is(.practice-card,.keyboard-card,.lesson-tile,.progress-panel,.stat) { box-shadow:0 8px 26px #00000012; }
:root[data-theme="dark"] :is(.card-heading .eyebrow,.lesson-description,.practice-meta,.keyboard-heading,.switch-label,.finger-legend,.legend-note,.practice-footer,.practice-picker label,.practice-picker>span) { color:#a0a9b6; }
:root[data-theme="dark"] .pill { color:#b4d3ba; background:#25332b; border-color:#354a3b; }
:root[data-theme="dark"] .pill>span { background:#a7ccae; }
:root[data-theme="dark"] .progress-track { background:#2d3540; }
:root[data-theme="dark"] .progress-track>div { background:var(--rust); }
:root[data-theme="dark"] .exercise { color:#8e9aac; scrollbar-color:#465364 transparent; }
:root[data-theme="dark"] .exercise .typed { color:#a7ccae; }
:root[data-theme="dark"] .exercise .current { color:#ffe4c3; background:#3d3025; border-bottom-color:#efb981; }
:root[data-theme="dark"] .exercise .wrong { color:#ffc7ba; background:#542f2f; border-bottom-color:#f0a08b; }
:root[data-theme="dark"] .typing-surface:focus-within { outline-color:#596957; }
:root[data-theme="dark"] :is(.start-overlay,.practice-bottom,.finger-cue,.tile-bottom,.history-table td,.history-table th) { border-color:var(--line); }
:root[data-theme="dark"] :is(.start-overlay>span,.practice-bottom,.icon-button) { color:#a0a9b6; }
:root[data-theme="dark"] .small-spark { color:#dfb883; }
:root[data-theme="dark"] .practice-bottom .error-feedback { color:#f0b09d; }
:root[data-theme="dark"] .primary-button { background:#e6b27c; border-color:#e6b27c; color:#20180f; font-weight:650; }
:root[data-theme="dark"] .primary-button:hover { background:#f2c795; border-color:#f2c795; }
:root[data-theme="dark"] .switch { background:#475365; }
:root[data-theme="dark"] input:checked+.switch { background:#829f8a; }
:root[data-theme="dark"] .key { background:#242b35; color:#a4afbd; border-color:#35404e; border-bottom-color:#11161d; }
:root[data-theme="dark"] :is(.key.lp,.key.rp) { background:#33292d; color:#e6b5aa; border-color:#4b383d; border-bottom-color:#211c20; }
:root[data-theme="dark"] :is(.key.lr,.key.rr) { background:#333026; color:#ddcb96; border-color:#4b4532; border-bottom-color:#232118; }
:root[data-theme="dark"] :is(.key.lm,.key.rm) { background:#25352e; color:#b4d0bd; border-color:#354d41; border-bottom-color:#17261e; }
:root[data-theme="dark"] :is(.key.li,.key.ri) { background:#273345; color:#bacbe6; border-color:#3c4c64; border-bottom-color:#1a2432; }
:root[data-theme="dark"] :is(.key.wide,.key.space-key) { background:#222932; color:#9ba7b7; border-color:#343d49; border-bottom-color:#11171e; }
:root[data-theme="dark"] .key.active-key { background:#e6b27c; color:#251b10; border-color:#c5915e; border-bottom-color:#956c45; box-shadow:0 0 0 3px #4a3829,0 0 18px #e6b27c12; }
:root[data-theme="dark"] .finger-legend .lp { background:#d8a99f; }
:root[data-theme="dark"] .finger-legend .lr { background:#d4c089; }
:root[data-theme="dark"] .finger-legend .lm { background:#a8c6b2; }
:root[data-theme="dark"] .finger-legend .li { background:#adc2df; }
:root[data-theme="dark"] .cue-key { background:#342a22; color:#f0c18e; border-color:#5a4430; }
:root[data-theme="dark"] .finger-cue div>span { color:#a0a9b6; }
:root[data-theme="dark"] .cue-symbol { color:#b8c4b3; }
:root[data-theme="dark"] .hidden-guide { color:#bed0bb; }
:root[data-theme="dark"] kbd { border-color:#424c59; background:#1d242e; color:#b1bac7; }
:root[data-theme="dark"] .session-card { background:#1c2825; border-color:#30423c; }
:root[data-theme="dark"] .session-card>.eyebrow { color:#a4bbb1; }
:root[data-theme="dark"] .session-card h3 { color:#d3e1d8; }
:root[data-theme="dark"] .focus-illustration>span { background:#2c3a34; color:#c6ddc8; border-color:#4c6354; border-bottom-color:#14231b; }
:root[data-theme="dark"] .key-bump { background:#93b59c; }
:root[data-theme="dark"] .focus-illustration i { color:#b1c5a3; }
:root[data-theme="dark"] :is(.accuracy-row,.accuracy-help,.habit p,.habit-number) { color:#b4c9bd; }
:root[data-theme="dark"] .habit-number { border-color:#4a5e51; }
:root[data-theme="dark"] .session-divider { background:#354b40; }
:root[data-theme="dark"] .next-card>.eyebrow { color:#a1a9b3; }
:root[data-theme="dark"] .journey-line { background:#384039; }
:root[data-theme="dark"] .journey-line i { background:#687569; }
:root[data-theme="dark"] .journey-line i.current { background:var(--rust); box-shadow:0 0 0 4px #352b23; }
:root[data-theme="dark"] .next-card p { color:#c0cab9; }
:root[data-theme="dark"] :is(.site-footer,.site-footer>span:first-child,.footer-thought) { color:#a0a9b6; }
:root[data-theme="dark"] :is(.group-label,.tile-top,.tile-bottom code,.lesson-tile p,.stat>span,.stat small,.progress-panel>p,.history-table th) { color:#a0a9b6; }
:root[data-theme="dark"] .lesson-tile:hover { border-color:#8eaa91; background:#1e252d; }
:root[data-theme="dark"] :is(.tile-top>b,.stat strong,.history-table td:last-child) { color:#b4cfb7; }
:root[data-theme="dark"] .result-card { background:#1e2d27; border-color:#395242; }
:root[data-theme="dark"] .result-card p { color:#b7ccbb; }
:root[data-theme="dark"] .secondary-button { border-color:#526554; color:#c2d5c3; }
:root[data-theme="dark"] .secondary-button:hover { background:#2b3c30; }
:root[data-theme="dark"] .weak-key-item { background:#2b2824; }
:root[data-theme="dark"] .weak-key-item small { color:#b7b8b1; }
:root[data-theme="dark"] .storage-notice { background:#35281f; color:#e9bd8c; }
:root[data-theme="dark"] .mobile-notice { background:#232a2d; border-color:#3b4747; color:#c1cbbf; }
:root[data-theme="dark"] dialog { color:var(--ink); background:#1b222b; border-color:#3d4855; box-shadow:0 24px 100px #0008; }
:root[data-theme="dark"] dialog::backdrop { background:#05080dbb; }
:root[data-theme="dark"] :is(.dialog-close,dialog p) { color:#b3bcc9; }
:root[data-theme="dark"] .guidance-note { color:#c3d3c0; background:#27372c; border-color:#8ca17a; }
:root[data-theme="dark"] .practice-picker select { border-color:#3b4654; }
:root[data-theme="dark"] #progress-content>p[style] { color:#a0a9b6 !important; }
@media(max-width:620px) {
 .topbar-actions { gap:12px; }
 .theme-toggle { padding:6px 8px; font-size:9px; }
 .text-button { font-size:9px; }
 :root[data-theme="dark"] .sidebar { background:var(--paper); }
}
@media(max-width:360px) { #theme-label { display:none; } .topbar-actions { gap:10px; } }
