/* yeon design tokens for the operator console. Copied from component-extension/theme.css (docs/THEMING.md
 * section 2, cross-origin surface). Values are verbatim and that file wins if the two drift. --id-* and the
 * .tgl switch are omitted: this page paints neither. Comments differ only where an em-dash was replaced. */

:root {
  color-scheme: light;

  /* ── surfaces (recessed → raised) ─────────────────────────────────────── */
  --bg:        #fbfbfc;   /* app / window background - coolest, most recessed */
  --surface:   #fff;      /* raised card / panel / input face */
  --surface-2: #f5f6f8;   /* inset fill: input alt, hover fill, zebra, code bg */

  /* ── lines ────────────────────────────────────────────────────────────── */
  --line:      #e7e8ec;   /* hairline - deliberately visible (grid look): borders, input outline */
  --line-soft: #eff0f3;   /* softer divider - row separators, section rules */

  /* ── text (contrast tiers) ────────────────────────────────────────────── */
  --text:   #0d0e11;      /* primary - AAA on surface/bg */
  --text-2: #3a3f47;      /* secondary strong - AAA; strong labels, dt terms */
  --muted:  #6b7280;      /* muted - AA (>=4.5:1) on surface/bg; metadata, hints, eyebrows */
  --faint:  #9aa0ab;      /* faint - sub-AA: placeholders, disabled, decorative ONLY (never body copy) */

  /* ── accent - yeon "kite indigo" (the ONE functional accent) ──────────── */
  --accent:      #3253d6; /* links, focus, primary fill, active marks - AA on surface (~6.3:1) */
  --accent-2:    #2743b8; /* accent hover / pressed / gradient stop (darker in light) */
  --accent-ink:  #fff;    /* text/icon ON an --accent fill (contrast guaranteed) */
  --accent-wash: #edf0fc; /* soft accent tint: focus halo, ::selection, selected-surface fill */
  --ring:        var(--accent-wash); /* focus-halo color (auto-follows accent-wash across themes) */

  /* ── semantic (solid + wash; danger also a border) ────────────────────── */
  --ok:   #1a7f5a; --ok-wash:   #e6f5ee;                    /* success / saved / positive */
  --warn: #b4690e; --warn-wash: #fbf0e1;                    /* warning / caution */
  --bad:  #c8372d; --bad-wash:  #fdecea; --bad-line: #f3c9c4; /* danger / destructive / error */
  --info: var(--accent); --info-wash: var(--accent-wash);   /* informational - reuses accent, no new hue */

  /* ── attribute pastels - text-bearing chips only (bg / border / ink) ──── *
   * For small labeled categorical tags whose TEXT sits on the pastel; ink is tuned AA-ish on its bg.
   * Distinct namespace + values from the identity pastels below (do not mix the two). */
  --p-sky-bg:#e5f1ff;   --p-sky-bd:#a9d2f6;   --p-sky-ink:#2f6fb0;
  --p-lav-bg:#eee9ff;   --p-lav-bd:#cbbef6;   --p-lav-ink:#5a45c7;
  --p-mint-bg:#e3f7ec;  --p-mint-bd:#a9e1c1;  --p-mint-ink:#1f8a5b;
  --p-peach-bg:#ffeede; --p-peach-bd:#fbc99f; --p-peach-ink:#b96e27;
  --p-lemon-bg:#fff7da; --p-lemon-bd:#f0dc97; --p-lemon-ink:#9a7a18;
  --p-rose-bg:#ffe7ee;  --p-rose-bd:#f5b4c8;  --p-rose-ink:#c24b72;


  /* ── typography ───────────────────────────────────────────────────────── */
  /* Every entry below is a family that REALLY EXISTS somewhere, in the order it should win.
   * `ui-sans-serif` / `ui-monospace` are deliberately absent: Chromium does not implement the
   * CSS Fonts 4 ui-* generics (its generic-keyword range is serif..math), so Blink parses them
   * as literal family names that are installed on no OS - a dead entry that only delays the
   * real match. `system-ui` IS implemented and is the one entry guaranteed to resolve on every
   * OS (macOS -> San Francisco, Windows -> the OS menu font, i.e. Segoe UI). Mono ends on
   * "Courier New" before the generic because that face ships on BOTH macOS and Windows, so the
   * stack always reaches a real fixed-pitch face instead of falling through to a proportional
   * last-resort font. See docs/THEMING.md §5 for the platform-by-platform landing table. */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  --fs-chip:    9.5px;  /* uppercase micro-chips */
  --fs-eyebrow: 11px;   /* uppercase section eyebrow labels */
  --fs-xs:      11px;   /* field labels, hints, tips */
  --fs-sm:      12px;   /* secondary / meta text */
  --fs-ctl:     12.5px; /* control text (buttons, selects, dense rows) */
  --fs-base:    13px;   /* body - panels & side panel (wide pages may use 13.5px) */
  --fs-md:      15px;   /* emphasis / small heading */
  --fs-lg:      17px;   /* section title / app title */
  --fs-xl:      20px;   /* page H1 (rare) */
  --fw-normal:   400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --lh-tight: 1.3; --lh: 1.5; --lh-relaxed: 1.6;

  /* ── radii ────────────────────────────────────────────────────────────── */
  --r-chip: 6px;  /* chips / tags */
  --r-sm:   6px;  /* inputs, buttons, small controls, list rows */
  --r:      8px;  /* cards, panels */
  --r-lg:   12px; /* large containers, modal / gate */
  --r-pill: 999px;/* toggles, pills, pill-badges */

  /* ── spacing (4px base) ───────────────────────────────────────────────── */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  /* ── elevation ────────────────────────────────────────────────────────── */
  --shadow-1: 0 1px 2px rgba(13,14,17,.05);    /* resting card */
  --shadow-2: 0 10px 30px rgba(13,14,17,.12);  /* popover / menu / sticky / toast */
  --scrim:    rgba(13,14,17,.4);               /* modal / overlay backdrop */

  /* ── motion ───────────────────────────────────────────────────────────── */
  --ease:  cubic-bezier(.2,.6,.3,1);
  --dur-1: 120ms; /* controls (border, background, filter) */
  --dur-2: 160ms; /* overlays (opacity, transform) */
}

/* DARK - follow the OS unless the user pinned light. Redefines only colour tokens; --ring/--info/
 * --info-wash auto-follow (they are var() refs), and identity pastels + scales stay constant. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:#08090a; --surface:#0f1011; --surface-2:#161719;
    --line:#23252a; --line-soft:#1a1c1f;
    --text:#f7f8f8; --text-2:#c4c7cd; --muted:#868a91; --faint:#5c6169;
    --accent:#7b97f5; --accent-2:#93a9f8; --accent-ink:#0b0d16; --accent-wash:#171b28;
    --ok:#4cc38a; --ok-wash:#12271f; --warn:#e0a54b; --warn-wash:#2a2113;
    --bad:#f26d63; --bad-wash:#2a1614; --bad-line:#4a2420;
    --p-sky-bg:#12222f;  --p-sky-bd:#2c5273;  --p-sky-ink:#86bef3;
    --p-lav-bg:#221c3a;  --p-lav-bd:#463a73;  --p-lav-ink:#b7a6f5;
    --p-mint-bg:#122a20; --p-mint-bd:#2e5a45; --p-mint-ink:#79e0ac;
    --p-peach-bg:#2c2013;--p-peach-bd:#654529;--p-peach-ink:#f2b57b;
    --p-lemon-bg:#282410;--p-lemon-bd:#584f1e;--p-lemon-ink:#e8d477;
    --p-rose-bg:#2c1620; --p-rose-bd:#663044; --p-rose-ink:#f09cb4;
    --shadow-1: 0 1px 2px rgba(0,0,0,.5);
    --shadow-2: 0 14px 44px rgba(0,0,0,.7);
    --scrim:    rgba(0,0,0,.65);
  }
}

/* DARK - explicit override: force dark over OS-light (a future in-app "dark" toggle). Same values as
 * the @media block above - keep the two lists identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#08090a; --surface:#0f1011; --surface-2:#161719;
  --line:#23252a; --line-soft:#1a1c1f;
  --text:#f7f8f8; --text-2:#c4c7cd; --muted:#868a91; --faint:#5c6169;
  --accent:#7b97f5; --accent-2:#93a9f8; --accent-ink:#0b0d16; --accent-wash:#171b28;
  --ok:#4cc38a; --ok-wash:#12271f; --warn:#e0a54b; --warn-wash:#2a2113;
  --bad:#f26d63; --bad-wash:#2a1614; --bad-line:#4a2420;
  --p-sky-bg:#12222f;  --p-sky-bd:#2c5273;  --p-sky-ink:#86bef3;
  --p-lav-bg:#221c3a;  --p-lav-bd:#463a73;  --p-lav-ink:#b7a6f5;
  --p-mint-bg:#122a20; --p-mint-bd:#2e5a45; --p-mint-ink:#79e0ac;
  --p-peach-bg:#2c2013;--p-peach-bd:#654529;--p-peach-ink:#f2b57b;
  --p-lemon-bg:#282410;--p-lemon-bd:#584f1e;--p-lemon-ink:#e8d477;
  --p-rose-bg:#2c1620; --p-rose-bd:#663044; --p-rose-ink:#f09cb4;
  --shadow-1: 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 14px 44px rgba(0,0,0,.7);
  --scrim:    rgba(0,0,0,.65);
}

/* LIGHT - explicit override: force light over OS-dark (a future in-app "light" toggle). :root already
 * holds the light values AND the @media block is guarded by :not([data-theme="light"]), so only
 * color-scheme needs restating here to flip native form controls / scrollbars back to light. */
:root[data-theme="light"] { color-scheme: light; }
