/* Theme tokens, shared by every page. Light is the default; dark follows the system or the saved choice (see /theme.js, which
   sets data-theme on <html>; without JavaScript the media query still follows the system). The dark values are Decks' original
   look, unchanged. Slides and the present/viewer stage stay as the deck designs them: they never use these tokens. */
:root {
  color-scheme: light dark;
  --bg: #ffffff; --surface: #f5f5f4; --raise: #ececea; --line: #e2e2df; --line-strong: #c4c4c0; --field: #8a8a86;
  --ink: #161616; --soft: #595959; --faint: #6b6b6b;
  --accent: #0099ff; --accent-hover: #33adff; --accent-text: #0066b3; --on-accent: #04121c; --danger: #c62828;
  --tint: rgba(0, 153, 255, .12); --tint-soft: rgba(0, 153, 255, .07); --tint-ring: rgba(0, 153, 255, .3);
  --topbar: rgba(255, 255, 255, .92); --dlg: #ffffff; --thumb: #e7e7e4; --dash: #c4c4c0; --veil: rgba(255, 255, 255, .88);
  --backdrop: rgba(20, 20, 20, .35); --shadow: 0 20px 60px rgba(0, 0, 0, .18);
  --an-a: #0072b2; --an-b: #c25400;
  --chrome-bg: rgba(255, 255, 255, .88); --chrome-ink: #161616; --chrome-soft: #4a4a4a; --chrome-hover: rgba(0, 0, 0, .08); --chrome-line: rgba(0, 0, 0, .2);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c0c0c; --surface: #161616; --raise: #1d1d1f; --line: #262628; --line-strong: #3a3a3d; --field: #262628;
  --ink: #f4f4f5; --soft: #a1a1aa; --faint: #8a8a94;
  --accent: #33adff; --accent-hover: #5bbfff; --accent-text: #33adff; --on-accent: #04121c; --danger: #ff6b6b;
  --tint: rgba(51, 173, 255, .16); --tint-soft: rgba(51, 173, 255, .07); --tint-ring: rgba(51, 173, 255, .35);
  --topbar: rgba(12, 12, 12, .92); --dlg: #131315; --thumb: #222222; --dash: #34343a; --veil: rgba(12, 12, 12, .85);
  --backdrop: rgba(0, 0, 0, .65); --shadow: 0 20px 60px rgba(0, 0, 0, .5);
  --an-a: #56b4e9; --an-b: #e69f00;
  --chrome-bg: rgba(12, 12, 12, .78); --chrome-ink: #f4f4f5; --chrome-soft: #d4d4d8; --chrome-hover: rgba(255, 255, 255, .12); --chrome-line: rgba(255, 255, 255, .2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0c0c0c; --surface: #161616; --raise: #1d1d1f; --line: #262628; --line-strong: #3a3a3d; --field: #262628;
    --ink: #f4f4f5; --soft: #a1a1aa; --faint: #8a8a94;
    --accent: #33adff; --accent-hover: #5bbfff; --accent-text: #33adff; --on-accent: #04121c; --danger: #ff6b6b;
    --tint: rgba(51, 173, 255, .16); --tint-soft: rgba(51, 173, 255, .07); --tint-ring: rgba(51, 173, 255, .35);
    --topbar: rgba(12, 12, 12, .92); --dlg: #131315; --thumb: #222222; --dash: #34343a; --veil: rgba(12, 12, 12, .85);
    --backdrop: rgba(0, 0, 0, .65); --shadow: 0 20px 60px rgba(0, 0, 0, .5);
    --an-a: #56b4e9; --an-b: #e69f00;
    --chrome-bg: rgba(12, 12, 12, .78); --chrome-ink: #f4f4f5; --chrome-soft: #d4d4d8; --chrome-hover: rgba(255, 255, 255, .12); --chrome-line: rgba(255, 255, 255, .2);
  }
}
:root[data-theme='light'] { color-scheme: light; }

/* Illustrations: dark recolours by default, the light originals in light mode (the hidden one is lazy, so never downloaded) */
.illo-light { display: none !important; }
:root[data-theme='light'] .illo-light { display: block !important; }
:root[data-theme='light'] .illo-dark { display: none !important; }

/* The sun/moon switch */
.theme-toggle { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.theme-toggle:hover { background: var(--raise); border-color: var(--line-strong); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
:root[data-theme='light'] .theme-toggle .sun { display: none; }
:root[data-theme='light'] .theme-toggle .moon { display: block; }

/* Scrollbars: the real, native ones, quietly themed (thin, rounded thumb, transparent track), for the page and every container that scrolls. Defined once on the theme tokens, so light and
   dark both follow. The public viewer's stage (body.dk-page) and forced-colors mode keep the system's own. */
:root:not(:has(.dk-page)) { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
:root:not(:has(.dk-page)) * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
:root:not(:has(.dk-page)) ::-webkit-scrollbar { width: 10px; height: 10px; }
:root:not(:has(.dk-page)) ::-webkit-scrollbar-track, :root:not(:has(.dk-page)) ::-webkit-scrollbar-corner { background: transparent; }
:root:not(:has(.dk-page)) ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; min-height: 36px; min-width: 36px; }
:root:not(:has(.dk-page)) ::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }
@media (forced-colors: active) {
  :root, :root * { scrollbar-width: auto !important; scrollbar-color: auto !important; }
  ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-track { all: unset; }
}
