/* ChiroScore — single source of truth for tokens.
   Replaces the :root block duplicated across the 8 design-system files.
   One theme: the hybrid board (light data surface, deep-green command chrome).
   Values are unchanged from foundations/colors.html except where noted "FIX" / "NEW". */

:root {
  /* Type */
  --ui: "Geist", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --text-xs: .72rem;   /* tile labels, rail headings, footnotes */
  --text-sm: .82rem;   /* table cells, buttons, secondary UI */
  --text-base: .92rem; /* prose */
  --text-md: 1rem;     /* emphasis prose — max prose size */
  --text-lg: 1.15rem;  /* panel titles */
  --text-xl: 1.4rem;   /* page heads */
  --text-2xl: 1.9rem;  /* KPI tile value */
  --text-3xl: 2.4rem;  /* specimen */
  --text-pill: .68rem; /* FIX: was .62rem (~10px) — too small for a 6–10ft clinic monitor */

  /* Space — 4px base. Components must use these, not off-grid rem paddings. */
  --sp-2xs: 2px;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;   /* tiles, cards, panels */
  --r-lg: 10px;  /* app frame */
  --r-pill: 999px;

  /* Light data board */
  --bg: #F6F8F6;
  --surface: #FFFFFF;
  --raised: #FDFDFE;
  --ink: #10231A;
  --muted: #5C6B63;
  --line: #D7E0DA;       /* panel & table hairline */
  --tile-line: #E2E9E4;  /* tile border — one step lighter than --line */

  /* Command chrome */
  --chrome-bg: #123D29;
  --chrome-ink: #EAF3EC;
  --chrome-line: #234F39;
  --chrome-muted: #9BBBA8;

  /* Accent / signal — rationed to the one thing needing a human */
  --accent: #D9760F;         /* on light board */
  --accent-chrome: #E0840F;  /* on chrome — FIX: theme-hybrid had overwritten --accent with this */
  --accent-ink: #1A1206;     /* FIX: theme-light used #FFFFFF on #D9760F, ~3:1, fails AA */

  /* Semantic status */
  --green: #157A4D;  --green-bg: #E6F3EC;
  --amber: #B5750A;  --amber-bg: #FBF1DD;   /* fill/border only - as text it is 3.40:1 on amber-bg, 3.81:1 on white */
  --muted-print: #3A4A41;                 /* NEW - secondary ink on paper (9.4:1); --muted is for screens */
  --amber-text: #8F5C08;                  /* NEW - amber as TEXT anywhere: 5.67:1 on white, 5.06:1 on --amber-bg */
  --accent-chrome-text: #F0A93A;          /* NEW - amber as TEXT on --chrome-bg (6.05:1); #E0840F is fill-only there */
  --red:   #B42318;  --red-bg:   #FBEAE8;

  /* NEW — interaction states. All derived from the palette above; no new hues. */
  --accent-hover: #C46A0D;
  --accent-active: #AE5E0B;
  --hover-bg: #EDF2EE;          /* light board row/item hover */
  --line-strong: #C9D5CD;       /* hairline one step darker: control hover border, chart comparison series */
  --red-bg-hover: #F7DDDA;      /* hover fill for destructive/retry controls sitting on --red-bg */
  --selected-bg: #E6F3EC;       /* = --green-bg */
  --pressed-bg: #E2E9E4;        /* = --tile-line */
  --chrome-hover: #1A4C34;
  --chrome-selected: #234F39;   /* = --chrome-line */
  --disabled-ink: #9AA8A0;
  --disabled-bg: #F1F4F2;
  --disabled-line: #E2E9E4;

  /* NEW — sanctioned alpha forms (match the app's text-foreground/80,
     text-primary-foreground/75, border-primary-foreground/20 utilities).
     Alpha on an existing ink, never a new hue. */
  --ink-80: rgba(16, 35, 26, .8);          /* tile description text */
  --chrome-ink-75: rgba(234, 243, 236, .75); /* rail item + heading text (legacy, matches the app today) */
  --chrome-ink-80: rgba(234, 243, 236, .8);  /* preferred muted rail text — one step up in contrast */
  --chrome-ink-20: rgba(234, 243, 236, .2);  /* control borders on chrome */
  --chrome-ink-15: rgba(234, 243, 236, .15); /* list dividers on chrome */

  /* NEW — focus. Neutral, never amber: amber is the signal token, not the accent token. */
  --focus: #123D29;             /* = --chrome-bg */
  --focus-on-chrome: #9BBBA8;   /* = --chrome-muted */
  --focus-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px #123D29;
  --focus-ring-chrome: 0 0 0 2px #123D29, 0 0 0 4px #9BBBA8;
  --focus-ring-inset: inset 0 0 0 2px #123D29;

  /* NEW — no elevation. The system is flat: hairlines and fills only.
     One exception, for layers that float above the board. */
  --shadow-overlay: 0 8px 24px rgba(16, 35, 26, .14);

  /* NEW — touch */
  --touch-min: 44px;
}
