/* ============================================================
   SYNAPSE DESIGN TOKENS
   The only place colours, radii and shadows are defined for the
   component kit (Components/UI). Values are those of the approved
   reference, docs/design/dashboard-reference.html.

   Theme: data-theme on <html> ("light" or "dark"), set before first
   paint by js/theme.js. With no stored choice the theme follows
   prefers-color-scheme.

   .theme-light pins the light values on a subtree: the shell uses it
   around pages that are not built from the kit yet, whose own CSS has
   no dark theme. .theme-dark pins the dark values: the sign-in shell
   (every page before sign-in is dark only).

   The older --color-*, --space-* tokens are in legacy-tokens.css.
   ============================================================ */

:root {
  --brand:#3A55E8; --brand-hover:#2F48D4; --on-brand:#FFFFFF;
  --brand-soft:#3A55E81F; --brand-faint:#3A55E80F;
  --bg:#F7F7F8; --surface:#FFFFFF; --surface-2:#F4F4F6; --line:#E7E7EA; --line-strong:#D9D9DE;
  --text:#111214; --text-2:#5C5F66; --text-3:#8B8E95;
  --ok:#16A34A; --ok-soft:#16A34A1A; --warn:#D97706; --warn-soft:#D977061F; --bad:#DC2626; --bad-soft:#DC26261A;
  --shadow:0 1px 2px #0000000A, 0 4px 16px #0000000A; --shadow-pop:0 12px 40px #00000024;
  --radius:10px; --radius-sm:7px;
  color-scheme:light;
}

/* White text on #7199FA fails contrast, so the dark brand carries near-black text. */
:root[data-theme="dark"] {
  --brand:#7199FA; --brand-hover:#86A8FB; --on-brand:#0B0C0E;
  --brand-soft:#7199FA2E; --brand-faint:#7199FA14;
  --bg:#0B0C0E; --surface:#131418; --surface-2:#1A1B20; --line:#24262C; --line-strong:#30323A;
  --text:#F2F3F5; --text-2:#A3A6AE; --text-3:#6E717A;
  --ok:#22C55E; --ok-soft:#22C55E1F; --warn:#F59E0B; --warn-soft:#F59E0B1F; --bad:#F87171; --bad-soft:#F871711F;
  --shadow:0 1px 2px #00000040; --shadow-pop:0 16px 48px #00000080;
  color-scheme:dark;
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --brand:#7199FA; --brand-hover:#86A8FB; --on-brand:#0B0C0E;
    --brand-soft:#7199FA2E; --brand-faint:#7199FA14;
    --bg:#0B0C0E; --surface:#131418; --surface-2:#1A1B20; --line:#24262C; --line-strong:#30323A;
    --text:#F2F3F5; --text-2:#A3A6AE; --text-3:#6E717A;
    --ok:#22C55E; --ok-soft:#22C55E1F; --warn:#F59E0B; --warn-soft:#F59E0B1F; --bad:#F87171; --bad-soft:#F871711F;
    --shadow:0 1px 2px #00000040; --shadow-pop:0 16px 48px #00000080;
    color-scheme:dark;
  }
}

/* Always dark: the sign-in shell and every page before sign-in (whatever the stored or system theme). */
.theme-dark {
  --brand:#7199FA; --brand-hover:#86A8FB; --on-brand:#0B0C0E;
  --brand-soft:#7199FA2E; --brand-faint:#7199FA14;
  --bg:#0B0C0E; --surface:#131418; --surface-2:#1A1B20; --line:#24262C; --line-strong:#30323A;
  --text:#F2F3F5; --text-2:#A3A6AE; --text-3:#6E717A;
  --ok:#22C55E; --ok-soft:#22C55E1F; --warn:#F59E0B; --warn-soft:#F59E0B1F; --bad:#F87171; --bad-soft:#F871711F;
  --shadow:0 1px 2px #00000040; --shadow-pop:0 16px 48px #00000080;
  color-scheme:dark;
}

/* A light island inside a dark page (see .theme-light above). Declared after the dark blocks so it wins on its subtree. */
.theme-light {
  --brand:#3A55E8; --brand-hover:#2F48D4; --on-brand:#FFFFFF;
  --brand-soft:#3A55E81F; --brand-faint:#3A55E80F;
  --bg:#F7F7F8; --surface:#FFFFFF; --surface-2:#F4F4F6; --line:#E7E7EA; --line-strong:#D9D9DE;
  --text:#111214; --text-2:#5C5F66; --text-3:#8B8E95;
  --ok:#16A34A; --ok-soft:#16A34A1A; --warn:#D97706; --warn-soft:#D977061F; --bad:#DC2626; --bad-soft:#DC26261A;
  --shadow:0 1px 2px #0000000A, 0 4px 16px #0000000A; --shadow-pop:0 12px 40px #00000024;
  color-scheme:light;
}
