/* ============================================================
   TraderPeak v6 — PRO / TERMINAL-LIGHT
   Bloomberg-light · Inter Tight · Neutral + Green/Red only
   ============================================================ */

:root {
  /* --- Paper & surfaces (cool light gray) --- */
  --paper: #F1F3F5;          /* main page — Bloomberg light */
  --paper-2: #E9ECEF;        /* subtle tint */
  --surface: #FFFFFF;        /* card body */
  --surface-2: #FAFBFC;      /* card alt */
  --surface-sunk: #F1F3F5;   /* inset */

  /* --- Ink (neutral grays, not navy) --- */
  --ink-0: #0B0D10;          /* primary text — near black */
  --ink-1: #1A1D21;
  --ink-2: #474B52;          /* secondary — 8.4:1 on surface */
  --ink-3: #5F6470;          /* tertiary — darkened from #6B7079 (4.2:1) → 5.8:1 to pass WCAG AA */
  --ink-4: #9199A2;          /* quaternary */
  --ink-5: #C4C9D0;          /* disabled / faint */

  /* --- Hairlines (cool) --- */
  --line: #DEE2E6;
  --line-2: #CED4DA;
  --line-cool: #DEE2E6;
  --line-cool-2: #CED4DA;

  /* --- NEUTRAL only. No brand accents. --- */
  /* Primary action = near-black pill */
  --accent: #0B0D10;
  --accent-2: #1A1D21;

  /* --- Direction: classic Bloomberg green/red --- */
  --bull: #16A34A;           /* green */
  --bull-2: #22C55E;
  --bull-deep: #15803D;
  --bull-soft: #DCFCE7;
  --bull-tint: #F0FDF4;
  --bull-line: #86EFAC;

  --bear: #DC2626;           /* red */
  --bear-2: #EF4444;
  --bear-deep: #991B1B;
  --bear-soft: #FEE2E2;
  --bear-tint: #FEF2F2;
  --bear-line: #FCA5A5;

  /* --- Legacy aliases (mapped to neutral so old selectors still work) --- */
  --violet: var(--ink-0);
  --violet-2: var(--ink-1);
  --violet-deep: var(--ink-0);
  --violet-soft: var(--paper-2);
  --violet-tint: var(--surface-2);
  --violet-line: var(--line-2);

  --amber: var(--ink-0);
  --amber-2: var(--ink-1);
  --amber-deep: var(--ink-0);
  --amber-soft: var(--paper-2);
  --amber-tint: var(--surface-2);
  --amber-line: var(--line-2);

  --navy: var(--ink-0);
  --navy-2: var(--ink-1);
  --navy-3: var(--ink-2);

  /* --- Section themes (all neutral now) --- */
  --sig-bg: var(--surface-2);
  --sig-accent: var(--ink-0);
  --risk-bg: var(--surface-2);
  --risk-accent: var(--ink-0);
  --fund-bg: var(--surface-2);
  --fund-accent: var(--ink-0);
  --ai-bg: #0B0D10;
  --ai-accent: var(--ink-0);
  --peers-bg: var(--surface-2);
  --peers-accent: var(--ink-0);

  /* --- Type: Söhne/GT America alternative --- */
  --font-display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* --- Type scale (UX audit: 18 distinct sizes → 6 declared steps) ---
     Use these vars in new components; existing inline `fontSize` values
     can migrate gradually. Bloomberg-light density preserved. */
  --fs-xxs: 10px;   /* eyebrow / mono labels / chip text */
  --fs-xs: 11px;    /* secondary metadata, tight tables */
  --fs-sm: 12px;    /* body small / dense data */
  --fs-md: 13px;    /* body / form labels */
  --fs-base: 14px;  /* default body — landing copy, lede paragraphs */
  --fs-lg: 15px;    /* card titles / panel headers */
  --fs-lg-2: 16px;  /* prominent body, marketing CTAs, modal text */
  --fs-xl: 18px;    /* section headings */
  --fs-2xl: 24px;   /* page headings */
  --fs-3xl: 36px;   /* hero / KPI numbers */

  /* --- Radii (tighter, more terminal) --- */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;

  /* --- Shadows (paper-soft) --- */
  --sh-xs: 0 1px 1px rgb(15 23 42 / 0.03);
  --sh-sm: 0 1px 2px rgb(15 23 42 / 0.04), 0 1px 3px rgb(15 23 42 / 0.04);
  --sh-md: 0 2px 4px rgb(15 23 42 / 0.04), 0 4px 12px -2px rgb(15 23 42 / 0.06);
  --sh-lg: 0 4px 8px rgb(15 23 42 / 0.05), 0 16px 40px -8px rgb(15 23 42 / 0.12);
  --sh-xl: 0 8px 16px rgb(15 23 42 / 0.06), 0 32px 64px -16px rgb(15 23 42 / 0.20);
  --sh-glow-v: 0 0 0 1px rgb(124 58 237 / 0.12), 0 0 40px -8px rgb(124 58 237 / 0.35);
  --sh-glow-a: 0 0 0 1px rgb(245 158 11 / 0.15), 0 0 40px -8px rgb(245 158 11 / 0.30);

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   Dark theme v2 — adopted from landing-v2.css (Landing v2 prototype,
   2026-05-04). Deep near-black with subtle green tint, ML-heavy
   aesthetic, green-500 brand accent. Replaces the prior Bloomberg-dark
   palette so /app dark mode reads as the same product as the marketing
   page on /. Token NAMES are preserved (--paper, --surface, --ink-0…)
   so no component code needs to change.
   ============================================================ */
:root[data-theme="dark"] {
  /* Surfaces — landing-v2 graphite ladder. Each step a touch greener
     than pure black, so the page reads as TraderPeak rather than
     "generic dark mode". */
  --paper:        #050706;   /* page bg — deepest */
  --paper-2:      #0A0E0C;
  --surface:      #0E1411;   /* card body */
  --surface-2:    #131A16;   /* card alt / raised */
  --surface-sunk: #050706;   /* inset (chart bg etc.) — same as paper */

  /* Inks — mirror landing-v2's rgba ladder, baked to solid for
     compatibility with rules that don't expect alpha values. */
  --ink-0: #F4F7F5;          /* primary — 17.5:1 on --paper */
  --ink-1: #DEE5E1;          /* ≈ rgba(255,255,255,0.85) */
  --ink-2: #A4ABA7;          /* secondary — ≈ 0.62 */
  --ink-3: #707771;          /* tertiary — ≈ 0.42 */
  --ink-4: #3D4441;          /* quaternary — ≈ 0.22 */
  --ink-5: #2A302D;          /* disabled */

  /* Hairlines — landing-v2 uses rgba(255,255,255, 0.06 / 0.10).
     Resolved to near-equivalents on the green-graphite bg. */
  --line:        #1A1F1C;
  --line-2:      #232927;
  --line-cool:   #1A1F1C;
  --line-cool-2: #232927;

  /* Brand accent — landing-v2 primary buttons are green-500
     (#22C55E). Matches the "ML-heavy gradient green" feel. */
  --accent:   #22C55E;
  --accent-2: #16A34A;

  /* Direction colors — green-500 / red-400, same hues as landing-v2.
     Slightly higher alpha than the v1 dark so the bull/bear fills
     read on the deeper bg. */
  --bull-soft:  rgba(34, 197, 94, 0.20);
  --bull-tint:  rgba(34, 197, 94, 0.12);
  --bull-line:  rgba(74, 222, 128, 0.32);   /* matches landing --grn-glow */
  --bear-soft:  rgba(248, 113, 113, 0.22);
  --bear-tint:  rgba(248, 113, 113, 0.12);
  --bear-line:  rgba(252, 165, 165, 0.36);

  /* Shadows: deeper than v1 since the bg is darker — lift cards more. */
  --sh-xs: 0 1px 1px rgb(0 0 0 / 0.30);
  --sh-sm: 0 1px 2px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.28);
  --sh-md: 0 2px 4px rgb(0 0 0 / 0.35), 0 4px 12px -2px rgb(0 0 0 / 0.40);
  --sh-lg: 0 4px 8px rgb(0 0 0 / 0.40), 0 16px 40px -8px rgb(0 0 0 / 0.55);
  --sh-xl: 0 8px 16px rgb(0 0 0 / 0.45), 0 32px 64px -16px rgb(0 0 0 / 0.65);
  /* Glow rings on form focus — green-tinted to match brand. */
  --sh-glow-v: 0 0 0 1px rgb(34 197 94 / 0.32), 0 0 32px -6px rgb(74 222 128 / 0.32);
  --sh-glow-a: 0 0 0 1px rgb(245 158 11 / 0.25), 0 0 32px -6px rgb(245 158 11 / 0.28);
}

/* Skeleton shimmer dark-mode override — light shadows vanish on dark bg. */
:root[data-theme="dark"] .sk-line {
  background: linear-gradient(90deg,
    rgb(255 255 255 / 0.04) 0%,
    rgb(255 255 255 / 0.10) 50%,
    rgb(255 255 255 / 0.04) 100%);
  background-size: 200% 100%;
}

/* ========= RESET ========= */
* { box-sizing: border-box; }
html, body { height: 100%; }

/* Visually-hidden utility for `<caption>` and other a11y-only labels.
   Removes from layout but keeps for screen readers. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-0);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow: hidden;
}

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink-0);
  outline-offset: 2px;
  border-radius: 3px;
}

.mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.serif { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ========= APP SHELL ========= */
.app {
  display: grid;
  grid-template-rows: 60px 32px 1fr;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  overflow: hidden;
  min-width: 0;
}
.main.no-rail { grid-template-columns: 1fr; }

.center { overflow-y: auto; overflow-x: hidden; }
.rail {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
}

/* Hide rail on narrow viewports; content gets full width. Keeps the
   dashboard readable on laptops &lt; 1280 and phones. */
@media (max-width: 1200px) {
  .main { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 960px) {
  .main { grid-template-columns: 1fr !important; }
  .rail { display: none; }
}

.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.scroll:hover::-webkit-scrollbar-thumb {
  background: var(--line-2);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 999px;
}

/* ========= TOP BAR ========= */
.topbar {
  /* Navbar shares the footer surface tone (var(--paper-2)) so the whole
     frame feels of-a-piece. A 1px bottom line + a very short drop-shadow
     create a gentle "step" between nav and the content below — the effect
     mimics Bloomberg Terminal / thinkorswim: chrome rails slightly darker
     than the work area, with a hairline separator. */
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
  padding: 0 28px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(11, 13, 16, 0.04), 0 6px 14px -8px rgba(11, 13, 16, 0.08);
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy), var(--violet-deep));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-sm), inset 0 1px 0 rgb(255 255 255 / 0.12);
  letter-spacing: -0.02em;
}
.brand em { font-style: normal; color: var(--violet); font-weight: 600; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.nav::-webkit-scrollbar { display: none; }

/* Skeleton shimmer for loading placeholders */
.sk-line {
  display: block;
  border-radius: 3px;
  background: linear-gradient(90deg, rgb(15 23 42 / 0.04) 0%, rgb(15 23 42 / 0.09) 50%, rgb(15 23 42 / 0.04) 100%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
}
@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.nav button {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 14px;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s var(--ease-out);
}
@media (max-width: 1360px) {
  .nav button { padding: 7px 10px; font-size: 12.5px; }
}
@media (max-width: 1180px) {
  .nav button { padding: 6px 8px; font-size: 12px; }
}
.nav button:hover { color: var(--ink-0); background: rgb(15 23 42 / 0.04); }
.nav button.active {
  color: var(--ink-0);
  background: rgb(15 23 42 / 0.06);
  font-weight: 600;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
  height: 36px;
  min-width: 0;
  max-width: 320px;
  width: 100%;
  justify-self: end;
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  transition: all .15s var(--ease-out);
}
@media (max-width: 1200px) {
  .search-pill .sl-text { display: none; }
  .search-pill kbd { display: none; }
  .search-pill { max-width: 40px; min-width: 36px; padding: 8px; justify-content: center; }
}
@media (max-width: 1000px) {
  .topbar { gap: 18px; padding: 0 16px; }
  .nav { gap: 0; }
  .nav button { padding: 6px 9px; font-size: 12px; }
  .brand span { display: none; }
}
/* CmdK palette — base styles weren't defined; without these, the modal
   has no width constraint and overflows on narrow viewports. */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(11, 13, 16, 0.42);
  display: grid; place-items: start center;
  padding-top: 12vh;
}
.cmdk {
  width: min(560px, 92vw);
  max-height: min(70vh, 600px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--sh-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cmdk-input {
  width: 100%; box-sizing: border-box;
  padding: 14px 18px; font-size: 14px;
  background: transparent; color: var(--ink-0);
  border: 0; border-bottom: 1px solid var(--line);
  outline: none; font-family: inherit;
}
.cmdk-input::placeholder { color: var(--ink-3); }
.cmdk-list { overflow-y: auto; padding: 6px 0; flex: 1; }
.cmdk-group {
  padding: 8px 18px 4px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
}
.cmdk-item {
  padding: 10px 18px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-1);
  min-height: 44px;
}
.cmdk-item.active, .cmdk-item:hover { background: var(--surface-2); }
.cmdk-item .ic { color: var(--ink-3); display: inline-flex; }
.cmdk-item .desc { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
@media (max-width: 480px) {
  .cmdk { width: 96vw; max-height: 80vh; }
  .cmdk-input { padding: 12px 14px; font-size: 16px; /* iOS no-zoom */ }
  .cmdk-item { padding: 12px 14px; }
}

/* Mobile hamburger — UX audit IA Critical: 18-item top-nav unusable on
   narrow viewports. Below 720px, swap the horizontal scroll-strip for
   a slide-in drawer triggered by ☰. WCAG SC 2.5.5 requires 44×44 CSS px
   touch targets — bumped from 36×36 in v2. */
@media (max-width: 720px) {
  .mobile-only { display: inline-grid !important; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 20px; }
  .nav { display: none; }
  /* Tables overflow horizontally on narrow viewports — wrap so users can
     scroll within the table card instead of breaking page layout. */
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  /* Sub-tab strip overflow gradient hint — users see there's more. */
  .tabs-wrap { position: relative; }
  .tabs-wrap::after {
    content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 32px;
    background: linear-gradient(90deg, transparent, var(--paper));
    pointer-events: none;
  }
}
@media (min-width: 721px) {
  .mobile-only { display: none !important; }
}
.search-pill:hover { border-color: var(--line-2); box-shadow: var(--sh-sm); }
.search-pill .sl-text { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-pill kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: var(--r-xs);
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border-radius: var(--r-md);
  transition: all .15s var(--ease-out);
  position: relative;
}
.icon-btn:hover { color: var(--ink-0); background: rgb(15 23 42 / 0.04); }
.icon-btn .badge {
  position: absolute;
  top: 8px; right: 9px;
  width: 6px; height: 6px;
  background: var(--amber);
  border-radius: 50%;
  border: 1.5px solid var(--paper);
}

.avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet-deep), var(--violet));
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 50%;
  box-shadow: var(--sh-sm), inset 0 1px 0 rgb(255 255 255 / 0.15);
}

/* ========= TICKER TAPE ========= */
.ticker-tape {
  height: 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  z-index: 9;
}
.ticker-tape::before, .ticker-tape::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 72px; z-index: 2; pointer-events: none;
}
.ticker-tape::before { left: 0; background: linear-gradient(90deg, var(--paper), transparent); }
.ticker-tape::after  { right: 0; background: linear-gradient(270deg, var(--paper), transparent); }
.ticker-tape-track {
  display: inline-flex; align-items: center;
  white-space: nowrap; height: 100%;
  animation: tt 120s linear infinite;
  padding-left: 28px;
}
.ticker-tape:hover .ticker-tape-track { animation-play-state: paused; }
@keyframes tt { to { transform: translateX(-50%); } }
.tt-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 16px;
  font-size: 11.5px;
  color: var(--ink-2);
  font-family: var(--font-sans);
}
.tt-tk {
  color: var(--ink-0); font-weight: 600; letter-spacing: -0.01em;
  font-family: var(--font-mono);
}
.tt-px { color: var(--ink-1); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tt-ch { font-weight: 500; font-family: var(--font-mono); }
.tt-ch.up { color: var(--bull); }
.tt-ch.down { color: var(--bear); }
.tt-sep { color: var(--ink-5); margin-left: 4px; }


/* ============================================================
   HERO — split: gradient navy band + card-on-card
   ============================================================ */
.hero-wrap {
  position: relative;
  padding: 0;
  isolation: isolate;
}

/* Neutral band — no gradients, just hairline + subtle dot grid */
.hero-band {
  background: var(--paper);
  padding: 40px 40px 120px;
  position: relative;
  overflow: hidden;
  color: var(--ink-0);
  border-bottom: 1px solid var(--line);
}
.hero-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgb(11 13 16 / 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, rgb(0 0 0 / 0.5), transparent 75%);
  pointer-events: none;
}
.hero-band::after { display: none; }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 24px;
  position: relative; z-index: 1;
}
.hero-meta .dot { width: 3px; height: 3px; background: var(--ink-5); border-radius: 50%; }
.hero-meta .live {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--bull-deep);
  padding: 3px 9px;
  background: var(--bull-tint);
  border: 1px solid var(--bull-line);
  border-radius: 3px;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.hero-meta .live::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--bull);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
  position: relative; z-index: 1;
}
.hero-title .tk-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  background: var(--ink-0);
  color: #fff;
  border: 1px solid var(--ink-0);
  border-radius: 3px;
}
.hero-title h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink-0);
}
.hero-title h1 em {
  font-style: normal;
  color: var(--ink-3);
  font-weight: 400;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 620px;
  margin-bottom: 24px;
  position: relative; z-index: 1;
}

/* ============================================================
   HERO CARD (overlapping card-on-card)
   ============================================================ */
.hero-card {
  margin: -100px 48px 0;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.hc-top {
  display: grid;
  grid-template-columns: 1.1fr auto auto;
  gap: 40px;
  align-items: flex-end;
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--line-cool);
}

.hc-price-block .hc-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.hc-price {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 0.95;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.hc-price .currency { font-size: 22px; color: var(--ink-3); margin-right: 2px; align-self: flex-start; margin-top: 8px; font-weight: 500; }
.hc-price .cents { font-size: 32px; color: var(--ink-2); font-weight: 500; }

.hc-delta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.hc-delta .pill {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}
.hc-delta .pill.up { color: var(--bull-deep); background: var(--bull-tint); border: 1px solid var(--bull-line); }
.hc-delta .pill.down { color: var(--bear-deep); background: var(--bear-tint); border: 1px solid var(--bear-line); }
.hc-delta .ah {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.hc-delta .ah .lbl { text-transform: uppercase; letter-spacing: 0.12em; margin-right: 7px; font-size: 10.5px; }
.hc-delta .ah .val { color: var(--ink-0); font-weight: 500; }
.hc-delta .ah .ch.up { color: var(--bull); margin-left: 6px; }
.hc-delta .ah .ch.down { color: var(--bear); margin-left: 6px; }

.hc-sparkline {
  width: 220px; height: 68px;
}
.hc-sparkline svg { display: block; }

.hc-actions { display: flex; gap: 8px; align-items: center; }
.hc-actions .btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  color: var(--ink-0);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-xs);
  transition: all .15s var(--ease-out);
}
.hc-actions .btn:hover {
  border-color: var(--line-cool-2);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.hc-actions .btn.primary {
  background: var(--ink-0);
  color: #fff;
  border-color: var(--ink-0);
  box-shadow: var(--sh-sm), inset 0 1px 0 rgb(255 255 255 / 0.08);
}
.hc-actions .btn.primary:hover {
  background: var(--ink-1);
  border-color: var(--ink-1);
}
.hc-actions .btn.watch.active {
  background: var(--paper-2);
  border-color: var(--line-2);
  color: var(--ink-0);
}

/* KPI tiles inside hero card */
.hc-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0;
  background: var(--surface-2);
}
.hc-kpi {
  padding: 20px 24px;
  border-right: 1px solid var(--line-cool);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hc-kpi:last-child { border-right: 0; }
.hc-kpi .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.hc-kpi .v {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-0);
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.hc-kpi .spk { height: 18px; margin-top: 2px; }
.hc-kpi .d { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.hc-kpi .d.up { color: var(--bull); }
.hc-kpi .d.down { color: var(--bear); }

/* ============================================================
   CHART SURFACE (under hero card)
   ============================================================ */
.chart-panel {
  margin: 24px 48px 0;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.chart-panel > *:last-child {
  padding: 14px 20px 16px;           /* chart area gets real breathing room */
}
.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line-cool);
  flex-wrap: wrap;
}

/* ============================================================
   TABS — soft underline
   ============================================================ */
.tabs-wrap {
  margin: 28px 48px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--paper, #FAFBFC);
  backdrop-filter: saturate(1.2) blur(6px);
}
.tabs {
  display: flex;
  gap: 0;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 14px 20px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s var(--ease-out), border-color .15s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.tab:first-child { padding-left: 0; }
.tab:hover { color: var(--ink-0); }
.tab.active {
  color: var(--ink-0);
  border-bottom-color: var(--ink-0);
  font-weight: 600;
}
.tab .tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  background: var(--ink-0);
  color: #fff;
  border-radius: var(--r-xs);
}

/* ============================================================
   PAGE + SECTION THEMES
   ============================================================ */
.page { padding: 32px 48px 96px; }
.stack { display: flex; flex-direction: column; gap: 40px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.row-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

/* Section header — editorial with serif + eyebrow */
.sect-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 8px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}
.sect-head .l {
  display: flex; flex-direction: column; gap: 6px;
}
.sect-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sect-head .eyebrow::before {
  content: ''; width: 14px; height: 1px; background: var(--ink-4);
}
.sect-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  margin: 0;
  line-height: 1.1;
}
.sect-head h2 em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.sect-head .r { display: flex; align-items: center; gap: 10px; }

/* Tinted section wrappers — all neutral, just hairline card */
.tint {
  padding: 32px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.tint.violet,
.tint.amber,
.tint.sky,
.tint.mint {
  background: var(--surface);
  border-color: var(--line);
}
.tint.navy {
  background: #0B0D10;
  border-color: #1A1D21;
  color: #fff;
}
.tint > .sect-head {
  border-bottom-color: var(--line);
  margin-bottom: 24px;
  padding-bottom: 14px;
}
.tint.navy > .sect-head {
  border-bottom-color: rgb(255 255 255 / 0.08);
}
.tint.navy .eyebrow { color: rgb(255 255 255 / 0.5); }
.tint.navy .eyebrow::before { background: rgb(255 255 255 / 0.25); }
.tint.navy h2 { color: #fff; }
.tint.navy h2 em { color: rgb(255 255 255 / 0.5); }

/* ============================================================
   CARDS — color accent bar + icon badge
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  position: relative;
  transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--sh-md); }

/* Thin accent bar — all neutral now */
.card[data-accent]::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 1;
  background: var(--ink-0);
}
.card[data-accent="violet"]::before,
.card[data-accent="amber"]::before,
.card[data-accent="sky"]::before,
.card[data-accent="mint"]::before,
.card[data-accent="rose"]::before,
.card[data-accent="navy"]::before { background: var(--ink-0); }

.card-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;  /* snapped to 4-grid: was 20/24/16 — kept symmetric */
}
.card-hd .ico-badge {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.card-hd .ico-badge.violet,
.card-hd .ico-badge.amber,
.card-hd .ico-badge.sky,
.card-hd .ico-badge.mint,
.card-hd .ico-badge.rose,
.card-hd .ico-badge.navy,
.card-hd .ico-badge.slate { background: var(--paper-2); color: var(--ink-0); }

.card-hd .title-block { flex: 1; min-width: 0; }
.card-hd h3 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-0);
  margin: 0 0 2px;
}
.card-hd .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.card-hd .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-bd { padding: 20px 24px; }

/* ============================================================
   CHIPS + BUTTONS + SEGMENTED
   ============================================================ */
.chip {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-xs);
  transition: all .15s var(--ease-out);
}
.chip:hover { color: var(--ink-0); border-color: var(--line-cool-2); transform: translateY(-0.5px); box-shadow: var(--sh-sm); }
.chip.active {
  color: #fff;
  background: var(--ink-0);
  border-color: var(--ink-0);
}

.segmented {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
}
.segmented button {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  transition: all .15s var(--ease-out);
  border-radius: var(--r-xs);
}
.segmented button:hover { color: var(--ink-0); }
.segmented button.active {
  background: var(--surface);
  color: var(--ink-0);
  font-weight: 600;
  box-shadow: var(--sh-sm);
}

/* ============================================================
   TABLES — inline minicharts support
   ============================================================ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
}
.tbl th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-cool);
  white-space: nowrap;
}
.tbl td {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--ink-0);
  border-bottom: 1px solid var(--line-cool);
  transition: background .15s var(--ease-out);
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--paper-2); }
.tbl .num, .tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl td.tk {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-0);
}
.up { color: var(--bull); }
.down { color: var(--bear); }

.inline-spark { display: inline-block; vertical-align: middle; margin-right: 8px; }
.inline-bar {
  display: inline-block;
  height: 6px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  position: relative;
}
.inline-bar > i {
  display: block;
  height: 100%;
  background: var(--ink-0);
  border-radius: 999px;
}


/* ============================================================
   DONUT RING + PROGRESS RING (replace horizontal bars)
   ============================================================ */
.ring {
  position: relative;
  display: grid;
  place-items: center;
}
.ring svg { transform: rotate(-90deg); }
.ring-val {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.ring-val .big {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-0);
  line-height: 1;
}
.ring-val .sm {
  font-size: 9px;
  color: var(--ink-3);
  margin-top: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   ANALYST / VERDICT
   ============================================================ */
.verdict-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
}
.verdict-gauge {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
}
.verdict-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.verdict-center .label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
  font-weight: 500;
}
.verdict-center .verdict {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-0);
  font-style: normal;
}
.verdict-center .score {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 6px;
  font-weight: 500;
}

.verdict-breakdown { display: flex; flex-direction: column; gap: 10px; }
.vb-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  gap: 14px;
  align-items: center;
  font-size: 12px;
}
.vb-row .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.vb-row .track {
  height: 4px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.vb-row .fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 999px;
  background: var(--ink-0);
}
.vb-row .fill.amber,
.vb-row .fill.mint,
.vb-row .fill.rose { background: var(--ink-0); }
.vb-row .v {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-1);
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   SIGNALS (bull/bear) inside violet tint
   ============================================================ */
.signal-col { display: flex; flex-direction: column; gap: 12px; }
.signal-col-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}
.signal-col-head .ico {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.signal-col-head.bull .ico { background: var(--bull-tint); color: var(--bull-deep); }
.signal-col-head.bear .ico { background: var(--bear-tint); color: var(--bear-deep); }
.signal-col-head .ttl {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: -0.01em;
}
.signal-col-head .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  padding: 3px 8px;
  background: var(--paper-2);
  border-radius: 999px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.signal-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-md);
  transition: all .15s var(--ease-out);
  box-shadow: var(--sh-xs);
}
.signal-item:hover {
  border-color: var(--line-2);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.signal-item .num-badge {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.signal-item.bull .num-badge { background: var(--bull-tint); color: var(--bull-deep); border-color: var(--bull-line); }
.signal-item.bear .num-badge { background: var(--bear-tint); color: var(--bear-deep); border-color: var(--bear-line); }

.signal-item .body { min-width: 0; }
.signal-item .head {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.signal-item .desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 6px;
}
.signal-item .meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.signal-item .conf {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--bull-deep);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.signal-item.bear .conf { color: var(--bear-deep); }
.signal-item .conf .sm {
  display: block;
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}

/* ============================================================
   AI ASSISTANT — flat dark, minimal
   ============================================================ */
.ai-hero {
  position: relative;
  padding: 32px;
  border-radius: var(--r-lg);
  background: #0B0D10;
  border: 1px solid #1A1D21;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.ai-hero::before { display: none; }
.ai-hero::after { display: none; }
.ai-hero > * { position: relative; z-index: 1; }

.ai-hero .eyebrow {
  color: rgb(255 255 255 / 0.5);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ai-hero .eyebrow .spark {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  color: rgb(255 255 255 / 0.8);
}
.ai-hero h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 20px;
  color: #fff;
  max-width: 700px;
}
.ai-hero h3 em { font-style: normal; color: rgb(255 255 255 / 0.5); font-weight: 400; }

.ai-prompts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.ai-prompt {
  padding: 12px 14px;
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--r-md);
  font-size: 12px;
  color: rgb(255 255 255 / 0.85);
  text-align: left;
  transition: all .15s var(--ease-out);
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
}
.ai-prompt:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(196 181 253 / 0.4);
  transform: translateY(-1px);
}
.ai-prompt .ico { color: rgb(255 255 255 / 0.5); flex-shrink: 0; }

.ai-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 18px;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.15);
  border-radius: var(--r-lg);
  backdrop-filter: blur(10px);
  transition: all .15s var(--ease-out);
}
.ai-input:focus-within {
  background: rgb(255 255 255 / 0.12);
  border-color: rgb(255 255 255 / 0.4);
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.08);
}
.ai-input input {
  flex: 1;
  background: none;
  border: 0;
  color: #fff;
  font-size: 13.5px;
  font-family: var(--font-sans);
  padding: 10px 0;
  outline: 0;
  letter-spacing: -0.005em;
}
.ai-input input::placeholder { color: rgb(255 255 255 / 0.5); }
.ai-input .send {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
  color: #fff;
  border-radius: var(--r-md);
  box-shadow: 0 2px 8px rgb(124 58 237 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.2);
  transition: transform .15s var(--ease-out);
}
.ai-input .send:hover { transform: scale(1.05); }

/* ============================================================
   TOP STOCKS — Stripe-like pricing cards
   ============================================================ */
.top-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.top-card {
  position: relative;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  transition: all .2s var(--ease-out);
  overflow: hidden;
  cursor: pointer;
}
.top-card:hover {
  border-color: var(--line-cool-2);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.top-card.featured {
  background: var(--surface);
  border-color: var(--ink-0);
  border-width: 1.5px;
}
.top-card.featured::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--ink-0);
}

.tc-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--r-xs);
  background: var(--ink-0);
  color: #fff;
}

.tc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.tc-logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
  color: #fff;
}
.tc-meta { flex: 1; min-width: 0; }
.tc-tk {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-0);
  letter-spacing: -0.01em;
}
.tc-name {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.tc-price .big {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink-0);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tc-price .ch {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: var(--r-xs);
}
.tc-price .ch.up { color: var(--bull-deep); background: var(--bull-tint); }
.tc-price .ch.down { color: var(--bear-deep); background: var(--bear-tint); }

.tc-spark {
  height: 34px;
  margin: 0 -4px 16px;
}

.tc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-cool);
}
.tc-stat .k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 2px;
}
.tc-stat .v {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.tc-stat .v.up { color: var(--bull); }
.tc-stat .v.down { color: var(--bear); }

/* Company logo backgrounds */
.logo-aapl { background: linear-gradient(135deg, #1D1D1F, #000); }
.logo-nvda { background: linear-gradient(135deg, #76B900, #5A8F00); }
.logo-msft { background: linear-gradient(135deg, #F25022, #7FBA00 33%, #00A4EF 66%, #FFB900); }
.logo-tsla { background: linear-gradient(135deg, #CC0000, #E31937); }
.logo-meta { background: linear-gradient(135deg, #0081FB, #0064E0); }
.logo-googl { background: linear-gradient(135deg, #4285F4, #DB4437 50%, #F4B400 75%, #0F9D58); }
.logo-amzn { background: linear-gradient(135deg, #232F3E, #FF9900); }
.logo-avgo { background: linear-gradient(135deg, #CC092F, #A0072B); }
.logo-crm { background: linear-gradient(135deg, #00A1E0, #0070D2); }

/* ============================================================
   NEWS
   ============================================================ */
.news-feed { display: flex; flex-direction: column; }
.news-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding .15s var(--ease-out);
}
.news-row:last-child { border-bottom: 0; }
.news-row:hover { padding-left: 8px; }
.news-row:hover .nr-title { color: var(--ink-2); }

.nr-body { min-width: 0; }
.nr-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.nr-src {
  color: var(--ink-1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9.5px;
}
.nr-sep { color: var(--ink-5); }
.nr-sent {
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nr-sent.pos { background: var(--bull-tint); color: var(--bull-deep); }
.nr-sent.neu { background: var(--paper-2); color: var(--ink-2); }
.nr-sent.neg { background: var(--bear-tint); color: var(--bear-deep); }

.nr-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-0);
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  transition: color .15s;
}
.nr-snip {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 85%;
}
.nr-thumb {
  width: 104px; height: 104px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-cool);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.nr-thumb.g-1 { background: #F1F3F5; }
.nr-thumb.g-2 { background: #E9ECEF; }
.nr-thumb.g-3 { background: #F1F3F5; }
.nr-thumb.g-4 { background: #E9ECEF; }
.nr-thumb.g-5 { background: #F1F3F5; }

/* ============================================================
   RAIL (right side)
   ============================================================ */
.rail-section { padding: 24px 22px; border-bottom: 1px solid var(--line); }
.rail-section:last-child { border-bottom: 0; }
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.rail-head .ttl {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rail-head .ttl::before {
  content: ''; width: 10px; height: 1px; background: var(--ink-4);
}
.rail-head .more {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color .15s;
}
.rail-head .more:hover { color: var(--ink-0); }

.watch-item {
  display: grid;
  grid-template-columns: 1fr 60px auto;
  gap: 10px;
  align-items: center;
  padding: 10px 4px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
}
.watch-item:hover { background: rgb(15 23 42 / 0.03); }
.watch-item .tk {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: -0.01em;
}
.watch-item .nm {
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-item .spk { grid-row: span 2; }
.watch-item .px {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-0);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.watch-item .ch {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   PEERS + KPI compare grid
   ============================================================ */
.peers-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.peers-rows { display: flex; flex-direction: column; border-right: 1px solid var(--line-cool); }
.peers-row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-cool);
  display: flex;
  align-items: center;
  gap: 12px;
}
.peers-row:last-child { border-bottom: 0; }
.peers-row .pk-logo { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: #fff; }
.peers-row .pk-info { min-width: 0; flex: 1; }
.peers-row .pk-tk { font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; color: var(--ink-0); }
.peers-row .pk-nm { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peers-row.me { background: var(--paper-2); }
.peers-row.me .pk-tk { color: var(--ink-0); font-weight: 700; }

.peers-metrics {
  display: flex;
  flex-direction: column;
  overflow-x: auto;
}
.peers-metric-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--line-cool);
  min-height: 63px;
}
.peers-metric-row:last-child { border-bottom: 0; }
.peers-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--line-cool);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.peers-cell:last-child { border-right: 0; }
.peers-cell .k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.peers-cell .v {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.peers-metric-row.me { background: var(--paper-2); }
.peers-metric-row.me .v { color: var(--ink-0); font-weight: 600; }

/* ============================================================
   EARNINGS / TIMELINE
   ============================================================ */
.earn-list { display: flex; flex-direction: column; gap: 10px; }
.earn-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-cool);
  border-radius: var(--r-md);
  align-items: center;
  transition: all .15s var(--ease-out);
}
.earn-row:hover { border-color: var(--line-cool-2); box-shadow: var(--sh-sm); }
.earn-row.upcoming { background: var(--paper-2); border-color: var(--line-2); }
.earn-date {
  text-align: center;
  padding: 6px 0;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.earn-row.upcoming .earn-date { background: var(--ink-0); border-color: var(--ink-0); }
.earn-row.upcoming .earn-date .m { color: rgb(255 255 255 / 0.7); }
.earn-row.upcoming .earn-date .d { color: #fff; }
.earn-date .m {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.earn-date .d {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-0);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.earn-body .q {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.earn-body .stats {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}
.earn-body .stats .s { display: flex; align-items: center; gap: 6px; }
.earn-body .stats .s .k { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-size: 9.5px; }
.earn-body .stats .s .beat.pos { color: var(--bull); font-weight: 600; }
.earn-body .stats .s .beat.neg { color: var(--bear); font-weight: 600; }

.earn-react {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
}
.earn-react.up { background: var(--bull-tint); color: var(--bull-deep); }
.earn-react.down { background: var(--bear-tint); color: var(--bear-deep); }
.earn-react.pending { background: var(--paper-2); color: var(--ink-2); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 40px 48px 28px;
  border-top: 1px solid var(--line);
  margin-top: 60px;
  background: var(--paper-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}
.footer h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a {
  font-size: 12.5px;
  color: var(--ink-1);
  text-decoration: none;
  transition: color .15s;
}
.footer a:hover { color: var(--ink-0); }
.footer-brand h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  margin: 0 0 8px;
}
.footer-brand h4 em { color: var(--ink-3); font-style: normal; }
.footer-brand p { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; max-width: 320px; margin: 0; }

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* ============================================================
   MISC: detail-row, hover cursor, etc
   ============================================================ */
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row .k {
  font-family: var(--font-sans);
  color: var(--ink-2);
  font-weight: 500;
}
.kv-row .v {
  font-family: var(--font-mono);
  color: var(--ink-0);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.kv-row .v.up { color: var(--bull); }
.kv-row .v.down { color: var(--bear); }

/* Insight callout — flat neutral */
.insight {
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ink-0);
  border-radius: var(--r-sm);
  margin-top: 16px;
}
.insight .ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-0);
  padding: 3px 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  margin-bottom: 10px;
}
.insight .text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-0);
  letter-spacing: -0.015em;
}
.insight .text em { font-style: normal; color: var(--ink-3); }

/* Section navigation (jump pills near section heads) */
.jump {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* small badge */
.ib {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-xs);
}
.ib.violet,
.ib.amber,
.ib.mint,
.ib.rose,
.ib.slate { background: var(--paper-2); color: var(--ink-0); border: 1px solid var(--line); }


/* ============================================================
   PAGE-LEVEL STYLES — Markets / Screener / Portfolio / AI Lab
   ============================================================ */

/* ----- Markets hero ----- */
.mk-hero {
  padding: 32px 40px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.mk-hero-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
}
.mk-hero-meta .dot { width: 3px; height: 3px; background: var(--ink-4); border-radius: 50%; }
.mk-hero-meta .live { color: var(--bull-deep); }
.mk-hero-meta .live::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--bull); border-radius: 50%; margin-right: 6px;
  animation: mk-pulse 2s infinite;
}
@keyframes mk-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.mk-hero-title {
  font-family: var(--font-display); font-size: 40px; font-weight: 500;
  letter-spacing: -0.035em; line-height: 1.05; color: var(--ink-0);
  margin: 16px 0 20px; max-width: 820px; text-wrap: pretty;
}
.mk-hero-title em { font-style: normal; color: var(--ink-3); }

.mk-hero-kpis {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0; border-top: 1px solid var(--line); padding-top: 18px;
}
.mk-hk {
  padding: 0 20px 0 0; border-right: 1px solid var(--line);
}
.mk-hk:last-child { border-right: 0; }
.mk-hk .k {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; margin-bottom: 6px;
}
.mk-hk .v {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: -0.03em; color: var(--ink-0);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.mk-hk .d {
  font-family: var(--font-mono); font-size: 11.5px;
  margin-top: 4px; font-weight: 500;
}
.mk-hk .d.up { color: var(--bull-deep); }
.mk-hk .d.down { color: var(--bear-deep); }
.mk-hk .spk { margin-top: 6px; }

/* ----- Shared table styles ----- */
.mk-idx .mk-ix-name {
  font-family: var(--font-display); font-weight: 600;
  color: var(--ink-0); letter-spacing: -0.015em;
}

/* ----- Heatmap ----- */
.hm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.hm-sec {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  overflow: hidden;
}
.hm-sec-hd {
  padding: 9px 12px; background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-2);
}
.hm-sec-hd :last-child { color: var(--ink-4); }
.hm-grid { display: flex; min-height: 110px; flex-wrap: wrap; }
.hm-tile {
  min-width: 40px; min-height: 54px; padding: 8px 10px;
  border-right: 1px solid rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; transition: filter 0.12s;
}
.hm-tile:hover { filter: brightness(1.08); }
.hm-tile .tk {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
}
.hm-tile .ch {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.hm-legend {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
}
.hm-legend .bar {
  width: 80px; height: 8px; border-radius: 2px;
  background: linear-gradient(90deg, #DC2626, #FEE2E2, #F1F3F5, #DCFCE7, #16A34A);
}

/* ----- Sectors ----- */
.sec-list { display: flex; flex-direction: column; }
.sec-row {
  display: grid;
  grid-template-columns: 160px 80px 1fr 80px;
  align-items: center; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.sec-row:last-child { border-bottom: 0; }
.sec-name { font-weight: 500; color: var(--ink-0); font-size: 13px; }
.sec-mcap { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.sec-bar {
  position: relative; height: 12px; background: var(--paper-2); border-radius: 2px;
}
.sec-bar .axis {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: var(--ink-4);
}
.sec-bar .fill {
  position: absolute; top: 0; bottom: 0; border-radius: 2px;
}
.sec-bar .fill.up { background: var(--bull); }
.sec-bar .fill.down { background: var(--bear); }
.sec-pct {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  text-align: right; font-variant-numeric: tabular-nums;
}
.sec-pct.up { color: var(--bull-deep); }
.sec-pct.down { color: var(--bear-deep); }

/* ----- Movers ----- */
.mov-card .tbl.compact td { padding: 10px 14px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.mov-card .tbl.compact tbody tr:last-child td { border-bottom: 0; }
.mov-card .tbl.compact tr:hover td { background: var(--paper-2); }

/* ----- Calendar ----- */
.cty-pill {
  display: inline-block; padding: 2px 7px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 3px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--ink-2);
}
.imp-dots { display: inline-flex; gap: 3px; }
.imp-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--line);
  display: block;
}
.imp-dots i.on { background: var(--ink-0); }

/* ----- Headlines ----- */
.mk-head-row {
  display: grid; grid-template-columns: 88px 1fr;
  align-items: center; gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background 0.1s;
}
.mk-head-row:last-child { border-bottom: 0; }
.mk-head-row:hover { background: var(--paper-2); }
.mk-head-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; padding: 3px 8px;
  background: var(--ink-0); color: #fff;
  border-radius: 3px; text-align: center; width: fit-content;
}
.mk-head-meta {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); margin-bottom: 5px;
}
.mk-head-meta .src { color: var(--ink-0); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.mk-head-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--ink-0); line-height: 1.4;
}

/* ----- Macro grid ----- */
.macro-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-top: 16px;
}
.macro-col { margin: 0; }
.macro-hd {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px;
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-0);
}
.macro-rows { padding: 6px 0; }
.macro-row {
  display: grid; grid-template-columns: 1fr auto 64px;
  align-items: baseline; gap: 12px;
  padding: 8px 16px; font-size: 12px;
}
.macro-row .k { color: var(--ink-2); }
.macro-row .v {
  font-family: var(--font-mono); font-weight: 600; color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.macro-row .ch {
  font-family: var(--font-mono); font-size: 11px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.macro-row .ch.up { color: var(--bull-deep); }
.macro-row .ch.down { color: var(--bear-deep); }

/* ============================================================
   SCREENER
   ============================================================ */
.saved-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-top: 16px;
}
.saved-card {
  background: #fff; border: 1px solid var(--line);
  padding: 14px 16px; border-radius: var(--r-sm);
  text-align: left; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.saved-card:hover { border-color: var(--ink-4); }
.saved-card.active {
  border-color: var(--ink-0); box-shadow: 0 0 0 1px var(--ink-0);
}
.sv-top { display: flex; justify-content: space-between; align-items: center; }
.sv-tk {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink-0);
}
.sv-n {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--ink-3); letter-spacing: 0.05em;
}
.sv-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.sv-spark { margin-top: auto; opacity: 0.7; }

.filter-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.f-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px; background: var(--ink-0); color: #fff;
  border-radius: var(--r-sm); font-size: 12px;
}
.f-chip .k { font-weight: 500; }
.f-chip .op {
  font-family: var(--font-mono); color: var(--ink-5);
  padding: 0 4px;
}
.f-chip .v { font-family: var(--font-mono); font-weight: 600; }
.f-chip .x {
  color: var(--ink-5); font-size: 14px; padding: 0 4px;
  line-height: 1;
}
.f-chip .x:hover { color: #fff; }
.f-add {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1px dashed var(--line-2);
  border-radius: var(--r-sm); font-size: 11.5px; color: var(--ink-3);
  font-family: var(--font-mono); letter-spacing: 0.05em;
}
.f-add:hover { border-color: var(--ink-0); color: var(--ink-0); }

.filter-presets {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}

.sc-table tbody tr:hover td { background: var(--paper-2); }
.ai-score {
  display: flex; align-items: center; gap: 8px;
}
.ai-score .bar {
  flex: 1; height: 5px; background: var(--paper-2);
  border-radius: 2px; overflow: hidden; max-width: 80px;
}
.ai-score .bar i {
  display: block; height: 100%; background: var(--ink-0);
}
.ai-score .val {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--ink-0); min-width: 22px; text-align: right;
}
.row-act {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 3px; color: var(--ink-3);
}
.row-act:hover { background: var(--paper-2); color: var(--ink-0); }

.sc-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 0 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}

.factor-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px 28px;
}
.factor-item { display: grid; grid-template-columns: 90px 1fr 36px; align-items: center; gap: 10px; }
.factor-item .fi-k {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 600;
}
.factor-item .fi-bar {
  height: 6px; background: var(--paper-2); border-radius: 2px; overflow: hidden;
  position: relative;
}
.factor-item .fi-bar .fill { height: 100%; display: block; }
.factor-item .fi-bar .fill.up { background: var(--bull); }
.factor-item .fi-bar .fill.down { background: var(--bear); }
.factor-item .fi-bar .fill.neu { background: var(--ink-3); }
.factor-item .fi-v {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  text-align: right;
}
.factor-item .fi-v.up { color: var(--bull-deep); }
.factor-item .fi-v.down { color: var(--bear-deep); }
.factor-item .fi-v.neu { color: var(--ink-2); }

/* ============================================================
   PORTFOLIO
   ============================================================ */
.pf-hero {
  padding: 32px 40px 32px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-md);
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px;
}
.pf-hero-left { display: flex; flex-direction: column; gap: 10px; }
.pf-total {
  font-family: var(--font-display); display: flex; align-items: baseline;
  letter-spacing: -0.045em; line-height: 1; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.pf-total .cur { font-size: 32px; font-weight: 500; color: var(--ink-3); margin-right: 2px; }
.pf-total .big { font-size: 64px; font-weight: 600; color: var(--ink-0); }
.pf-total .cents { font-size: 32px; font-weight: 500; color: var(--ink-3); }
.pf-delta { display: flex; align-items: center; gap: 14px; }
.pf-delta .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pf-delta .pill.up { background: var(--bull-soft); color: var(--bull-deep); }
.pf-delta .pill.down { background: var(--bear-soft); color: var(--bear-deep); }
.pf-delta .ah .lbl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
}
.pf-actions { display: flex; gap: 8px; margin-top: 12px; }
.pf-actions .btn {
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500; color: var(--ink-0); background: #fff;
}
.pf-actions .btn:hover { border-color: var(--ink-0); }
.pf-actions .btn.primary {
  background: var(--ink-0); color: #fff; border-color: var(--ink-0);
}
.pf-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--paper);
}
.pf-kpi {
  padding: 14px 18px; border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); background: #fff;
}
.pf-kpi .k {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; margin-bottom: 5px;
}
.pf-kpi .v {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1; color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.pf-kpi .v.up { color: var(--bull-deep); }
.pf-kpi .v.down { color: var(--bear-deep); }
.pf-kpi .s {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  margin-top: 5px;
}

.pf-table tbody tr:hover td { background: var(--paper-2); }
.pf-table tr.cash-row td {
  background: var(--paper-2);
  font-weight: 500;
}

.pf-legend {
  display: flex; align-items: center; gap: 20px; margin-top: 14px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2);
}
.pf-legend i {
  display: inline-block; width: 14px; height: 2px; margin-right: 6px;
  vertical-align: middle; border-radius: 1px;
}
.pf-legend .sp { margin-left: auto; color: var(--ink-3); }

.sa-list { display: flex; flex-direction: column; }
.sa-row {
  display: grid; grid-template-columns: 140px 1fr 110px;
  align-items: center; gap: 14px; padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.sa-row:last-child { border-bottom: 0; }
.sa-k { font-size: 12px; font-weight: 500; color: var(--ink-0); }
.sa-bars { display: flex; flex-direction: column; gap: 3px; }
.sa-bar-me, .sa-bar-bm {
  height: 6px; background: var(--paper-2); border-radius: 2px; overflow: hidden;
}
.sa-bar-me i { display: block; height: 100%; background: var(--ink-0); }
.sa-bar-bm i { display: block; height: 100%; background: var(--ink-4); }
.sa-nums {
  display: flex; justify-content: flex-end; gap: 10px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.sa-nums .me { font-size: 12px; font-weight: 600; color: var(--ink-0); }
.sa-nums .diff { font-size: 11px; }
.sa-nums .diff.up { color: var(--bull-deep); }
.sa-nums .diff.down { color: var(--bear-deep); }
.sa-legend {
  display: flex; gap: 20px; padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2);
}
.sa-legend i {
  display: inline-block; width: 10px; height: 6px; margin-right: 6px;
  vertical-align: middle; border-radius: 2px;
}

.conc-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.conc-top .big-num {
  font-family: var(--font-display); font-size: 40px; font-weight: 600;
  letter-spacing: -0.03em; color: var(--ink-0); line-height: 1; margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.conc-top .sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.conc-list { display: flex; flex-direction: column; gap: 6px; }
.conc-row {
  display: grid; grid-template-columns: 60px 1fr 50px;
  align-items: center; gap: 10px; font-size: 12px;
}
.conc-row .tk { font-family: var(--font-mono); font-weight: 600; }
.conc-row .bar {
  height: 6px; background: var(--paper-2); border-radius: 2px; overflow: hidden;
}
.conc-row .bar i { display: block; height: 100%; background: var(--ink-0); }
.conc-row .w {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  text-align: right; font-variant-numeric: tabular-nums;
}

.sug-row {
  display: grid; grid-template-columns: 80px 60px 1fr 130px 80px;
  align-items: center; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.sug-row:last-child { border-bottom: 0; }
.sug-row:hover { background: var(--paper-2); }
.sug-act {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; padding: 3px 8px; border-radius: 3px;
  text-align: center;
}
.sug-tk {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em;
}
.sug-txt { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.sug-conf {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}

/* ============================================================
   AI LAB
   ============================================================ */
.ai-hero-band { grid-template-columns: 1.2fr 1fr; }

.model-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-top: 16px;
}
.model-card {
  background: #fff; border: 1px solid var(--line);
  padding: 16px; border-radius: var(--r-sm);
  text-align: left; display: flex; flex-direction: column; gap: 10px;
  transition: all 0.15s;
}
.model-card:hover { border-color: var(--ink-4); }
.model-card.active { border-color: var(--ink-0); box-shadow: 0 0 0 1px var(--ink-0); }
.mc-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mc-name {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink-0);
}
.mc-status {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase;
}
.mc-status.prod { background: var(--bull-soft); color: var(--bull-deep); }
.mc-status.beta { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.mc-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.mc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.mc-stats > div {}
.mc-stats .k {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 3px;
}
.mc-stats .v {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--ink-0);
}
.mc-stats .v.up { color: var(--bull-deep); }

.feat-list { display: flex; flex-direction: column; gap: 4px; }
.feat-row {
  display: grid; grid-template-columns: 44px 1fr 120px 32px;
  align-items: center; gap: 12px; padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.feat-row:last-child { border-bottom: 0; }
.feat-grp {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; padding: 2px 5px; border-radius: 2px;
  text-align: center;
}
.feat-k { font-size: 12px; color: var(--ink-0); }
.feat-bar {
  height: 5px; background: var(--paper-2); border-radius: 2px; overflow: hidden;
}
.feat-bar i { display: block; height: 100%; }
.feat-v {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-align: right; color: var(--ink-0);
}
.feat-legend {
  display: flex; gap: 16px; padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-2);
}
.feat-legend i {
  display: inline-block; width: 10px; height: 6px; margin-right: 6px;
  vertical-align: middle; border-radius: 2px;
}

.bt-stats {
  display: grid; grid-template-columns: repeat(6, 1fr);
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.bt-stats > div {
  padding: 0 14px; border-right: 1px solid var(--line);
}
.bt-stats > div:last-child { border-right: 0; }
.bt-stats > div:first-child { padding-left: 0; }
.bt-stats .k {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 3px;
}
.bt-stats .v {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  letter-spacing: -0.025em; color: var(--ink-0);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.bt-stats .v.up { color: var(--bull-deep); }
.bt-stats .v.down { color: var(--bear-deep); }

.anom-row {
  display: grid; grid-template-columns: 72px 56px 1fr 80px 100px;
  align-items: center; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.anom-row:last-child { border-bottom: 0; }
.anom-row:hover { background: var(--paper-2); }
.anom-sev {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; padding: 3px 8px; border-radius: 3px;
  text-align: center;
}
.anom-tk {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em;
}
.anom-t { font-size: 13px; color: var(--ink-0); font-weight: 500; }
.anom-det { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.anom-time {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}

.regime-list {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line);
}
.regime-row {
  display: grid; grid-template-columns: 140px 1fr 50px;
  align-items: center; gap: 12px; padding: 6px 0;
  font-size: 12px; color: var(--ink-2);
}
.regime-row.active { color: var(--ink-0); font-weight: 600; }
.regime-row .bar {
  height: 5px; background: var(--paper-2); border-radius: 2px; overflow: hidden;
}
.regime-row .bar i { display: block; height: 100%; background: var(--ink-3); }
.regime-row.active .bar i { background: var(--ink-0); }
.regime-row .v {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  text-align: right; font-variant-numeric: tabular-nums;
}

.train-list { display: flex; flex-direction: column; gap: 14px; }
.train-row {
  padding: 14px; background: var(--paper-2); border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.train-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.train-top .n {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: -0.02em;
}
.train-top .eta {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  letter-spacing: 0.08em;
}
.train-bar {
  height: 4px; background: #fff; border: 1px solid var(--line);
  border-radius: 2px; overflow: hidden;
}
.train-bar i {
  display: block; height: 100%; background: var(--ink-0);
  transition: width 0.3s;
}
.train-foot {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
}
.train-foot .gpu { color: var(--ink-0); font-weight: 600; }

/* inline bar helper */
.inline-bar {
  display: inline-block; height: 4px; background: var(--paper-2);
  border-radius: 2px; overflow: hidden; vertical-align: middle;
}
.inline-bar i { display: block; height: 100%; background: var(--ink-0); }


/* AI narrator streaming caret — blinks while text reveal animation runs */
@keyframes af-caret-blink {
  0%   { opacity: 1; }
  100% { opacity: 0.15; }
}

/* AI Analyst card loading spinner — used in <AIAnalystCard/> */
@keyframes tp-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ====================================================================
   Dark theme v2 — full component-level adoption of Landing v2 visual
   language. Block 2 of 2 (token block above just remaps colour values;
   this block replaces COMPONENT styling so /app cards, buttons, tabs,
   nav, headings, live dots etc. read 1:1 like the marketing landing.
   Light theme is untouched — every selector here is gated on
   :root[data-theme="dark"].
   Source: src/dashboard/editorial-static/landing-v2.css (2026-05-04).
   ==================================================================== */

/* New tokens introduced for landing-v2 parity. Existing tokens are
   already remapped in the block at line 126; these add what was missing. */
:root[data-theme="dark"] {
  --grn-0: #4ADE80;
  --grn-1: #22C55E;
  --grn-2: #16A34A;
  --grn-3: #15803D;
  --grn-glow:        rgba(74, 222, 128, 0.32);
  --grn-glow-strong: rgba(74, 222, 128, 0.55);
  --grn-glow-soft:   rgba(74, 222, 128, 0.10);
  --red-soft: rgba(248, 113, 113, 0.10);
  --red-line: rgba(248, 113, 113, 0.32);
}

/* ── Buttons — gradient-green primary, frosted secondary ────────── */
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] button.btn-primary,
:root[data-theme="dark"] a.btn-primary {
  background: linear-gradient(180deg, var(--grn-0), var(--grn-2));
  color: #052E16;
  border: 1px solid var(--grn-2);
  box-shadow: 0 0 0 1px var(--grn-glow), 0 6px 18px rgba(74, 222, 128, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
}
:root[data-theme="dark"] .btn-primary:hover,
:root[data-theme="dark"] button.btn-primary:hover,
:root[data-theme="dark"] a.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--grn-glow-strong), 0 12px 32px rgba(74, 222, 128, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Secondary / ghost — frosted-glass white-low-alpha pill, hovers
   green-tinted. Mirrors landing .btn-secondary semantics on app classes
   that play the same role. */
:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] button.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-0);
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: background .15s ease, border-color .15s ease;
}
:root[data-theme="dark"] .btn-secondary:hover,
:root[data-theme="dark"] .btn-ghost:hover,
:root[data-theme="dark"] button.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ── Chip / pill (used as inline tag + filter buttons) ──────────── */
:root[data-theme="dark"] .chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink-1);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
:root[data-theme="dark"] .chip:hover {
  background: var(--grn-glow-soft);
  border-color: var(--grn-glow);
  color: var(--ink-0);
}
:root[data-theme="dark"] .chip.up,
:root[data-theme="dark"] .chip.bull {
  background: var(--bull-tint);
  border-color: var(--bull-line);
  color: var(--grn-0);
}
:root[data-theme="dark"] .chip.down,
:root[data-theme="dark"] .chip.bear {
  background: var(--bear-tint);
  border-color: var(--bear-line);
  color: #FCA5A5;
}

/* ── Cards — green halo on hover (was just sh-md before) ────────── */
:root[data-theme="dark"] .card {
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
:root[data-theme="dark"] .card:hover {
  border-color: rgba(74, 222, 128, 0.22);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.10), 0 12px 36px -8px rgba(74, 222, 128, 0.14), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
/* The data-accent strip in editorial maps to var(--ink-0) on dark.
   Override so accent strips along card top/left use brand green. */
:root[data-theme="dark"] .card[data-accent="mint"]::before,
:root[data-theme="dark"] .card[data-accent="bull"]::before,
:root[data-theme="dark"] .card[data-accent="ai"]::before {
  background: linear-gradient(180deg, var(--grn-0), var(--grn-2));
}
:root[data-theme="dark"] .card[data-accent="bear"]::before,
:root[data-theme="dark"] .card[data-accent="rose"]::before {
  background: linear-gradient(180deg, #F87171, #DC2626);
}

/* ── Tabs — active tab gets green underline ───────────────────── */
:root[data-theme="dark"] .tab.active {
  color: var(--ink-0);
  border-bottom-color: var(--grn-0);
  box-shadow: 0 1px 0 0 var(--grn-glow);
}
:root[data-theme="dark"] .tab:hover { color: var(--ink-0); }

/* ── Live indicators — pulsing green dot, mirrors landing .live ── */
@keyframes tp-pulse-grn {
  0%, 100% { box-shadow: 0 0 0 0 var(--grn-glow); }
  50%      { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}
:root[data-theme="dark"] .live::before,
:root[data-theme="dark"] .live-dot,
:root[data-theme="dark"] .status-dot,
:root[data-theme="dark"] .dot.live {
  background: var(--grn-0);
  animation: tp-pulse-grn 1.6s ease-in-out infinite;
}
:root[data-theme="dark"] .status-pill {
  background: rgba(74, 222, 128, 0.08);
  border-color: var(--grn-glow);
  color: var(--grn-0);
}

/* ── Hero / headline gradient — green→mint on emphasized words ── */
:root[data-theme="dark"] h1 em,
:root[data-theme="dark"] .mk-hero-title em,
:root[data-theme="dark"] .hero-title em,
:root[data-theme="dark"] h1 .accent,
:root[data-theme="dark"] h1 .gradient,
:root[data-theme="dark"] .gradient-text {
  background: linear-gradient(135deg, var(--grn-0) 0%, var(--grn-1) 60%, #86EFAC 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-style: normal;
}

/* ── Top bar / nav frosted-glass effect ────────────────────────── */
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .app-topbar,
:root[data-theme="dark"] .nv,
:root[data-theme="dark"] .navbar {
  background: rgba(5, 7, 6, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

/* ── Sidebar / left rail — solid surface, green accent on active ─ */
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .nav-rail {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
}
:root[data-theme="dark"] .sidebar a.active,
:root[data-theme="dark"] .nav-rail a.active,
:root[data-theme="dark"] .sidebar [aria-current="page"],
:root[data-theme="dark"] .nav-rail [aria-current="page"] {
  background: var(--grn-glow-soft);
  color: var(--grn-0);
  border-left: 2px solid var(--grn-0);
}

/* ── Form focus rings — green tinted (was violet before) ───────── */
:root[data-theme="dark"] input:focus-visible,
:root[data-theme="dark"] textarea:focus-visible,
:root[data-theme="dark"] select:focus-visible,
:root[data-theme="dark"] button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--grn-glow), 0 0 24px -4px var(--grn-glow);
}

/* ── Scrollbars (WebKit) — slim green-on-graphite ──────────────── */
:root[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
:root[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--paper); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  border: 2px solid var(--paper);
}
:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--grn-glow);
}

/* ── Subtle texture: top-of-page green halo (matches landing hero) ─ */
:root[data-theme="dark"] body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 320px;
  background: radial-gradient(ellipse 60% 100% at 30% -10%, rgba(74, 222, 128, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Stat / KPI tiles — match landing hero-meta + tile feel ──── */
:root[data-theme="dark"] .tile,
:root[data-theme="dark"] .kpi,
:root[data-theme="dark"] .stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
}
:root[data-theme="dark"] .tile .v.up,
:root[data-theme="dark"] .kpi .v.up,
:root[data-theme="dark"] .stat-tile .v.up,
:root[data-theme="dark"] .mono.up { color: var(--grn-0); }
:root[data-theme="dark"] .tile .v.down,
:root[data-theme="dark"] .kpi .v.down,
:root[data-theme="dark"] .stat-tile .v.down,
:root[data-theme="dark"] .mono.down { color: #F87171; }

/* ====================================================================
   Dark theme v2 — Block 3: tables, tints, numerical mono, section heads.
   Picks up the editorial-specific classes that aren't shared with the
   landing prototype but read as the same surface family in /app.
   Still light-theme safe (every selector under [data-theme="dark"]).
   ==================================================================== */

/* ── Tables: green-tint on row hover, mono numerics keep direction ── */
:root[data-theme="dark"] .tbl {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}
:root[data-theme="dark"] .tbl th {
  background: var(--paper-2);
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
:root[data-theme="dark"] .tbl td {
  border-bottom: 1px solid var(--line);
}
:root[data-theme="dark"] .tbl tr:hover td {
  background: var(--grn-glow-soft);
  color: var(--ink-0);
}
:root[data-theme="dark"] .tbl .num.up,
:root[data-theme="dark"] .tbl td.up,
:root[data-theme="dark"] .tbl .num.bull { color: var(--grn-0); }
:root[data-theme="dark"] .tbl .num.down,
:root[data-theme="dark"] .tbl td.down,
:root[data-theme="dark"] .tbl .num.bear { color: #F87171; }

/* ── Tints (the sectioned colored panels: mint/violet/amber/sky/navy) ──
   In dark+landing-v2 we want: mint = brand green, navy = bg-2, others
   muted to neutral so the page doesn't look like a Skittles bag. */
:root[data-theme="dark"] .tint {
  background: var(--surface);
  border: 1px solid var(--line);
}
:root[data-theme="dark"] .tint.mint {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.04), transparent 80%);
  border-color: var(--grn-glow);
}
:root[data-theme="dark"] .tint.mint .eyebrow,
:root[data-theme="dark"] .tint.mint h2 em {
  color: var(--grn-0);
}
:root[data-theme="dark"] .tint.violet,
:root[data-theme="dark"] .tint.amber,
:root[data-theme="dark"] .tint.sky {
  background: var(--surface);
  border-color: var(--line);
}
:root[data-theme="dark"] .tint.navy {
  background: var(--surface-2);
  border-color: var(--line-2);
}

/* ── Section heads / eyebrows — slim green accent before label ── */
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .sect-head .eyebrow,
:root[data-theme="dark"] .section-head .eyebrow {
  color: var(--grn-0);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
:root[data-theme="dark"] .eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--grn-0);
}

/* ── Mono / numerical — directional colors when class hints ── */
:root[data-theme="dark"] .mono.up,
:root[data-theme="dark"] .num.up,
:root[data-theme="dark"] [data-dir="up"] { color: var(--grn-0); }
:root[data-theme="dark"] .mono.down,
:root[data-theme="dark"] .num.down,
:root[data-theme="dark"] [data-dir="down"] { color: #F87171; }

/* ── Hero blocks (mk-hero used in pages-platform) — emphasize em ── */
:root[data-theme="dark"] .mk-hero {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.04) 0%, transparent 60%);
  border: 1px solid var(--line);
  border-radius: 14px;
}
:root[data-theme="dark"] .mk-hero-meta .live {
  color: var(--grn-0);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
:root[data-theme="dark"] .mk-hero-meta .live::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grn-0);
  animation: tp-pulse-grn 1.6s ease-in-out infinite;
}

/* ── Selection / highlight ── */
:root[data-theme="dark"] ::selection {
  background: rgba(74, 222, 128, 0.35);
  color: var(--ink-0);
}

/* ── Links ── */
:root[data-theme="dark"] a {
  color: var(--grn-0);
}
:root[data-theme="dark"] a:hover {
  color: #86EFAC;
  text-shadow: 0 0 12px var(--grn-glow);
}
/* Don't recolor links in nav/buttons that intentionally inherit. */
:root[data-theme="dark"] .nv-links a,
:root[data-theme="dark"] .sidebar a,
:root[data-theme="dark"] .nav-rail a,
:root[data-theme="dark"] .topbar a,
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .tab {
  color: inherit;
  text-shadow: none;
}

/* ====================================================================
   Dark theme v2 — Block 4: portfolio + uncovered cross-page classes.
   Audit (2026-05-04) flagged ~20 classes used by pages-portfolio.jsx,
   pages-agents.jsx, pages-decisions.jsx etc. with zero dark coverage.
   This block closes the gap so /app#portfolio stops showing white
   hero / KPI / button boxes on the green-graphite background.
   ==================================================================== */

/* ── Hardcoded #fff overrides — pf-hero/pf-kpi/pf-actions/model-card ── */
:root[data-theme="dark"] .pf-hero {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.04) 0%, transparent 60%), var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-0);
}
:root[data-theme="dark"] .pf-kpi {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-0);
}
:root[data-theme="dark"] .pf-actions .btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-0);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
:root[data-theme="dark"] .pf-actions .btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
:root[data-theme="dark"] .pf-actions .btn.primary,
:root[data-theme="dark"] .pf-actions .btn.btn-primary {
  background: linear-gradient(180deg, var(--grn-0), var(--grn-2));
  color: #052E16;
  border-color: var(--grn-2);
  box-shadow: 0 0 0 1px var(--grn-glow), 0 6px 18px rgba(74, 222, 128, 0.18);
}
:root[data-theme="dark"] .model-card {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-0);
}
:root[data-theme="dark"] .model-card:hover {
  border-color: rgba(74, 222, 128, 0.22);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.10), 0 12px 36px -8px rgba(74, 222, 128, 0.14);
}

/* ── pf-delta — up/down pill row ── */
:root[data-theme="dark"] .pf-delta .pill.up { background: var(--bull-tint); color: var(--grn-0); border-color: var(--bull-line); }
:root[data-theme="dark"] .pf-delta .pill.down { background: var(--bear-tint); color: #F87171; border-color: var(--bear-line); }
:root[data-theme="dark"] .pf-legend { color: var(--ink-2); }

/* ── Sector allocation (sa-*) — me=green, bm=neutral ── */
:root[data-theme="dark"] .sa-list,
:root[data-theme="dark"] .sa-row,
:root[data-theme="dark"] .sa-legend { color: var(--ink-1); }
:root[data-theme="dark"] .sa-row .sa-k { color: var(--ink-2); }
:root[data-theme="dark"] .sa-bars {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
}
:root[data-theme="dark"] .sa-bar-me { background: linear-gradient(90deg, var(--grn-0), var(--grn-2)); }
:root[data-theme="dark"] .sa-bar-bm { background: rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .sa-nums { color: var(--ink-2); }
:root[data-theme="dark"] .sa-nums .me { color: var(--grn-0); }

/* ── Concentration analysis (conc-*) ── */
:root[data-theme="dark"] .conc-top,
:root[data-theme="dark"] .conc-list,
:root[data-theme="dark"] .conc-row { color: var(--ink-1); border-color: var(--line); }
:root[data-theme="dark"] .conc-top .big-num { color: var(--ink-0); }
:root[data-theme="dark"] .conc-row .bar {
  background: rgba(255, 255, 255, 0.04);
}
:root[data-theme="dark"] .conc-row .bar > * {
  background: linear-gradient(90deg, var(--grn-0), var(--grn-2));
}

/* ── Suggestions (sug-*) — green tint hover, AI tag green ── */
:root[data-theme="dark"] .sug-row {
  border-bottom: 1px solid var(--line);
  transition: background .12s ease;
}
:root[data-theme="dark"] .sug-row:hover {
  background: var(--grn-glow-soft);
}
:root[data-theme="dark"] .sug-tk { color: var(--ink-0); font-weight: 600; }
:root[data-theme="dark"] .sug-txt { color: var(--ink-2); }
:root[data-theme="dark"] .sug-conf { color: var(--grn-0); }
:root[data-theme="dark"] .sug-act {
  background: linear-gradient(180deg, var(--grn-0), var(--grn-2));
  color: #052E16;
  border: 1px solid var(--grn-2);
}

/* ── AI tag / insight / ico-badge — small green pills ── */
:root[data-theme="dark"] .ai-tag,
:root[data-theme="dark"] .insight {
  background: var(--grn-glow-soft);
  color: var(--grn-0);
  border: 1px solid var(--grn-glow);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
:root[data-theme="dark"] .ico-badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-1);
}
:root[data-theme="dark"] .ico-badge.bull,
:root[data-theme="dark"] .ico-badge.mint,
:root[data-theme="dark"] .ico-badge.ai {
  background: var(--grn-glow-soft);
  border-color: var(--grn-glow);
  color: var(--grn-0);
}
:root[data-theme="dark"] .ico-badge.bear,
:root[data-theme="dark"] .ico-badge.rose {
  background: var(--bear-tint);
  border-color: var(--bear-line);
  color: #F87171;
}

/* ── Search pill (agents page) — chip with green hover ── */
:root[data-theme="dark"] .search-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink-1);
}
:root[data-theme="dark"] .search-pill:hover,
:root[data-theme="dark"] .search-pill:focus-within {
  background: var(--grn-glow-soft);
  border-color: var(--grn-glow);
}
:root[data-theme="dark"] .search-pill input,
:root[data-theme="dark"] .search-pill input:focus {
  background: transparent;
  color: var(--ink-0);
  border: none;
  outline: none;
  box-shadow: none;
}

/* ── Generic helpers — big-num, tag, inline-bar, cash-row ── */
:root[data-theme="dark"] .big-num,
:root[data-theme="dark"] .big {
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink-1);
}
:root[data-theme="dark"] .tag.up,  :root[data-theme="dark"] .tag.bull { background: var(--bull-tint); border-color: var(--bull-line); color: var(--grn-0); }
:root[data-theme="dark"] .tag.down, :root[data-theme="dark"] .tag.bear { background: var(--bear-tint); border-color: var(--bear-line); color: #F87171; }
:root[data-theme="dark"] .inline-bar {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}
:root[data-theme="dark"] .inline-bar > * {
  background: linear-gradient(90deg, var(--grn-0), var(--grn-2));
}
:root[data-theme="dark"] .cash-row {
  background: var(--grn-glow-soft);
  color: var(--grn-0);
}

/* ── Inline-block accent bar (.ib) — used as colored sigil in pages ── */
:root[data-theme="dark"] .ib { background: var(--ink-3); }
:root[data-theme="dark"] .ib.violet,
:root[data-theme="dark"] .ib.amber,
:root[data-theme="dark"] .ib.sky,
:root[data-theme="dark"] .ib.mint,
:root[data-theme="dark"] .ib.bull { background: var(--grn-0); }
:root[data-theme="dark"] .ib.rose,
:root[data-theme="dark"] .ib.bear { background: #F87171; }
:root[data-theme="dark"] .ib.navy { background: var(--ink-1); }

/* ── pf-table specific — keep table semantics + green hover ── */
:root[data-theme="dark"] .pf-table tr:hover td {
  background: var(--grn-glow-soft);
}

/* ====================================================================
   Charts Pro Merged — page-specific styles for the new /app#charts.
   The component (pages-charts-merged.jsx) wraps the existing PriceChart
   in a Pro Chart v2-style outer shell. Layout uses CSS grid; visuals
   pick up landing-v2 dark tokens via the editorial theme.
   ==================================================================== */
.cp-merged {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* min-height: 100% (not height) — let content drive total height
     when MTF stacks main+secondary chart vertically. height:100% was
     constraining the page-merged box, causing cp-body to overflow
     visually into the footer's space below. */
  min-height: 100%;
  padding: 0 4px;
}

/* CTX bar — top breadcrumb + ticker input + price */
.cp-ctx {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cp-ctx-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.cp-ctx-brand .mark {
  width: 22px; height: 22px; border-radius: 5px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 11px;
  background: linear-gradient(135deg, #4ADE80, #16A34A);
  color: #052E16;
}
.cp-ctx-brand b { color: var(--ink-0); font-weight: 700; }
.cp-ctx-sym { display: inline-flex; align-items: baseline; gap: 12px; }
.cp-ctx-input {
  background: transparent; border: none;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--ink-0); letter-spacing: 0.06em;
  padding: 4px 6px; border-radius: 4px;
  width: 80px;
}
.cp-ctx-input:focus { outline: 2px solid rgba(74, 222, 128, 0.32); outline-offset: 2px; }
.cp-ctx-px { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--ink-0); }
.cp-ctx-ch { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.cp-ctx-ch.up { color: #4ADE80; }
.cp-ctx-ch.down { color: #F87171; }
.cp-ctx-r { margin-left: auto; }
.cp-ctx-btn {
  font-size: 11px; color: var(--ink-2); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 5px;
  text-decoration: none;
}
.cp-ctx-btn:hover { color: var(--ink-0); border-color: var(--line-2); }

/* Toolbar — timeframe pills + chart type toggle + overlay toggles */
.cp-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cp-tf { display: inline-flex; gap: 2px; background: var(--paper-2); border-radius: 6px; padding: 2px; }
.cp-tf-pill {
  background: transparent; border: none; padding: 5px 11px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--ink-2); border-radius: 4px; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.cp-tf-pill:hover { color: var(--ink-0); }
.cp-tf-pill.active { background: var(--surface); color: var(--ink-0); box-shadow: 0 0 0 1px var(--line-2); }
.cp-tt { display: inline-flex; gap: 2px; background: var(--paper-2); border-radius: 6px; padding: 2px; }
.cp-tt-btn {
  background: transparent; border: none; padding: 5px 11px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  border-radius: 4px; cursor: pointer;
}
.cp-tt-btn.active { background: var(--surface); color: var(--ink-0); box-shadow: 0 0 0 1px var(--line-2); }
.cp-overlays { display: inline-flex; gap: 14px; font-size: 11px; color: var(--ink-2); }
.cp-overlays label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.cp-overlays input[type="checkbox"] { accent-color: #4ADE80; }

/* Body grid: tools | chart | right panel */
.cp-body {
  display: grid;
  grid-template-columns: 44px 1fr 280px;
  gap: 12px;
  flex: 1;
  min-height: 600px;
}

/* Drawing tools sidebar */
.cp-tools {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: center;
}
.cp-tool-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-2); border-radius: 5px;
  transition: background .12s ease, color .12s ease;
}
.cp-tool-btn:hover { background: rgba(74, 222, 128, 0.08); color: var(--ink-0); }
.cp-tool-btn.active {
  background: rgba(74, 222, 128, 0.15);
  color: #4ADE80;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.32);
}

/* Central chart wrapper. Content-driven height (cp-prochart inline-
   styled with explicit pixel height) so MTF stacking just works —
   main 760px + secondary 240px = 1000px cp-chart total, no sticky/
   percent-height tricks that broke when cp-chart-mtf was a thing.
   Sticky-top only on single-chart mode (when no MTF below the main).
   align-self: start so right column doesn't stretch the grid row. */
.cp-chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 600px;
  align-self: start;
  position: sticky;
  top: 12px;
}

/* MTF mode — drop sticky so scrolling down reveals secondary chart
   + footer naturally below the main. Content drives total height. */
.cp-chart-mtf {
  position: static;
}

/* In MTF mode, drop the right column's internal scroll/max-height —
   chart is taller (main + secondary), so two parallel scrolls becomes
   confusing. Page-scroll is the natural model here. */
.cp-right-mtf {
  max-height: none !important;
  overflow-y: visible !important;
}

/* Left tools palette — sticky too so it travels with the chart. */
.cp-tools {
  align-self: start;
  position: sticky;
  top: 12px;
}

/* Right panels container — own scroll matching chart height so it's
   internally scrollable (TradingView feel) instead of stretching the
   page. max-height:calc(100vh - 220px) mirrors .cp-chart so bottom
   edges align. min-width:0 prevents grid blowout from long news
   headlines. Custom thin scrollbar. */
.cp-right {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  align-self: start;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.cp-right::-webkit-scrollbar { width: 6px; }
.cp-right::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.cp-right::-webkit-scrollbar-track { background: transparent; }

@keyframes cp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Embedded RailContent inside cp-right — wrap in a cp-pan-style
   surface so the rail-section padding/dividers visually integrate
   with the chart-specific panels above it. NO overflow:hidden — that
   was clipping content and making the parent scroll appear to stop
   at the Annotations panel above. */
.cp-rail-embed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cp-rail-embed .rail-section { padding: 12px 14px; }
.cp-rail-embed .rail-section:first-child { padding-top: 8px; }
.cp-rail-embed .rail-head .ttl { font-size: 11px; }
.cp-rail-embed .watch-item { padding: 6px 0; }
.cp-pan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.cp-pan-hd {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-2); font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 10px;
}
.cp-pan-ic { color: #A78BFA; font-size: 14px; }
.cp-pan-tag {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 9px;
  background: var(--paper-2); padding: 2px 6px; border-radius: 3px;
  color: var(--ink-3); letter-spacing: 0.06em;
}
.cp-pan-body { font-size: 12px; }

/* Forecast panel highlights */
.cp-pan-fc { background: linear-gradient(180deg, rgba(167,139,250,0.04), transparent), var(--surface); border-color: rgba(167, 139, 250, 0.18); }
.cp-fc-headline { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cp-fc-val { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.cp-fc-val.up { color: #4ADE80; }
.cp-fc-val.down { color: #F87171; }
.cp-fc-target { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.cp-fc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.cp-fc-meta > div { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-mono); font-size: 10px; }
.cp-fc-meta span { color: var(--ink-3); letter-spacing: 0.05em; text-transform: uppercase; }
.cp-fc-meta b { color: var(--ink-0); font-size: 12px; font-weight: 700; }

/* Events list */
.cp-evts { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.cp-evt { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cp-evt:last-child { border-bottom: 0; }
.cp-evt-badge {
  width: 24px; height: 24px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  border-radius: 4px;
}
.cp-evt-badge.mint { background: rgba(74,222,128,0.12); color: #4ADE80; border: 1px solid rgba(74,222,128,0.32); }
.cp-evt-badge.sky  { background: rgba(96,165,250,0.12); color: #60A5FA; border: 1px solid rgba(96,165,250,0.32); }
.cp-evt-badge.amber{ background: rgba(245,158,11,0.12); color: #F59E0B; border: 1px solid rgba(245,158,11,0.32); }
.cp-evt-badge.violet{background: rgba(167,139,250,0.12); color: #A78BFA; border: 1px solid rgba(167,139,250,0.32); }
.cp-evt-body { flex: 1; min-width: 0; }
.cp-evt-msg { font-size: 11.5px; color: var(--ink-1); line-height: 1.35; }
.cp-evt-ts { font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); margin-top: 2px; }

/* News strip */
.cp-news { display: flex; flex-direction: column; gap: 0; max-height: 360px; overflow-y: auto; }
.cp-news-row {
  display: block; padding: 8px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.cp-news-row:last-child { border-bottom: 0; }
.cp-news-row:hover { background: rgba(74, 222, 128, 0.04); }
.cp-news-h { font-size: 12px; color: var(--ink-1); line-height: 1.35; margin-bottom: 4px; }
.cp-news-m { display: inline-flex; gap: 8px; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.cp-news-m .sent.pos { color: #4ADE80; }
.cp-news-m .sent.neg { color: #F87171; }

/* Light-theme adjustments — same chassis, lighter surfaces. */
:root[data-theme="light"] .cp-pan-fc { background: linear-gradient(180deg, rgba(167,139,250,0.03), transparent), var(--surface); border-color: rgba(167, 139, 250, 0.20); }
:root[data-theme="light"] .cp-tool-btn:hover { background: rgba(22, 163, 74, 0.08); }
:root[data-theme="light"] .cp-tool-btn.active { background: rgba(22, 163, 74, 0.10); color: #16A34A; box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.32); }
:root[data-theme="light"] .cp-fc-val.up { color: #16A34A; }
:root[data-theme="light"] .cp-fc-val.down { color: #DC2626; }
:root[data-theme="light"] .cp-news-row:hover { background: rgba(22, 163, 74, 0.04); }

/* Responsive — collapse right panel on narrow screens */
@media (max-width: 1280px) {
  .cp-body { grid-template-columns: 44px 1fr; }
  .cp-right { display: none; }
}

/* ====================================================================
   PRO CHART V2 — internal renderer styles. Only the chart-internal
   classes from chart-pro.css (the ones used by SVG hover crosshair,
   tooltip, legend HUD, RSI/timeline sub-panes). Scoped under
   `.cp-prochart` so they can't leak into other pages.
   Source: src/dashboard/editorial-static/chart-pro.css (2026-05-04)
   ==================================================================== */
.cp-prochart { position: relative; display: flex; flex-direction: column; min-width: 0; }
.cp-prochart .chart-svg-wrap { position: relative; flex: 1; border-bottom: 1px solid var(--line); min-height: 280px; }
.cp-prochart .chart-svg-wrap svg { display: block; width: 100%; height: 100%; }

/* HUD — top-left OHLCV legend */
.cp-prochart .legend-hud {
  position: absolute; top: 12px; left: 14px;
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; z-index: 4;
  pointer-events: none;
}
.cp-prochart .legend-row { display: flex; align-items: center; gap: 6px; }
.cp-prochart .legend-row .k { color: var(--ink-3); width: 28px; }
.cp-prochart .legend-row .v { color: var(--ink-0); font-weight: 500; }
.cp-prochart .legend-row .v.up { color: #4ADE80; }
.cp-prochart .legend-row .v.down { color: #F87171; }
.cp-prochart .legend-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 7px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 3px; font-size: 10px; color: var(--ink-2);
}
.cp-prochart .legend-pill .sw { width: 8px; height: 2px; border-radius: 1px; }

/* Overlays legend — top-right */
.cp-prochart .legend-overlays {
  position: absolute; top: 12px; right: 14px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono); font-size: 10px;
  z-index: 4; pointer-events: none; text-align: right;
}
.cp-prochart .legend-overlays .ov {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  color: var(--ink-2);
}
.cp-prochart .legend-overlays .ov .sw { width: 12px; height: 2px; }

/* Crosshair info — bottom-left, lifted above the SVG x-axis date pill
   (which sits at chart-bottom around y=h-9) so the two don't overlap
   when crosshair is active. */
.cp-prochart .cross-info {
  position: absolute; bottom: 36px; left: 14px;
  display: flex; gap: 16px;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  z-index: 4; pointer-events: none;
  background: rgba(8,12,10,0.6);
  padding: 4px 8px; border-radius: 4px;
  backdrop-filter: blur(4px);
}
:root[data-theme="light"] .cp-prochart .cross-info {
  background: rgba(255,255,255,0.7);
}
.cp-prochart .cross-info b { color: var(--ink-1); font-weight: 500; }

/* Sub-panes */
.cp-prochart .ind-row { height: 120px; border-bottom: 1px solid var(--line); position: relative; }
.cp-prochart .ind-row svg { display: block; width: 100%; height: 100%; }
.cp-prochart .ind-label {
  position: absolute; top: 8px; left: 14px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); display: flex; gap: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
  z-index: 2; pointer-events: none;
}
.cp-prochart .ind-label b { color: var(--ink-1); font-weight: 500; }
.cp-prochart .timeline { height: 64px; border-top: 1px solid var(--line); position: relative; background: rgba(0,0,0,0.2); }
.cp-prochart .timeline svg { display: block; width: 100%; height: 100%; }

/* SVG-internal crosshair lines + price/date pill */
.cp-prochart .cross line { stroke: rgba(74,222,128,0.45); stroke-width: 0.7; stroke-dasharray: 3 3; }
.cp-prochart .cross .lbl { fill: #050706; font-family: var(--font-mono); font-size: 10px; font-weight: 500; }
.cp-prochart .cross .lbl-bg { fill: #4ADE80; }
.cp-prochart .cross .lbl-bg-x { fill: var(--paper-2); stroke: var(--line-2); stroke-width: 1; }
.cp-prochart .cross .lbl-x { fill: var(--ink-0); }

/* Tooltip */
.cp-prochart .tt {
  position: absolute; z-index: 10; pointer-events: none;
  background: rgba(8,12,10,0.96);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px; padding: 10px 12px; min-width: 180px;
  font-family: var(--font-mono); font-size: 11px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6); backdrop-filter: blur(8px);
}
.cp-prochart .tt-hd {
  font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.cp-prochart .tt-row { display: flex; justify-content: space-between; padding: 2px 0; gap: 16px; }
.cp-prochart .tt-row .k { color: var(--ink-3); }
.cp-prochart .tt-row .v { color: var(--ink-1); font-weight: 500; }
.cp-prochart .tt-row .v.up { color: #4ADE80; }
.cp-prochart .tt-row .v.down { color: #F87171; }
.cp-prochart .tt-row .v.ai { color: #A78BFA; }

/* Light-theme overrides — flip a few surfaces that hardcode dark rgbas. */
:root[data-theme="light"] .cp-prochart .legend-pill { background: rgba(11,13,16,0.04); }
:root[data-theme="light"] .cp-prochart .timeline { background: rgba(11,13,16,0.02); }
:root[data-theme="light"] .cp-prochart .tt { background: rgba(255,255,255,0.98); border-color: rgba(11,13,16,0.16); box-shadow: 0 12px 40px rgba(11,13,16,0.18); }
:root[data-theme="light"] .cp-prochart .cross .lbl { fill: #ffffff; }

/* ── Reusable modal scaffolding ───────────────────────────────────
   Backdrop + card pattern used by the 6+ chart modals (Backtester,
   Split, Time Machine, Options Heatmap, Indicator Settings, Pattern
   Study). Was 6+ duplicated inline-style blocks with minor variations;
   now one class set with --tp-accent for the left-stripe color. */
.tp-modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.tp-modal-card {
  width: min(640px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--tp-accent, #4ADE80);
  border-radius: 8px; padding: 22px;
}
.tp-modal-card.wide  { width: min(1100px, 96vw); max-height: 92vh; }
.tp-modal-card.tall  { max-height: 94vh; }
.tp-modal-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.tp-modal-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  font-family: var(--font-mono); color: var(--tp-accent, #4ADE80);
}
.tp-modal-title {
  font-size: 17px; font-weight: 700; color: var(--ink-0); margin-top: 2px;
}
.tp-modal-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 18px; padding: 4px 8px;
}
.tp-modal-close:hover { color: var(--ink-0); }

/* KPI tile pattern — used by backtest results, decisions 24h tape,
   portfolio metrics. ~12 inline-style copies → one class. */
.tp-kpi-tile {
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.tp-kpi-tile .k {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.tp-kpi-tile .v {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--ink-0);
}

/* Filter input group — used by every "filter bar" in tables. ~8 copies. */
.tp-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
}
.tp-filter-bar label {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs); color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.tp-filter-bar input,
.tp-filter-bar select {
  padding: 6px 8px; font-size: 12px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 4px; color: var(--ink-0);
}
