/* RTZ design tokens: the one source of colours, fonts, type scale and shapes for the portal.
   Mirrors the approved public site (V4): one dark, an off-white and a cream, ink/muted text,
   Poppins headings, Manrope copy, 8 px panels, full pills for buttons, toggles and tags.
   Loaded first by every portal page; every other stylesheet consumes these variables. */

@font-face { font-family: Poppins; src: url('/fonts/poppins-medium.woff2') format('woff2'); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: Poppins; src: url('/fonts/poppins-semibold.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
/* Full variable font for characters outside the Latin subset only. Overlapping faces are tried from the LAST one
   declared, so the 23 KB Latin subset (preloaded) comes after it; declared first, the 165 KB TTF was fetched on every page. */
@font-face { font-family: Manrope; src: url('/fonts/Manrope-Variable.ttf') format('truetype'); font-style: normal; font-weight: 200 800; font-display: swap; }
@font-face { font-family: Manrope; src: url('/fonts/Manrope-Variable-latin.woff2') format('woff2'); font-style: normal; font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+20A3, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Palette (site V4). Contrast measured: ink 9.9:1 and muted 6.4:1 on off-white, 9.0:1 / 5.8:1 on cream. */
  --rtz-dark: #140F0C;          /* primary actions, footer, active states */
  --rtz-dark-hover: #2B2521;    /* hover of dark actions (state only) */
  --rtz-dark-line: #3A322D;     /* hairlines on dark (decorative, never text) */
  --rtz-on-dark: #FAF8F5;       /* text on dark, 18:1 */
  --rtz-on-dark-2: #C9C0B6;     /* secondary text on dark, 10.6:1 */
  --rtz-offwhite: #FAF8F5;      /* light ground A, cards on cream */
  --rtz-cream: #F2EDE6;         /* light ground B, cards on off-white */
  --rtz-white: #FFFFFF;         /* form fields */
  --rtz-ink: #443E39;           /* text and headings */
  --rtz-muted: #625A53;         /* secondary text, ≥ 5.3:1 on every light ground */
  --rtz-line: #DDD5CB;          /* hairlines on light grounds (decorative) */
  --rtz-field-border: #857B72;  /* field and control outlines, ≥ 3.5:1 (WCAG 1.4.11) */

  /* Semantic tones: status (independent of category) and content categories. Ink ≥ 5:1 on its soft. */
  --tone-done-ink: #3B6A4C;     --tone-done-soft: #E5EEE3;
  --tone-active-ink: #3A5E72;   --tone-active-soft: #E3ECEF;
  --tone-waiting-ink: #80531C;  --tone-waiting-soft: #F5E8D3;
  --tone-neutral-ink: #625A53;  --tone-neutral-soft: #ECE6DE;
  --tone-planned-ink: #6A5277;  --tone-planned-soft: #EEE6EE;
  --tone-danger-ink: #963A33;   --tone-danger-soft: #F6E4DF;
  --tone-training-ink: #3F6853; --tone-training-soft: #E4ECE4;
  --tone-nutrition-ink: #93502E; --tone-nutrition-soft: #F6E6DA;
  --tone-documents-ink: #6A5277; --tone-documents-soft: #EEE6EE;

  /* Type: the site's validated pair and a scale derived from its sizes (11 · 13 · 15 · 16 · 18 · 19 · 22–28 · 30–40 · 34–52 px). */
  --rtz-font-display: Poppins, Arial, sans-serif;
  --rtz-font-body: Manrope, Arial, sans-serif;
  --rtz-fs-label: .6875rem;     /* caps labels, buttons, header links */
  --rtz-fs-caption: .8125rem;   /* footer, meta */
  --rtz-fs-small: .9375rem;     /* secondary copy */
  --rtz-fs-body: 1rem;
  --rtz-fs-lead: 1.125rem;
  --rtz-fs-h3: 1.1875rem;
  --rtz-fs-h2: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);
  --rtz-fs-title: clamp(1.875rem, 1.6rem + 1.2vw, 2.5rem);
  --rtz-fs-h1: clamp(2.125rem, 1.6rem + 2.2vw, 3.25rem);
  --rtz-tracking-display: -.04em;
  --rtz-tracking-caps: .085em;

  /* Shapes and spacing */
  --rtz-radius: 8px;            /* cards, photos, panels */
  --rtz-pill: 999px;            /* buttons, toggles, tags */
  --rtz-gutter: max(24px, calc((100% - 1260px) / 2));
  --rtz-target: 44px;           /* minimum touch target */
  --rtz-focus: 2px solid var(--rtz-dark);
  --rtz-focus-offset: 3px;

  /* Roles used by the shared portal styles. */
  --ink: var(--rtz-ink);
  --muted: var(--rtz-muted);
  --accent: var(--rtz-dark);
  --soft: var(--rtz-cream);
  --canvas: var(--rtz-offwhite);
  --line: var(--rtz-line);
  --white: var(--rtz-white);
  --font: var(--rtz-font-body);

  /* Roles used by the client space and Alexia's admin (canvas cream, surfaces off-white, fields white). */
  --app-canvas: var(--rtz-cream);
  --app-surface: var(--rtz-offwhite);
  --app-field: var(--rtz-white);
  --app-text: var(--rtz-ink);
  --app-muted: var(--rtz-muted);
  --app-line: var(--rtz-line);
  --app-control-border: var(--rtz-field-border);
  --app-accent: var(--rtz-dark);
  --app-accent-hover: var(--rtz-dark-hover);
  --app-accent-soft: var(--rtz-cream);
  --app-followup: var(--rtz-cream);
  --app-document-ink: var(--tone-documents-ink);
  --app-documents: var(--tone-documents-soft);
  --app-nutrition-ink: var(--tone-nutrition-ink);
  --app-nutrition-soft: var(--tone-nutrition-soft);
  --app-pending-ink: var(--tone-waiting-ink);
  --app-pending-soft: var(--tone-waiting-soft);
  --app-replays: var(--tone-documents-soft);
  --status-done-ink: var(--tone-done-ink);       --status-done-soft: var(--tone-done-soft);
  --status-active-ink: var(--tone-active-ink);   --status-active-soft: var(--tone-active-soft);
  --status-info-ink: var(--tone-active-ink);     --status-info-soft: var(--tone-active-soft);
  --status-waiting-ink: var(--tone-waiting-ink); --status-waiting-soft: var(--tone-waiting-soft);
  --status-neutral-ink: var(--tone-neutral-ink); --status-neutral-soft: var(--tone-neutral-soft);
  --status-planned-ink: var(--tone-planned-ink); --status-planned-soft: var(--tone-planned-soft);
  --status-danger-ink: var(--tone-danger-ink);   --status-danger-soft: var(--tone-danger-soft);

  color-scheme: light;
}
@media (max-width: 820px) { :root { --rtz-gutter: max(21px, env(safe-area-inset-left), env(safe-area-inset-right)); } }
