/* EO Tools theme, AL decision 2026-09-05: light is the default, dark is opt-in.
   Load this AFTER the page's own <style> block. Both rules below score 0,2,0 on
   specificity, so they beat a plain :root from the page and source order decides
   between them: the dark block comes last and wins whenever data-theme="dark".
   A page that already declares a token keeps its own value only if that token is
   absent here. Nothing else in the page needs to change. */

:root:root {
  /* Fixed colour system, identical on the four intranets (rule 3, 2026-09-09) */
  --n-white: #ffffff; --n-paper: #f7f6f3; --n-grey-1: #dedbd4; --n-grey-2: #b6b1a7; --n-grey-3: #6e6e78; --n-grey-4: #45454e; --n-black: #16161a;
  --c-red: #a3282a; --c-green: #0f7a55; --c-amber: #8a5f08; --c-blue: #1c6f9c; --c-violet: #6641b8;
  color-scheme: light;
  /* ground */
  --bg: #f7f6f3;
  --bg-card: #ffffff;
  --bg-soft: #efede8;
  --black: #f7f6f3;
  --black-2: #ffffff;
  /* ink */
  --text: #16161a;
  --white: #16161a;
  --ink: #16161a;
  --text-dim: #45454e;
  --text-muted: #6e6e78;
  /* structure */
  --border: #dedbd4;
  --grey-1: #dedbd4;
  --grey-2: #b6b1a7;
  --grey-3: #6e6e78;
  /* accent */
  /* No gold anywhere (rule 3, 2026-09-09): the alias resolves to the ink */
  --gold: #16161a;
  --gold-deep: #45454e;
  --red: #a3282a;
  /* trauma map family */
  --tm-bg: #f7f6f3;
  --tm-card: #ffffff;
  --tm-card-hi: #f1efe9;
  --tm-border: #dedbd4;
  --tm-border-hi: #c6c2b8;
  --tm-text: #16161a;
  --tm-text-mid: #4d4a44;
  --tm-text-dim: #77736c;
  --tm-emerald: #0f7a55;
  --tm-rose: #b03a4d;
  --tm-violet: #6641b8;
  --tm-sky: #1c6f9c;
  --tm-amber: #8a5f08;
}

:root[data-theme="dark"] {
  --c-red: #fb7185; --c-green: #10b981; --c-amber: #fbbf24; --c-blue: #38bdf8; --c-violet: #a78bfa;
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-card: #121216;
  --bg-soft: #15151a;
  --black: #0a0a0c;
  --black-2: #121216;
  --text: #f2f2f5;
  --white: #f2f2f5;
  --ink: #f2f2f5;
  --text-dim: #b8b8c2;
  --text-muted: #7a7a85;
  --border: #22222a;
  --grey-1: #22222a;
  --grey-2: #4a4a52;
  --grey-3: #7a7a85;
  --gold: #f2f2f5;
  --gold-deep: #b8b8c2;
  --red: #b42a2a;
  --tm-bg: #0a0a0c;
  --tm-card: #14141a;
  --tm-card-hi: #1a1a22;
  --tm-border: #2a2a32;
  --tm-border-hi: #3a3a42;
  --tm-text: #e8e4dc;
  --tm-text-mid: #a8a39a;
  --tm-text-dim: #6a6560;
  --tm-emerald: #10b981;
  --tm-rose: #fb7185;
  --tm-violet: #a78bfa;
  --tm-sky: #38bdf8;
  --tm-amber: #fbbf24;
}

/* Nothing is themed until the ground itself follows the tokens. A page whose body
   paints a literal hex keeps that hex, which is exactly the case an agent has to
   tokenise by hand. */
html, body { background: var(--bg); color: var(--text); }
body { transition: background .18s ease, color .18s ease; }
/* Inter replaced JetBrains Mono everywhere (rule 2, AL 2026-09-09). Numbers keep their alignment here. */
html { font-variant-numeric: tabular-nums; }

/* Floating toggle, injected by eo-theme.js when the page carries no button of its own. */
#eo-theme-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  font: 500 11.5px/1 Inter, -apple-system, system-ui, sans-serif;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 9px 13px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.14);
}
#eo-theme-fab:hover { color: var(--gold); border-color: var(--gold); }
@media print { #eo-theme-fab { display: none; } }
