/* tokens.css — the three DAS overlay themes as CSS custom properties.
 *
 * SINGLE SOURCE OF TRUTH for color: every HEX here is extracted byte-exact from
 * `panda-desk/ui/overlay.py` (the crown jewel — READ-ONLY). Mapping:
 *   :root[data-theme="das-black"]  ← _COLORS_BLACK   (overlay.py L297-310)  "graphite_compact" / "DAS BLACK" (DEFAULT)
 *   :root[data-theme="das-white"]  ← _COLORS_WHITE   (overlay.py L327-350)  "white_v3"        / "DAS WHITE"
 *   :root[data-theme="das-blue"]   ← _COLORS_BLUE    (overlay.py L312-325)  "aurora"          / "DAS BLUE"
 *
 * Internal naming kept 1:1 with the python theme dict keys (a key `text_muted`
 * → `--text-muted`) so the eventual python emitter (P3+ overlay_model) can map
 * mechanically, exactly like scanner's theme_css.py does for `--scan-*`.
 *
 * Module-level state constants (overlay.py L360-367) live as theme-invariant
 * fallbacks on :root; each theme overrides score_* where it needs light-bg
 * legibility (DAS WHITE has score_clean/caution/toxic overrides, L342).
 */

:root {
  /* ── Module-level state colors (overlay.py L360-367) — NOT themed by default.
     Each theme may override score_* (DAS WHITE does). ───────────────────── */
  --score-toxic: #ff4444;     /* SCORE_TOXIC   */
  --score-caution: #ffaa00;   /* SCORE_CAUTION */
  --score-clean: #44ff44;     /* SCORE_CLEAN   */
  --unlinked-color: #555555;  /* UNLINKED_COLOR    — fallback for --ovl-link-color (link pill); no longer paints the border */
  /* ── Panda AI signature (owner 03-09-2026): the ONE colour that marks AI text —
     PANDA AI pill, EDGE / RISK callout rule + label + tint, news AI line. Owner picked
     "Azul 2" (#3b82f6, pill text black) on 03-09 over lilac/amber/white; green=bull,
     red=bear, amber=caution stay untouched. DAS WHITE: darker blue + white pill text. */
  --ai: #3b82f6;              --ai-fg: #000000;
  --locked-border: #666666;   /* window border — FIXED colour whatever the link/lock state (owner 16-09-2026) */
  --ovl-link-color: var(--unlinked-color);  /* TOK-2 — live link colour (host pushes it); link pill only, NOT the border */

  /* ── Theme-invariant warning literal (risk_warnings.py WARN_COLOR L83) ── */
  --warn-color: #ff3838;      /* TOK-1 — country/float/split warnings, hardcoded in original */

  /* ── News bias badges (_BIAS_BADGE_COLORS, overlay.py L165-169) ──────── */
  --bias-short-bg: #a00000;   --bias-short-fg: #ffffff;
  --bias-long-bg: #1a7a3a;    --bias-long-fg: #ffffff;
  --bias-neutral-bg: #555555; --bias-neutral-fg: #e0e0e0;

  /* ── News source badge (_render_news_row, overlay.py L241-242) ──────── */
  --news-src-sec-bg: #cc0000;     /* is_sec → red   */
  --news-src-other-bg: #334455;   /* else   → slate */
  --news-src-fg: #ffffff;

  /* ── Fixed chrome literals (overlay.py builder) ─────────────────────── */
  --update-bar-bg: #e6a817;   --update-bar-fg: #0a0a0a;   /* _update_bar     L1406-1409 */
  --blink-on: #ffaa00;        /* unlinked link-button blink (overlay.py _blink) */

  /* Geometry tokens (port simplifications; not from a python value) */
  --radius-pill: 999px;
  --radius-card: 3px;
  --bar-h: 3px;
}

/* ══════════════════════════════════════════════════════════════════════
   DAS BLACK  ←  _COLORS_BLACK (overlay.py L297-310)  — DEFAULT
   ══════════════════════════════════════════════════════════════════════ */
:root[data-theme="das-black"] {
  --bg: #000000;              --header-bg: #0a0a0a;
  --surface: #161616;         --surface-high: #1e1e1e;
  --border: #262626;          --border-strong: #363636;
  --text: #f0f0f0;            --text-muted: #a0a0a0;     --text-dim: #666666;
  --accent: #cccccc;          --accent-glow: #e0e0e0;
  --label: #a0a0a0;           --ai-bg: #000000;          --separator: #262626;
  --card-bg: #161616;         --card-border: #262626;    --panel-header-bg: #0a0a0a;
  --badge-low: #3a6b3a;       --badge-low-fg: #d4f0d4;
  --badge-med: #5c4400;       --badge-med-fg: #ffe082;
  --badge-high: #5a0a0a;      --badge-high-fg: #ffdddd;
  --section-title: #bbbbbb;
  --risk-high: #e09090;       --risk-med: #e0c070;       --risk-low: #888888;

  /* News zones — DAS BLACK uses the dark inline defaults from
     _build_news_panels (overlay.py L991-1002; only DAS WHITE overrides). */
  --news-brk-border: #cc2200; --news-brk-bg: #1a0000; --news-brk-hdr-bg: #2a0000; --news-brk-fg: #ff4444;
  --news-rec-border: #cc7a00; --news-rec-bg: #1a1000; --news-rec-hdr-bg: #2a1a00; --news-rec-fg: #ffaa00;
  --news-lts-border: #555555; --news-lts-bg: #1a1a1a; --news-lts-hdr-bg: #2a2a2a; --news-lts-fg: #aaaaaa;
}

/* ══════════════════════════════════════════════════════════════════════
   DAS BLUE  ←  _COLORS_BLUE (overlay.py L312-325)
   ══════════════════════════════════════════════════════════════════════ */
:root[data-theme="das-blue"] {
  --bg: #0a0e17;              --header-bg: #0f1524;
  --surface: #131a2b;         --surface-high: #1a2235;
  --border: #1e2739;          --border-strong: #2a3550;
  --text: #e8ecf5;            --text-muted: #8b96ad;     --text-dim: #5b6480;
  --accent: #5b9cff;          --accent-glow: #7eb2ff;
  --label: #8b96ad;           --ai-bg: #0a0e17;          --separator: #1e2739;
  --card-bg: #131a2b;         --card-border: #1e2739;    --panel-header-bg: #0f1524;
  --badge-low: #1a5c2a;       --badge-low-fg: #44ff77;
  --badge-med: #7a5c00;       --badge-med-fg: #fff176;
  --badge-high: #5a0a0a;      --badge-high-fg: #ffdddd;
  --section-title: #5b9cff;
  --risk-high: #f87171;       --risk-med: #fbbf24;       --risk-low: #7b8499;

  /* News zones — DAS BLUE inherits the dark inline defaults (no overrides
     in _COLORS_BLUE). Same literals as DAS BLACK (overlay.py L991-1002). */
  --news-brk-border: #cc2200; --news-brk-bg: #1a0000; --news-brk-hdr-bg: #2a0000; --news-brk-fg: #ff4444;
  --news-rec-border: #cc7a00; --news-rec-bg: #1a1000; --news-rec-hdr-bg: #2a1a00; --news-rec-fg: #ffaa00;
  --news-lts-border: #555555; --news-lts-bg: #1a1a1a; --news-lts-hdr-bg: #2a2a2a; --news-lts-fg: #aaaaaa;
}

/* ══════════════════════════════════════════════════════════════════════
   DAS WHITE  ←  _COLORS_WHITE (overlay.py L327-350)
   The only theme that overrides score_* (L342) + the news zones (L343-349).
   ══════════════════════════════════════════════════════════════════════ */
:root[data-theme="das-white"] {
  --bg: #eaeaee;              --header-bg: #d8d8dc;
  --surface: #ffffff;         --surface-high: #dcdce4;
  --border: #c0c0c8;          --border-strong: #a8a8b4;
  --text: #0f0f0f;            --text-muted: #585858;     --text-dim: #888890;
  --accent: #1a5a9a;          --accent-glow: #2a7ac0;
  --label: #585858;           --ai-bg: #f4f4f6;          --separator: #c0c0c8;
  --card-bg: #ffffff;         --card-border: #c0c0c8;    --panel-header-bg: #d8d8dc;
  --badge-low: #16621c;       --badge-low-fg: #d0ffd8;
  --badge-med: #7a5000;       --badge-med-fg: #fff4cc;
  --badge-high: #8a1818;      --badge-high-fg: #ffe8e8;
  --section-title: #1a5a9a;
  --risk-high: #cc3333;       --risk-med: #bb6600;       --risk-low: #707070;

  /* Score colors need light-bg-legible overrides (overlay.py L342). */
  --score-clean: #16621c;     --score-caution: #8a5500;  --score-toxic: #aa1818;
  --ai: #2563eb;              --ai-fg: #ffffff;

  /* News zones in light tones (overlay.py L343-349). */
  --news-brk-border: #cc2200; --news-brk-bg: #fff0ee; --news-brk-hdr-bg: #fce0dc; --news-brk-fg: #aa1500;
  --news-rec-border: #cc7a00; --news-rec-bg: #fff8f0; --news-rec-hdr-bg: #feeedd; --news-rec-fg: #8a5200;
  --news-lts-border: #a0a0a8; --news-lts-bg: #f4f4f6; --news-lts-hdr-bg: #d8d8dc; --news-lts-fg: #505058;
}
