/* ── CSS Variables ────────────────────────────────────────��──────────────────── */
:root {
  /* Surfaces — elevation ladder. */
  --surface-0: #0d1117;
  --surface-1: #12171d;
  --surface-2: #0f141a;
  --surface-3: #1a212b;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  /* Accent border keeps the teal identity for focus/selected states */
  --border-accent: rgba(58, 175, 186, 0.45);

  /* Radii */
  --r-widget: 12px;
  --r-item: 8px;
  --r-chip: 999px;

  /* Elevation shadows */
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-widget: 0 4px 20px rgba(0, 0, 0, 0.5);

  /* Motion */
  --t-fast: 150ms cubic-bezier(0.2, 0, 0, 1);
  --t-med: 250ms cubic-bezier(0.2, 0, 0, 1);

  /* Loss/gain chip fills (12% alpha of the semantic colors) */
  --chip-red-bg: rgba(248, 113, 113, 0.12);
  --chip-green-bg: rgba(74, 222, 128, 0.12);
  --chip-teal-bg: rgba(58, 175, 186, 0.12);

  --bg:          #0d1117;
  --bg-nav:      var(--surface-2);
  --bg-card:     var(--surface-1);
  --bg-item:     #161c24;
  --teal:        #1f6f78;
  --teal-hover:  #2a9aa8;
  --teal-bright: #3aafba;
  --text:        #e2e8f0;
  --text-muted:  #7a8592;
  --red:         #f87171;
  --green:       #4ade80;
  --border:      rgba(31, 111, 120, 0.35);
  --radius:      8px;
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.5);
  /* Exact-value type scale; one-off sizes remain literal. */
  --fs-062: 0.62rem;
  --fs-065: 0.65rem;
  --fs-068: 0.68rem;
  --fs-070: 0.7rem;
  --fs-072: 0.72rem;
  --fs-075: 0.75rem;
  --fs-078: 0.78rem;
  --fs-080: 0.8rem;
  --fs-081: 0.81rem;
  --fs-082: 0.82rem;
  --fs-085: 0.85rem;
  --fs-088: 0.88rem;
  --fs-090: 0.9rem;
  --fs-100: 1rem;

  /* Exact-value spacing scale for padding, margin, and gap. */
  --sp-6: 6px;
  --sp-8: 8px;
  --sp-10: 10px;
  --sp-14: 14px;
  --sp-18: 18px;

  /* Teal interaction tints. */
  --tint-teal-06: rgba(31, 111, 120, 0.06);
  --tint-teal-10: rgba(31, 111, 120, 0.1);
  --tint-teal-12: rgba(31, 111, 120, 0.12);
  --tint-teal-15: rgba(31, 111, 120, 0.15);
  --tint-teal-20: rgba(31, 111, 120, 0.2);
  --tint-teal-40: rgba(31, 111, 120, 0.4);
}

/* ── Reset & Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }  /* base for rem — overridden by inline style from font-scale setting */

body {
  background: var(--surface-0);
  color: var(--text);
  font-family: "Inter var", Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: var(--fs-100);
  line-height: 1.6;
  scroll-behavior: smooth;
}

body.mode-good {
  --border: rgba(58, 175, 186, 0.42);
  --border-accent: rgba(58, 175, 186, 0.60);
}

a { color: inherit; text-decoration: none; }

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

  .ticker-list {
    animation: none !important;
  }
}

/* ── Page Wrapper ────────────────────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
