/* Tokens — sourced from the language codex (LG7 base starter · LG8 trust visual language).
   Every value here transcribes a codex commitment; nothing invented inline.
   Layout tokens are LOGICAL (inline-start/end) so RTL is never a retrofit (LG13). */

:root {
  /* LG7 palette (starter values, verbatim) */
  --surface: #FFFFFF;
  --surface-sunken: #F6F7F9;
  --surface-raised: #FFFFFF;
  --ink: #1A1D21;
  --ink-muted: #5A6169;
  --ink-subtle: #8A9199;
  --line: #E3E6EA;
  --accent: #2563A8;
  --accent-hover: #1E4E86;
  --accent-ink: #FFFFFF;

  /* LG8 trust visual language (starter hexes, verbatim).
     conf-high / conf-medium are QUIET (ink-muted treatment, no colour of their own). */
  --conf-low: #B45309;
  --conf-low-wash: #FEF3E6;
  --steward-mark: #1F7A4D;      /* RESERVED: person-vouch only (FND-2) */
  --health-questionable: #8A6D3B;
  --health-poor: #7A4A4A;

  /* LG7 type — dual-script stack. IBM Plex Sans Arabic is the committed default (DGA);
     self-containment forbids fetching it, so it is named first and the system Arabic
     UI fonts stand behind it. Arabic shares the SAME size/leading tokens as Latin
     (PM ruling 2026-07-10) and is never letter-spaced. */
  --font-stack: -apple-system, "Segoe UI", Roboto, "IBM Plex Sans Arabic",
                "Geeza Pro", "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
  --fs-display: 24px;
  --fs-heading: 18px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-caption: 12px;
  --lh-body: 1.5;
  --lh-heading: 1.3;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;

  /* LG7 spacing — 4px grid */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px;

  /* LG7 radius + elevation (three steps only) */
  --radius-control: 4px;
  --radius-card: 6px;
  --elev-raised: 0 0 0 1px var(--line);
  --elev-overlay: 0 8px 32px rgba(26,29,33,.18), 0 0 0 1px var(--line);
}

html { font-family: var(--font-stack); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink); background: var(--surface-sunken); }
body { margin: 0; }

/* Arabic is never letter-spaced (LG13/CV57) */
:lang(ar) { letter-spacing: 0 !important; }

/* Numbers, ids, dates inside RTL runs stay LTR-isolated (LG7 bidi contract).
   Every dynamic mixed-script field the app renders is wrapped in <bdi> or .num. */
.num, bdi.num { direction: ltr; unicode-bidi: isolate; }
