/* dark mode: toggled by theme.js via html[data-theme=dark] */
html[data-theme=dark]{color-scheme:dark;--paper:#10151f;--cream:#10151f;--card:#171e2c;--line:#2a3347;--ink:#e6e9f0;--mut:#aab3c5;--lab:#c2a96a;--navy:#e8ecf5;--gold:#d9b25a;--gold2:#d9b25a;--goldtx:#e2c179}
html[data-theme=dark] body,html[data-theme=dark] body.ed{background:#10151f;color:#e6e9f0}
html[data-theme=dark] .top,html[data-theme=dark] .nav,html[data-theme=dark] .ed-top,html[data-theme=dark] .ed-head,html[data-theme=dark] nav,html[data-theme=dark] .dd ul,html[data-theme=dark] .dd > ul{background:#10151f}
html[data-theme=dark] .ed-ft,html[data-theme=dark] .ft2{background:#0b0f17;color:#aab3c5}
html[data-theme=dark] .panel,html[data-theme=dark] .item,html[data-theme=dark] .cm,html[data-theme=dark] .lv,html[data-theme=dark] .card{background:#171e2c;border-color:#2a3347;color:#e6e9f0}
html[data-theme=dark] .cm.me{background:#1d2740}
html[data-theme=dark] input[type=text],html[data-theme=dark] input[type=email],html[data-theme=dark] input[type=password],html[data-theme=dark] input[type=number],html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0f1522;color:#e6e9f0;border-color:#34405a}
html[data-theme=dark] .brand h1,html[data-theme=dark] .pg h1,html[data-theme=dark] .panel h2,html[data-theme=dark] .panel h3,html[data-theme=dark] .item h4,html[data-theme=dark] .ed-brand h1,html[data-theme=dark] .ed-hero h2,html[data-theme=dark] .ed-state p,html[data-theme=dark] .ed-wotd .wd b,html[data-theme=dark] .ed-wotd .wa,html[data-theme=dark] .ed-wotd .we{color:#f1f3f8}
html[data-theme=dark] .ed-hero h2 em{color:var(--gold)}
html[data-theme=dark] nav,html[data-theme=dark] .ed-nav,html[data-theme=dark] .ed-nav a,html[data-theme=dark] .dd ul a{color:#cfd6e4}
html[data-theme=dark] .ed-btn,html[data-theme=dark] .btn.o,html[data-theme=dark] .btn.n,html[data-theme=dark] .tabsb a,html[data-theme=dark] .tabsb button{color:#e8ecf5;border-color:#4a5675}
html[data-theme=dark] .btn.g{background:#d9b25a;color:#10151f;border-color:#d9b25a}
html[data-theme=dark] .ed-band,html[data-theme=dark] .ed-split{filter:none}
html[data-theme=dark] .ed-hero p,html[data-theme=dark] .pg .lead,html[data-theme=dark] .hint,html[data-theme=dark] small,html[data-theme=dark] .ed-wotd .wdf{color:#aab3c5}
html[data-theme=dark] th{color:#c2a96a}html[data-theme=dark] td,html[data-theme=dark] th{border-color:#2a3347}
html[data-theme=dark] .bar{background:#2a3347}
html[data-theme=dark] img{opacity:.92}
#kil-theme{position:fixed;left:16px;bottom:16px;z-index:300;width:42px;height:42px;border:1px solid #c9953c;background:#fbf8f2;color:#0b2250;font-size:18px;cursor:pointer;line-height:1}
html[data-theme=dark] #kil-theme{background:#171e2c;color:#d9b25a}

/* surfaces that use the navy variable as a background must stay dark/readable */
html[data-theme=dark] .ed-btn.solid,html[data-theme=dark] .ed-btn:hover,html[data-theme=dark] .ed-wotd .wl:hover,
html[data-theme=dark] .tabsb .on,html[data-theme=dark] .tabsb a:hover,html[data-theme=dark] .tabsb button:hover,
html[data-theme=dark] .btn.o:hover,html[data-theme=dark] .btn.n:hover,html[data-theme=dark] .side .on,html[data-theme=dark] .side button:hover{background:#d9b25a;color:#10151f;border-color:#d9b25a}
html[data-theme=dark] .ed-band,html[data-theme=dark] .about,html[data-theme=dark] .strip,html[data-theme=dark] .lv.mid{background:#0b0f17;color:#e6ecf5}
html[data-theme=dark] .toast{background:#1d2740;color:#fff}
html[data-theme=dark] .pill{background:transparent;color:#c2a96a;border-color:#34405a}
html[data-theme=dark] .pill.ok{background:#1d6b3a;color:#fff;border-color:#1d6b3a}
html[data-theme=dark] .side button{background:transparent;color:#e8ecf5;border-color:#34405a}
html[data-theme=dark] .btn.g:hover{background:#f1d489;color:#10151f}
html[data-theme=dark] .warn{background:#2a2412;color:#e6e9f0}

#kil-speed{position:fixed;left:66px;bottom:16px;z-index:300;height:42px;padding:0 14px;border:1px solid #c9953c;background:#fbf8f2;color:#0b2250;font:600 12px Inter,sans-serif;letter-spacing:.06em;cursor:pointer}
html[data-theme=dark] #kil-speed{background:#171e2c;color:#d9b25a}

/* v38 dark audit fixes (contrast, WCAG AA) */
html[data-theme=dark] .empty,html[data-theme=dark] .fcnt,html[data-theme=dark] .hint{color:#aeb8cf!important}
html[data-theme=dark] .ed-contents li p{color:#aeb8cf}
html[data-theme=dark] .btn.n,html[data-theme=dark] .btn.n:not(.sm){color:#fff}
html[data-theme=dark] .ed-art .tb{background:#232b42;border-color:#3a4566}

html[data-theme=dark] .fcl,html[data-theme=dark] .fcnt{color:#e6ecff!important;opacity:1!important}
html[data-theme=dark] .pill.founder{background:linear-gradient(180deg,#2b3a24,#1d2a18)!important;color:#e9dcae!important;border:1px solid #9c8a4e!important;font-weight:700}
html[data-theme=dark] .rolesel{background:#1a2338;color:#e6ecff;border-color:#34405a}
html[data-theme=dark] #fl .kbtn.n,html[data-theme=dark] #fl .kbtn.n:not(.sm){background:#1d2740;color:#e8ecf5;border:1px solid #4a5675}html[data-theme=dark] #fl .kbtn.n:hover{background:#d9b25a;color:#10151f;border-color:#d9b25a}
html[data-theme=dark] #fl .kcard,html[data-theme=dark] #fl .kcard p,html[data-theme=dark] #fl .kcard .lead,html[data-theme=dark] #fl .kcard small,html[data-theme=dark] #fl .kcard div:not(.bar):not(.row){color:#0b2250}html[data-theme=dark] #fl .kcard [dir=rtl],html[data-theme=dark] #fl .kcard .ar{color:#5a4a1a}
html[data-theme=dark] .kmeta [dir=rtl]{color:#aeb8cf!important}
html[data-theme=dark] .kex [dir=rtl]{color:#e6ebf5!important}
html[data-theme=dark] .kpron{color:#aeb8cf!important}
html[data-theme=dark] .kdef{color:#c3cbdc!important}
html[data-theme=dark] #fl .kcard .hint,html[data-theme=dark] #fl .kcard .bar+*,html[data-theme=dark] #fl .kcard [class*=cnt]{color:#c0b492 !important;opacity:1}
/* v43: every secondary button gets a dark fill with light text in dark mode (was white text on a light fill) */
html[data-theme=dark] .btn.n,html[data-theme=dark] .btn.o,html[data-theme=dark] .mbtns .btn.n{background:#1d2740!important;color:#e8ecf5!important;border:1px solid #4a5675}
html[data-theme=dark] .btn.n:hover,html[data-theme=dark] .btn.o:hover,html[data-theme=dark] .btn.n:focus-visible{background:#d9b25a!important;color:#10151f!important;border-color:#d9b25a}
html[data-theme=dark] .btn.n:disabled{opacity:.5}
/* progress and strength bars were too faint on dark */
html[data-theme=dark] .bar{background:#3a4766;border:1px solid #4a5675}
html[data-theme=dark] .bar i{background:linear-gradient(90deg,#d9b25a,#f0d58a)}
html[data-theme=dark]{--segon:#d9b25a;--segoff:#4a5675}

/* dropdown option list: the browser paints the option popup with the control's own background,
   so .panel select option{color:#111} left every option black-on-near-black in dark mode */
html[data-theme=dark] select{color-scheme:dark}
html[data-theme=dark] select option{background:#0f1522;color:#e6e9f0}
html[data-theme=dark] select option:checked{background:#2a3347;color:#fff}

html[data-theme=dark] .hint.bad{color:#ff9d9d !important}
html[data-theme=dark] .gboard .gcard{background:#131b2b!important;color:#e6e9f0!important;border-color:#2a3347}
html[data-theme=dark] .gboard .gcard.on,html[data-theme=dark] .gboard .gcard.done{background:#1a2438!important;border-color:#c9a227;color:#fff!important}
html[data-theme=dark] .gboard .gcard.done{opacity:.55;border-color:#2f7d4f}
html[data-theme=dark] .scslot{background:#131b2b!important;color:#e6e9f0!important;border-color:#c9a227}
html[data-theme=dark] .sctile{background:#131b2b!important;color:#e6e9f0!important;border-color:#2a3347}
html[data-theme=dark] .hsvg line,html[data-theme=dark] .hsvg circle{stroke:#e6e9f0}
html[data-theme=dark] .hsvg .hp.on{stroke:#ff8b80}
html[data-theme=dark] .hslot{color:#e6e9f0;border-color:#e6e9f0}
html[data-theme=dark] .hslot.on{color:#7ee0a3;border-color:#7ee0a3}
html[data-theme=dark] .hl{background:#131b2b!important;color:#e6e9f0!important;border-color:#2a3347}
html[data-theme=dark] .hl.ok{color:#7ee0a3!important;border-color:#2f7d4f}
html[data-theme=dark] .hl.no{color:#ff8b80!important;border-color:#7a2f2a}
html[data-theme=dark] .spopt{background:#131b2b!important;color:#e6e9f0!important;border-color:#2a3347}
html[data-theme=dark] #lsin{background:#0f1522;color:#e6e9f0;border-color:#34405a}
html[data-theme=dark] .wdword{color:#f1f3f8}
html[data-theme=dark] .wddef{color:#dfe4ee}
html[data-theme=dark] .wdex{color:#aab3c5}
html[data-theme=dark] .wdmeta{color:#aab3c5}
html[data-theme=dark] .cfq{color:#e6e9f0}
html[data-theme=dark] .cfover{color:#f1f3f8}
html[data-theme=dark] .cfans{color:#7ee0a3}
html[data-theme=dark] .cfwhy{color:#aab3c5}
html[data-theme=dark] .spopt.bad{border-color:#7a2f2a!important;color:#ff8b80!important}
html[data-theme=dark] .gtile{background:#131b2b;border-color:#2a3347;color:#e6e9f0}
html[data-theme=dark] .gtile i{border-color:#c9a227;color:#c9a227}
html[data-theme=dark] .gsub{color:#aab3c5}
html[data-theme=dark] .gpick label{color:#aab3c5}
html[data-theme=dark] .odtile{background:#131b2b;border-color:#2a3347;color:#e6e9f0}
html[data-theme=dark] .odtile span{color:#aab3c5}
html[data-theme=dark] .odtile.on{border-color:#2f7d4f;background:#12261b}
html[data-theme=dark] .odtile.bad{border-color:#7a2f2a;background:#2a1614}
html[data-theme=dark] .wscell{background:#131b2b;border-color:#2a3347;color:#e6e9f0}
html[data-theme=dark] .wscell.sel{background:#2a2412;border-color:#c9a227;color:#ffe6a3}
html[data-theme=dark] .wscell.on{background:#12261b;border-color:#2f7d4f;color:#7ee0a3}
html[data-theme=dark] .wsword{color:#dfe4ee}
html[data-theme=dark] .wsword.on{color:#7ee0a3}
html[data-theme=dark] .wchip{background:#131b2b;border-color:#2a3347;color:#e6e9f0}
html[data-theme=dark] .wchip.last{background:#2a2412;border-color:#c9a227;color:#ffe6a3}
html[data-theme=dark] .bbcell{background:#131b2b;border-color:#2a3347;color:#e6e9f0}
html[data-theme=dark] .cwcell{background:#131b2b;border-color:#38445c;color:#e6e9f0}
html[data-theme=dark] .cwcell.blk{background:transparent;border-color:transparent}
html[data-theme=dark] .cwcell.ok{background:#17351f;border-color:#3f7d51;color:#cdeccd}
html[data-theme=dark] .cwcell.bad{background:#3a1d1d;border-color:#8a4a4a}
html[data-theme=dark] .cwclue input{background:#0f1626;border-color:#3d4a63;color:#e6e9f0}
html[data-theme=dark] .cwclue.ok input{border-color:#3f7d51;background:#152a1b}
html[data-theme=dark] a.gl{text-decoration-color:#e0bd63}
html[data-theme=dark] .gitem.glhit{border-color:#e0bd63;box-shadow:0 0 0 4px rgba(224,189,99,.14)}

/* Third audit UX-08: lesson focus mode follows the chosen theme instead of forcing a light screen */
html[data-theme=dark] body.kil-focus{background:radial-gradient(circle at 50% -10%,#1c2438 0,#141a28 45%,#0e131d 100%)!important}
html[data-theme=dark] #fl .kcard{background:#171e2c;border-top-color:#d9b25a;box-shadow:0 18px 50px rgba(0,0,0,.45)}
html[data-theme=dark] #fl .kword{color:#f1ead6}
html[data-theme=dark] #fl h3{color:#f1ead6}
html[data-theme=dark] #fl .hint{color:#c0b492}
html[data-theme=dark] #fl .kar{color:#efd79c;background:#241f12;border-color:#4c4227}
html[data-theme=dark] #fl .ch{background:#1b2436;color:#f1ead6;border-color:#2f3a52}
html[data-theme=dark] #fl .ch:hover:not(:disabled){border-color:#d9b25a;background:#232d44}
html[data-theme=dark] #fl #ti{background:#1b2436;color:#f1ead6;border-color:#2f3a52}
html[data-theme=dark] #fl .bar{background:#26314a}
html[data-theme=dark] #fl .kbtn.n{background:#1b2436;color:#f1ead6}
html[data-theme=dark] body.kil-focus #qz .q{background:#1b2436;border-color:#2f3a52}
html[data-theme=dark] body.kil-focus #qz .q>b{color:#f1ead6}
html[data-theme=dark] body.kil-focus #qz .q label{background:#1b2436;border-color:#2f3a52;color:#e6e9f0}
html[data-theme=dark] body.kil-focus #qz .q label:hover{border-color:#d9b25a;background:#232d44}
html[data-theme=dark] body.kil-focus #qz .q label:has(input:checked){border-color:#d9b25a;background:#232d44;box-shadow:inset 0 0 0 1px #d9b25a}
html[data-theme=dark] .kres{background:#1b2436;border-color:#2f3a52;color:#e6e9f0}
html[data-theme=dark] .kil-x a{color:#efd79c!important;background:#1b2436!important;border-color:#3a4560}
html[data-theme=dark] #klw{color:#f1ead6!important}
html[data-theme=dark] .kil-play{background:#d9b25a;color:#12203f;box-shadow:0 8px 22px rgba(0,0,0,.45)}
