/* Shared design system — Gulf Development palette (#004370 deep teal-blue + #6AB96F green).
   Light / Dark, following the device: there is no theme switch. Each page's first-paint
   script, and then the SPAs' shared helper (web/shared/src/theme.ts, followDeviceTheme),
   writes the OS setting to data-theme on <html>; the prefers-color-scheme rules cover a
   page that has not set it yet. Pages consume the CSS vars below. */

:root {
  /* type — the approved prototype's two families, served from /static/fonts
     (see web/static/fonts/README.md). Latin comes from Geist / Instrument Sans;
     Thai and anything else falls through the stack, because neither family
     ships those glyphs and the real data is bilingual.

     Deliberately NOT called --font-sans: Tailwind v4 defines a token of that
     name in its own default theme, and the built SPA bundle loads after this
     sheet, so the framework's system stack would silently win in production
     while dev looked right. Each SPA maps Tailwind's --font-sans onto this
     token inside its @theme block instead. */
  --font-product: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  --font-product-display: "Instrument Sans", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  /* surfaces — four distinct elevation layers: app bg < input < panel < panel2 */
  --bg:#f4f7fa; --panel:#ffffff; --panel2:#eef2f7; --input:#ffffff;
  --line:#e3e9f0; --line2:#cdd9e5; --user:#e7f0f8;
  /* text — every text token passes WCAG AA (>=4.5:1) on bg/panel/panel2/input,
     same bar the dark block already meets (dim was 2.9:1 before the darkening) */
  --txt:#13212e; --muted:#566776; --dim:#5c6f82;
  /* brand */
  --accent:#004370; --accent2:#6ab96f; --on-accent:#ffffff; --accent-soft:rgba(0,67,112,.10);
  /* status — darkened to hold >=4.5:1 as text on all four surfaces (they label
     badges/banners in both Studios); hues unchanged */
  --ok:#2a7743; --warn:#8f6110; --err:#c02f2f; --pink:#844daa;
  --shadow:0 10px 34px rgba(16,42,66,.13);
  /* elevation + shape language (shared by the legacy pages and the Studio SPA) */
  --elev-card:0 1px 2px rgba(16,42,66,.05), 0 4px 16px rgba(16,42,66,.06);
  --radius-card:12px; --radius-control:9px;
  color-scheme:light;
}

/* ---- dark tokens (shared by data-theme="dark" + a dark device before data-theme is set) ----
   Layer separation is deliberately wider than before (the old values read as one
   flat near-black wall): bg is the deepest, inputs sit slightly above it, panels
   and raised panels step up visibly. All text/accent pairs pass WCAG AA (>=4.5:1)
   on every surface — verified against bg/panel/panel2/input. */
:root[data-theme="dark"] {
  --bg:#0a0f16; --panel:#121b26; --panel2:#1b2635; --input:#0d141d;
  --line:#243141; --line2:#36485c; --user:#1c3049;
  --txt:#e8eef5; --muted:#a5b4c5; --dim:#7e90a3;
  --accent:#5fb0e8; --accent2:#6ab96f; --on-accent:#042032; --accent-soft:rgba(95,176,232,.14);
  --ok:#54d196; --warn:#f0b454; --err:#ff7a7a; --pink:#e07cc8;
  --shadow:0 14px 44px rgba(0,0,0,.55);
  --elev-card:0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
  color-scheme:dark;
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg:#0a0f16; --panel:#121b26; --panel2:#1b2635; --input:#0d141d;
    --line:#243141; --line2:#36485c; --user:#1c3049;
    --txt:#e8eef5; --muted:#a5b4c5; --dim:#7e90a3;
    --accent:#5fb0e8; --accent2:#6ab96f; --on-accent:#042032; --accent-soft:rgba(95,176,232,.14);
    --ok:#54d196; --warn:#f0b454; --err:#ff7a7a; --pink:#e07cc8;
    --shadow:0 14px 44px rgba(0,0,0,.55);
    --elev-card:0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
    color-scheme:dark;
  }
}

/* ---- Gulf logo swap (default art on light, white art on dark).
   The :root prefix raises specificity above page-level "header img / .brand img"
   rules (which force display:block); without it the white logo leaks into light mode. ---- */
:root .logo-light{display:block} :root .logo-dark{display:none}
:root[data-theme="dark"] .logo-light{display:none}
:root[data-theme="dark"] .logo-dark{display:block}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .logo-light{display:none}
  :root:not([data-theme="light"]) .logo-dark{display:block}
}
