/* Night mode for the lesson player (all courses). Switched on by html[data-theme="dark"].
   lesson.css and lesson-app.css stay frozen; this file only overrides them.
   Toggle: the moon/sun button in the top bar (#themeBtn). Choice saved in localStorage "aix-theme";
   with no saved choice the player follows the device setting. */

/* ---------- theme button (top bar is dark in both modes) ---------- */
.themebtn{width:34px;height:34px;flex:none;border-radius:999px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.06);color:#cdd7ea;display:grid;place-items:center;padding:0;transition:background .15s,color .15s}
.themebtn:hover{background:rgba(255,255,255,.14);color:#fff}
.themebtn svg{width:17px;height:17px}
.themebtn .sun{display:none}
html[data-theme="dark"] .themebtn .sun{display:block}
html[data-theme="dark"] .themebtn .moon{display:none}

/* ---------- tokens ---------- */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#0b1424;color:#e6ecf7}
html[data-theme="dark"] .device[data-v][data-p]{
  --bg:#0b1424; --card:#14213b; --ink:#e6ecf7; --muted:#a6b3ca; --faint:#7788a6; --line:#26375a;
  --accent:#5b8ff9; --accent-soft:#1a2c52; --accent-ink:#fff;
  --good:#3cc47f; --good-soft:#143524; --todo:#f2a64b; --todo-soft:#3a2b14; --mark:#6b5414;
  --shadow:0 2px 0 #08101f, 0 8px 24px -12px rgba(0,0,0,.6);
  --top-bg:#08111f; --top-ink:#fff; --top-muted:#9db0d3; --seg-off:#22355a; --seg-on:#5b8ff9;
  --btn-bg:#2f6bef; --btn-3d:0 4px 0 #173f9e;
  --pts-bg:#ffc93c; --pts-ink:#3d2a00;
  --rail-bg:#0f1a2f; --rail-on:#1a2c52; --rail-on-ink:#a9c4ff;
}
html[data-theme="dark"] .frame{box-shadow:none}

/* ---------- lesson.css hard-coded colours ---------- */
html[data-theme="dark"] .btn:disabled{background:#2a3958;color:#7788a6}
html[data-theme="dark"] .opt .r{border-color:#4a5b7c}
html[data-theme="dark"] .drawer{background:rgba(0,0,0,.55)}
html[data-theme="dark"] .nextcard{background:#1c2d52;color:#fff}
html[data-theme="dark"] .toast{background:#24375c;color:#fff}
html[data-theme="dark"] .launchbar{background:#1c2d52}
html[data-theme="dark"] .launch-note{color:var(--muted)}
html[data-theme="dark"] .launch-status{color:var(--good)}
html[data-theme="dark"] .rl .n .rn{color:#fff}

/* ---------- navy panels: lift them off the dark page ---------- */
html[data-theme="dark"] .nextcard.dark,
html[data-theme="dark"] .world,
html[data-theme="dark"] .rc-sum,
html[data-theme="dark"] .ce-rank,
html[data-theme="dark"] .cs-hd,
html[data-theme="dark"] .wn-s2,
html[data-theme="dark"] .sh-card,
html[data-theme="dark"] .yp > li.end .yp-card,
html[data-theme="dark"] .termpop{background:#1c2d52;box-shadow:0 0 0 1px #2c4270}
html[data-theme="dark"] .cs-hd{box-shadow:none}
html[data-theme="dark"] .termpop .ex{background:#0f1a2f}
html[data-theme="dark"] .wn-s2 li{background:#14213b}
html[data-theme="dark"] .world-ppl{border-top-color:#2c4270}
html[data-theme="dark"] .ce-meter{background:#0f1a2f}
html[data-theme="dark"] .lv.here .lvn,
html[data-theme="dark"] .cs-n,
html[data-theme="dark"] .rnk-n::before,
html[data-theme="dark"] .wn-stages li.now span{background:#24375c;border-color:#3a5385}
html[data-theme="dark"] .wn-stages li.now span{box-shadow:0 0 0 4px #4d3c10}
html[data-theme="dark"] .prose .tooltable th{background:#1c2d52}
html[data-theme="dark"] .act-check{background:#2f6bef;color:#fff}
html[data-theme="dark"] .prose .tryit li::before{background:#2f6bef}
html[data-theme="dark"] .ch-cur{background:var(--ink)}
html[data-theme="dark"] .md strong,
html[data-theme="dark"] .cs-tpl-h,
html[data-theme="dark"] .ch-step.now{color:var(--ink)}

/* ---------- white cards and light-grey fills ---------- */
html[data-theme="dark"] .msg-file,
html[data-theme="dark"] .chatpic-hd,
html[data-theme="dark"] .prose .draftbox,
html[data-theme="dark"] .prose .tooltable,
html[data-theme="dark"] .srt-b button,
html[data-theme="dark"] .mtc-r select,
html[data-theme="dark"] .fl-s,
html[data-theme="dark"] .rnk-b button,
html[data-theme="dark"] .bld-b,
html[data-theme="dark"] .prose .meet,
html[data-theme="dark"] .prose .tm,
html[data-theme="dark"] .prose .trick,
html[data-theme="dark"] .prose .tryit li,
html[data-theme="dark"] .ce .yours .cs-tpl,
html[data-theme="dark"] .ch-step,
html[data-theme="dark"] .ch-win,
html[data-theme="dark"] .ch-comp,
html[data-theme="dark"] .md-tab,
html[data-theme="dark"] .prose .bb-doc,
html[data-theme="dark"] .prose .bb-tool,
html[data-theme="dark"] .cp-card,
html[data-theme="dark"] .mine-box textarea,
html[data-theme="dark"] .gen-box-in,
html[data-theme="dark"] .spt-box,
html[data-theme="dark"] .gift-in,
html[data-theme="dark"] .tc-ic{background:var(--card);color:var(--ink)}
html[data-theme="dark"] .ch-av.ai{background:#e9eef7}
html[data-theme="dark"] .ch-logos img{background:#e9eef7;border-radius:6px;padding:2px;box-sizing:border-box;width:22px;height:22px}
html[data-theme="dark"] .msg-peek span,
html[data-theme="dark"] .spt-p,
html[data-theme="dark"] .cht-m.ai,
html[data-theme="dark"] .ch-row.ai .ch-b,
html[data-theme="dark"] .ch-typing,
html[data-theme="dark"] .ch-sim,
html[data-theme="dark"] .tooltip-note,
html[data-theme="dark"] .ce-why span,
html[data-theme="dark"] .ch-step i,
html[data-theme="dark"] .md th,
html[data-theme="dark"] .prose .bb-doc-hd,
html[data-theme="dark"] .prose .tm-bar,
html[data-theme="dark"] .prose .tm-side,
html[data-theme="dark"] .prose .tm-btn,
html[data-theme="dark"] .prose .tt-pills i,
html[data-theme="dark"] .prose .meet-plan div,
html[data-theme="dark"] .prose .fit-n{background:#1b2944;color:var(--ink)}
html[data-theme="dark"] .prose .tm-side i:first-child{background:var(--card);color:var(--ink)}
html[data-theme="dark"] .prose .tm-bar span,
html[data-theme="dark"] .chatpic-hd span{background:#34476b}
html[data-theme="dark"] .md th,
html[data-theme="dark"] .md td,
html[data-theme="dark"] .rtab th,
html[data-theme="dark"] .rtab td{border-bottom-color:var(--line)}
html[data-theme="dark"] .md-tab{border-color:var(--line)}
html[data-theme="dark"] .ch-comp:focus-within,
html[data-theme="dark"] .mine-box textarea:focus{box-shadow:0 0 0 3px #1a2c52}
html[data-theme="dark"] .ch-send{box-shadow:0 3px 0 #173f9e}
html[data-theme="dark"] .ch-row.you .ch-b,
html[data-theme="dark"] .cht-m.you,
html[data-theme="dark"] .ch-av.you{background:#2f6bef}
html[data-theme="dark"] .ch-typing i,
html[data-theme="dark"] .ch-row .ch-typing i{background:#7788a6}
html[data-theme="dark"] .ch-inc{background:rgba(255,255,255,.08)}
html[data-theme="dark"] .ch-inc small{color:#f5d27a}
html[data-theme="dark"] .ch-tool{background:#1a2c52;color:#a9c4ff}

/* ---------- soft yellow / tinted boxes ---------- */
html[data-theme="dark"] .ce-why span.on,
html[data-theme="dark"] .cs-two .you,
html[data-theme="dark"] .p3,
html[data-theme="dark"] .wn-why,
html[data-theme="dark"] .sh-catch,
html[data-theme="dark"] .cht-task,
html[data-theme="dark"] .prose .meet-plan div:last-child,
html[data-theme="dark"] .ce .yours,
html[data-theme="dark"] .ch-task,
html[data-theme="dark"] .qw-ctx{background:#33290f;color:#f3e3b5}
html[data-theme="dark"] .cs-two .you b,
html[data-theme="dark"] .p3,
html[data-theme="dark"] .wn-why p,
html[data-theme="dark"] .gift-in small,
html[data-theme="dark"] .gift-hint{color:#f5d27a}
html[data-theme="dark"] .ch-note{background:#3a2b14;color:#f5c98a}
html[data-theme="dark"] .act-fb.ok{color:#9fe3bd}
html[data-theme="dark"] .act-fb.no,
html[data-theme="dark"] .cht-coach .no{color:#f5c98a}
html[data-theme="dark"] .ch-ok,
html[data-theme="dark"] .ch-step.done,
html[data-theme="dark"] .mine-row{color:var(--good)}
html[data-theme="dark"] .ch-step.done i{background:#1f7a4c}
html[data-theme="dark"] .rtab .nf{color:#f2a64b}
html[data-theme="dark"] .p1,
html[data-theme="dark"] .rl-tag.rl-learn,
html[data-theme="dark"] .cs-chips span,
html[data-theme="dark"] .prose .meet-chips span{background:#1a2c52;color:#a9c4ff}
html[data-theme="dark"] .p2,
html[data-theme="dark"] .prose .fit-y{background:#143524;color:#9fe3bd}
html[data-theme="dark"] .prose .fit-y b{color:#9fe3bd}
html[data-theme="dark"] .p4{background:#2d1f4a;color:#d4b8ff}
html[data-theme="dark"] .p5{background:#40182a;color:#ffb3c6}
html[data-theme="dark"] .msg-new{background:#4a1d22;color:#ffb3b8}
html[data-theme="dark"] .toolcard{background:#1a2c52}
html[data-theme="dark"] .prose .tt-ic.c1{background:#1a2c52;color:#a9c4ff}
html[data-theme="dark"] .prose .tt-ic.c2{background:#143524;color:#9fe3bd}
html[data-theme="dark"] .prose .tt-ic.c3{background:#33290f;color:#f5d27a}
html[data-theme="dark"] .prose .tt-ic.c4,
html[data-theme="dark"] .prose .tt-ic.c5{background:#3d2015;color:#ffb594}
html[data-theme="dark"] .prose .tt-ic.c6{background:#2d1f4a;color:#d4b8ff}
html[data-theme="dark"] .prose .tt-ic.c7{background:#24375c}
html[data-theme="dark"] .prose .meet-ic.ic-agent{background-color:#24375c}
html[data-theme="dark"] .ce-star path{fill:#24375c;stroke:#34476b}
html[data-theme="dark"] .cs{box-shadow:0 0 0 1px var(--line),0 24px 40px -24px rgba(0,0,0,.7)}
html[data-theme="dark"] .cs-tpl-h i,
html[data-theme="dark"] .qw-cat .checks .tip .ic{background:#1a2c52;color:#a9c4ff}

/* ---------- spot-the-problem and other activities ---------- */
html[data-theme="dark"] .spt-p{border-bottom-color:#5a6c8e}
html[data-theme="dark"] .spt-p[aria-pressed="true"],
html[data-theme="dark"] .spt-p.found{background:#6b5414;color:#fff}
html[data-theme="dark"] .spt.red .spt-p[aria-pressed="true"],
html[data-theme="dark"] .spt.red .spt-p.found{background:#000;color:#000;border-bottom-color:#000}
html[data-theme="dark"] .spt-list .spt-p{background:var(--card);border-color:var(--line)}
html[data-theme="dark"] .spt-list .spt-p:hover{border-color:#4a5b7c}
html[data-theme="dark"] .spt-box{border-color:#4a5b7c}
html[data-theme="dark"] .spt-list .spt-p[aria-pressed="true"]{background:#33290f;border-color:#e0a800}
html[data-theme="dark"] .spt-list .spt-p.wrong{background:#3a1619}
html[data-theme="dark"] .spt-list .spt-p.found{background:#143524;border-color:#3cc47f}
html[data-theme="dark"] .spt-two .gen-frame{background:#1b2944}
html[data-theme="dark"] .gen-frame{background:#1b2944}
html[data-theme="dark"] .gen-frame::after{color:#a6b3ca;background:linear-gradient(110deg,#1b2944 20%,#26375a 40%,#1b2944 60%) 0 0/250% 100%}
html[data-theme="dark"] .bld-b{border-color:#4a5b7c}
html[data-theme="dark"] .qw-cat.ok{border-color:#245c3d}
html[data-theme="dark"] .qw-cat.no{border-color:#6b4a1a}
html[data-theme="dark"] .lg-sizes figcaption,
html[data-theme="dark"] .cp-card dt{color:var(--muted)}
html[data-theme="dark"] .cp-card{box-shadow:0 0 0 1px var(--line)}

/* ---------- design-tool (Canva-style) simulation ---------- */
html[data-theme="dark"] .cv-side,
html[data-theme="dark"] .cv-clicks,
html[data-theme="dark"] .cv-kit,
html[data-theme="dark"] .cv-font select{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .cv-side span{color:var(--muted)}
html[data-theme="dark"] .cv-side span.on{background:#2d1f4a;color:#d4b8ff}
html[data-theme="dark"] .cv-main,
html[data-theme="dark"] .cv-main .ch-thread{background:#101b31}
html[data-theme="dark"] .ch-win.cv .ch-task{background:#2d1f4a;color:#eadcff}
html[data-theme="dark"] .cv-pro{background:#2d1f4a;color:#d4b8ff}
html[data-theme="dark"] .cv-kit{box-shadow:0 0 0 1px var(--line)}
html[data-theme="dark"] .cv-kit-sec{border-top-color:var(--line)}
html[data-theme="dark"] .cv-kit-sec h5,
html[data-theme="dark"] .cv-result>span{color:var(--muted)}
html[data-theme="dark"] .cv-sw-i{border-color:var(--line)}
html[data-theme="dark"] .cv-sw-i:has(input.bad){background:#3a1619}
html[data-theme="dark"] .cv-logo-slot{border-color:#5b4b8a;color:#c9a8ff}
html[data-theme="dark"] .cv-logo-slot[aria-pressed="true"]{color:var(--ink)}
