/* ============================================================
   Endury — Design Tokens
   Single source of truth for the visual language shared by the
   mobile (Endury.dc.html) and web (Endury Web.dc.html) prototypes.

   HOW TO USE
   - Drop these custom properties into the :root block of
     endury/http/static/css/base.css (or @import this file).
   - When you change a value in the prototype, change it HERE and the
     real app follows. Prototype literals are intentionally the same
     values listed below, so a design edit is a one-line token diff.
   ============================================================ */

:root {
  /* ---- Surfaces (dark, warm-neutral) ---- */
  --cb-bg:              #19191B;   /* app background base */
  --cb-bg-grad-top:     #1B1B1D;   /* top of the 160deg app gradient */
  --cb-bg-grad-bot:     #171719;   /* bottom of the app gradient */
  --cb-surface-1:       #1C1C1E;   /* rails, sunken panels */
  --cb-surface-2:       #232325;   /* cards, inputs, chips (default) */
  --cb-surface-3:       #2D2D30;   /* raised cards, nested tiles */
  --cb-sheet-top:       #272729;   /* coach sheet / modal gradient top */
  --cb-sheet-bot:       #1D1D1F;   /* coach sheet / modal gradient bottom */

  /* ---- Lines ---- */
  --cb-border:          #333336;   /* default hairline */
  --cb-border-strong:   #3A3A3D;   /* modal / sheet edges */
  --cb-border-faint:    #2B2B2E;   /* month cells, subtle dividers */

  /* ---- Text ---- */
  --cb-text:            #E5E5E7;   /* primary */
  --cb-text-strong:     #EBE8E2;   /* coach name / emphasis */
  --cb-text-muted:      #ADADB1;   /* secondary / labels — the dimmest legible tier */

  /* ---- Accent (warm platinum — the one brand accent) ---- */
  --cb-accent:          #B5B3AE;   /* primary actions, selection, ring */
  --cb-accent-ink:      #19191B;   /* dark ink ON a light/mid fill (accent, race-a, good, warn, alert, miss) */
  --cb-ink-light:       #FFFFFF;   /* light ink ON a dark fill (brand tiles) — the counterpart to accent-ink */

  /* ---- Semantic status (used sparingly — see rules below) ---- */
  --cb-good:            #86AD90;   /* on-target, connected, readiness OK (calm sage) */
  --cb-good-bright:     #30D158;   /* "live"/online dot, fresh DONE badge only */
  --cb-warn:            #C68F6C;   /* mild off-target, fatigue signal (calm terracotta) */
  --cb-miss:            #C4748C;   /* missed session — its own hue, not warn's sync/off-target meaning */
  --cb-skip:            #8FA3B8;   /* deliberately skipped session (illness/pause) — quieter than missed, distinct from planned grey */
  --cb-alert:           #D9663F;   /* RESERVED: genuine problems only (sync failed, overreaching, listening) */

  /* ---- Sport colors (calendar cards, dots, load bars) ---- */
  --cb-sport-bike:      rgb(0,176,80);
  --cb-sport-run:       rgb(255,149,0);
  --cb-sport-swim:      rgb(0,120,215);
  --cb-sport-strength:  rgb(155,89,182);
  --cb-sport-rest:      rgb(142,142,147);
  --cb-sport-other:     rgb(142,142,147);

  /* ---- Race priority ---- */
  --cb-race-a:          #b88a3a;   /* A race (gold) */
  --cb-race-b:          #BE5167;   /* B tune-up (muted rose) — darkened so --cb-ink-light clears AA 4.5:1 */
  --cb-race-c:          #6B7686;   /* C tune-up (slate) — darkened so --cb-ink-light clears AA 4.5:1 */

  /* ---- Zone palette (calm, 5-step, cool→warm) ---- */
  --cb-zone-1:          #8A9BA8;
  --cb-zone-2:          #7FA8AC;   /* also CTL / fitness line */
  --cb-zone-3:          #86AD90;
  --cb-zone-4:          #C2A96B;   /* also ATL / fatigue line */
  --cb-zone-5:          #C68F6C;   /* also TSB / form line */

  /* ---- Workout step colors (session outline / step list) ---- */
  --cb-step-warmup:     #0A84FF;
  --cb-step-interval:   #FF9F0A;
  --cb-step-recovery:   #30D158;
  --cb-step-cooldown:   #BF5AF2;
  --cb-step-rest:       #636366;

  /* ---- Brand (third-party integration tiles — not part of the app palette) ---- */
  --cb-brand-garmin:        #0a6fb0;
  --cb-brand-strava:        #b5541f;
  --cb-brand-wahoo:         #3b6ea5;
  --cb-brand-trainingpeaks: #3a7d8c;
  --cb-brand-apple:         #9b5b6b;

  /* ---- Typography ---- */
  --cb-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --cb-fs-hero:   26px;  /* ring value, big numbers */
  --cb-fs-title:  17px;  /* screen title */
  --cb-fs-body:   13px;  /* chat, buttons, card title */
  --cb-fs-input:  16px;  /* text controls — iOS zooms a focused input below 16px */
  --cb-fs-meta:   11px;  /* metrics row */
  --cb-fs-label:  10px;  /* UPPERCASE section labels (letter-spacing .06em) */
  --cb-fs-micro:  9px;   /* badges, axis ticks */

  /* ---- Radii ---- */
  --cb-r-bar:     2px;   /* progress/load bars, sport dots, sheet handle */
  --cb-r-chip:    6px;   /* small square controls, chips, badges */
  --cb-r-card:    12px;
  --cb-r-tile:    9px;
  --cb-r-pill:    999px;
  --cb-r-sheet:   20px;
  --cb-r-phone:   37px;  /* device screen inner radius (mobile frame only) */

  /* ---- Spacing scale ----
     The UI is laid out on a 2px grid; -N-5 names are the half-steps between
     the whole steps, so a dense component can stay on-scale without rounding. */
  --cb-sp-0-5: 2px;  --cb-sp-1: 4px;    --cb-sp-1-5: 6px;
  --cb-sp-2: 8px;    --cb-sp-2-5: 10px; --cb-sp-3: 12px;
  --cb-sp-3-5: 14px; --cb-sp-4: 16px;   --cb-sp-5: 18px;
  --cb-sp-5-5: 20px; --cb-sp-6: 22px;   --cb-sp-7: 24px;

  /* ---- Motion ---- */
  --cb-ease:      cubic-bezier(.4,0,.2,1);
  --cb-dur-fast:  .15s;
  --cb-dur-med:   .3s;
  --cb-dur-drawer:.32s;
}

/*
  COLOR SEMANTICS — RULES (keep the palette disciplined)
  1. ONE accent (--cb-accent). Primary buttons, selection, the load ring,
     the coach's left message border. Do not introduce new accents.
  2. --cb-alert is reserved. Use ONLY for genuine problems the athlete must
     act on: failed sync, overreaching flag, active voice "listening". Never
     for decoration. If everything is alert-colored, nothing is.
  3. Compliance/adherence uses --cb-good (90–112% of plan) and --cb-warn
     (outside that band). Percentages, not new hues.
  4. Sport identity rides edges and markers (the card's left stripe, dots,
     bars) — never a full-body card tint, which costs metadata contrast and
     makes adjacent cards read as competing skins.
  5. Fitness lines: CTL=zone-2, ATL=zone-4, TSB=zone-5 (dashed).
*/
