/* Pincite — "Record" design system: tokens for the application surfaces.

   THE PALETTE IS SHARED WITH THE MARKETING SITE. The `:root` colour blocks below are
   byte-compared against `site/style.css` by `tests/guards/test_design_tokens.py`: a
   colour changed in one file and not the other fails CI. The two files exist separately
   only because they are deployed by different pipelines onto different origins (the app
   box via git archive, the site via Cloudflare Pages) and neither may import the other.

   Constraints, same as the site: no webfonts, no CDN, no remote images. Theme is
   `prefers-color-scheme` only — no toggle, no persisted preference, no script.

   The rule that decides sans vs mono, on every surface: if a string comes out of the
   system — a timestamp, a speaker label, a digest, a filename, a recording id, an error
   code — it is mono. No exceptions. */

:root {
  /* ---- color: light (default) ---- */
  --bg: #fbf9f5;          /* page paper */
  --surface: #ffffff;     /* cards, figures, certificate */
  --ink: #1c1b18;         /* headings, primary text */
  --ink-muted: #56534b;   /* body support, captions, meta */
  --accent: #6d2020;      /* gap marker, step numerals, links, focus, cert rule */
  --accent-lift: #8f2b2b; /* hover + active ONLY; base accent is static */
  --gutter: #6f695c;      /* rail numbers, field labels — AA at 12px */
  --rule: #e4ded1;        /* section and card borders */
  --rule-soft: #efeae0;   /* interior dividers */
  --code-bg: #f0ebe1;     /* inline code, strip headers, gap-marker field */
  --redact: #ddd6c8;      /* redaction bars — no other use, ever */

  /* ---- type ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step-0: 1.0625rem;     /* 17px body,  lh 1.65 */
  --step-1: 1.25rem;       /* 20px h3,    lh 1.30, track -0.008em, weight 640 */
  --step-2: 1.5rem;        /* 24px lead,  lh 1.32, track -0.012em, weight 600 */
  --step-3: 2rem;          /* 32px h2,    lh 1.20, track -0.018em, weight 650 */
  --step-4: 2.75rem;       /* 44px h1,    lh 1.08, track -0.025em, weight 700 */
  --step-mono: 0.8125rem;  /* 13px artifacts */
  --step-label: 0.6875rem; /* 11px mono caps, track 0.14em */

  /* ---- space ---- */
  --space-1: 0.5rem;    /* 8  */
  --space-2: 0.875rem;  /* 14 */
  --space-3: 1.375rem;  /* 22 */
  --space-4: 2.25rem;   /* 36 */
  --space-5: 3.5rem;    /* 56 */
  --space-6: 5rem;      /* 80 */

  /* ---- structure ---- */
  --measure: 38rem;     /* prose line length */
  --page: 46rem;        /* single-column page shell */
  --page-wide: 72rem;   /* the transcript surfaces, which need the width */
  --rail: 3.5rem;       /* 56px rail column */
  --rail-gap: 1.5rem;   /* 24px rail-to-content */

  /* ---- radius: cards and figures, chips, the step numeral. Nowhere else, and no
     shadows anywhere. ---- */
  --radius-card: 4px;
  --radius-chip: 3px;

  /* ---- review-pane annotation colours — an app-only extension, declared here so it
     is visible rather than buried in review.css ------------------------------------
     The site spends the accent on exactly five things and nothing signals status by
     colour. The review pane cannot honour that: it must distinguish low-confidence
     words, unscored words, and gap notices AT A GLANCE while an attorney scrubs audio,
     and three states cannot share one accent. So it gets three additional hues, warm
     enough to sit in this palette, each carrying a non-colour cue as well (weight, an
     underline, or the mono gap band) so the distinction survives a colour-blind reader
     and a greyscale print. These are the ONLY colours in the system outside the eleven
     tokens above, they are confined to the review pane, and they are named for what
     they mean rather than what they look like. */
  --flag-low: #8a3324;        /* low model confidence */
  --flag-low-field: #f6e7e2;
  --flag-unscored: #5b4a20;   /* no confidence score returned at all */
  --flag-unscored-field: #f3ecdb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1b1917;
    --ink: #e8e4dc;
    --ink-muted: #a29c91;
    --accent: #e08b8b;
    --accent-lift: #f0b0b0;
    --gutter: #8f887c;
    --rule: #302c27;
    --rule-soft: #24211e;
    --code-bg: #24211e;
    --redact: #322e29;

    --flag-low: #e8a598;
    --flag-low-field: #33211d;
    --flag-unscored: #d8c48a;
    --flag-unscored-field: #2b2618;
  }
}

/* This buyer prints things — a review pane gets printed and marked up on paper as
   often as it gets read on screen. Make it survive paper. */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --ink: #000000;
    --ink-muted: #333333;
    --accent: #000000;
    --accent-lift: #000000;
    --gutter: #555555;
    --rule: #999999;
    --rule-soft: #cccccc;
    --code-bg: #ffffff;
    --redact: #cccccc;

    --flag-low: #000000;
    --flag-low-field: #ffffff;
    --flag-unscored: #000000;
    --flag-unscored-field: #ffffff;
  }
}
