/* design-tokens.css — (2026.11.64, Phase 2) one source for colour, type, spacing, radius, shadow.
   Loaded AFTER every <style> block in clinic.html, so these values win over the older layers.
   Identity (2026.11.81, official Ittika brand pack): Deep Midnight Teal #083A42 · Emerald Mint #34D399 ·
   text #0F172A · dark background #0B1320. Light surfaces stay warm alabaster.
   New code uses the --c-* / --s-* / --r-* names. The legacy names (--primary, --bg, --card …) are mapped below
   so the whole app follows the tokens without touching every rule. */
:root{
  /* surfaces */
  --c-surface:#F5F2EA;      /* page (alabaster) */
  --c-raised:#FFFFFF;       /* cards, sheets */
  --c-sunk:#EEEAE0;         /* inputs on cards, wells, table heads */
  --c-line:#E2DDD1;         /* 1px borders */
  --c-line-strong:#CFC8B8;  /* input borders, dividers that must be seen */
  /* ink (AA on --c-surface and --c-raised) */
  --c-ink:#0F172A;          /* 16:1 */
  --c-ink-2:#364255;        /* 8.5:1 secondary text (AAA) */
  --c-ink-3:#3D4A5F;        /* 7.2:1 hints, captions (AAA; never smaller than 12px) */
  /* signature */
  --c-brand:#083A42;        /* deep midnight teal: text links, active states */
  --c-brand-solid:var(--primary);  /* filled buttons (follows the user's accent choice) */
  --c-brand-hover:color-mix(in srgb, var(--primary) 84%, #000);
  --c-brand-tint:#E2F1EC;   /* selected rows, icon tiles, chips */
  --c-brand-ink:#083A42;    /* text on --c-brand-tint (10:1) */
  --c-mint:#34D399;         /* accent: marks on dark surfaces — never text on light */
  --c-gold:#C49A4E;         /* decoration only (dots, rules, stars) — not for text */
  --c-gold-ink:#644410;     /* gold text (7.5:1, AAA) */
  --c-gold-tint:#F4ECDA;
  /* status */
  --c-ok:#2F7A55;   --c-ok-tint:#E5F1EA;
  --c-warn:#93580F; --c-warn-tint:#FAF0DF;
  --c-danger:#B4432F; --c-danger-tint:#FBEAE6;
  --c-info:#2F5D86; --c-info-tint:#E7EFF7;
  --focus-ring:0 0 0 3px color-mix(in srgb, var(--primary) 26%, transparent);

  /* type */
  --f-sans:'Cairo','Segoe UI',system-ui,-apple-system,Tahoma,sans-serif;
  --t-xs:12px; --t-sm:13.5px; --t-md:15px; --t-lg:17px; --t-xl:20px; --t-2xl:24px; --t-3xl:30px;
  --lh-tight:1.35; --lh:1.6;
  /* spacing (4px grid) */
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px; --s-7:32px; --s-8:48px;
  /* radius */
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:20px; --r-pill:999px;
  /* shadows — light, never heavy */
  --sh-1:0 1px 2px rgba(17,28,23,.05);
  --sh-2:0 1px 2px rgba(17,28,23,.04), 0 4px 14px rgba(17,28,23,.06);
  --sh-3:0 12px 40px rgba(17,28,23,.18);
  --touch:44px;

  /* legacy names → tokens */
  --primary:#083A42; --primary-light:#0F5560; --primary-dark:#052A30;
  --accent:#96692A; --accent-light:#D9B26F; --sage:#4F9A8C;
  --bg:var(--c-surface); --card:var(--c-raised); --ink:var(--c-ink); --ink-soft:var(--c-ink-2); --border:var(--c-line);
  --danger:var(--c-danger); --warn:var(--c-warn); --ok:var(--c-ok);
  --radius:var(--r-md); --shadow:var(--sh-2); --shadow-sm:var(--sh-1);
}
html.dark{
  --c-surface:#0B1320; --c-raised:#121C2C; --c-sunk:#0E1726; --c-line:#243249; --c-line-strong:#34455F;
  --c-ink:#E5EBF3; --c-ink-2:#A9B6C9; --c-ink-3:#A3B0C4;
  --c-brand:#34D399; --c-brand-solid:#0B5F58; --c-brand-hover:#09524C;
  --c-brand-tint:#102E33; --c-brand-ink:#A7EFD0;
  --c-gold:#C9A25C; --c-gold-ink:#E2C58F; --c-gold-tint:#2A2418;
  --c-ok:#4CC993; --c-ok-tint:#10291F; --c-warn:#D9A866; --c-warn-tint:#2A2216;
  --c-danger:#E58B7E; --c-danger-tint:#2E1C19; --c-info:#8DB6DC; --c-info-tint:#172330;
  --focus-ring:0 0 0 3px rgba(52,211,153,.3);
  --sh-1:0 1px 3px rgba(0,0,0,.22); --sh-2:0 2px 10px rgba(0,0,0,.28); --sh-3:0 14px 44px rgba(0,0,0,.5);
  /* !important on purpose: the clinic colour picker writes --primary inline on <html>; at night the light green must win */
  --primary:#34D399 !important; --primary-light:#6EE7B7 !important; --primary-dark:#10B981 !important;
  --accent:#D6A47A; --accent-light:#E2C58F; --sage:#5FB8A0;
  --bg:var(--c-surface); --card:var(--c-raised); --ink:var(--c-ink); --ink-soft:var(--c-ink-2); --border:var(--c-line);
  --danger:var(--c-danger); --warn:var(--c-warn); --ok:var(--c-ok);
  color-scheme:dark;
}
/* accent choices from «المظهر» keep working: they set --primary on html[data-acc] (higher specificity than :root) */
