/* Shared CRT design tokens — dark tools, SCF pages, executive summary (screen).
   Import this first; pages may add their own :root vars on top for one-off needs. */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Surfaces (dark blue stack, lightest → deepest) ──
     --navy     = full-page / app chrome background (body, tool shell).
     --navy2    = main panels, cards, KPI tiles, “raised” sections.
     --navy3    = inset tracks, wells, secondary cards (progress bars, sample tiles).
     --navy4    = extra-deep strip (used sparingly where you need another step). */
  --navy: #021527;
  --navy2: #051e33;
  --navy3: #0a2d4a;
  --navy4: #061a2e;

  /* ── Brand accent (amber / gold) ──
     Primary CTAs, “Calculate”, exec summary button, step badges, key highlights,
     emphasis in headings (<em>), savings callouts, spinner accent, many gradients. */
  --amber: #f5a700;
  --amber2: #ffbe40; /* lighter end of gradients, hover brighten */
  --amber-dark: #d49000; /* pressed / darker UI states */
  --amber-hover: #d49000; /* hover alias (often same as dark) */

  /* ── Semantic UI colors (charts, KPI stripes, tags, status) ──
     --green  = CRT-positive / “with CRT”, STRM badges, analyst-hours KPI, gap coverage.
     --blue   = secondary accent, “traditional vs CRT” contrast, some KPIs / tags.
     --purple = ROI / payback style metrics, tertiary accent cards.
     --red    = risk, “without CRT”, loss bars, destructive emphasis in charts. */
  --green: #13627C;
  --blue: #4a9eff;
  --purple: #c084fc;
  --red: #f87171;

  --white: #fff;

  /* ── Text (intended hierarchy; all #fff today — tune opacity in components if needed) ──
     --text   = primary body / titles on dark.
     --text2  = secondary paragraphs, subtitles.
     --text3  = labels, hints, mono captions, de-emphasized copy.
     --text-light = alias for high-contrast light text on dark blocks. */
  --text: #ffffff;
  --text2: #ffffff;
  --text3: #ffffff;

  /* ── Hairlines & card edges on dark navy ──
     --border   = default dividers, list row separators.
     --border2  = stronger card / panel outlines, scrollbar thumbs.
     --border-navy* = alternate naming for similar strokes (nav / legacy sections). */
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.13);
  --border-navy: rgba(255, 255, 255, 0.08);
  --border-navy2: rgba(255, 255, 255, 0.14);
  --text-light: #ffffff;

  /* ── Font stacks (pair with Google Fonts links on each HTML page) ──
     --mont   = headlines, KPI numbers, buttons, emphasis figures.
     --outfit = UI body, card titles, comfortable reading.
     --mono   = labels, tables, codes, small caps / technical lines. */
  --mont: "Montserrat", sans-serif;
  --outfit: "Outfit", sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;

  /* ── Corner radius ──
     --r / --radius = small chips, tight controls (8px).
     --r2             = cards, modals, large buttons (14px).
     --radius-lg      = larger rounded shells (12px). */
  --r: 8px;
  --r2: 14px;
  --radius: 8px;
  --radius-lg: 12px;

  /* ── Light / marketing surfaces (SCF pages, print-friendly strips) ──
     Used where the layout flips to light background, not the default dark tool shell. */
  --off-white: #f4f6fb;
  --text-muted: #7a92a8;
  --yellow: #ffd166;

  /* ── Scoped typography tokens (see crt-ui-standard.css for usage) ──
     Category rail headers: size / weight / letter-spacing.
     Pills / chips: size / weight. */
  --crt-cat-fs: 12px;
  --crt-cat-fw: 500;
  --crt-cat-ls: 0.14em;
  --crt-pill-fs: 13px;
  --crt-pill-fw: 500;

  /* Runtime: admin/color-changer.html + ../crt-theme-override.js may set inline
     overrides on <html> for any of the variables above (same keys). Persisted
     in localStorage as crt_theme_overrides_v1 (JSON object of --key → value). */
}

html {
  scroll-behavior: smooth;
}

/* Prevent unstyled blue links on dark bg */
a { color: inherit; }

/* Global focus-visible ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* Interactive gold: underline on hover to distinguish from decorative gold */
button:not(:disabled):hover, a[href]:hover {
  text-decoration-skip-ink: auto;
}

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