/* ============================================================
   ll-tokens-bridge.css — the --ll-* → v5 token bridge, alone.

   Extracted from ll-public.css 2026-08-20. The legacy content stylesheets
   (site-core.css and friends) are written against --ll-* names; this maps them
   onto the v5 tokens so those pages follow the theme.

   It is SEPARATE from the public chrome because the two have different audiences.
   A page on the APP shell needs the bridge and must NOT have the public header/
   footer CSS, which restyles body and assumes a marketing nav that is not present.
   Before the split, the knowledgebase could only have one or the other, which is
   why a signed-in member clicking "All articles" was thrown onto marketing chrome.

   Load order: ll-v5.css, then this, then the content stylesheet.
   ============================================================ */

/* ---------- TOKEN BRIDGE: --ll-* → v5 (dark, default) ---------- */
:root {
  --ll-bg: var(--bg);
  --ll-bg-soft: var(--card);
  --ll-bg-panel: var(--card);
  --ll-text: var(--ink);
  --ll-text-muted: var(--muted);

  /* Accent = the v5 ledger blue; alt = the v5 gold (the CTA color). RGB
     triplets are needed because the content CSS composes rgba(var(--x-rgb),a). */
  --ll-accent: var(--blueHi);
  --ll-accent-rgb: 127, 178, 255;
  --ll-accent-alt: var(--goldHi);
  --ll-accent-alt-rgb: 245, 196, 81;
  --ll-btn-on-accent: #0d1117;

  /* site-core.css composes rgba(var(--ll-text-rgb), a) and rgba(var(--ll-bg-rgb), a)
     19 times between them, and NEITHER was ever declared — anywhere in the repo. An
     undefined var() voids the whole declaration, so those 19 borders, chips and row
     rules simply did not draw. Most visibly on the changelog editor, where the
     "Hidden" status pill lost its pill entirely: a draft, the most important state on
     the page, rendered as bare grey text beside Public and Internal as real chips. */
  --ll-text-rgb: 244, 246, 248;  /* v5 dark --ink #f4f6f8 */
  --ll-bg-rgb: 15, 20, 25;       /* v5 dark --bg  #0f1419 */

  --ll-border-subtle: var(--border-2);
  --ll-border: var(--border);
  --ll-border-accent: var(--border-strong);

  /* Status palette (KB-THEME-1). site-core composes these on the typed KB
     callouts (.kb-callout--tip/--warning/--caution), the changelog type pills
     and the receipts table, but they were only ever defined in the RETIRED
     theme files (themes/app.css, themes/dataviz.css) and in ll-compat.css's
     light-only block — so on bridged pages the callouts lost their border,
     tint and label color entirely (undefined var() = invalid declaration).
     Mapped onto the v5 outcome palette (COHESION-4: green = good/returned,
     gold = needs the member, red = not returned). RGB literals are needed for
     the rgba(var(--x-rgb), a) compositions and must be re-synced whenever the
     v5 accents move, like the accent/text/bg triplets above. */
  --ll-success: var(--green);
  --ll-success-rgb: 63, 208, 138;   /* v5 dark --green #3fd08a */
  --ll-warning: var(--gold);
  --ll-warning-rgb: 230, 165, 42;   /* v5 dark --gold #e6a52a */
  --ll-error: var(--red);
  --ll-error-rgb: 239, 93, 106;     /* v5 dark --red #ef5d6a */

  --ll-font-family: var(--font);
  --ll-ease-out: var(--ease);
  --ll-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ll-duration-fast: var(--t-fast);

  --ll-radius-sm: var(--r-sm);
  --ll-radius-md: var(--r-md);
  --ll-radius-pill: var(--r-pill);

  --ll-chart-line: var(--blueHi);
  --ll-chart-grid-rgba: rgba(127, 178, 255, 0.05);
  --ll-chart-baseline-rgba: rgba(127, 178, 255, 0.09);
  --ll-gradient-cta-primary: linear-gradient(160deg, #7fb2ff 0%, #3b82f6 55%, #1d4ed8 100%);
  --ll-gradient-cta-gold: var(--grad-gold);

  --ll-text-xs: 0.72rem;
  --ll-text-sm: 0.85rem;
  --ll-text-base: 1rem;
  --ll-text-lg: 1.125rem;
  --ll-text-xl: 1.25rem;
  --ll-text-2xl: 1.5rem;
  --ll-text-3xl: 2rem;
}

/* Light-theme accent triplets (blueHi/goldHi go darker on light — keep the
   rgba() compositions legible). The v5 [data-theme="light"] block already
   re-points --bg/--ink/etc, so the var()-chained bridge tokens follow along;
   only the RGB literals need a light override. */
[data-theme="light"] {
  /* These literals must be re-synced whenever the light accents move. They were left
     pointing at the pre-2026-08-19 values (#3b7ae0 / #a87610) when the light palette
     went ink-weight for contrast, so every rgba() composition on the public pages was
     still mixing the old, lighter colours. */
  --ll-accent-rgb: 32, 84, 202;    /* v5 light --blueHi #2054ca */
  --ll-accent-alt-rgb: 124, 86, 12; /* v5 light --goldHi #7c560c */
  --ll-text-rgb: 22, 27, 34;       /* v5 light --ink #161b22 */
  --ll-bg-rgb: 231, 233, 238;      /* v5 light --bg  #e7e9ee */
  --ll-success-rgb: 41, 119, 76;   /* v5 light --green #29774c */
  --ll-warning-rgb: 140, 97, 14;   /* v5 light --gold  #8c610e */
  --ll-error-rgb: 187, 63, 12;     /* v5 light --red   #bb3f0c */
  --ll-btn-on-accent: #ffffff;
  --ll-chart-grid-rgba: rgba(59, 122, 224, 0.06);
  --ll-chart-baseline-rgba: rgba(59, 122, 224, 0.1);
}
