/* Copied from src/web/style.css lines 1-118 (tokens only). The prototype stays the source: change there first, then re-copy.
   Client = Iris (default), coach and admin = Cobalt (<html data-app="coach">). Macro/data colours are shared and never fork. */
:root, [data-theme="dark"] {
  --bg: #0a0b10;
  --elev: #13151c;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --dim: #8b90a0;
  --primary: #6e76ff;   /* Iris: accents on dark (5.3:1) */
  --primary-fill: #5058e6; /* Iris fill under white text (5.4:1) */
  --on-primary: #ffffff;
  --rose: #ff6b81;      /* protein */
  --teal: #3fd0c0;      /* carbs, high confidence, ok */
  --honey: #f7c35f;     /* fat, PRs, streak, rewards */
  /* Inks: small text on a hue's 12–14 % tint or on surface-2 (pills, flags, chips). The hue itself is under 4.5:1
     there; each ink is the hue mixed toward --text (70 %; primary 60 %) and passes 4.5:1 on every tint and surface. */
  --primary-ink: #a1a7fb;
  --teal-ink: #74dad0;
  --rose-ink: #fa93a4;
  --honey-ink: #f4d08c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --glass-blur: blur(20px);
  --bezel: #15171d;
  color-scheme: dark;
}
[data-theme="light"] {
  /* Daylight "Linen" (v0.11, 16 Nov 2026; docs/STYLE_GUIDE.md, src/web/palette.html): warm elevated neutrals, tinted
     ink, macro hues spread in lightness (rose L*33 < teal 37 < honey 41). Ratios are worst case over bg, elev, surface
     and surface-2; test/contrast.test.js checks every pair. */
  --bg: #f7f3ec;        /* warm off-white page */
  --elev: #fffdf9;
  --surface: #fffdf9;   /* cards: near-white with a warm tint */
  --surface-2: #efe9e0; /* controls, ring tracks */
  --line: rgba(68, 48, 26, 0.11);
  --text: #221d18;      /* tinted near-black: 13.8:1 */
  --dim: #675f56;       /* warm grey: 5.7:1 on bg, 5.2:1 on surface-2 */
  --primary: #4450cb;   /* Iris: 5.8:1; 4.8:1 on its own tint */
  --primary-fill: #4450cb; /* white text 6.5:1 */
  --on-primary: #ffffff;
  --rose: #9c063e;      /* 7.6:1; 5.8:1 on its tint */
  --teal: #006262;      /* 6.5:1; 5.3:1 on its tint */
  --honey: #815908;     /* 5.6:1; 4.7:1 on its tint */
  --primary-ink: #3a4195; /* inks: 70 % hue + 30 % --text, 5.9:1 or better on tints and surface-2 */
  --teal-ink: #0a4d4c;
  --rose-ink: #770d33;
  --honey-ink: #65470d;
  --shadow: 0 8px 24px rgba(68, 48, 26, 0.1);
  --bezel: #e2dbd0;
  color-scheme: light;
}
/* Increase Contrast (ledger I5, 02-design-system §1): secondary text, hairlines and control fills step up so every
   label and edge stays clearly visible. The Swift export turns this block into the colour sets' High Contrast
   appearances (tools/export-tokens.js). */
@media (prefers-contrast: more) {
  :root, [data-theme="dark"] {
    --surface-2: rgba(255, 255, 255, 0.14);
    --line: rgba(255, 255, 255, 0.3);
    --dim: #b9bdca;
    --text: #ffffff;
  }
  [data-theme="light"] {
    --surface-2: #e6dfd3; /* hues stay 4.7:1 or better on it */
    --line: rgba(68, 48, 26, 0.36);
    --dim: #463f37;       /* 7.8:1 on surface-2 */
    --text: #000000;
  }
}
/* Coach app (trainer dashboard): Cobalt brand. The macro/data colours (rose, teal, honey) are shared with the
   client app on purpose: trainers read client data, and protein must mean the same colour everywhere. */
[data-app="coach"], [data-app="coach"][data-theme="dark"] {
  --primary: #3d8bff;   /* Cobalt: accents on dark */
  --primary-fill: #2a66d9; /* fill under white text (5.3:1) */
  --primary-ink: #84b3fb; /* Cobalt ink: 60 % hue + 40 % --text, 4.5:1 or better on its tint over every surface */
  --bg: #0b0e13;
  --elev: #141922;
  --bezel: #141922;
}
[data-app="coach"][data-theme="light"] {
  /* Linen, a shade calmer for a desk: same warm family, less yellow. */
  --primary: #005bc4;   /* Cobalt: 5.8:1; 4.7:1 on its own tint */
  --primary-fill: #005bc4; /* white text 6.4:1 */
  --primary-ink: #0a4890; /* 70 % hue + 30 % --text, 6.0:1 or better on its tint */
  --bg: #f5f3ee;
  --elev: #fffefb;
  --surface: #fffefb;
  --surface-2: #ece8e1;
  --line: rgba(52, 44, 32, 0.12);
}
:root {
  --protein: var(--rose);
  --carbs: var(--teal);
  --fat: var(--honey);
  --xp: var(--primary);
  --gold: var(--honey);
  --streak: var(--honey);
  --ok: var(--teal);
  --warn: var(--honey);
  --bad: var(--rose);
  --grad: var(--primary-fill); /* solid fills under white text; no gradients (owner feedback, 8 Nov 2026) */
  --tint: color-mix(in srgb, var(--primary) 14%, transparent);

  --r-card: 24px;
  --r-chip: 16px;
  /* Type scale (STYLE_GUIDE Typography). Exported to the Swift app's tokens.json as pt. */
  --fs-hero: 46px;    /* hero number (rings centre) */
  --fs-title: 28px;   /* screen and onboarding titles */
  --fs-body: 17px;    /* body and primary buttons */
  --fs-caption: 13px; /* captions and sub lines */
  --t-fast: 160ms;
  --t-med: 320ms;
  --spring: cubic-bezier(0.2, 0.9, 0.3, 1.2);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --num: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
