/* @hifive/tokens 1.4.0 — built 2026-12-04. Edit packages/tokens/src, not this file. */
/* Performance Hub (and To-Do) — maps the app's existing variables onto HiFive tokens.
   Checked 9 Nov 2026 against hifive-performance-hub/src/index.css and src/styles/theme.js.

   Load AFTER /theme.css and AFTER the app's own index-*.css so these win. The variable names match
   the app's :root block one for one. Two things this file cannot do, which need one small PR in
   hifive-performance-hub:
     1. theme.js applyPalette() writes --brand-dark/-mid/-light/-pink/-shadow/-dark-rgb as INLINE styles
        on <html> at boot, and inline beats any stylesheet. When html[data-skin] is present it must skip
        that write (or write from window.hifiveTheme), so the HiFive palette wins and the app's own
        palette picker becomes the HiFive Appearance sheet.
     2. Dark mode is keyed on html[data-theme-mode="dark"] there; the token sheet uses data-theme="dark".
        Both are honoured below; the app should mirror one onto the other (one line in its boot). */

html[data-skin] {
  --font-heading: var(--font-display);
  /* The app's own :root sets --font-body to Nunito and loads after the token
     sheet, so the stack is written out here. (It used to read
     var(--font-body), a cycle that left the variable blank.) */
  --font-body: Inter, 'Nunito', -apple-system, 'Segoe UI', Roboto, 'Noto Sans Malayalam', sans-serif;

  /* These carry ROLES in the app, not brightness steps (13 Nov 2026, measured in every palette):
     dark = solid brand surfaces with white text, mid = buttons and outlines, light = links and
     small accents, i.e. TEXT. Light was brand-500, a fill: 2.2:1 in Sol, 1.8:1 in Aami dark. The app's
     own text now reads --primary-text first (hifive-performance-hub contrast-text). */
  --brand-dark: rgb(var(--brand-700));
  --brand-mid: rgb(var(--brand-600));
  --brand-light: var(--primary-text);
  --brand-pink: var(--accent);
  --brand-shadow: rgb(var(--brand-900) / .25);
  --brand-dark-rgb: var(--brand-700);

  --c-ink: var(--text-strong);
  --c-heading: var(--text-strong);
  --c-text-muted: var(--text-muted);
  --c-text-faint: var(--text-muted);   /* used for small text: --text-faint fell to 3.5:1 on dark cards */
  --c-slate: var(--text-muted);        /* text too, same reason */
  --c-bg: var(--surface-0);
  --c-bg-alt: var(--surface-2);
  --c-surface: var(--surface-1);
  --c-line: var(--line);
  --c-line-strong: var(--line-strong);
  --c-chip-bg: var(--primary-soft);
  --c-chip-text: var(--primary-text);
  --c-clay: var(--surface-1);
  --c-clay-inset: var(--surface-2);

  --glass: rgb(255 255 255 / .72);
  --glass-strong: rgb(255 255 255 / .9);
  --glass-stroke: rgb(255 255 255 / .75);
  --glass-blur: 14px;
  --card-shadow: var(--shadow-card);
  --nav-bg: rgb(255 255 255 / .6);
  --app-bg: var(--surface-0);

  --field-bg: var(--surface-1);
  --field-border: var(--line);
  --field-hl: rgb(255 255 255 / .85);
  --field-placeholder: var(--text-faint);

  --r-8: var(--r-sm); --r-10: var(--r-sm); --r-12: 12px; --r-16: var(--r-md); --r-22: var(--r-lg); 
  --e1: var(--shadow-card);

  --hifive-hub-accent: var(--primary);
  --hifive-hub-fg: var(--on-primary);
}
html[data-skin][data-theme="dark"], html[data-skin].dark, html[data-skin][data-theme-mode="dark"] {
  --glass: rgb(var(--ink-800) / .8);
  --glass-strong: rgb(var(--ink-800) / .95);
  --glass-stroke: rgb(255 255 255 / .1);
  --nav-bg: rgb(var(--ink-900) / .85);
  --field-hl: rgb(255 255 255 / .06);
  --card-shadow: 0 1px 2px rgb(0 0 0 / .45), 0 16px 44px rgb(0 0 0 / .55);
}
/* Dense data tables stay flat under Soft. */
html[data-skin][data-style="soft"] .data-table-wrap, html[data-skin][data-style="soft"] table { box-shadow: none; background: var(--surface-1); }
