/* chgr Speiseplan — design tokens (single source of truth for every visual value).
   World: "Tablettkarte" — the tray card laid on every tray. See DESIGN.md.
   Pages and masks MUST NOT define their own colours, sizes or layout values; they use these tokens. */

/* ---------- Fonts (self-hosted; the app runs offline behind WireGuard) ---------- */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
/* chgr wordmark only. Licence for embedding still to be confirmed (see design.md D7). */
@font-face { font-family: "Travax"; font-weight: 400; font-display: block; src: url("fonts/travax.woff") format("woff"); }

:root {
  /* ---------- Colour: Alpenpark palette ---------- */
  --c-ground: #EFEAE3;          /* linen table the cards lie on */
  --c-paper: #FFFFFF;           /* card strips, fields, grids */
  --c-paper-muted: #F7F4EF;     /* read-only fields, header bands */
  --c-line: #DDD5CB;            /* 1px borders */
  --c-line-strong: #2E2422;     /* grids' header rule, focus outline base */
  --c-cut: #BEB2A6;             /* dashed cut line after the meal letter */
  --c-ink: #2E2422;             /* text (Kaffeebraun) */
  --c-ink-muted: #6B5E57;       /* secondary text, 5.9:1 on paper */
  --c-action: #7A2531;          /* wine red: action and place ONLY */
  --c-action-hover: #66202B;
  --c-action-press: #521722;
  --c-action-tint: #F4E9EA;     /* selected tab ground, current place */
  --c-on-action: #FFFFFF;
  --c-confirm: #3B7550;         /* fir green: confirmed state */
  --c-confirm-tint: #E7F0EA;
  --c-mark: #F5DF5E;            /* highlighter: "bestellt" */
  --c-mark-soft: #FBF0B4;       /* highlighter on hover / auto-assigned */
  --c-mark-edge: #B59A12;       /* border of highlighter swatches */
  --c-danger: #B23A34;          /* conflicts, destructive */
  --c-danger-tint: #FBEAE8;
  --c-danger-ink: #7E211C;      /* conflict text on danger tint */
  --c-done: #7A6E64;            /* finished ward hexagon */
  --c-on-dark: #FFFFFF;         /* text on hexagons and dark chips */
  --c-on-dark-line: rgba(255, 255, 255, 0.5);
  --c-code: #2E2422;            /* allergen code chip ground */
  --c-on-code: #FFFFFF;
  --c-paused: #8A7F78;          /* paused orders: hatched, never removed */
  --c-focus: #7A2531;

  /* ---------- Type ---------- */
  --font-ui: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-wordmark: "Travax", "Atkinson Hyperlegible", sans-serif;
  --fs-xs: 0.8125rem;   /* 13 px at 16: allergen codes, captions */
  --fs-s: 0.875rem;     /* 14: grid cells (compact) */
  --fs-m: 1rem;         /* 16: body */
  --fs-l: 1.25rem;      /* 20: section titles */
  --fs-xl: 1.75rem;     /* 28: resident name */
  --fs-letter: 3.5rem;  /* 56: meal letter F/M/A */
  --lh-tight: 1.2;
  --lh-body: 1.45;
  --track-wordmark: 0.18em;
  --track-caps: 0.06em;

  /* ---------- Space (8 px grid; everything snaps to it) ---------- */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem;

  /* ---------- Shape & depth ---------- */
  --radius: 3px;                /* paper corners, never pills */
  --border: 1px solid var(--c-line);
  --border-strong: 1px solid var(--c-line-strong);
  --shadow-lift: 0 2px 8px rgba(46, 36, 34, 0.14);   /* only for popovers and menus */

  /* ---------- Motion ---------- */
  --dur-sweep: 260ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------- Density (compact = mouse, comfortable = touch) ---------- */
  --zoom: 1;
  --base: 15px;
  --control-h: 2rem;            /* ≈ 30 px compact */
  --row-h: 1.875rem;            /* grid row */
  --hit: 1.75rem;               /* min hit target */
  --strip-pad: var(--s-4);
}
/* Default density follows the input device; users can override with data-density. */
@media (pointer: coarse) {
  :root:not([data-density="compact"]) { --base: 17px; --control-h: 2.75rem; --row-h: 2.75rem; --hit: 2.75rem; --strip-pad: var(--s-5); }
}
:root[data-density="comfortable"] { --base: 17px; --control-h: 2.75rem; --row-h: 2.75rem; --hit: 2.75rem; --strip-pad: var(--s-5); }

html { font-size: calc(var(--base) * var(--zoom)); }
body {
  margin: 0; background: var(--c-ground); color: var(--c-ink);
  font: 400 var(--fs-m)/var(--lh-body) var(--font-ui);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  caret-color: var(--c-action);
}
::selection { background: var(--c-mark); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
* { scrollbar-color: var(--c-cut) var(--c-paper-muted); scrollbar-width: thin; }
input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--c-action); }
[hidden] { display: none !important; }
a { color: var(--c-action); text-underline-offset: 0.18em; }
@media (prefers-reduced-motion: reduce) { :root { --dur-sweep: 0ms; } }
