/*
 * GENERATED from packages/ui/src/tokens.css by W-COLOR-1 (2026-09-29): the gold
 * "Quiet ink" system. The website is a standalone static site (no bundler) and cannot
 * import across packages, so re-copy on every change to that file. Accent presets
 * and the categorical chart hues are not shipped here (unused on
 * the marketing site; gold law). Website-only additions are marked "Website-only".
 */

/*
 * Money Mystic design tokens (B4).
 *
 * The single CSS source of truth, lifted verbatim from prototype/money-mystic.html
 * and docs/DESIGN_SYSTEM.md. Components reference these variables only — never raw
 * hex — so theming is a single `data-theme` swap on <html>. Keep in sync with
 * tokens.ts (the parity test enforces it).
 */

:root {
  color-scheme: light;
  /* ---- Color: light theme (default) — "Quiet ink" (Cameron's pick, 2026-09-27) ----
     Warm paper, near-black ink, one accent: gold, matched to the logo (--brand-gold-*),
     for the Mystic and wealth alike. The Mystic is gold now (Cameron, 2026-09-29). Every text pair below was measured: worst is --ink-3 on --surface-2
     at 5.00:1; --line-strong clears 3.23:1 on --surface-2. */
  --canvas: #FAF9F6;
  --surface: #FFFFFF;
  --surface-2: #F4F3EE;
  --line: #E9E6DD;
  /* Divider vs control boundary: --line is decorative, --line-strong is for input,
     toggle and switch borders, which WCAG 1.4.11 requires to clear 3:1. */
  --line-strong: #8A877E;
  --ink: #161514;
  --ink-2: #57554F;
  --ink-3: #6B6862;
  /* Shared semantic depth roles. Keep these aliases aligned with @mystic/ui so
     standalone pages and the app speak the same surface and ink language. */
  --surface-0: var(--canvas);
  --surface-1: var(--surface);
  --surface-3: var(--primary-soft);
  --surface-4: var(--sidebar-active-bg);
  --ink-1: var(--ink);
  --ink-4: var(--line-strong);
  --line-hairline: var(--line);
  --primary: #161514;
  --primary-ink: #161514;
  --primary-soft: #EFEDE6;
  /* Text on a --primary fill. Flips with the theme because --primary does. */
  --on-primary: #FFFFFF;
  /* Focus ring. It is drawn 2px wide with a 2px offset by `:focus-visible` only in
     home.css and pages.css, so pointer focus does not show the keyboard affordance. */
  --focus: var(--ink);
  --focus-width: 2px;
  --focus-offset: 2px;
  /* Brand gold: the three tones of the logo mark (website/assets/logo.svg), fixed in
     both themes. Mirror website/tokens.css names. */
  --brand-gold-hi: #FBF5E0;
  --brand-gold: #E0B548;
  --brand-gold-lo: #8B6914;
  --on-gold: #161514;
  --gold-1: var(--brand-gold-hi);
  --gold-2: var(--brand-gold);
  --gold-3: var(--brand-gold-lo);
  /* The Mystic is gold. Light: the logo's deep tone (5.09:1 on white, 4.66:1 on
     --brand-gold-hi) carries text and non-text; --brand-gold is the border tone. */
  --mystic: var(--brand-gold-lo);
  --mystic-soft: var(--brand-gold-hi);
  --success: #1FAE76;
  --success-soft: #E0F5EC;
  --danger: #EF5A72;
  --danger-soft: #FCE6EA;
  --warn: #EFA13C;
  --warn-soft: #FCEFDD;
  --state-success: var(--success);
  --state-success-surface: var(--success-soft);
  --state-danger: var(--danger);
  --state-danger-surface: var(--danger-soft);
  --state-warning: var(--warn);
  --state-warning-surface: var(--warn-soft);

  /* ---- Per-domain accent palettes (each section gets its own signature hue) ---- */
  --accent-crypto: #E658A0;        --accent-crypto-soft: #FBE3EF;        --accent-crypto-ink: #A3256B;
  --accent-investing: #117F79;     --accent-investing-soft: #DEF4F2;     --accent-investing-ink: #0E5F5A;
  --accent-subscriptions: #E0496A; --accent-subscriptions-soft: #FCE3E8; --accent-subscriptions-ink: #B5304B;
  --accent-wealth: #E0B548;        --accent-wealth-soft: #FBF5E0;        --accent-wealth-ink: #8B6914;

  /* ---- Deterministic categorical data-viz palette ----
     Eight ordered roles, deliberately excluding brand gold as a default series. */
  --chart-category-1: var(--accent-investing);
  --chart-category-2: var(--accent-subscriptions);
  --chart-category-3: var(--warn);
  --chart-category-4: var(--success);
  --chart-category-5: var(--danger);
  --chart-category-6: var(--ink-3);
  --chart-category-7: var(--primary);
  --chart-category-8: var(--line-strong);
  --chart-1: var(--chart-category-1); --chart-2: var(--chart-category-2);
  --chart-3: var(--chart-category-3); --chart-4: var(--chart-category-4);
  --chart-5: var(--chart-category-5); --chart-6: var(--chart-category-6);
  --chart-7: var(--chart-category-7); --chart-8: var(--chart-category-8);

  /* Signature gradient + scrim */
  --grad-mystic: linear-gradient(135deg, #6F510F 0%, #8B6914 100%);
  --grad-promo: linear-gradient(135deg, #F4F3EE, #FBF5E0);
  --grad-ember: linear-gradient(135deg, #F0617E 0%, #D4A017 100%);
  --on-accent: #FFFFFF; /* text/icon on gradient fills — white in both themes */
  --scrim: rgba(22, 21, 20, 0.45);
  --elevation-card: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --grain-opacity: 0.02;
  --grain-texture: none;

  /* ---- Sidebar: same paper as the page, not a dark rail ---- */
  --sidebar-bg: #F4F3EE;
  --sidebar-border: #E9E6DD;
  --sidebar-text: #161514;
  --sidebar-text-muted: #6B6862;
  --sidebar-hover: #ECEAE3;
  --sidebar-active-bg: #E6E3DA;
  --logo-glow: 0 0 16px rgba(224, 181, 72, 0.32);
  /* Floating action pills (Ask anything, + Transaction). Their own tokens: they used
     to borrow the sidebar's, which only worked while the sidebar was dark. */
  --fab-bg: #161514;
  --fab-ink: #FFFFFF;

  /* ---- Radius ----
     Cards and figures are square-cornered and hairline-bordered (was 10/16/22;
     soft rounded blocks are ruled out). Buttons, CTAs, chips and dots use
     --r-pill, the shape the app ships (ruling 276). */
  --r-sm: 16px;
  --r-md: 22px;
  --r-lg: 26px;
  --r-pill: 999px;

  /* ---- Elevation: cards sit flat on paper; only floating layers lift ---- */
  --shadow-1: none;
  --shadow-2: 0 1px 2px rgba(22, 21, 20, 0.04);
  --shadow-3: 0 12px 40px rgba(22, 21, 20, 0.12);
  --glow-mystic: 0 6px 24px rgba(139, 105, 20, 0.22);

  /* ---- Spacing scale (px; base unit 4 → 8px grid rhythm) ---- */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  /* Page content inset; narrows below the desktop window floor. */
  --page-pad: var(--space-24);
  /* Separation between major sections and after page headers. */
  --section-gap: var(--space-32);
  /* Interior padding of a standard card or panel. */
  --card-pad: var(--space-24);
  /* Interior padding of compact cards and panels. */
  --card-pad-compact: var(--space-16);
  /* Separation between sibling cards in a group. */
  --card-gap: var(--space-16);
  /* Separation between a card heading and its body. */
  --card-head-gap: var(--space-12);
  /* Separation between a chart and its caption or legend. */
  --chart-caption-gap: var(--space-12);
  /* Vertical padding of content rows without a fixed height. */
  --row-pad-y: var(--space-12);
  /* Separation between tightly related items in a stack. */
  --stack-tight: var(--space-8);
  /* Separation between ordinary items in a stack. */
  --stack: var(--space-16);

  /* Website-only: one vertical section scale (Q18a; home.css keeps its own --section-space on .live-home). --site-section-side is one side of a section boundary (48 to 56px),
     --site-section-major is section to section (96 to 112px, what home's 56/56 sections already give).
     --section-py is the top padding that follows a page hero's 32px bottom, so hero to content is also major. */
  --site-section-side: clamp(48px, 1vw + 42px, 56px);
  --site-section-major: calc(2 * var(--site-section-side));
  --section-py: calc(var(--site-section-major) - var(--space-32));
  --section-py-tight: clamp(48px, 1vw + 42px, 56px);
  --grid-gap: clamp(16px, 1.5vw + 8px, 24px);
  --fs-h2-site: var(--fs-site-section);
  /* Website-only: gap from a section's heading block to its content. */
  --section-header-gap: var(--section-gap);
  --site-layout-gap: clamp(32px, 5vw, 64px);
  --site-card-inset: clamp(16px, 2.4vw, 32px);
  --site-page-gutter: max(var(--h-pad), calc((100vw - var(--h-max)) / 2 + var(--h-pad)));
  --site-brand-gutter: max(var(--space-32), calc((100vw - var(--h-max)) / 2 + var(--space-32)));
  --site-center-offset: 50%;
  --site-rule-gap: 1px;
  /* Website-only: primary button hover. Light: deep logo gold under white text (5.09:1). Dark: see the dark blocks. */
  --primary-hover: var(--brand-gold-lo);

  /* ---- Typography ---- */
  /* UI text in Geist, with the platform's own face as the fallback. */
  --font-sans: 'Geist', 'Geist Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Sentence headers and section titles in Newsreader, with book-serif fallbacks. */
  --font-heading: 'Urbanist', 'Urbanist Fallback', var(--font-sans);
  --font-figure: var(--font-heading);
  --fw-heading: 600;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
  --fvn-tabular: tabular-nums;

  /* Website reading type follows the browser default; app tokens remain unchanged. */
  --fs-site-label: .8125rem;
  --fs-site-body: .875rem;
  --fs-site-h3: 1rem;
  --fs-site-h2: 1.25rem;
  --fs-site-h1: 1.5rem;
  --fs-site-display: 2rem;
  --fs-site-section: clamp(1.75rem, 2.4vw + .5rem, 2.75rem);
  --fs-site-page: clamp(2rem, 3.6vw, 3.25rem);
  --fw-site-page: 700;

  /* Website scale: 13, 14, 16, 20, 24, 32, fluid section and page headings. */
  --fs-display: var(--fs-site-display);   --lh-display: 38px;   --fw-display: 700;
  --fs-h1: var(--fs-site-h1);        --lh-h1: 32px;        --fw-h1: 700;
  --fs-h2: var(--fs-site-h2);        --lh-h2: 28px;        --fw-h2: 650;
  --fs-h3: var(--fs-site-h3);        --lh-h3: 22px;        --fw-h3: 600;
  --fs-subtitle: var(--fs-site-body);  --lh-subtitle: 20px;  --fw-subtitle: 400;
  --fs-body: var(--fs-site-body);      --lh-body: 20px;      --fw-body: 400;
  --fs-body-tight: var(--fs-site-body); --lh-body-tight: 18px; --fw-body-tight: 400;
  --fs-small: var(--fs-body);     --lh-small: 18px;     --fw-small: 400;
  --fs-label: var(--fs-site-label);     --lh-label: 16px;     --fw-label: 550;
  --fs-micro: var(--fs-label);     --lh-micro: 14px;     --fw-micro: 500;
  --ls-label: 0.06em;

  /* Website-only: the marketing hero headline has no in-app equivalent at this scale. */
  --fs-hero: var(--fs-h1-site);      --lh-hero: 1.05;
  /* Website-only: THE page H1 size. Home and every inner page use this one clamp. */
  --fs-h1-site: var(--fs-site-page);
  /* One measure for every screen H1 — sized for the longest data-driven sentence headline. */
  --h1-measure: 56ch;
  /* Control sizes: every button, tab and pill snaps to one of these three heights. */
  --control-h-sm: 28px;
  --control-h-md: 32px;
  --control-h-lg: 40px;

  /*
   * Decorative glyph sizes (empty-state icons, etc). These are ART, not type —
   * they must never be mapped onto the type scale.
   */
  --icon-display: 44px;
  --icon-hero: 56px;

  /* ---- Icon size scale (functional; --icon-display/--icon-hero stay art-only) ----
     See docs/CRAFT_DIRECTION.md §2. CSS width/height on these classes overrides the
     SVG width/height attribute, so existing <svg> markup needs no prop change. */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-stroke: 1.7;

  /* motion:start. MOTION_SPEC v2 section 1.2 (ruling 271): the one motion token set. Copied byte for byte into
     website/tokens.css; renderer motion/timing.ts is its JS twin. Pinned by packages/ui/test/motion-tokens.test.ts. */
  --mm-dur-micro: 100ms;
  --mm-dur-fast: 120ms;
  --mm-dur-transition: 150ms;
  --mm-dur-hover: 150ms;
  --mm-dur-normal: 200ms;
  --mm-dur-settle: 240ms;
  --mm-dur-route: 240ms;
  --mm-dur-slow: 300ms;
  --mm-dur-count: 400ms;
  --mm-dur-reveal: 560ms;
  --mm-dur-draw: var(--mm-dur-reveal);
  --mm-dur-reduced: 0.001ms;
  --mm-dur-skeleton: 1400ms;
  --mm-dur-spin: 800ms;
  --mm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --mm-ease-arrive: cubic-bezier(0.22, 1, 0.36, 1);
  --mm-ease-exit: cubic-bezier(0.4, 0, 0.9, 0.6);
  --mm-ease-move: cubic-bezier(0.4, 0, 0.2, 1);
  --mm-stagger-step: 30ms;
  --mm-rise: 8px;
  --mm-rise-reveal: 16px;
  --mm-lift: 2px;
  /* Older names, kept as aliases so no consumer changes. */
  --dur-instant: var(--mm-dur-micro);
  --dur-fast: var(--mm-dur-transition);
  --dur-base: var(--mm-dur-normal);
  --dur-slow: var(--mm-dur-slow);
  --ease: var(--mm-ease);
  --ease-standard: var(--mm-ease);
  --ease-fluid: var(--mm-ease);
  --ease-out: var(--mm-ease-arrive);
  --ease-in-out: var(--mm-ease-move);
  /* motion:end */
  /* the app's category hues (packages/ui/src/tokens.css --cat-1/2/3/5), the same in both themes */
  --hue-rent: #3C87F3;
  --hue-groceries: #E95A12;
  --hue-utilities: #3B9A96;
  --hue-dining: #E658A0;
  --hue-insurance: #1AB37D;
  --hue-gas: #9C6642;
  --hue-lifestyle: #1FA2DB;

  /* Website scenes share the interaction clock and the 4/8 spacing scale. */
  --scene-dur-exit: var(--mm-dur-fast);
  --scene-dur-settle: var(--mm-dur-normal);
  --scene-dur-enter: var(--mm-dur-slow);
  /* Ambient background drift (hero flowing paths): far slower than the interaction
     clock on purpose — a 280ms drift would read as frantic, not calm. Reduced-motion
     still freezes it. */
  --scene-dur-ambient: 28s;
  --scene-ease-enter: var(--mm-ease);
  --scene-ease-exit: var(--mm-ease-exit);
  --scene-depth-near: var(--space-8);
  --scene-depth-far: var(--space-16);

  /* Website-only: safe defaults for values progressively updated by site scripts. */
  --d: 0;
  --ledger-open: 0;
  --ledger-x: 0;
  --ledger-y: 0;
  --mint-parallax-x: 0px;
  --mint-parallax-y: 0px;
  --mx: 50%;
  --my: 50%;
  --reveal-order: 0;
  --rv-i: 0;
  --scene-figure-opacity: 1;
  --scene-figure-shift: 0;
  --scene-opacity: 1;
  --scene-shift: 0;
  --screen-opacity: 1;
  --screen-progress: 0;
  --screen-shift: 0;
  --scroll-tilt: 28deg;
  --shadow-sm: var(--shadow-2);
  --thread-handoff-x: 0px;
  --thread-handoff-y: 0px;
  --thread-left: 0;
  --thread-progress: 0;
  --thread-top: 0;
  --thread-travel: 0px;
  --w: 0%;
  --word-order: 0;

  /* Color tokens for text hierarchy (use instead of raw colors) */
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);

  /* Focus ring (Button spec: 2px primary @40% + 2px offset) */
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(139, 105, 20, 0.55);
  --focus-color: var(--mystic);
  --focus-ring: var(--ring);
  /* Chip text inks — themed so chips stay readable on their soft backgrounds. */
  --success-ink: #0f7a4f;
  --danger-ink: #c23350;
  /* #A86A18 was 3.91:1 on --warn-soft, and even pure white on it only reached
     4.43:1 — the ink itself was too light for AA on any pale ground. 4.61:1 now. */
  --warn-ink: #9A5F14;
  --mystic-ink: var(--brand-gold-lo);

  /* ---- Customizable accent colors (light theme) ---- */
  --accent-primary: #161514;
  --accent-primary-ink: var(--primary-ink);
  --accent-primary-soft: #EFEDE6;

  /* Accent variants */


  --accent-teal: #1FA8A0;
  --accent-teal-ink: #0E5F5A;
  --accent-teal-soft: #DEF4F2;

  --accent-emerald: #34B27B;
  --accent-emerald-ink: #1F7B4F;
  --accent-emerald-soft: #E0F5EC;

  --accent-amber: #EFA13C;
  --accent-amber-ink: var(--warn-ink);
  --accent-amber-soft: #FCEFDD;

  --accent-rose: #E0496A;
  --accent-rose-ink: #B5304B;
  --accent-rose-soft: #FCE3E8;

  --accent-theme-blue: var(--primary);
  --accent-theme-blue-ink: var(--primary-ink);
  --accent-theme-blue-soft: var(--primary-soft);
  --accent-theme-teal: #10B981;
  --accent-theme-teal-ink: #047857;
  --accent-theme-teal-soft: #D1FAE5;
  --accent-theme-emerald: #14B8A6;
  --accent-theme-emerald-ink: #0D7377;
  --accent-theme-emerald-soft: #CCFBF1;
  --accent-theme-amber: #EFC006;
  --accent-theme-amber-ink: #715C09;
  --accent-theme-amber-soft: #FDF7DD;
  --accent-theme-rose: #E83092;
  --accent-theme-rose-ink: #861350;
  --accent-theme-rose-soft: #FDE3F1;
}

/* ---- Dark theme (WCAG AA contrast fixed; Phase 3) ---- */
:root[data-theme='dark'] {
  color-scheme: dark;
  /*
   * "Quiet ink" at night — warm near-black paper, light ink, gold for the Mystic.
   *
   * Every text pairing here was measured before it landed; the worst case is
   * --ink-3 on --surface-2 at 5.32:1, and --line-strong clears 3:1 on --surface-2.
   * Verify with `node tools/a11y-audit.mjs` after any change to these values.
   */
  --canvas: #141312;
  --surface: #1C1B19;
  --surface-2: #242220;
  --line: #312F2B;
  /* --line is a divider. Control boundaries (inputs, toggles, switches) must clear
     3:1 per WCAG 1.4.11, which a divider tone never will — use --line-strong. */
  --line-strong: #77736B;
  --ink: #F2F0EB;
  --ink-2: #BCB7AD;
  --ink-3: #9A958B;
  --primary: #F2F0EB;
  --primary-ink: #F2F0EB;
  --primary-soft: #2C2A27;
  --on-primary: #141312;
  --primary-hover: var(--brand-gold); /* dark ink on gold, >=9:1 */
  --mystic: var(--brand-gold);
  --focus: var(--brand-gold);
  --mystic-soft: #3A2F14;
  --success: #3FD79B;
  --success-soft: #164E3B;
  --danger: #FF7A8A;
  --danger-soft: #7C2D12;
  --warn: #FFC24D;
  /* #78350F read as muddy brown behind amber text on chips — use the deeper
     amber-tinted field (matches accent-wealth-soft) */
  --warn-soft: #422006;

  /* ---- Per-domain accent palettes (dark, WCAG AA) ---- */
  --accent-crypto: #E658A0;        --accent-crypto-soft: #3A1A2D;        --accent-crypto-ink: #F9A8D4;
  --accent-investing: #6EE7B7;     --accent-investing-soft: #164E3B;     --accent-investing-ink: #CCFBF1;
  --accent-subscriptions: #FB7185; --accent-subscriptions-soft: #831843; --accent-subscriptions-ink: #FCE7F3;
  --accent-wealth: #D4AF6A;        --accent-wealth-soft: #3A3021;        --accent-wealth-ink: #E9CF94;

  --scrim: rgba(8, 7, 6, 0.6);
  /* Same deep logo gold as light: every button/badge that fills with this gradient
     pairs it with white (--on-accent) text, which clears 6.30:1 and 5.09:1 on it. */
  --grad-mystic: linear-gradient(135deg, #6F510F 0%, #8B6914 100%);
  --grad-promo: linear-gradient(135deg, #242220, #33291A);
  --grad-ember: linear-gradient(135deg, #FF8DA3 0%, #E6B84D 100%);
  --glow-mystic: 0 6px 24px rgba(224, 181, 72, 0.22);
  --sidebar-bg: #181715;
  --sidebar-border: #2A2825;
  --sidebar-text: #F2F0EB;
  --sidebar-text-muted: #9A958B;
  --sidebar-hover: #242220;
  --sidebar-active-bg: #2C2A27;
  --logo-glow: 0 0 16px rgba(224, 181, 72, 0.32);
  --fab-bg: #F2F0EB;
  --fab-ink: #141312;
  /* Focus ring + chip inks recolored for the dark surface. */
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(224, 181, 72, 0.6);
  --success-ink: #7DE8B8;
  --danger-ink: #FF9AA6;
  --warn-ink: #FFC97A;
  --mystic-ink: var(--brand-gold);

  /* ---- Shadows for dark theme (lighter, more subtle on dark background) ---- */
  --shadow-1: none;
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.5);

  /* ---- Customizable accent colors (dark theme) ---- */
  --accent-primary: #F2F0EB;
  --accent-primary-ink: #F2F0EB;
  --accent-primary-soft: #2C2A27;

  /* Accent variants */


  --accent-teal: #5CC6D6;
  --accent-teal-ink: #A5E4EE;
  --accent-teal-soft: #293D3F;

  --accent-emerald: #34D399;
  --accent-emerald-ink: #A7F3D0;
  --accent-emerald-soft: #214033;

  --accent-amber: #FB923C;
  --accent-amber-ink: #FDBA74;
  --accent-amber-soft: #493320;

  --accent-rose: #FB7185;
  --accent-rose-ink: #FDA4AF;
  --accent-rose-soft: #492C2F;

  /* ---- Accent theme presets (dark) — see the light-theme block above. ---- */
  --accent-theme-blue-ink: #93B5FF;
  --accent-theme-blue-soft: rgba(107, 160, 255, 0.1);
  --accent-theme-teal: #2DD4BF;
  --accent-theme-teal-ink: #67E8F9;
  --accent-theme-teal-soft: rgba(45, 212, 191, 0.1);
  --accent-theme-emerald: #2EE7D5;
  --accent-theme-emerald-ink: #5EEAD4;
  --accent-theme-emerald-soft: rgba(46, 231, 213, 0.1);
  --accent-theme-amber: #F4E225;
  --accent-theme-amber-ink: #FBF074;
  --accent-theme-amber-soft: rgba(244, 226, 37, 0.1);
  --accent-theme-rose: #F04CA4;
  --accent-theme-rose-ink: #F994CA;
  --accent-theme-rose-soft: rgba(240, 76, 164, 0.1);
}

/* Website-only: pages ship data-theme="dark" and theme.js swaps a stored choice in before first paint.
   This block keeps dark following the OS if the attribute is ever absent (an explicit light choice wins).
   Same values as the block above; a media query and an attribute selector cannot share one rule. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    /*
     * "Quiet ink" at night — warm near-black paper, light ink, gold for the Mystic.
     *
     * Every text pairing here was measured before it landed; the worst case is
     * --ink-3 on --surface-2 at 5.32:1, and --line-strong clears 3:1 on --surface-2.
     * Verify with `node tools/a11y-audit.mjs` after any change to these values.
     */
    --canvas: #141312;
    --surface: #1C1B19;
    --surface-2: #242220;
    --line: #312F2B;
    /* --line is a divider. Control boundaries (inputs, toggles, switches) must clear
       3:1 per WCAG 1.4.11, which a divider tone never will — use --line-strong. */
    --line-strong: #77736B;
    --ink: #F2F0EB;
    --ink-2: #BCB7AD;
    --ink-3: #9A958B;
    --primary: #F2F0EB;
    --primary-ink: #F2F0EB;
    --primary-soft: #2C2A27;
    --on-primary: #141312;
    --primary-hover: var(--brand-gold); /* dark ink on gold, >=9:1 */
    --mystic: var(--brand-gold);
    --focus: var(--brand-gold);
    --mystic-soft: #3A2F14;
    --success: #3FD79B;
    --success-soft: #164E3B;
    --danger: #FF7A8A;
    --danger-soft: #7C2D12;
    --warn: #FFC24D;
    /* #78350F read as muddy brown behind amber text on chips — use the deeper
       amber-tinted field (matches accent-wealth-soft) */
    --warn-soft: #422006;

    /* ---- Per-domain accent palettes (dark, WCAG AA) ---- */
    --accent-crypto: #E658A0;        --accent-crypto-soft: #3A1A2D;        --accent-crypto-ink: #F9A8D4;
    --accent-investing: #6EE7B7;     --accent-investing-soft: #164E3B;     --accent-investing-ink: #CCFBF1;
    --accent-subscriptions: #FB7185; --accent-subscriptions-soft: #831843; --accent-subscriptions-ink: #FCE7F3;
    --accent-wealth: #D4AF6A;        --accent-wealth-soft: #3A3021;        --accent-wealth-ink: #E9CF94;

    --scrim: rgba(8, 7, 6, 0.6);
    /* Same deep logo gold as light: every button/badge that fills with this gradient
       pairs it with white (--on-accent) text, which clears 6.30:1 and 5.09:1 on it. */
    --grad-mystic: linear-gradient(135deg, #6F510F 0%, #8B6914 100%);
    --grad-promo: linear-gradient(135deg, #242220, #33291A);
    --grad-ember: linear-gradient(135deg, #FF8DA3 0%, #E6B84D 100%);
    --glow-mystic: 0 6px 24px rgba(224, 181, 72, 0.22);
    --sidebar-bg: #181715;
    --sidebar-border: #2A2825;
    --sidebar-text: #F2F0EB;
    --sidebar-text-muted: #9A958B;
    --sidebar-hover: #242220;
    --sidebar-active-bg: #2C2A27;
    --logo-glow: 0 0 16px rgba(224, 181, 72, 0.32);
    --fab-bg: #F2F0EB;
    --fab-ink: #141312;
    /* Focus ring + chip inks recolored for the dark surface. */
    --ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(224, 181, 72, 0.6);
    --success-ink: #7DE8B8;
    --danger-ink: #FF9AA6;
    --warn-ink: #FFC97A;
    --mystic-ink: var(--brand-gold);

    /* ---- Shadows for dark theme (lighter, more subtle on dark background) ---- */
    --shadow-1: none;
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.5);

    /* ---- Customizable accent colors (dark theme) ---- */
    --accent-primary: #F2F0EB;
    --accent-primary-ink: #F2F0EB;
    --accent-primary-soft: #2C2A27;

    /* Accent variants */


    --accent-teal: #5CC6D6;
    --accent-teal-ink: #A5E4EE;
    --accent-teal-soft: #293D3F;

    --accent-emerald: #34D399;
    --accent-emerald-ink: #A7F3D0;
    --accent-emerald-soft: #214033;

    --accent-amber: #FB923C;
    --accent-amber-ink: #FDBA74;
    --accent-amber-soft: #493320;

    --accent-rose: #FB7185;
    --accent-rose-ink: #FDA4AF;
    --accent-rose-soft: #492C2F;

    /* ---- Accent theme presets (dark) — see the light-theme block above. ---- */
    --accent-theme-blue-ink: #93B5FF;
    --accent-theme-blue-soft: rgba(107, 160, 255, 0.1);
    --accent-theme-teal: #2DD4BF;
    --accent-theme-teal-ink: #67E8F9;
    --accent-theme-teal-soft: rgba(45, 212, 191, 0.1);
    --accent-theme-emerald: #2EE7D5;
    --accent-theme-emerald-ink: #5EEAD4;
    --accent-theme-emerald-soft: rgba(46, 231, 213, 0.1);
    --accent-theme-amber: #F4E225;
    --accent-theme-amber-ink: #FBF074;
    --accent-theme-amber-soft: rgba(244, 226, 37, 0.1);
    --accent-theme-rose: #F04CA4;
    --accent-theme-rose-ink: #F994CA;
    --accent-theme-rose-soft: rgba(240, 76, 164, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 999px) {
  :root {
    --page-pad: var(--space-16);
  }
}

/* S-016/S-017: one header on every page. home.css re-declares .nav-in's gap after pages.css, so the gap is a
   token set here at id strength; the coin replaces it with one 8px box gap (16px glyph to wordmark), which also keeps
   its 2px+2px focus ring clear of the wordmark. */
:root { --nav-gap: 1.5rem; }
@media (max-width: 30rem) { :root { --nav-gap: var(--space-4); } }
#nav .nav-in { gap: var(--nav-gap); }
#nav .nav-in > .brand { min-height: 2.75rem; }
.nav-in > .glance-coin {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: calc(var(--space-8) - var(--nav-gap));
  margin-left: calc(-1 * var(--space-8));
  padding: 0.5rem;
  color: var(--mystic);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
#coin-glance {
  position: fixed;
  margin: 0;
  inset: auto;
  width: min(16rem,calc(100vw - 1rem));
  padding: 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  font: 400 var(--fs-site-body)/1.45 var(--font-sans);
}
#coin-glance h2 { font: 600 var(--fs-site-h3) var(--font-heading); margin: 0.75rem 0 0.25rem; }
#coin-glance strong { font: 700 var(--fs-site-display) var(--font-figure); color: var(--mystic); }
#coin-glance span, #coin-glance p { color: var(--ink-2); }

/* S-021: no orphaned last words. Elements only (text-wrap inherits), zero specificity so explicit rules win, and the
   frozen ranges (home #recall..#faq, pricing main; rulings 343/344) keep their line breaks. */
:where(p, li, figcaption, dd, blockquote):where(:not(#recall *, #recall ~ * *, main:has(#beta-pricing) *)) { text-wrap: pretty; }
:where(h1, h2, h3, h4, summary):where(:not(#recall *, #recall ~ * *, main:has(#beta-pricing) *)) { text-wrap: balance; }

@media (max-width: 30rem) {
  .nav-in > :is(.nav-pricing-compact, .theme-toggle) { display: none; }
  .nav-links > .theme-toggle { align-self: flex-start; margin-top: var(--space-8); }
}

/* Lit by your money (FINAL_SPEC §2): window depth and the data glow, both themes */
:root {
  --cat-rent: #3C87F3; --cat-groceries: #E95A12; --cat-utilities: #3B9A96;
  --cat-insurance: #1AB37D; --cat-lifestyle: #1FA2DB; --cat-gas: #9C6642;
  /* the app's dark slots (packages/ui/src/tokens.css, dark block) for the always-dark app windows:
     categoryHue() gives Subscriptions lime, Insurance umber, Health mint; the rest are Subscriptions-board brand hues */
  --cat-lime: #999400; --cat-umber: #816137; --cat-mint: #47FFB6;
  --cat-blue: #3C87F3; --cat-amber: #E95A12; --cat-azure: #8FC6FC; --cat-rose: #E658A0; --cat-teal: #3B9A96;
  --cat-salmon: #AB7E49; --cat-aquamarine: #2DD2C2; --cat-sand: #E2BF9C; --cat-denim: #315581; --cat-chartreuse: #D2DF20;
  --rim: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  --window-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 1px 2px rgb(0 0 0 / .4), 0 40px 120px -24px rgb(0 0 0 / .7);
  --window-radius: 26px; --card-radius: 22px; --inner-radius: 16px;
  --mm-glow-gold: 0 0 64px -12px rgb(224 181 72 / .45);
  --glow-opacity: .35; --glow-gold-opacity: .7;
  --dur-arrive: var(--mm-dur-reveal);
}
:root[data-theme='light'] {
  --window-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 1px 2px rgb(20 19 18 / .12), 0 40px 100px -32px rgb(20 19 18 / .28);
  --glow-opacity: .18;
}
