/* Aitho dark theme: hand-tuned rules (Settings > Appearance, owner 2026-11-09). Loaded after the generated
   static/dark/*.css on presenter pages only. Every rule is scoped to html[data-theme="dark"], so Light is untouched.
   Theme v2 (owner 2026-11-10, modelled on ChatGPT's dark): neutral, never navy. Black page #000000, cards and grouped
   rows #1C1C1E, inputs and pressed states #2C2C2E, separators #38383A, ink #F5F5F7, dim #AEAEB2, faint #98989F;
   the cobalt accent #2E5BFF kept for fills (primary buttons, the logo tile), #8EA8FF where the accent is text
   (4.5:1 or better on every surface). */
html[data-theme="dark"] {
  color-scheme: dark;
  --dk-ground: #000000; --dk-surface: #1C1C1E; --dk-raised: #2C2C2E; --dk-line: #38383A; --dk-ink: #F5F5F7;
  --dk-dim: #AEAEB2; --dk-faint: #98989F; --dk-link: #8EA8FF; --dk-accent: #2E5BFF;
}
/* the v2 tokens (static/aitho-ui.css), set once here so every page that reads them agrees */
html[data-ui="v2"][data-theme="dark"] {
  --ui-ink: #F5F5F7; --ui-ink-2: #D1D1D6; --ui-dim: #AEAEB2; --ui-faint: #98989F;
  --ui-bg: #000000; --ui-panel: #1C1C1E; --ui-card: #1C1C1E; --ui-line: #38383A; --ui-line-2: #48484A;
  --ui-accent: #2E5BFF; --ui-accent-soft: #1C1C1E;
}
html[data-theme="dark"] ::placeholder { color: #8E8E93; }
/* the pages' own text, line and page tokens: one neutral scale everywhere. --bg is the page (black); --paper (the phone's
   cards, the home warm-up and hard-question cards) is the card grey; --st-ground is the grouped ground under Settings. */
html[data-theme="dark"] { --ink: #F5F5F7; --dim: #AEAEB2; --muted: #AEAEB2; --faint: #98989F; --line: #38383A;
  --bg: #000000; --paper: #1C1C1E; --st-ground: #000000; }
/* native controls the light CSS leaves to the browser: neutral greys (zero-specificity :where, so any page rule that sets a
   background, and its generated twin, still wins) */
html[data-theme="dark"] :where(button) { background-color: #2C2C2E; color: var(--dk-ink); }
html[data-theme="dark"] :where(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]), textarea, select) {
  background-color: #2C2C2E; color: var(--dk-ink); border-color: #38383A; }
/* the segmented choices (speech engine, layout): the chosen one reads as chosen */
html[data-theme="dark"] .seg button.on { background: #48484A; color: #FFFFFF; box-shadow: none; }
/* side menus: black (phone, as ChatGPT's) or #111111 (the desktop sidebar beside the black page), grey selected rows */
html[data-theme="dark"] .app .side.sb { background: #111111; border-right-color: #262628; }
html[data-theme="dark"] .sb-foot { background: linear-gradient(to bottom, rgba(17,17,17,0), #111111 42%); }
html[data-theme="dark"] .app .snav.active, html[data-theme="dark"] .sb-recent.on, html[data-theme="dark"] .sb-acct[aria-expanded="true"],
html[data-theme="dark"] .lib-recent.on, html[data-theme="dark"] #drawer .lib-nav .dw-item.on, html[data-theme="dark"] .lib-acct[aria-expanded="true"] {
  background: #2C2C2E; color: var(--dk-ink); }
html[data-theme="dark"] .app .snav.active .ic { color: var(--dk-ink); }
html[data-ui="v2"][data-theme="dark"] .snav.active, html[data-ui="v2"][data-theme="dark"] .rail-item.active { background: #2C2C2E; color: var(--dk-ink); }
/* the Settings page's icon rail and section list, and the desktop Settings window: the #111111 side panel, not a card */
html[data-theme="dark"] { --side: #111111; --rail: #111111; }
html[data-theme="dark"] .rail, html[data-theme="dark"] .snav-wrap { background: #111111; border-right-color: #262628; }
html[data-theme="dark"] .st-modal .st-sheet { background: #111111; box-shadow: 0 0 0 1px #262628, 0 24px 60px rgba(0,0,0,.6); }
html[data-theme="dark"] .st-modal .st-badge { box-shadow: 0 0 0 3px #111111; }
/* the Appearance menu (theme v2): a raised grey popover with a white checkmark */
html[data-theme="dark"] .ap-menu { background: #2C2C2E; box-shadow: 0 0 0 .5px rgba(255,255,255,.1), 0 12px 32px -8px rgba(0,0,0,.7); }
html[data-theme="dark"] .ap-menu button { color: var(--dk-ink); background: none; }
html[data-theme="dark"] .ap-menu button:hover, html[data-theme="dark"] .ap-menu button:focus-visible, html[data-theme="dark"] .ap-menu button:active { background: #3A3A3C; }
html[data-theme="dark"] .ap-btn { background: #2C2C2E; border-color: #38383A; color: var(--dk-ink); }
/* QR codes stay dark-on-white in every theme, or phones cannot scan them (room casting, the room code, the phone link) */
html[data-theme="dark"] .pvr-qr, html[data-theme="dark"] .cast-qr, html[data-pvr="1"][data-theme="dark"] .pvr-qr { background: #FFFFFF !important; border-color: #E7ECF6 !important; }
