/* sydnee.viewer — sydnee.ai brand × Bloomberg-terminal density.
   Brand source: sydnee.ai (Cormorant Garamond + cocoa/cream/terracotta).
   Display chrome = serif. Data = mono. Two themes via [data-theme].
*/

/* ── tokens ────────────────────────────────────────────────────────────── */

:root[data-theme="dark"] {
  --bg:        #1C1714;        /* deep cocoa */
  --bg-raised: #251E1A;
  --bg-sunken: #14100E;
  --fg:        #FDF8F0;        /* cream */
  --fg-dim:    #8C7E72;        /* taupe */
  --fg-faint:  rgba(253, 248, 240, 0.30);
  --border:    rgba(253, 248, 240, 0.10);
  --border-strong: rgba(253, 248, 240, 0.22);
  --accent:    #E8621A;        /* terracotta — sydnee.ai .ai dot */
  --gold:      #C4A35A;        /* hover/highlight */
  --pos:       #6FAE7E;
  --neg:       #C9694A;
  --warn:      #C4A35A;
  --status-bg: #14100E;
}

:root[data-theme="light"] {
  --bg:        #FDF8F0;
  --bg-raised: #FFFFFF;
  --bg-sunken: #F1E9DD;
  --fg:        #1C1714;
  --fg-dim:    #6F6157;
  --fg-faint:  rgba(28, 23, 20, 0.30);
  --border:    rgba(28, 23, 20, 0.10);
  --border-strong: rgba(28, 23, 20, 0.22);
  --accent:    #D6520F;
  --gold:      #9B7E3A;
  --pos:       #2E7A4E;
  --neg:       #B23A1A;
  --warn:      #9B7E3A;
  --status-bg: #F1E9DD;
}

/* default theme if attribute missing */
:root { color-scheme: dark; }
:root[data-theme="dark"]  { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* ── reset ─────────────────────────────────────────────────────────────── */

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga";
}

/* mono reserved for data + chrome readouts (Bloomberg convention) */
.mono, table, .hero-value, .tile-cell-val, .sb-clock, .login-input,
.fixture-banner, .pill, code, kbd, samp {
  font-family: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }

/* ── status bar (Bloomberg-style top strip) ────────────────────────────── */

.statusbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--status-bg);
  border-bottom: 1px solid var(--border-strong);
  padding: 6px 14px;
  font-size: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.sb-left, .sb-right { display: flex; align-items: center; gap: 12px; }

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg);
}
.brand:hover { color: var(--accent); }
.emblem { display: inline-flex; line-height: 0; color: var(--fg); }

.wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.wm-name { color: var(--fg); }
.wm-dot  { color: var(--accent); }

.sb-sep { color: var(--fg-faint); font-family: 'JetBrains Mono', monospace; }

.sb-scope {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.sb-nav { display: flex; gap: 2px; margin-left: 8px; }
.sb-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--fg-dim);
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
}
.sb-link:hover { color: var(--accent); border-color: var(--border-strong); }

.sb-clock {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.5px;
}

.sb-form { display: inline; }
.sb-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.sb-btn:hover { border-color: var(--accent); color: var(--accent); }
.sb-btn-quiet { border-color: var(--border); padding: 4px 8px; font-size: 12px; }

/* ── content ───────────────────────────────────────────────────────────── */

.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}
.page-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--fg-dim);
  margin-bottom: 4px;
}
.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.page-meta { font-size: 11px; }

h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.section { margin-bottom: 22px; }

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px 16px;
}

/* ── hero strip (per-module standalone view) ───────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-strong);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  margin-bottom: 22px;
  overflow: hidden;
}
.hero-cell {
  background: var(--bg-raised);
  padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 72px;
}
.hero-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  margin-bottom: 6px;
  font-weight: 700;
}
.hero-value {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1;
}
.hero-value.strong { color: var(--accent); }
.hero-sub { font-size: 10px; margin-top: 4px; letter-spacing: 1px; }

/* ── bot health row (compact chips above the pair grid) ───────────────── */

.bot-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
}
.bot-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 12px;
  color: var(--fg);
  transition: border-color 0.15s;
}
.bot-chip:hover { border-color: var(--accent); color: var(--fg); }
.bot-chip-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; font-weight: 500;
}
.bot-chip-status {
  font-size: 9px; letter-spacing: 1.5px;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--fg-dim);
}
.bot-chip-meta { font-size: 10px; letter-spacing: 0.5px; }

/* ── tabs (pure CSS :target — no JS, fragment survives meta-refresh) ─── */

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-link {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 10px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.tab-link:hover { color: var(--fg); }
.tab-count {
  font-size: 10px;
  color: var(--fg-faint);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.tab-panel { display: none; }
.tab-panel:target { display: block; }

/* Default (no fragment): first panel inside .tabs shown, first tab styled active.
   Must scope to .tabs so the page-head / bot-row sections preceding the panels
   don't confuse :first-of-type / :first-child matching. */
body:not(:has(.tab-panel:target)) .tabs > .tab-panel:first-child { display: block; }
body:not(:has(.tab-panel:target)) .tab-nav .tab-link:first-child {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
body:not(:has(.tab-panel:target)) .tab-nav .tab-link:first-child .tab-count {
  color: var(--accent);
}

/* Active tab: link whose href matches the targeted panel */
body:has(#tab-ready:target)    .tab-link[href="#tab-ready"],
body:has(#tab-open:target)     .tab-link[href="#tab-open"],
body:has(#tab-watching:target) .tab-link[href="#tab-watching"],
body:has(#tab-pairs:target)    .tab-link[href="#tab-pairs"],
body:has(#tab-activity:target) .tab-link[href="#tab-activity"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
body:has(#tab-ready:target)    .tab-link[href="#tab-ready"]    .tab-count,
body:has(#tab-open:target)     .tab-link[href="#tab-open"]     .tab-count,
body:has(#tab-watching:target) .tab-link[href="#tab-watching"] .tab-count,
body:has(#tab-pairs:target)    .tab-link[href="#tab-pairs"]    .tab-count,
body:has(#tab-activity:target) .tab-link[href="#tab-activity"] .tab-count {
  color: var(--accent);
}

/* signals whose linked order was CANCELLED — historical/voided */
tr.signal-cancelled td {
  opacity: 0.42;
  text-decoration: line-through;
  text-decoration-color: var(--fg-faint);
}
tr.signal-cancelled td:last-child {
  text-decoration: none;
  color: var(--neg);
  opacity: 0.7;
}

/* unavailable account strip — visually softer to signal "pending data" */
.account-strip-unavailable .account-value { color: var(--fg-faint); }

/* ──────────────────────────────────────────────────────────────────────
   SINGLE-PAIR TV/PROJECTOR LAYOUT — one screen, no scroll, professional
   ────────────────────────────────────────────────────────────────────── */

/* TV layout: lock body + content to 100% viewport width, no centering,
   no margins, no max-width — works in browsers without :has() too */
html:has(.tv-strip-head),
body:has(.tv-strip-head),
body:has(.tv-strip-head) .content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}
body:has(.tv-strip-head) {
  padding: 0;
  /* Was height:100vh + overflow:hidden — locked to viewport so the
     RECENT TRADES / SIGNALS / ACCOUNT / PLAN row got clipped on
     anything smaller than a TV. min-height keeps the TV-fits-exactly
     behavior; overflow-y:auto lets shorter viewports scroll. */
  min-height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
body:has(.tv-strip-head) .statusbar { display: none; }
body:has(.tv-strip-head) .page-head { display: none; }
body:has(.tv-strip-head) .content {
  padding: 0;
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
/* Each strip is its own row spanning the full width — make sure none
   inherit a constrained width from the parent's layout system. */
body:has(.tv-strip-head) .tv-strip-head,
body:has(.tv-strip-head) .tv-strip-price,
body:has(.tv-strip-head) .tv-strip-toolbar,
body:has(.tv-strip-head) .tv-chart-section,
body:has(.tv-strip-head) .tv-strip-footer { width: 100%; box-sizing: border-box; }

/* ── HEADER STRIP (40px) ─────────────────────────────────────────────── */

.tv-strip-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-sunken);
  flex: 0 0 auto;
  gap: 22px;
}
.tv-strip-brand {
  display: inline-flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.tv-brand-mark {
  display: inline-flex; align-items: center;
  color: var(--fg);
  line-height: 0;
}
.tv-brand-mark svg { width: 28px; height: 28px; }
.tv-brand-wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.7px;
  line-height: 1;
}
.tv-brand-name { color: var(--fg); }
.tv-brand-dot  { color: var(--accent); }

.tv-strip-sep {
  color: var(--fg-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
}
.tv-strip-pair {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--fg);
  text-transform: uppercase;
}
.tv-strip-source {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.tv-strip-meta {
  display: inline-flex; align-items: center; gap: 22px;
  font-size: 15px;
  letter-spacing: 0.3px;
}
.tv-meta-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-right: 6px;
  font-weight: 700;
}
.tv-meta-val { color: var(--fg); font-weight: 500; font-size: 16px; }
.tv-strip-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 2px; font-weight: 700;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: var(--fg-faint);
}
.tv-strip-live .tv-live-dot { width: 10px; height: 10px; }
.tv-strip-live[data-state="connected"] { color: var(--pos); border-color: rgba(111,174,126,0.4); }
.tv-strip-live[data-state="connecting"] { color: var(--gold); border-color: rgba(196,163,90,0.4); }
.tv-strip-live[data-state="error"] { color: var(--neg); border-color: rgba(201,105,74,0.4); }
.tv-live-dot { animation: none; margin: 0; }
.tv-strip-live[data-state="connected"] .tv-live-dot { background: var(--pos); }
.tv-strip-live[data-state="connecting"] .tv-live-dot { background: var(--gold); }
.tv-strip-live[data-state="error"] .tv-live-dot { background: var(--neg); }

/* theme toggle button — sits next to LIVE pill, glyph only */
.tv-theme-form { margin: 0; display: inline-flex; }
.tv-theme-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  width: 34px; height: 34px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.tv-theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* idle pill for triggers where neither side is close */
.tv-trigger-side-idle {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 2px;
  display: inline-block;
}

/* mobile sparkline — hidden by default; shown on portrait phone only */
.tv-mobile-spark { display: none; }
.tv-mobile-spark svg { width: 100%; height: 60px; display: block; }
.tv-mobile-spark.spark-pos { color: var(--pos); }
.tv-mobile-spark.spark-neg { color: var(--neg); }
.tv-spark-hint {
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 4px 0 8px;
  opacity: 0.6;
}

/* ── PRICE STRIPE (~110px) ───────────────────────────────────────────── */

.tv-strip-price {
  flex: 0 0 auto;
  padding: 18px 26px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.tv-pricerow {
  display: flex; align-items: baseline; gap: 36px;
  flex-wrap: wrap;
}
/* Right-aligned column 2 — clock + regime chip stacked, anchored right
   so they don't fight the price for horizontal space. */
.tv-pricerow-right {
  margin-left: auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  text-align: right;
  align-self: center;
}
.tv-pricerow-clock {
  font-size: 18px; letter-spacing: 1px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.tv-price {
  font-size: 88px;
  font-weight: 600;
  letter-spacing: -2.5px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tv-change {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 22px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  background: rgba(140, 126, 114, 0.10);
}
.tv-change.pos { background: rgba(111, 174, 126, 0.14); color: var(--pos); }
.tv-change.neg { background: rgba(201, 105, 74, 0.14);  color: var(--neg); }
.tv-change-pct { font-weight: 700; }
.tv-change-abs { font-size: 17px; opacity: 0.85; }
.tv-change-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--fg-faint);
  font-weight: 600;
  margin-left: 6px;
}

.tv-header {
  display: none;  /* legacy — replaced by tv-strip-head */
}

/* Range bars — TradingView/Yahoo-style day + 30-day range visualizer.
   Two stacked rows; each is a thin track with a subtle fill from low to
   current price and a triangular marker at current price. The marker
   slides on every live tick (see updateRangeMarker in btc_chart.js). */
.tv-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  font-variant-numeric: tabular-nums;
}
.tv-range-block { display: flex; flex-direction: column; gap: 6px; }
.tv-range-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: 0.3px;
}
.tv-range-lo, .tv-range-hi {
  color: var(--fg-dim); font-weight: 600;
}
.tv-range-label {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 700;
}
.tv-range-track {
  position: relative;
  height: 6px;
  background: rgba(140, 126, 114, 0.18);
  border-radius: 3px;
  overflow: visible;
}
.tv-range-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--neg);
  border-radius: 3px 0 0 3px;
  transition: width 180ms ease-out;
}
.tv-range-track.pos .tv-range-fill { background: var(--pos); }
.tv-range-track.neg .tv-range-fill { background: var(--neg); }
/* 30-day track gets a muted fill — the live data is the day track */
.tv-range-track.tv-range-month .tv-range-fill {
  background: rgba(140, 126, 114, 0.45);
}
.tv-range-marker {
  position: absolute; top: 100%; transform: translate(-50%, 2px);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid var(--fg);
  transition: left 180ms ease-out;
}

/* quote row (bid / ask / spread / flow / trades) */
.tv-quoterow {
  display: flex; align-items: center; gap: 28px;
  font-size: 14px;
  letter-spacing: 0.3px;
  flex-wrap: wrap;
}
.tv-quote-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--fg-dim); margin-right: 6px;
  font-weight: 600;
}
.tv-quote-px { color: var(--fg); font-weight: 500; font-size: 15px; }
.tv-quote-sz { font-size: 12px; margin-left: 6px; }
.tv-bid-block .tv-quote-px { color: var(--pos); }
.tv-ask-block .tv-quote-px { color: var(--neg); }

/* flow gauge — signed_volume_60s / volume_60s, range -1..+1 */
.tv-flow-block {
  display: inline-flex; align-items: center; gap: 8px;
}
.tv-flow-gauge {
  position: relative;
  width: 180px; height: 14px;
  background: rgba(140, 126, 114, 0.14);
  border-radius: 2px;
  overflow: visible;
}
.tv-flow-zero {
  position: absolute; left: 50%; top: -2px; bottom: -2px;
  width: 1px; background: var(--fg-faint);
}
.tv-flow-needle {
  position: absolute; top: -3px; bottom: -3px;
  width: 4px; left: 50%;
  background: var(--fg-faint);
  border-radius: 1px;
  transition: left 0.4s ease-out, background 0.2s;
  transform: translateX(-2px);
}
.tv-flow-needle.flow-buy   { background: var(--pos); box-shadow: 0 0 6px var(--pos); }
.tv-flow-needle.flow-sell  { background: var(--neg); box-shadow: 0 0 6px var(--neg); }
.tv-flow-needle.flow-flat  { background: var(--fg-dim); }
.tv-flow-val {
  font-size: 14px;
  font-weight: 600;
  min-width: 52px;
}

.tv-trades-block { font-size: 13px; }
.tv-trades-block #tv-trades60s { color: var(--fg); margin-left: 6px; font-weight: 500; }

.tv-pair-block { display: none; /* legacy */ }
.tv-pair-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 600;
}
.tv-pair-base { color: var(--fg); }
.tv-pair-source { font-size: 10px; letter-spacing: 1px; }

.tv-price-row {
  display: flex; align-items: baseline; gap: 18px;
  flex-wrap: wrap;
}
.tv-price {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -1.5px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 0.25s;
}
/* Quiet TV-friendly tick flash — color only, no transform; resets on next tick */
.tv-price-up   { color: var(--pos) !important; }
.tv-price-down { color: var(--neg) !important; }

.tv-change {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(140, 126, 114, 0.10);
}
.tv-change.pos { background: rgba(111, 174, 126, 0.14); color: var(--pos); }
.tv-change.neg { background: rgba(201, 105, 74, 0.14);  color: var(--neg); }
.tv-change-pct { font-weight: 600; }
.tv-change-abs { font-size: 13px; opacity: 0.85; }
.tv-change-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--fg-faint);
  font-weight: 400;
  margin-left: 4px;
}

.tv-quote-row {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.3px;
}
.tv-quote-bid #tv-bid { color: var(--pos); }
.tv-quote-ask #tv-ask { color: var(--neg); }

/* compact account chip in the header right-rail */
.tv-account-chip {
  display: flex; flex-direction: column;
  gap: 3px;
  font-size: 11px;
  letter-spacing: 0.3px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-raised);
  white-space: nowrap;
  align-self: flex-start;
}
.tv-acct-row { display: inline-flex; align-items: baseline; gap: 6px; }
.tv-acct-label { color: var(--fg-dim); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; }
.tv-acct-val { color: var(--fg); font-weight: 500; }
.tv-acct-pct { font-size: 9px; opacity: 0.7; }
.tv-acct-sep { display: none; }

/* ── TOOLBAR (TF picker + status copy) ──────────────────────────────── */

.tv-strip-toolbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}
.tv-strip-toolbar-right {
  display: inline-flex; align-items: center; gap: 18px;
  font-size: 13px; letter-spacing: 0.5px;
  flex-wrap: wrap;
}

/* MODE toggle (Calibrated / Day-Trade) — segmented control in the toolbar */
.tv-mode-block {
  display: inline-flex; align-items: center; gap: 8px;
}
.tv-mode-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 1.8px; font-weight: 700;
  color: var(--fg-dim); text-transform: uppercase;
}
.tv-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  overflow: hidden;
}
.tv-mode-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  background: transparent;
  color: var(--fg-dim);
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid var(--border-strong);
}
.tv-mode-btn:last-child { border-right: none; }
.tv-mode-btn:hover:not(:disabled):not(.tv-mode-active) {
  background: var(--bg-raised); color: var(--fg);
}
.tv-mode-btn.tv-mode-active {
  background: var(--accent);
  color: var(--bg);
}
.tv-mode-disabled .tv-mode-btn { opacity: 0.45; cursor: not-allowed; }
.tv-mode-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  min-height: 14px;
}
.tv-mode-status-pending { color: var(--gold); }
.tv-mode-status-ok      { color: var(--pos); }
.tv-mode-status-err     { color: var(--neg); }

/* PROFILE PARAMS STRIP — under the toolbar, shows the active profile's
   actual entry / TF / stop / target / exit / max-hold / edge.
   Day-trade mode adds a warning chip below. */
.tv-strip-profile {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 8px 22px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  align-items: stretch;
}
.tv-prof-cell {
  display: flex; flex-direction: column;
  gap: 2px;
  padding: 4px 18px;
  border-right: 1px solid var(--border);
  min-width: 90px;
}
.tv-prof-cell:last-of-type { border-right: none; }
.tv-prof-k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 1.5px; font-weight: 700;
  color: var(--fg-dim); text-transform: uppercase;
}
.tv-prof-v {
  font-size: 14px; font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}
.tv-prof-cell-edge .tv-prof-v { color: var(--pos); }
.tv-prof-cell-edge.tv-prof-edge-dim .tv-prof-v {
  color: var(--fg-faint);
  font-size: 12px;
}
/* `pinned` badge in PLAN header for day-trade override profiles. */
.tv-plan-pinned {
  display: inline-block;
  font-size: 9px; letter-spacing: 1.5px; font-weight: 700;
  padding: 2px 6px;
  margin-left: 6px;
  border: 1px solid #C4A35A;
  color: #C4A35A;
  background: rgba(196,163,90,0.10);
  border-radius: 2px;
  text-transform: uppercase;
}

.tv-prof-warn {
  /* Was `flex: 1 0 100%` for the old .tv-strip-profile flex-row context.
     The strip was removed; the warning is now a direct child of the
     body column-flex layout, where flex-basis:100% becomes 100vh and
     flex-grow:1 consumes everything below — pushing chart/INTEL/footer
     off-screen. flex:0 0 auto pins it to its content height. */
  flex: 0 0 auto;
  margin: 6px 22px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #C4A35A;
  border-left: 2px solid #C4A35A;
  padding: 6px 14px;
  background: rgba(196, 163, 90, 0.08);
}
.tv-strip-bullet { color: var(--fg-faint); }
#chart-next-bar.chart-imminent { color: var(--accent); }

/* Stoch overlay legend — swatches identifying the K and D lines */
.tv-stoch-legend {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  font-weight: 600;
}
.tv-stoch-k-swatch, .tv-stoch-d-swatch {
  display: inline-block;
  width: 18px; height: 3px;
  border-radius: 1px;
  vertical-align: middle;
  margin-right: 3px;
}
.tv-stoch-k-swatch { background: rgba(165, 102, 204, 0.95); }   /* RSI purple */
.tv-stoch-d-swatch { background: rgba(218, 187, 78, 0.85); margin-left: 6px; }   /* signal yellow */
.tv-stoch-bands {
  margin-left: 8px;
  padding: 0 8px;
  border-left: 1px solid var(--border);
  color: var(--fg-faint);
}

.tv-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}
.tv-tf-picker { display: inline-flex; gap: 0; }
.tv-tf-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.5px;
  font-weight: 600;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-right: none;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  position: relative;
}
.tv-tf-btn:first-child { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.tv-tf-btn:last-child  { border-right: 1px solid var(--border); border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
.tv-tf-btn:hover { color: var(--fg); background: var(--bg-raised); }
.tv-tf-btn.tv-tf-active {
  color: var(--accent);
  background: var(--bg-raised);
  border-color: var(--accent);
}
.tv-tf-marker {
  display: inline-block;
  font-size: 8px;
  color: var(--gold);
  margin-left: 3px;
  vertical-align: super;
}

.tv-toolbar-right {
  display: flex; align-items: center; gap: 14px;
}

/* ── REGIME BAND (SMA-50/200 — bull green, bear red) ─────────────────── */

.tv-regime-band {
  flex: 0 0 auto;
  display: flex; align-items: center;
  gap: 14px;
  padding: 4px 22px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  min-height: 22px;
}
.tv-regime-track {
  position: relative;
  height: 10px;
  flex: 1 1 auto;
  background: rgba(140, 126, 114, 0.10);
  border-radius: 2px;
  overflow: hidden;
}
.regime-seg {
  position: absolute; top: 0; bottom: 0;
}
.regime-bull { background: #5a8d62; }
.regime-bear { background: #b56b50; }
.tv-regime-now { display: none; }   /* "Now: …" relocated to the price-row chip */
.tv-regime-empty {
  font-size: 11px; letter-spacing: 1px;
  flex: 1 1 auto;
  text-align: center;
}

/* Bull/Bear chip on the price row — highlighted badge in the right-aligned
   column 2 alongside the live clock. Stronger fill + colored text + shadow
   so it reads as a featured badge, not a faint chip. */
.tv-pricerow-regime {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px; letter-spacing: 0.6px;
  background: rgba(140,126,114,0.10);
  box-shadow: 0 1px 0 rgba(0,0,0,0.25);
}
.tv-pricerow-regime:empty { display: none; }
.tv-pricerow-regime.pos {
  color: #6FAE7E;
  border-color: rgba(111,174,126,0.55);
  background: rgba(111,174,126,0.18);
}
.tv-pricerow-regime.neg {
  color: #C9694A;
  border-color: rgba(201,105,74,0.55);
  background: rgba(201,105,74,0.18);
}
.tv-pricerow-regime-arrow { font-size: 16px; }
.tv-pricerow-regime-word  { font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; font-size: 13px; }
.tv-pricerow-regime-dur   { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.85; }

/* ── CHART + WHY-PANEL ROW ───────────────────────────────────────────── */

.tv-chart-row {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;   /* anchor for the why-toggle button + drawer */
}
/* Full-width chart variant: why-panel becomes an overlay drawer (hidden by
   default), so the chart owns the whole row width. */
.tv-chart-row-full { min-height: 460px; }

/* 65/35 split: chart owns most width, INTEL sidebar on the right gets a
   fixed share for score / brief / triggers / activity. Min-height bounded
   so the footer stays visible on a single 1080p screen. */
.tv-chart-row-split {
  display: grid;
  grid-template-columns: 65% 35%;
  min-height: 520px;
  max-height: 65vh;
}
.tv-chart-row-split .tv-chart-section { min-width: 0; min-height: 0; }
@media (max-width: 1100px) {
  .tv-chart-row-split { grid-template-columns: 1fr; max-height: none; }
}

/* sydnee predict toggle — pinned top-right of the chart pane below the
   why-toggle. Mirrors why-toggle styling; turns accent-orange when
   Sydnee Wire fired in the last 24h so it doubles as an attention badge. */
.tv-predict-toggle {
  position: absolute; top: 38px; right: 12px; z-index: 4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.6px; font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: rgba(28,23,20,0.65);
  color: var(--fg-dim);
  cursor: pointer;
  border-radius: 3px;
  backdrop-filter: blur(6px);
}
.tv-predict-toggle:hover { color: var(--accent); border-color: var(--accent); }
.tv-predict-toggle-hot {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 0 rgba(232,98,26,0.5);
  animation: tv-predict-toggle-pulse 2.4s ease-in-out infinite;
}
@keyframes tv-predict-toggle-pulse {
  0%   { box-shadow: 0 0 0 0  rgba(232,98,26,0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(232,98,26,0);   }
  100% { box-shadow: 0 0 0 0  rgba(232,98,26,0);    }
}

/* Predict drawer — slides in from the RIGHT over the chart pane (the
   why-panel slides from the left, so they don't overlap each other). */
.tv-chart-row-split .tv-predict-panel {
  position: absolute; top: 0; bottom: 0; right: 0; z-index: 5;
  width: 100%;
  max-width: 480px;
  background: var(--bg-raised);
  border-left: 1px solid var(--border-strong);
  transform: translateX(100%);
  transition: transform 220ms ease-out;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tv-chart-row-split .tv-predict-panel.tv-predict-open { transform: translateX(0); display: flex; }
/* Fully remove from layout when collapsed — the prior `transform: translateX(100%)`
   left the abs-positioned panel reserving overlay space (and on browsers without
   :has support, eating the right column). display:none guarantees the layout. */
.tv-chart-row-split .tv-predict-panel-collapsed { display: none; }
.tv-chart-row-split:has(.tv-predict-open) .tv-predict-toggle { display: none; }

.tv-predict-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.tv-predict-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 500; color: var(--fg);
}
.tv-predict-sub { font-size: 10px; letter-spacing: 1.5px; margin-top: 2px; }
.tv-predict-close {
  background: transparent; border: none;
  font-size: 22px; line-height: 1; color: var(--fg-dim); cursor: pointer;
}
.tv-predict-close:hover { color: var(--accent); }

/* Wire summary row — shows fire-count today, click anchors to timeline. */
.tv-predict-wire-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: rgba(232,98,26,0.06);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.tv-predict-wire-glyph { color: var(--accent); font-size: 14px; }
.tv-predict-wire-label { font-weight: 700; letter-spacing: 1px; }
.tv-predict-wire-count { margin-left: auto; color: var(--accent); font-weight: 600; }

.tv-predict-section-head {
  font-size: 10px; letter-spacing: 2px; font-weight: 700;
  padding: 14px 18px 6px;
  flex: 0 0 auto;
}

.tv-predict-markets {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 18px 14px;
  overflow-y: auto;
  flex: 1 1 50%; min-height: 0;
}
.tv-predict-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 3px;
  background: rgba(140,126,114,0.05);
  border-left: 3px solid var(--border);
}
.tv-predict-row-title {
  font-size: 12px; line-height: 1.35; color: var(--fg);
  overflow-wrap: break-word;
}
.tv-predict-row-bar {
  height: 6px;
  background: rgba(140,126,114,0.2);
  border-radius: 3px; overflow: hidden;
}
.tv-predict-row-fill {
  height: 100%; background: var(--accent); border-radius: 3px 0 0 3px;
  transition: width 240ms ease-out;
}
.tv-predict-row-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.tv-predict-row-prob { font-weight: 700; color: var(--fg); font-size: 13px; }

/* Wire timeline — compact 2-line cards. */
.tv-predict-wires {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 18px 18px;
  overflow-y: auto;
  flex: 1 1 50%; min-height: 0;
}
.tv-predict-wire-card {
  padding: 8px 10px;
  border-radius: 3px;
  border-left: 3px solid var(--accent);
  background: rgba(232,98,26,0.06);
  display: flex; flex-direction: column; gap: 4px;
}
.tv-predict-wire-line1 {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11px;
}
.tv-predict-wire-time { font-weight: 700; color: var(--fg); }
.tv-predict-wire-deltas {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px;
}
.tv-predict-wire-summary {
  font-size: 11px; line-height: 1.35;
  color: var(--fg-dim);
}

.tv-predict-empty { padding: 12px; text-align: center; font-size: 12px; }

/* Toggle button pinned top-right of the chart pane — opens the why drawer. */
.tv-why-toggle {
  position: absolute; top: 8px; right: 12px; z-index: 4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 1px; font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: rgba(28,23,20,0.65);
  color: var(--fg-dim);
  cursor: pointer;
  border-radius: 3px;
  backdrop-filter: blur(6px);
}
.tv-why-toggle:hover { color: var(--accent); border-color: var(--accent); }
.tv-why-close {
  position: absolute; top: 8px; right: 12px;
  font-size: 22px; line-height: 1;
  background: transparent; border: none;
  color: var(--fg-dim); cursor: pointer;
}
.tv-why-close:hover { color: var(--accent); }

/* ── WHY-THIS-STRATEGY sidebar ───────────────────────────────────────── */

.tv-why-panel {
  flex: 0 0 320px;
  border-left: 1px solid var(--border);
  background: var(--bg-raised);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tv-why-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.tv-why-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
}
.tv-why-sub {
  font-size: 9px; letter-spacing: 1.8px;
  margin-top: 2px;
}
.tv-why-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 4px;
}
.tv-why-row {
  padding: 10px 12px;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.tv-why-row:hover { background: var(--bg-sunken); }
.tv-why-row:last-child { border-bottom: none; }
.tv-why-head-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.tv-why-ts { font-size: 10px; letter-spacing: 0.5px; }
.tv-why-caret {
  font-size: 11px;
  transition: transform 0.15s;
}
.tv-why-expanded .tv-why-caret { transform: rotate(180deg); }
.tv-why-summary {
  font-size: 12px;
  margin-top: 4px;
  color: var(--fg);
  letter-spacing: 0.2px;
  line-height: 1.45;
}
.tv-why-detail {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  gap: 14px;
  flex-direction: row;
}
.tv-why-expanded .tv-why-detail { display: flex; }
.tv-prof-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.tv-prof-col-head {
  font-size: 9px; letter-spacing: 1.5px; font-weight: 700;
  color: var(--fg-dim); text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tv-prof-field {
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 10px;
  letter-spacing: 0.2px;
  padding: 1px 0;
}
.tv-prof-fk { color: var(--fg-dim); }
.tv-prof-fv { color: var(--fg); text-align: right; word-break: break-all; }
.tv-why-empty {
  padding: 18px 12px;
  font-size: 11px; letter-spacing: 0.5px;
  text-align: center;
  font-style: italic;
}

/* ── CHART (fills remaining viewport between price stripe and footer) ── */

.tv-chart-section {
  margin: 0; padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex; flex-direction: column;
  position: relative;   /* anchor for the triggers overlay + why toggle */
}

/* ── TRIGGERS inside POSITION footer column ──────────────────────────── */
/* 2-line row: [name + side pill] / [brief description] / [progress bar
   with status label baked in]. Even row heights via consistent grid +
   gaps. Bar label spells out "% to fire" so the reader knows what the
   percentage represents. */
.tv-pos-triggers {
  display: flex; flex-direction: column;
  /* Single full-width column — each trigger gets the full SIGNALS column
     so the narrative + progress bar have room to breathe. Multi-column
     grids made every label crush at typical viewer widths. */
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.tv-pos-trig-row {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 4px;
  border-left: 4px solid var(--border);
  background: rgba(140,126,114,0.05);
  /* Constrain card so long narratives wrap inside instead of overflowing
     into adjacent cards. min-width: 0 lets the grid track shrink properly. */
  min-width: 0;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.tv-pos-trig-row > * { min-width: 0; }
.tv-pos-trig-narrative { overflow-wrap: break-word; word-break: normal; }
.tv-pos-trig-fired   { border-left-color: var(--accent); background: rgba(232, 98, 26, 0.10); }
.tv-pos-trig-warming { border-left-color: #C4A35A;       background: rgba(196,163,90, 0.08); }
/* Cold rows still readable — only border + label dim, not the whole card.
   Reader needs to see bxt's context even when it's far from firing. */
.tv-pos-trig-cold .tv-pos-trig-name { color: var(--fg-dim); }
.tv-pos-trig-line1 {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.tv-pos-trig-name {
  font-size: 17px; font-weight: 700; color: var(--fg);
  letter-spacing: 0.4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-pos-trig-side { font-size: 11px; padding: 3px 9px; letter-spacing: 1.4px; flex-shrink: 0; }
.tv-pos-trig-desc {
  font-size: 14px; line-height: 1.4;
  color: var(--fg-dim);
  font-style: italic;
}
/* Plain-English narrative — main read. Larger, not italic, full opacity. */
.tv-pos-trig-narrative {
  font-size: 15px; line-height: 1.45;
  color: var(--fg);
  font-family: 'Cormorant Garamond', serif;
}

.tv-pos-trig-bar {
  position: relative;
  height: 24px;
  background: rgba(140, 126, 114, 0.22);
  border-radius: 3px;
  overflow: hidden;
}
.tv-pos-trig-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--fg-dim);
  border-radius: 3px 0 0 3px;
  transition: width 240ms ease-out;
}
.tv-pos-trig-fired   .tv-pos-trig-fill { background: var(--accent); }
.tv-pos-trig-warming .tv-pos-trig-fill { background: #C4A35A; }
.tv-pos-trig-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--fg);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.55);
}
:root[data-theme="light"] .tv-pos-trig-label {
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}
.tv-cht-trig-row {
  display: grid;
  grid-template-columns: minmax(72px, max-content) auto 1fr auto;
  gap: 8px; align-items: center;
  font-size: 11px;
  padding: 3px 0;
}
.tv-cht-trig-cold    { opacity: 0.55; }
.tv-cht-trig-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-cht-trig-side { font-size: 9px; padding: 2px 5px; letter-spacing: 1.2px; }

/* Progress bar 0-100% with % label overlaid right-aligned. */
.tv-cht-trig-bar {
  position: relative;
  height: 14px;
  min-width: 80px;
  background: rgba(140, 126, 114, 0.22);
  border-radius: 2px;
  overflow: hidden;
}
.tv-cht-trig-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--fg-dim);
  border-radius: 2px 0 0 2px;
  transition: width 240ms ease-out;
}
.tv-cht-trig-fired   .tv-cht-trig-fill { background: var(--accent); }
.tv-cht-trig-warming .tv-cht-trig-fill { background: #C4A35A; }
.tv-cht-trig-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.3px;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}
:root[data-theme="light"] .tv-cht-trig-pct {
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}
.tv-cht-trig-state {
  font-size: 11px; color: var(--fg-dim);
  white-space: nowrap;
}
.tv-cht-trig-state .trigger-fired-pill { font-size: 9px; padding: 2px 5px; }

@media (max-width: 720px) {
  .tv-chart-triggers { max-width: calc(100vw - 32px); }
  .tv-cht-trig-row { font-size: 10px; }
}
.tv-chart-wrap {
  position: relative;
  background: var(--bg);
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  border-bottom: 1px solid var(--border);
}
/* Single chart pane — Stoch K/D overlaid via left price scale, no sub-pane */
.tv-chart-price-pane { flex: 1 1 100%; min-height: 0; min-width: 0; }
.tv-chart-stoch-pane { display: none; }

/* ── FOOTER (triggers + account + position, side-by-side) ────────────── */

.tv-strip-footer {
  flex: 0 0 auto;
  display: grid;
  /* triggers : account : position (legacy 3-col, kept for any non-detail views) */
  grid-template-columns: 2.4fr 1fr 2fr;
  gap: 0;
  border-top: 1px solid var(--border-strong);
  background: var(--bg-sunken);
  /* No max-height — let the SIGNALS card grid expand to fit every row.
     Page may scroll on a small viewport, but on a TV all signals show. */
  min-height: 320px;
}
/* Footer: SIGNALS on the LEFT at 65% (mirrors the chart width above)
   so the chart and signals share a visual column; ACCOUNT and PLAN sit
   to the right inside the remaining 35%. Markup order in the template
   is Account → Signals → Plan, so we use grid `order` to flip Signals
   into the leftmost slot without re-shuffling Jinja. */
/* Footer columns: SIGNALS dominant on the left (mirrors chart 65%),
   then RECENT TRADES, ACCOUNT+POSITION (with the trade ticket), and
   PLAN compact on the right. 4-col grid; markup order is
   account→signals→recent→plan, CSS order props rearrange. */
.tv-strip-footer-2col {
  /* All four columns sized proportionally — SIGNALS used to dominate
     at 2.4fr which left RECENT TRADES + PLAN cramped. New ratio gives
     SIGNALS roughly the same width as ACCOUNT+POSITION (which hosts
     two sub-columns), with PLAN compact and RECENT TRADES in between. */
  grid-template-columns: 1.4fr 1.3fr 1.6fr 1.1fr;
}
.tv-strip-footer-2col .tv-foot-col       { overflow-y: visible; min-width: 0; }
.tv-strip-footer-2col .tv-foot-triggers  { order: -2; }
.tv-strip-footer-2col .tv-foot-recent    { order: -1; }
.tv-strip-footer-2col .tv-foot-account   { order:  0; }
.tv-strip-footer-2col .tv-foot-plan      { order:  1; }
@media (max-width: 1380px) {
  /* Two-up on medium screens — signals + recent on top, account + plan below. */
  .tv-strip-footer-2col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  /* Single-column stacking on phones. */
  .tv-strip-footer-2col { grid-template-columns: 1fr; }
}
/* RECENT TRADES — footer column. Each row is a compact 2-line card:
     [glyph] [time · side]
             [headline]
             [detail dim]
   Sized to fit comfortably in a ~14% column without text overflowing. */
.tv-recent-trades-meta { font-size: 10px; letter-spacing: 0.5px; }
.tv-recent-trades-list {
  display: flex; flex-direction: column;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  overflow-y: auto;
  max-height: 36vh;
}
.tv-act-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  padding: 6px 8px;
  border-radius: 3px;
  border-left: 3px solid var(--border);
  background: rgba(140,126,114,0.05);
  min-width: 0;
}
.tv-act-state-filled    { border-left-color: var(--pos); background: rgba(111,174,126,0.10); }
.tv-act-state-partial,
.tv-act-state-open      { border-left-color: #C4A35A;    background: rgba(196,163,90, 0.10); }
.tv-act-state-cancelled,
.tv-act-state-rejected  { border-left-color: var(--neg); opacity: 0.7; }
.tv-act-state-skip      { opacity: 0.65; }
.tv-act-glyph {
  font-size: 11px; line-height: 1; text-align: center;
  padding-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.tv-act-glyph.tv-act-filled    { color: var(--pos); }
.tv-act-glyph.tv-act-partial,
.tv-act-glyph.tv-act-open      { color: #C4A35A; }
.tv-act-glyph.tv-act-cancelled { color: var(--neg); }
.tv-act-glyph.tv-act-skip      { color: var(--fg-dim); }
.tv-act-body {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.tv-act-line1 {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11px;
}
.tv-act-ts   { font-size: 11px; }
.tv-act-side { font-size: 9px; padding: 2px 6px; letter-spacing: 1.2px; text-align: center; flex-shrink: 0; }
.tv-act-headline {
  font-size: 12px; line-height: 1.35;
  color: var(--fg); font-weight: 500;
  overflow-wrap: break-word; word-break: normal;
}
.tv-act-detail {
  font-size: 11px; line-height: 1.35;
  overflow-wrap: break-word;
}
.tv-act-empty { padding: 12px; text-align: center; font-size: 12px; }

/* ACCOUNT + POSITION as 2 sub-columns inside one footer column —
   side-by-side instead of stacked vertically so the whole footer
   fits on one screen. */
.tv-acct-pos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.tv-acct-sub {
  display: flex; flex-direction: column;
  min-width: 0;
}
.tv-acct-sub-head {
  font-size: 10px; letter-spacing: 2px; font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 1380px) {
  /* On the 2-up footer breakpoint the sub-grid stays side-by-side
     since each ACCOUNT-column is now half-width. */
  .tv-acct-pos-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .tv-acct-pos-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* Legacy divider kept around briefly — not used after the 2-col split. */
.tv-acct-position-divider { display: none; }

/* Why-panel collapses into an overlay drawer on the chart-row-full layout.
   Default state = hidden off-canvas to the right; .tv-why-open slides in. */
.tv-chart-row-full .tv-why-panel {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 5;
  width: min(440px, 40vw);
  flex: 0 0 auto;
  background: var(--bg-raised);
  border-left: 1px solid var(--border-strong);
  transform: translateX(100%);
  transition: transform 220ms ease-out;
  box-shadow: -8px 0 24px rgba(0,0,0,0.35);
}
.tv-chart-row-full .tv-why-panel.tv-why-open { transform: translateX(0); }
.tv-chart-row-full .tv-why-panel-collapsed { transform: translateX(100%); }
.tv-chart-row-full .tv-why-toggle { display: inline-flex; }
/* When drawer is open, hide the open-button (close button on drawer takes over) */
.tv-chart-row-full:has(.tv-why-open) .tv-why-toggle { display: none; }

/* ── COMPACT TRIGGERS STRIP — replaces the bulky footer column ──────── */
.tv-triggers-strip {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  overflow-x: auto;
  white-space: nowrap;
}
.tv-trig-strip-head {
  font-size: 11px; letter-spacing: 2px; font-weight: 700;
  flex-shrink: 0;
}
.tv-trig-strip-list {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.tv-trig-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(140,126,114,0.06);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tv-trig-chip-fired   { border-color: rgba(232, 98, 26, 0.55); background: rgba(232, 98, 26, 0.10); }
.tv-trig-chip-warming { border-color: rgba(196,163,90, 0.40); background: rgba(196,163,90, 0.08); }
.tv-trig-chip-cold    { opacity: 0.65; }
.tv-trig-chip-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; color: var(--fg);
}
.tv-trig-chip-side { font-size: 9px; padding: 2px 6px; letter-spacing: 1.2px; }
.tv-trig-chip-bar {
  width: 60px; height: 4px;
  background: rgba(140,126,114,0.25);
  border-radius: 2px; overflow: hidden;
}
.tv-trig-chip-fill {
  display: block; height: 100%;
  background: var(--fg-dim);
  transition: width 240ms ease-out;
}
.tv-trig-chip-fired   .tv-trig-chip-fill { background: var(--accent); }
.tv-trig-chip-warming .tv-trig-chip-fill { background: #C4A35A; }
.tv-trig-chip-state { font-size: 11px; color: var(--fg-dim); }
.tv-trig-chip-state .trigger-fired-pill { font-size: 10px; padding: 2px 6px; }
.tv-foot-col {
  padding: 16px 22px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.tv-foot-col:last-child { border-right: none; }
.tv-foot-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Triggers — always-expanded list, never collapsed. Even cold rows show
   their value prominently so they don't read as 'collapsed/empty'. */
.tv-trigger-list { display: flex; flex-direction: column; gap: 12px; }
.tv-trigger-row {
  display: grid;
  grid-template-columns: 200px 80px 1fr 170px 160px;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.tv-trigger-row:last-child { border-bottom: none; }
.tv-trigger-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.2px;
}
.tv-trigger-side .pill { font-size: 12px; padding: 4px 10px; }
.tv-trigger-track {
  height: 18px;
  background: rgba(140, 126, 114, 0.18);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.tv-trigger-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 0.3s ease-out;
}
.tv-trigger-fired .tv-trigger-fill { background: var(--pos); }
.tv-trigger-cold  .tv-trigger-fill { background: rgba(140, 126, 114, 0.45); }
.tv-trigger-vals {
  font-size: 17px;
  text-align: right;
  letter-spacing: 0.3px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  display: inline-flex; align-items: baseline; gap: 6px; justify-content: flex-end;
}
.tv-trig-now-lbl { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.tv-trig-thresh { font-size: 13px; }
.tv-trigger-state {
  font-size: 14px;
  text-align: right;
  letter-spacing: 0.5px;
}
.trigger-fired-pill { font-size: 11px; padding: 3px 10px; letter-spacing: 1.8px; }

/* Account — single vertical column so position can use the freed width */
.tv-acct-stack {
  display: flex; flex-direction: column;
  gap: 10px;
}
/* Legacy grid kept for any other consumers */
.tv-acct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.tv-acct-item-wide { grid-column: 1 / span 2; }
.tv-acct-k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: 4px;
  font-weight: 700;
}
.tv-acct-v {
  font-size: 19px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}
.tv-acct-nlv { color: var(--accent); font-size: 26px; font-weight: 600; }
.tv-acct-pct { font-size: 13px; margin-left: 6px; }

/* Position — left ticket column + right strategy plan column */
.tv-pos-block { display: flex; flex-direction: column; gap: 10px; }
.tv-pos-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.tv-pos-col { display: flex; flex-direction: column; gap: 10px; }
.tv-pos-plan {
  border-left: 1px dashed var(--border);
  padding-left: 18px;
}
.tv-pos-plan-head {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tv-pos-side { margin-bottom: 6px; }
.tv-pos-side .pill { font-size: 13px; padding: 5px 12px; letter-spacing: 1.5px; }
.tv-pos-row {
  display: flex; justify-content: space-between;
  font-size: 17px;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) {
  .tv-pos-2col { grid-template-columns: 1fr; }
  .tv-pos-plan { border-left: none; padding-left: 0;
                 border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 6px; }
}
.tv-pos-flat {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  height: 100%;
  gap: 10px;
  padding-top: 4px;
}
.tv-pos-flat-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 400;
  color: var(--fg-dim);
  letter-spacing: 4px;
  text-align: center;
}
.tv-pos-flat-sub { font-size: 13px; letter-spacing: 1.5px; }
.tv-pos-flat-sub-inline {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1px;
  vertical-align: middle;
}
.tv-pos-last {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.tv-pos-last-head {
  font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
  margin-bottom: 2px;
}

.tv-footer {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.tv-footer-triggers,
.tv-footer-position,
.tv-footer-trades {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  min-height: 120px;
}
.tv-footer-trades { border-right: none; }
.tv-footer-head {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.trigger-bars-tight {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  background: transparent; border: none; padding: 0;
}
.trigger-bars-tight .trigger-bar {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.tv-pos-summary {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  padding-top: 4px;
}

.tv-trades-tight {
  max-height: 120px;
  overflow-y: auto;
  font-size: 11px;
}
.tv-trades-tight .trade-row { padding: 4px 6px; font-size: 10px; }

/* ── responsive ──────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────────────
   MOBILE — phone-shaped layout. Drops the no-scroll TV constraint and
   restructures so the chart sits above the fold and account/triggers/
   position scroll below as a single column.
   ────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Drop the TV's 100vh / overflow:hidden — phones scroll. */
  html:has(.tv-strip-head),
  body:has(.tv-strip-head) {
    height: auto !important;
    overflow: visible !important;
  }
  body:has(.tv-strip-head) .content {
    flex: none;
    min-height: 0;
  }

  /* Hide the wordmark + source caption — too much horizontal real estate.
     The Sydnee emblem + pair stays visible. */
  .tv-hide-mobile { display: none !important; }

  /* HEADER: emblem + pair on one line, account chips moved to footer */
  .tv-strip-head {
    padding: 10px 14px;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .tv-strip-brand { gap: 10px; flex-wrap: nowrap; min-width: 0; }
  .tv-brand-mark svg { width: 22px; height: 22px; }
  .tv-strip-pair { font-size: 15px; letter-spacing: 1.5px; }
  /* Account chips hidden in header on mobile — they get a dedicated section
     below the chart so the header line stays readable. */
  .tv-strip-meta > span:not(.tv-strip-live) { display: none; }
  .tv-strip-live { font-size: 10px; padding: 4px 10px; gap: 6px; flex-shrink: 0; }
  .tv-strip-live .tv-live-dot { width: 8px; height: 8px; }

  /* PRICE STRIPE — compact, tighter type, all rows full-width */
  .tv-strip-price { padding: 14px 14px 10px; gap: 8px; }
  .tv-pricerow { gap: 12px; flex-wrap: wrap; }
  .tv-price { font-size: 44px; letter-spacing: -1.2px; line-height: 1; flex: 1 1 100%; }
  .tv-change {
    font-size: 16px; padding: 4px 10px;
    flex: 0 0 auto;
  }
  .tv-change-abs { font-size: 13px; }
  .tv-change-label { font-size: 9px; }
  .tv-range-row {
    gap: 14px; grid-template-columns: 1fr;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
  }
  .tv-range-head { font-size: 11px; }
  .tv-range-label { font-size: 9px; letter-spacing: 1.5px; }

  /* Quote row — stacks vertically, labels left-aligned, values mono */
  .tv-quoterow {
    gap: 8px; font-size: 12px;
    flex-direction: column; align-items: stretch;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
  }
  .tv-quoterow > div {
    display: flex; align-items: center;
    gap: 8px;
    padding: 2px 0;
  }
  .tv-quote-label { font-size: 10px; min-width: 64px; margin-right: 0; }
  .tv-quote-px { font-size: 14px; }
  .tv-quote-sz { font-size: 11px; margin-left: auto; }
  .tv-flow-block { flex-wrap: wrap; }
  .tv-flow-gauge { width: 100%; height: 12px; flex: 1 1 auto; }
  .tv-flow-val { min-width: 48px; text-align: right; font-size: 13px; }

  /* TF picker — full-width, 6 even columns, easier tap targets */
  .tv-strip-toolbar {
    padding: 6px 8px;
    flex-direction: column; align-items: stretch; gap: 6px;
  }
  .tv-tf-picker { display: grid; grid-template-columns: repeat(6, 1fr); width: 100%; }
  .tv-tf-btn { padding: 10px 0; font-size: 13px; text-align: center; }
  .tv-tf-btn:first-child { border-radius: 0; }
  .tv-tf-btn:last-child { border-radius: 0; }
  .tv-strip-toolbar-right {
    justify-content: space-between; gap: 8px;
    font-size: 11px;
    padding: 0 6px;
  }
  .tv-stoch-legend { font-size: 11px; gap: 4px; }
  .tv-stoch-bands { padding: 0 4px; margin-left: 4px; }

  /* Chart row stacks: sidebar drops below chart, full-width */
  .tv-chart-row { flex-direction: column; }
  .tv-why-panel {
    flex: 0 0 auto;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 280px;
  }
  .tv-regime-band { padding: 4px 14px; }
  .tv-regime-now { font-size: 10px; }

  /* PORTRAIT PHONE — hide the heavy chart, show a sparkline instead.
     Lightweight Charts at <400px width has cramped axes and the
     candles aren't readable; sparkline captures direction-of-day
     in 60px and frees room for triggers. Tap the sparkline to
     force the full chart in. */
  .tv-mobile-spark { display: block; padding: 8px 14px 0; }
  .tv-chart-section { display: none; }
  body.tv-force-chart .tv-mobile-spark { display: none; }
  body.tv-force-chart .tv-chart-section { display: flex; }

  body.tv-force-chart .tv-chart-section { flex: 0 0 auto; }
  body.tv-force-chart .tv-chart-wrap {
    height: 42vh;
    min-height: 280px;
  }

  /* FOOTER — single column scrolling list, no max-height */
  .tv-strip-footer {
    grid-template-columns: 1fr;
    max-height: none;
    min-height: 0;
  }
  .tv-foot-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .tv-foot-col:last-child { border-bottom: none; }
  .tv-foot-head { font-size: 11px; letter-spacing: 2px; margin-bottom: 10px; padding-bottom: 8px; }

  /* Trigger rows — collapse 5-col grid into label/value pairs */
  .tv-trigger-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name side"
      "track track"
      "vals state";
    gap: 6px 10px;
    padding: 10px 0;
  }
  .tv-trigger-name { grid-area: name; font-size: 18px; }
  .tv-trigger-side { grid-area: side; }
  .tv-trigger-track { grid-area: track; height: 14px; }
  .tv-trigger-vals { grid-area: vals; text-align: left; font-size: 14px; }
  .tv-trigger-state { grid-area: state; text-align: right; font-size: 12px; }

  /* Account grid — single column on phone */
  .tv-acct-grid { grid-template-columns: 1fr; gap: 10px; }
  .tv-acct-item-wide { grid-column: 1; }
  .tv-acct-v { font-size: 17px; }
  .tv-acct-nlv { font-size: 22px; }
  .tv-acct-grid .tv-acct-item {
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 6px;
  }
  .tv-acct-grid .tv-acct-item:last-child { border-bottom: none; }
  .tv-acct-k { margin-bottom: 0; font-size: 11px; }

  /* Position — flat headline shrunk; held position rows full-width */
  .tv-pos-flat-headline { font-size: 32px; letter-spacing: 4px; }
  .tv-pos-row { font-size: 15px; }
}

@media (max-width: 768px) and (orientation: landscape) {
  /* Landscape phone — chart back in, sparkline out (rotation = chart mode) */
  .tv-mobile-spark { display: none; }
  .tv-chart-section { display: flex; }
  .tv-chart-wrap { height: 60vh; min-height: 240px; }
  .tv-price { font-size: 36px; }
}

/* ── single-pair account header (replaces 4-cell strip on BTC view) ──── */

.acct-header {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 16px 20px;
  margin-bottom: 22px;
}
.acct-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
.acct-cell { display: flex; flex-direction: column; gap: 6px; }
.acct-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
}
.acct-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.acct-qty {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
}
.acct-detail {
  font-size: 10px;
  letter-spacing: 0.3px;
  text-align: right;
}
.acct-nlv-row {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
}
.acct-nlv-row .acct-tag { color: var(--accent); font-weight: 700; }
.acct-nlv-row .acct-qty { font-size: 20px; }

.acct-pnl-cell { gap: 12px; }
.acct-pnl-row { display: flex; flex-direction: column; gap: 2px; }
.acct-pnl-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 700;
}
.acct-pnl-value {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
  display: flex; align-items: baseline; gap: 6px;
}
.acct-pnl-value.dim { color: var(--fg-faint); }
.acct-pct {
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-faint);
  letter-spacing: 0.5px;
}
.acct-pnl-sub {
  font-size: 10px;
  letter-spacing: 0.3px;
}
.acct-header-unavailable .acct-qty,
.acct-header-unavailable .acct-pnl-value { color: var(--fg-faint); }

/* ── BTC chart section ───────────────────────────────────────────────── */

.btc-chart-section { margin-bottom: 22px; }
.btc-chart-section h2 {
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
}
.chart-heartbeat {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 1px;
  color: var(--fg-dim);
}
.chart-countdown {
  font-size: 10px; letter-spacing: 1px;
  color: var(--fg-dim);
  padding-left: 14px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.chart-countdown #chart-next-bar { color: var(--fg); font-weight: 500; }
#chart-next-bar.chart-imminent {
  color: var(--accent);
  animation: live-breathe 1s ease-in-out infinite;
}
.chart-heartbeat .live-dot { margin: 0; }
#chart-last-tick.chart-stale {
  color: var(--neg);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
#chart-last-tick.chart-stale::after {
  content: ' · STALE';
  color: var(--neg);
  margin-left: 2px;
}
.btc-chart-wrap {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px;
  position: relative;
  min-height: 520px;
}
.btc-chart-price { width: 100%; height: 360px; }
.btc-chart-stoch { width: 100%; height: 140px; margin-top: 4px; border-top: 1px dashed var(--border); padding-top: 4px; }

.chart-skeleton {
  position: absolute; inset: 8px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: stretch; justify-content: center;
  padding: 24px;
  background: var(--bg-raised);
}
.skeleton-bar {
  height: 16px; background: linear-gradient(90deg,
    rgba(140,126,114,0.06) 0%, rgba(140,126,114,0.18) 50%, rgba(140,126,114,0.06) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s linear infinite;
  border-radius: 2px;
}
.skeleton-bar:nth-child(1) { width: 80%; }
.skeleton-bar:nth-child(2) { width: 64%; }
.skeleton-bar:nth-child(3) { width: 72%; }
.skeleton-text {
  font-size: 10px; letter-spacing: 1.5px; text-align: center;
  margin-top: 8px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── trigger progress bars ───────────────────────────────────────────── */

.trigger-bars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px;
}
.trigger-bar {
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 6px;
  border-bottom: 1px dashed var(--border);
}
.trigger-bar:last-child { border-bottom: none; }
.trigger-bar-label {
  display: flex; align-items: baseline; gap: 8px;
  grid-row: 1; grid-column: 1;
}
.trigger-bar-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; font-weight: 500;
}
.trigger-bar-side { font-size: 9px; }
.trigger-bar-track {
  grid-row: 1; grid-column: 2;
  height: 12px;
  background: rgba(140, 126, 114, 0.14);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.trigger-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 0.3s ease-out;
}
.trigger-bar-fired .trigger-bar-fill { background: var(--pos); }
.trigger-bar-cold .trigger-bar-fill   { background: rgba(140, 126, 114, 0.35); }
.trigger-bar-meta {
  grid-row: 2; grid-column: 1 / span 2;
  font-size: 10px; letter-spacing: 0.3px;
}

/* ── status bar reconnecting indicator ───────────────────────────────── */

.sb-live-reconnecting .live-dot {
  background: var(--gold) !important;
  animation: live-breathe 0.8s ease-in-out infinite !important;
}
.sb-live-reconnecting .sb-live-label::after {
  content: ' ··· RECONNECTING';
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 1px;
  margin-left: 4px;
}

/* ── account inventory panel (per-asset balances from spot bot) ──────── */

.inventory {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.inventory-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.inventory-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  font-weight: 700;
}
.inventory-total {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg-dim);
}
.inventory-total-val {
  font-size: 14px;
  color: var(--fg);
  font-weight: 600;
  margin-left: 4px;
}
.inventory-table { width: 100%; font-size: 12px; }
.inventory-table th, .inventory-table td {
  padding: 6px 8px;
  border-bottom: 1px dashed var(--border);
}
.inventory-table tbody tr:last-child td { border-bottom: none; }
.inventory-empty {
  padding: 18px; text-align: center;
  font-size: 11px; letter-spacing: 1.5px; font-style: italic;
}

/* tradeable direction badge on pair card */
.pair-tradeable {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 2px;
}
.tradeable-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  display: inline-block;
}
.tradeable-both     { color: var(--accent); }
.tradeable-long     { color: var(--gold); }
.tradeable-inactive { color: var(--fg-faint); opacity: 0.7; }

.tradeable-foot {
  font-size: 9px;
  letter-spacing: 0.3px;
}

.pair-profile-spot {
  color: var(--gold);
  font-weight: 700;
}

/* placement badge (M/T) on trade rows */
.placement-badge {
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  font-size: 9px;
  font-weight: 700;
  border-radius: 2px;
}
.placement-maker { background: rgba(111, 174, 126, 0.18); color: var(--pos); }
.placement-taker { background: rgba(255,255,255,0.06);    color: var(--fg-dim); }

/* exit-row status word leads with bold pnl */
.trade-kind-exit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  font-weight: 700;
}

/* ── recent trades pane (live SSE-fed) ───────────────────────────────── */

.recent-trades {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px 14px;
  margin-bottom: 22px;
}
.recent-trades-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.recent-trades-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  font-weight: 700;
}
.recent-trades-status {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--pos);
  display: inline-flex; align-items: center; gap: 5px;
}

.recent-trades-list {
  display: flex; flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.trade-row {
  padding: 6px 8px;
  border-left: 2px solid var(--border);
  border-radius: 2px;
  background: rgba(255,255,255,0.01);
  font-size: 12px;
  animation: trade-flash 0.4s ease-out;
}
.trade-row.trade-entry { border-left-color: var(--accent); }
.trade-row.trade-exit  { border-left-color: var(--gold); }
.trade-line1 {
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
}
.trade-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--fg-dim);
}
.trade-pair {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 500;
}
.trade-time {
  font-size: 10px;
  margin-left: auto;
}
.trade-line2 {
  font-size: 10px;
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.trade-empty {
  font-size: 10px;
  text-align: center;
  letter-spacing: 1.5px;
  padding: 14px 0;
  font-style: italic;
}

@keyframes trade-flash {
  from { background: rgba(232, 98, 26, 0.12); }
  to   { background: rgba(255,255,255,0.01); }
}

/* persistent pulsing "live" dot — sits next to each live cell + in status bar.
   Pure CSS animation (transform/opacity only — GPU, no reflow, no battery cost).
   The .tick-pulse class is added briefly on each tick by JS for a heartbeat
   regardless of move size, complementing the >10bps full-cell flash. */
.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pos);
  margin-left: 6px;
  animation: live-breathe 2.4s ease-in-out infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.live-dot.tick-pulse { animation: live-pulse 0.18s ease-out; }
@keyframes live-breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.08); box-shadow: 0 0 4px var(--pos); }
}
@keyframes live-pulse {
  0%   { transform: scale(2);   opacity: 1; }
  100% { transform: scale(1);   opacity: 0.6; }
}

/* status-bar LIVE pill: dim until first event, full color when streaming */
.sb-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--fg-faint);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.sb-live[data-state="connected"] { color: var(--pos); border-color: rgba(111, 174, 126, 0.35); }
.sb-live[data-state="error"]     { color: var(--neg); border-color: rgba(201, 105, 74, 0.35); }
.sb-live[data-state="connecting"] .live-dot { background: var(--fg-faint); animation: none; }
.sb-live[data-state="error"] .live-dot      { background: var(--neg);      animation: none; }

/* pair-price wrap so the live dot sits inline with the price */
.pair-price-wrap { display: inline-flex; align-items: center; gap: 4px; }

/* live tick flash on price cells.
   - tabular-nums: prevent reflow as digits widen/narrow during fast updates
   - no transition (would fire on every tick); a single 200ms class-based
     highlight runs only when the JS gates a >10bps move */
[data-live-price],
[data-live-prox],
[data-live-current] {
  font-variant-numeric: tabular-nums;
}
.tick-up   { animation: tick-up-flash   0.2s ease-out; }
.tick-down { animation: tick-down-flash 0.2s ease-out; }
@keyframes tick-up-flash {
  0%   { color: var(--pos); }
  100% { color: inherit; }
}
@keyframes tick-down-flash {
  0%   { color: var(--neg); }
  100% { color: inherit; }
}

/* ── account strip (NLV / Cash / P&L / Risk above tabs) ──────────────── */

.account-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-strong);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  margin-bottom: 22px;
  overflow: hidden;
}
.account-cell {
  background: var(--bg-raised);
  padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 80px;
}
.account-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  margin-bottom: 6px;
  font-weight: 700;
}
.account-value {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1.1;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
}
.account-pct {
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-faint);
  letter-spacing: 0.5px;
}
.account-sub {
  font-size: 10px;
  margin-top: 5px;
  letter-spacing: 0.3px;
}
.account-value.warn { color: var(--warn); }

/* ── trigger grid (one card per trigger; closest-to-firing pairs) ────── */

.trigger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.trigger-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.trigger-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.trigger-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--accent);
}
.trigger-count {
  font-size: 11px;
  letter-spacing: 1px;
}
.trigger-body {
  display: flex; flex-direction: column;
  gap: 8px;
}
.trigger-row {
  display: flex; flex-direction: column;
  gap: 3px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.trigger-row:last-child { border-bottom: none; padding-bottom: 0; }
.trigger-pair {
  display: flex; align-items: center; gap: 8px;
}
.trigger-base {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 500;
}
.trigger-side {
  font-size: 9px;
  letter-spacing: 1.2px;
}
.trigger-prox-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
}
.trigger-prox {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
}
.trigger-prox-fired   { color: var(--accent); }
.trigger-prox-warming { color: var(--gold); }
.trigger-prox-cold    { color: var(--fg-faint); }
.trigger-row-fired    { border-bottom-style: solid; border-bottom-color: var(--accent); }
.trigger-row-warming  { border-bottom-style: solid; border-bottom-color: rgba(196, 163, 90, 0.3); }
.trigger-fired-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--accent);
  color: var(--bg);
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 4px;
}
.trigger-prox-label {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--fg-faint);
  font-weight: 400;
  margin-left: 4px;
}
.trigger-vals {
  font-size: 10px;
  letter-spacing: 0.3px;
}
.trigger-empty {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-align: center;
  padding: 16px 8px;
  font-style: italic;
}

/* ── per-pair profile line (winner_entry · expected_wr · tf) ─────────── */

.pair-profile {
  font-size: 10px;
  letter-spacing: 0.5px;
  display: flex; align-items: baseline; gap: 4px;
  margin-top: -4px;
  text-transform: uppercase;
}
.pair-profile-trig { color: var(--accent); }
.pair-profile-wr   { color: var(--fg); }
.pair-profile-tf   { color: var(--fg-dim); }
.pair-profile-sep  { color: var(--fg-faint); }

/* ── pair grid (per-instrument cards) ─────────────────────────────────── */

.pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.pair-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: 3px;
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.pair-card.pair-up    { color: var(--pos); }
.pair-card.pair-down  { color: var(--neg); }
.pair-card.pair-flat  { color: var(--fg-dim); }
/* the colored class above sets currentColor for the SVG; reset for body text */
.pair-card .pair-id,
.pair-card .pair-price,
.pair-card .pair-pos-val,
.pair-card .pair-pos-label { color: var(--fg); }
.pair-card .dim { color: var(--fg-dim); }

.pair-card.pair-up    { border-left-color: var(--pos); }
.pair-card.pair-down  { border-left-color: var(--neg); }
.pair-card.pair-held  { background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg-raised) 70%, color-mix(in srgb, var(--accent) 6%, var(--bg-raised)) 100%); }
.pair-card:hover { border-color: var(--accent); }
.pair-card.pair-up:hover, .pair-card.pair-down:hover { border-color: var(--accent); }

.pair-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.pair-id {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.pair-base { color: var(--fg); }
.pair-sep  { color: var(--fg-faint); margin: 0 2px; }
.pair-quote { color: var(--fg-dim); font-size: 14px; }

.pair-side-pill {
  font-size: 9px;
  letter-spacing: 1.5px;
}

.pair-price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
}
.pair-price {
  font-size: 20px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.3px;
}
.pair-change {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex; align-items: baseline; gap: 5px;
}
.pair-change-label {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--fg-faint);
  font-weight: 400;
}

.pair-spark {
  height: 44px;
  display: flex; align-items: center;
  /* currentColor inherited from .pair-up/.pair-down/.pair-flat */
}
.pair-spark svg { display: block; width: 100%; }
.pair-spark-empty {
  font-size: 9px; letter-spacing: 1.5px;
  width: 100%; text-align: center;
}

.pair-pos {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.pair-pos-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pair-pos-cell { min-width: 0; }
.pair-pos-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--fg-dim); margin-bottom: 2px;
}
.pair-pos-val {
  font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── master dashboard tiles ────────────────────────────────────────────── */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tile {
  display: flex; flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 16px;
  min-height: 200px;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--fg);
}
.tile-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.tile-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.tile-status {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--fg-dim);
  display: inline-flex; align-items: center; gap: 6px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--pos); box-shadow: 0 0 6px var(--pos); }
.dot-stub { background: var(--fg-dim); }
.dot-down { background: var(--neg); }

.tile-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile-cell { padding: 6px 0; }
.tile-cell-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--fg-dim); margin-bottom: 3px;
}
.tile-cell-val { font-size: 16px; font-weight: 500; letter-spacing: -0.2px; }
.tile-cell-val.strong { color: var(--accent); }
.tile-empty { align-items: center; justify-content: center; flex: 1; }
.tile-foot {
  font-size: 9px; letter-spacing: 2px;
  margin-top: 14px; padding-top: 10px;
  border-top: 1px solid var(--border);
  text-align: right;
}
.tile:hover .tile-foot { color: var(--accent); }

/* ── data tables (Bloomberg dense) ─────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-sunken); }
th {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 700;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border-strong);
}
td.num, th.num { text-align: right; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.dim { color: var(--fg-dim); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.pill.buy  { color: var(--pos); background: transparent; }
.pill.sell { color: var(--neg); background: transparent; }

.empty {
  color: var(--fg-dim);
  font-style: italic;
  padding: 18px;
  text-align: center;
  font-size: 13px;
}

.fixture-banner {
  background: transparent;
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 2px;
  padding: 6px 14px;
  margin: 10px 18px 0;
  font-size: 10px;
  letter-spacing: 2px;
  text-align: center;
}

/* ── login ─────────────────────────────────────────────────────────────── */

.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-box {
  width: 360px; max-width: calc(100vw - 32px);
  text-align: center;
  padding: 36px 28px;
}
.login-emblem { color: var(--fg); margin-bottom: 18px; display: inline-block; }
.login-wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 500; letter-spacing: 1px;
  margin-bottom: 6px;
}
.login-tagline {
  font-style: italic; font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 30px;
}
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--fg-dim); text-align: left;
}
.login-input {
  background: var(--bg-raised);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 14px;
  letter-spacing: 4px;
  outline: none;
  transition: border-color 0.15s;
}
.login-input:focus { border-color: var(--accent); }
.login-err {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--neg); letter-spacing: 1px;
  text-align: left;
}
.login-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 3px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 10px;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s, color 0.15s;
}
.login-btn:hover { background: var(--accent); color: var(--bg); }
.login-foot {
  margin-top: 32px;
  font-size: 9px; letter-spacing: 2px; color: var(--fg-faint);
}

/* ── mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  body { font-size: 15px; }
  .content { padding: 16px 12px 40px; }
  .statusbar { padding: 6px 10px; font-size: 11px; }
  .sb-nav { width: 100%; order: 5; padding-top: 4px; border-top: 1px solid var(--border); margin-top: 4px; margin-left: 0; }
  .sb-clock { display: none; }

  .page-title { font-size: 28px; }

  .hero { grid-template-columns: repeat(2, 1fr); }
  .hero-cell { min-height: 56px; padding: 10px 12px; }
  .hero-value { font-size: 17px; }

  .tile-grid { grid-template-columns: 1fr; }
  .pair-grid { grid-template-columns: 1fr; }
  .trigger-grid { grid-template-columns: 1fr; }
  .account-strip { grid-template-columns: repeat(2, 1fr); }
  .account-cell { min-height: 64px; padding: 10px 12px; }
  .account-value { font-size: 16px; }
  .acct-grid { grid-template-columns: 1fr; gap: 16px; }
  .trigger-bars { grid-template-columns: 1fr; }
  .trigger-bar { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .trigger-bar-label, .trigger-bar-track, .trigger-bar-meta { grid-column: 1; }
  .trigger-bar-track { grid-row: 2; }
  .trigger-bar-meta { grid-row: 3; }
  .btc-chart-price { height: 280px; }
  .btc-chart-stoch { height: 100px; }
  .bot-row { gap: 6px; }
  .bot-chip { padding: 6px 10px; }
  .bot-chip-meta { display: none; }
  .pair-card { padding: 12px; }

  /* tables → stacked label/value cards */
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tbody tr {
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 6px 4px;
    margin-bottom: 8px;
    background: var(--bg-raised);
  }
  tbody tr:hover { background: var(--bg-raised); }
  td {
    border: none;
    padding: 4px 10px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }
  td.num { text-align: right; }
  td::before {
    content: attr(data-label);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fg-dim);
    font-weight: 700;
    flex-shrink: 0;
  }
}

/* ── MACRO TAPE — what's pushing BTC ─────────────────────────────────── */
/* Thin horizontal strip below the price stripe. Color logic encodes BTC
   sentiment: green = supportive of BTC (e.g. SPY up, UUP down). The hint
   tooltip explains each ticker's relationship to BTC for non-traders. */
.tv-macro-strip {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 0;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
  white-space: nowrap;
}
.tv-macro-head {
  font-size: 11px; letter-spacing: 2px; font-weight: 700;
  padding: 10px 18px 10px 0;
  color: var(--fg-dim); flex-shrink: 0;
}
.tv-macro-cell {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 10px 18px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.tv-macro-cell:last-child { border-right: 1px solid var(--border); }
.tv-macro-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 1.5px; font-weight: 700;
  color: var(--fg-dim);
}
.tv-macro-px { font-size: 13px; color: var(--fg); font-weight: 500; }
.tv-macro-chg { font-size: 12px; font-weight: 600; }
.tv-macro-cell.pos .tv-macro-chg,
.tv-macro-cell.pos .tv-macro-label { color: var(--pos); }
.tv-macro-cell.neg .tv-macro-chg,
.tv-macro-cell.neg .tv-macro-label { color: var(--neg); }

/* ── crypto-macro toolbar (default) ─────────────────────────────────── */
.tv-cmacro-strip { position: relative; }
/* Pre-chart variant — sits at the page top above the 30D range. Tight
   padding, centered cells. overflow:visible critical so hover popovers
   aren't clipped by the strip's bounding box. */
.tv-cmacro-strip-pre-chart {
  margin: 4px 22px -4px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow: visible;
  justify-content: center;
}
.tv-cmacro-strip-pre-chart .tv-cmacro-list {
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
}
.tv-cmacro-strip-pre-chart .tv-macro-cell { padding: 6px 14px; }
.tv-cmacro-strip-pre-chart .tv-macro-head { padding: 6px 14px 6px 0; }
@media (max-width: 720px) {
  /* Phone: cells render as a clean 2-column grid (equal widths, no
     ragged rows from flex-wrap). MACRO label hidden — cells are
     self-labeled. Strip sits inside a contained pill so it reads as
     one group, not a continuation of the page edge. */
  .tv-cmacro-strip-pre-chart {
    margin: 4px 8px 0;
    padding: 6px;
    background: var(--bg-sunken);
    border-radius: 6px;
    display: block;
    overflow: visible;
  }
  .tv-cmacro-strip-pre-chart .tv-macro-head { display: none; }
  .tv-cmacro-strip-pre-chart .tv-cmacro-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex-wrap: unset;
    white-space: normal;
  }
  .tv-cmacro-strip-pre-chart .tv-macro-cell {
    display: grid;
    grid-template-columns: minmax(48px, auto) 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 4px;
    margin: 0;
    min-height: 38px;
    box-sizing: border-box;
  }
  .tv-cmacro-strip-pre-chart .tv-macro-label { font-size: 9px; letter-spacing: 1px; }
  .tv-cmacro-strip-pre-chart .tv-macro-px    { font-size: 12px; line-height: 1.2; }
  .tv-cmacro-strip-pre-chart .tv-macro-chg   { font-size: 10px; line-height: 1.2; }
  .tv-cmacro-strip-pre-chart .tv-cmacro-info {
    font-size: 12px; opacity: 0.7;
    justify-self: end; margin-left: 0;
    min-width: 16px; text-align: center;
  }
  /* Date pill on the ETF cell folds into the change column on phone. */
  .tv-cmacro-etf-date { display: none; }
}

/* Toolbar cells with hover popovers — applies to FUNDING/DVOL/SKEW/F&G/
   BTC.D/ETF/DXY/BTC↔DXY uniformly. The cell itself is the hover/focus
   target. cursor:default (not help) so desktop doesn't show the ugly ?
   pointer; the ⓘ glyph alone signals "more info on hover/tap". */
.tv-cmacro-has-popover { position: relative; cursor: default; outline: none; }
.tv-cmacro-etf-date {
  font-size: 10px; letter-spacing: 0.6px;
  margin-left: 4px;
}
.tv-cmacro-info {
  font-size: 10px; line-height: 1;
  margin-left: 4px;
  color: var(--fg-dim);
  cursor: pointer;
  user-select: none;
  opacity: 0.6;
}
.tv-cmacro-has-popover:hover .tv-cmacro-info,
.tv-cmacro-has-popover:focus-within .tv-cmacro-info { color: var(--accent); opacity: 1; }

/* Hover popover — reveals the full plain-English read. Pure CSS hover. */
.tv-cmacro-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%; transform: translateX(-50%) translateY(-4px);
  min-width: 240px; max-width: 360px;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; line-height: 1.4;
  color: var(--fg);
  white-space: normal;
  opacity: 0; pointer-events: none;
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  /* z-index above price stripe (no explicit z-index there, default 0)
     and the chart row's relative-positioned panels. */
  z-index: 200;
}
@media (max-width: 720px) {
  /* Phone popover: pinned to the viewport, full-width minus 12px gutters,
     anchored toward the top of the screen so it never collides with the
     iOS bottom toolbar (which steals ~120px of bottom real estate when
     visible). Word-wrap forced so long tooltip strings don't overflow. */
  .tv-cmacro-popover {
    position: fixed;
    top: 76px;            /* below the price row's top edge */
    bottom: auto;
    left: 12px; right: 12px;
    width: auto; max-width: none; min-width: 0;
    transform: translateY(-6px);
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    word-break: break-word; overflow-wrap: anywhere;
    font-size: 12px; line-height: 1.45;
    padding: 12px 14px;
    z-index: 250;
  }
  .tv-cmacro-has-popover:hover .tv-cmacro-popover,
  .tv-cmacro-has-popover:focus-within .tv-cmacro-popover {
    transform: translateY(0);
  }
  /* Override the desktop last-child anchor — fixed-positioning ignores it. */
  .tv-cmacro-list > .tv-cmacro-has-popover:last-child .tv-cmacro-popover {
    left: 12px; right: 12px; transform: translateY(-6px);
  }
  .tv-cmacro-list > .tv-cmacro-has-popover:last-child:hover .tv-cmacro-popover,
  .tv-cmacro-list > .tv-cmacro-has-popover:last-child:focus-within .tv-cmacro-popover {
    transform: translateY(0);
  }
}
.tv-cmacro-has-popover:hover .tv-cmacro-popover,
.tv-cmacro-has-popover:focus-within .tv-cmacro-popover {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* Last cell's popover would clip the right edge of the strip — anchor right. */
.tv-cmacro-list > .tv-cmacro-has-popover:last-child .tv-cmacro-popover {
  left: auto; right: 0; transform: translateY(-4px);
}
.tv-cmacro-list > .tv-cmacro-has-popover:last-child:hover .tv-cmacro-popover,
.tv-cmacro-list > .tv-cmacro-has-popover:last-child:focus-within .tv-cmacro-popover {
  transform: translateY(0);
}
.tv-cmacro-popover-head { font-size: 9px; letter-spacing: 1.4px; margin-bottom: 4px; }
.tv-cmacro-popover-body { font-family: inherit; }

/* Desktop trade notifications toggle — slim icon-led button. */
.tv-notif-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-dim);
  padding: 3px 8px; border-radius: 3px;
  cursor: pointer;
  font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
  transition: border-color 120ms, color 120ms;
}
.tv-notif-btn:hover { border-color: var(--accent); color: var(--fg); }
.tv-notif-btn .tv-notif-icon { display: inline-block; vertical-align: middle; }
.tv-notif-btn.tv-notif-on { color: var(--accent); border-color: rgba(232,98,26,0.5); }
.tv-notif-btn.tv-notif-on .tv-notif-icon { stroke: var(--accent); }
.tv-notif-btn.tv-notif-blocked { color: var(--neg); border-color: rgba(201,105,74,0.4); }
.tv-notif-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.tv-cmacro-list {
  display: flex; align-items: center; gap: 0;
  flex: 1 1 auto;
  /* No overflow clipping at the list level — popovers anchor below cells
     and would otherwise be cropped by the strip's bounding box. */
  white-space: nowrap;
}
.tv-cmacro-empty { padding: 10px 18px; font-size: 11px; }
.tv-cmacro-cell.tone-pos      .tv-macro-px { color: var(--pos); }
.tv-cmacro-cell.tone-neg      .tv-macro-px { color: var(--neg); }
.tv-cmacro-cell.tone-pos.tone-dim .tv-macro-px,
.tv-cmacro-cell.tone-pos-dim  .tv-macro-px { color: rgba(111,174,126,0.65); }
.tv-cmacro-cell.tone-neg.tone-dim .tv-macro-px,
.tv-cmacro-cell.tone-neg-dim  .tv-macro-px { color: rgba(201,105,74,0.65); }
.tv-cmacro-cell.tone-warn     .tv-macro-px { color: #C4A35A; }
.tv-cmacro-cell.tone-warn     .tv-macro-label { color: #C4A35A; }
.tv-cmacro-cell .tv-macro-chg { font-size: 11px; opacity: 0.85; }
.tv-cmacro-stale { opacity: 0.45; }
.tv-cmacro-flash { animation: tv-cmacro-flash 0.6s ease-out; }
@keyframes tv-cmacro-flash {
  0%   { background: rgba(232,98,26,0.18); }
  100% { background: transparent; }
}
.tv-macro-hint {
  font-size: 10px; letter-spacing: 0.3px;
  margin-left: 6px;
  /* Truncate to prevent runaway hint widths from blowing up the strip. */
  max-width: 24ch; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 1280px) { .tv-macro-hint { display: none; } }

@media (max-width: 720px) {
  .tv-macro-strip { padding: 0 12px; }
  .tv-macro-head { padding: 8px 12px 8px 0; font-size: 10px; }
  .tv-macro-cell { padding: 8px 12px; gap: 6px; }
  .tv-macro-px { font-size: 12px; }
  .tv-macro-chg { font-size: 11px; }
}

/* ── SCORE STRIP — LLM-scored BTC context (Claude Opus 4.7) ──────────── */
/* Five regions: 3 score chips + summary/drivers + action hint. Color
   bands encode bullish (green) / lean / neutral / bearish (red). */
.tv-score-strip {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg-sunken);
}
.tv-score-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tv-score-meta { font-size: 10px; letter-spacing: 0.5px; }
/* New 2-column layout: LLM read on the left, persisted AI briefs on right */
.tv-score-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0 24px;
  align-items: stretch;
}
.tv-score-left {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
  min-width: 0;
  align-items: start;
}
.tv-score-left .tv-score-cells { grid-row: span 3; }
.tv-score-left .tv-score-summary,
.tv-score-left .tv-score-action { grid-column: 2; }
.tv-score-right {
  display: flex; flex-direction: column; gap: 10px;
  padding-left: 22px;
  border-left: 1px dashed var(--border);
  min-width: 0;
}
.tv-score-right-head {
  font-size: 11px; letter-spacing: 2px; font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.tv-analysis-empty { font-size: 12px; padding: 4px 0; }
.tv-analysis-card-active { border-left-width: 4px; }
.tv-analysis-tag {
  font-size: 9px; letter-spacing: 1.8px; font-weight: 700;
  padding: 2px 6px; border-radius: 2px;
  background: rgba(232, 98, 26, 0.18); color: var(--accent);
}
.tv-score-cells {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 8px 14px;
  align-items: stretch;
}
.tv-score-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3px 7px;
  min-width: 44px;
  border-radius: 3px;
  background: rgba(140, 126, 114, 0.08);
  border: 1px solid var(--border);
}
.tv-score-cell.pos { background: rgba(111, 174, 126, 0.10); border-color: rgba(111,174,126,0.30); }
.tv-score-cell.neg { background: rgba(201, 105, 74, 0.10);  border-color: rgba(201,105,74,0.30); }
.tv-score-k { font-size: 8px; letter-spacing: 1.2px; font-weight: 700; color: var(--fg-dim); }
.tv-score-v { font-size: 12px; font-weight: 600; line-height: 1; margin: 1px 0; font-variant-numeric: tabular-nums; }
.tv-score-cell.pos .tv-score-v { color: var(--pos); }
.tv-score-cell.neg .tv-score-v { color: var(--neg); }
.tv-score-band { font-size: 8px; letter-spacing: 1px; text-transform: uppercase; }
.tv-score-summary {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.tv-score-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px; line-height: 1.35;
  color: var(--fg);
}
.tv-score-drivers {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0 12px;
  font-size: 11px; color: var(--fg-dim);
}
.tv-score-drivers li::before { content: "· "; color: var(--accent); margin-right: 4px; }
.tv-score-action {
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 0;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}
.tv-score-hint-k { font-size: 10px; letter-spacing: 1.5px; font-weight: 700; }
.tv-score-hint { color: var(--fg); font-weight: 500; }
.tv-score-size { font-size: 11px; }

/* ETF flows row — surfaces analyses.sources.etf_flows from the CLI scorer.
   Greyed out when the model couldn't fetch fresh data (data unavailable). */
.tv-etf-flows {
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 6px; margin-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
}
.tv-etf-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tv-etf-k { font-size: 10px; letter-spacing: 1.4px; font-weight: 700; }
.tv-etf-v { font-weight: 600; font-size: 12px; }
.tv-etf-v.pos { color: var(--pos); }
.tv-etf-v.neg { color: var(--neg); }
.tv-etf-v.dim { color: var(--fg-dim); font-style: italic; }
.tv-etf-arrow { font-size: 10px; vertical-align: middle; }
.tv-etf-trend {
  font-size: 10px; letter-spacing: 0.5px;
  padding: 1px 6px; border-radius: 2px;
  background: rgba(140,126,114,0.10);
  color: var(--fg-dim);
  text-transform: uppercase;
}
.tv-etf-trend-strong_inflow,
.tv-etf-trend-inflow         { background: rgba(111,174,126,0.18); color: var(--pos); }
.tv-etf-trend-strong_outflow,
.tv-etf-trend-outflow        { background: rgba(196, 90, 90, 0.18); color: var(--neg); }
.tv-etf-trend-neutral        { background: rgba(140,126,114,0.18); color: var(--fg-dim); }
.tv-etf-trend-unknown        { background: transparent; color: var(--fg-dim); font-style: italic; }
.tv-etf-streak { font-size: 10px; }
.tv-etf-notes  { font-size: 10px; line-height: 1.4; padding-top: 2px; }
[data-etf-unknown="1"] .tv-etf-trend { opacity: 0.6; }

/* Policy shifts — up to 3 cards from analyses.sources.policy_shifts. */
.tv-policy-shifts {
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 6px; margin-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
}
.tv-policy-head { font-size: 10px; letter-spacing: 1.4px; font-weight: 700; margin-bottom: 2px; }
.tv-policy-row {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 0;
  flex-wrap: wrap;
  min-width: 0;
}
.tv-policy-badge {
  font-size: 9px; letter-spacing: 0.8px;
  padding: 1px 5px; border-radius: 2px;
  flex-shrink: 0; text-transform: uppercase; font-weight: 600;
}
.tv-policy-badge-pro_crypto  { background: rgba(111,174,126,0.18); color: var(--pos); }
.tv-policy-badge-anti_crypto { background: rgba(196, 90, 90, 0.18); color: var(--neg); }
.tv-policy-badge-neutral     { background: rgba(140,126,114,0.18); color: var(--fg-dim); }
.tv-policy-title {
  flex: 1 1 auto; min-width: 0;
  color: var(--fg);
  overflow-wrap: break-word;
}
.tv-policy-when { font-size: 10px; flex-shrink: 0; }

@media (max-width: 1100px) {
  .tv-score-grid { grid-template-columns: 1fr; }
  .tv-score-right { padding-left: 0; border-left: none;
                    padding-top: 12px; border-top: 1px dashed var(--border); }
  .tv-score-cells { grid-template-columns: repeat(3, 1fr); }
}

/* ── INTEL SIDEBAR — chart's right-rail companion ────────────────────── */
.tv-intel-panel {
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-sunken);
  overflow-y: auto;
  min-width: 0;
}

/* ── INTEL ROTATING CAROUSEL ─────────────────────────────────────────── */
/* The carousel is the dominant surface in the right column. Cards are
   sized to fill the available height (chart row's 35% column) with TV-
   readable type — readable from across the room or on a projector. */
.tv-intel-carousel {
  padding: 0;
  overflow: hidden;
  /* Inherit full chart-row height — the parent .tv-intel-panel is a
     flex child of .tv-chart-row-split (65/35 grid). */
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  min-height: 0;
}
.tv-intel-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.tv-intel-card {
  position: absolute; inset: 0;
  padding: 24px 28px 16px;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
  transform: translateX(8px);
}
.tv-intel-card[data-active] {
  opacity: 1; pointer-events: auto;
  transform: translateX(0);
}
.tv-intel-card[data-card-empty="1"] { display: none; }
/* Top tone strip — colored ribbon at the very top of each macro card so
   the regime is visible from across the room before the eye reaches the
   value. Width is 100% but transparent for non-toned cards. */
.tv-intel-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
}
.tv-intel-card[data-tone="pos"]::before     { background: var(--pos); }
.tv-intel-card[data-tone="pos-dim"]::before { background: rgba(111,174,126,0.55); }
.tv-intel-card[data-tone="neg"]::before     { background: var(--neg); }
.tv-intel-card[data-tone="neg-dim"]::before { background: rgba(201,105,74,0.55); }
.tv-intel-card[data-tone="warn"]::before    { background: #C4A35A; }
.tv-intel-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  flex: 0 0 auto;
}
.tv-intel-card-title {
  font-size: 16px; letter-spacing: 2.5px; font-weight: 700;
  color: var(--fg);
  display: flex; align-items: center; gap: 10px;
}
.tv-intel-card-when {
  font-size: 11px; letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(140,126,114,0.10);
  color: var(--fg-dim);
}
.tv-intel-card-body {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
}

/* Common WHAT / READ / SOURCE sub-section blocks */
.tv-card-section { display: flex; flex-direction: column; gap: 4px; }
.tv-card-section-head {
  font-size: 10px; letter-spacing: 1.8px; font-weight: 700;
}
.tv-card-section-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; line-height: 1.5;
  color: var(--fg);
}
.tv-card-section-body strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}
.tv-card-source {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 10px; letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* Card 1: SCORES — three big chips. Values readable from across a room. */
.tv-card-body-scores .tv-score-cells {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tv-card-body-scores .tv-score-cell {
  padding: 22px 12px;
  border-radius: 6px;
}
.tv-card-body-scores .tv-score-k    { font-size: 13px; letter-spacing: 2px; }
.tv-card-body-scores .tv-score-v    {
  font-size: 56px; line-height: 1; margin: 6px 0;
  font-weight: 700; letter-spacing: -1.5px;
}
.tv-card-body-scores .tv-score-band { font-size: 12px; letter-spacing: 1.4px; }
.tv-card-body-scores .tv-score-hint { font-size: 16px; }
.tv-card-body-scores .tv-score-size { font-size: 13px; }

/* Card 2: SENTIMENT — text-heavy, generous line-height */
.tv-card-body-text .tv-score-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; line-height: 1.45;
  color: var(--fg);
}
.tv-card-body-text .tv-score-drivers {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 15px; line-height: 1.45;
  color: var(--fg-dim);
}
.tv-card-body-text .tv-score-drivers li::before {
  content: "· "; color: var(--accent); margin-right: 6px;
}

/* Card 3: POLICY SHIFTS — stacked rows */
.tv-card-policy-list { display: flex; flex-direction: column; gap: 12px; }
.tv-card-policy-list .tv-policy-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 16px;
  border-radius: 5px;
  background: rgba(140,126,114,0.06);
  flex-wrap: wrap;
}
.tv-card-policy-list .tv-policy-badge { font-size: 11px; padding: 3px 8px; }
.tv-card-policy-list .tv-policy-title { font-size: 16px; line-height: 1.45; }

/* Cards 4-11: macro signals — XL value, badge, WHAT / READ / SOURCE */
.tv-card-body-macro { gap: 18px; }
.tv-card-macro-hero {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 0 22px;
  border-bottom: 1px dashed var(--border);
}
.tv-card-macro-value {
  font-size: 64px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  letter-spacing: -2px;
}
.tv-intel-card-macro[data-tone="pos"] .tv-card-macro-value,
.tv-intel-card-macro[data-tone="pos-dim"] .tv-card-macro-value { color: var(--pos); }
.tv-intel-card-macro[data-tone="neg"] .tv-card-macro-value,
.tv-intel-card-macro[data-tone="neg-dim"] .tv-card-macro-value { color: var(--neg); }
.tv-intel-card-macro[data-tone="warn"] .tv-card-macro-value { color: #C4A35A; }
.tv-card-macro-badge {
  display: inline-block;
  font-size: 13px; letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  background: rgba(140,126,114,0.08);
  border: 1px solid var(--border);
  align-self: flex-start;
}
.tv-card-macro-badge:empty { display: none; }
.tv-intel-card-macro[data-tone="pos"] .tv-card-macro-badge,
.tv-intel-card-macro[data-tone="pos-dim"] .tv-card-macro-badge {
  color: var(--pos); border-color: rgba(111,174,126,0.45);
  background: rgba(111,174,126,0.12);
}
.tv-intel-card-macro[data-tone="neg"] .tv-card-macro-badge,
.tv-intel-card-macro[data-tone="neg-dim"] .tv-card-macro-badge {
  color: var(--neg); border-color: rgba(201,105,74,0.45);
  background: rgba(201,105,74,0.12);
}
.tv-intel-card-macro[data-tone="warn"] .tv-card-macro-badge {
  color: #C4A35A; border-color: rgba(196,163,90,0.45);
  background: rgba(196,163,90,0.12);
}
.tv-card-macro-change { font-size: 13px; }
.tv-intel-empty { padding: 20px 0; text-align: center; font-size: 14px; }

/* Card 0: CAMPAIGN — hero number + honest split + cooldown countdown */
.tv-card-body-campaign { gap: 18px; }
.tv-card-campaign-name { font-size: 12px; letter-spacing: 1.4px; margin-left: 8px; }
.tv-card-campaign-hero {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 0 18px;
  border-bottom: 1px dashed var(--border);
}
.tv-card-campaign-headline {
  display: flex; align-items: baseline; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.tv-card-campaign-cashflow {
  font-size: 56px; font-weight: 700; line-height: 1;
  letter-spacing: -1.5px;
  color: var(--fg);
}
.tv-intel-card-campaign[data-tone="pos"] .tv-card-campaign-cashflow { color: var(--pos); }
.tv-intel-card-campaign[data-tone="pos-dim"] .tv-card-campaign-cashflow { color: rgba(111,174,126,0.85); }
.tv-card-campaign-of { font-size: 28px; font-weight: 400; }
.tv-card-campaign-target { font-size: 22px; font-weight: 500; }
.tv-card-campaign-pct {
  font-size: 18px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--accent);
  margin-top: 4px;
}
.tv-intel-card-campaign[data-tone="pos"] .tv-card-campaign-pct { color: var(--pos); }
.tv-card-campaign-pct-label {
  font-size: 12px; letter-spacing: 1.4px; font-weight: 500;
  margin-left: 4px;
}
.tv-card-campaign-days {
  font-size: 12px; letter-spacing: 0.6px;
}
.tv-card-campaign-split {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  background: rgba(140,126,114,0.05);
  border-radius: 4px;
}
.tv-card-campaign-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline; gap: 8px;
}
.tv-card-campaign-row-label { font-size: 10px; letter-spacing: 1.4px; font-weight: 700; }
.tv-card-campaign-row-val   {
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.tv-card-campaign-row-note  {
  grid-column: 1 / -1;
  font-size: 10px; letter-spacing: 0.5px;
}

/* ── BOT ACTIVITY strip — page footer ─────────────────────────────────
   Five compact cells: SIGNAL / SCORE / FILL / PROFILE / 24H. Each cell
   has a label, value, and "X ago" timestamp that ticks at 1Hz. Goes
   stale (dim) when the gap exceeds the per-surface threshold so the
   operator can see at a glance whether the bot is alive. */
.tv-bot-strip {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 22px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.tv-bot-strip-head {
  font-size: 10px; letter-spacing: 1.8px; font-weight: 700;
  flex-shrink: 0;
  color: var(--fg-dim);
}
.tv-bot-strip-cells {
  display: flex; flex-wrap: wrap; gap: 14px;
  flex: 1 1 auto;
}
.tv-bot-cell {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px;
  border-left: 2px solid var(--border);
}
.tv-bot-cell-stale { opacity: 0.45; }
.tv-bot-cell-stale .tv-bot-cell-when { color: var(--neg); }
.tv-bot-cell-k {
  font-size: 9px; letter-spacing: 1.5px; font-weight: 700;
}
.tv-bot-cell-v {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.tv-bot-cell-when { font-size: 10px; }
@media (max-width: 720px) {
  .tv-bot-strip { padding: 8px 12px; gap: 10px; }
  .tv-bot-strip-head { display: none; }
  .tv-bot-cell { padding: 3px 8px; gap: 5px; }
  .tv-bot-cell-k { font-size: 8px; }
  .tv-bot-cell-v { font-size: 10px; }
  .tv-bot-cell-when { font-size: 9px; }
}

/* RECENT TRADES — harvest state (rebalance@inventory fills). Distinct
   gold accent so the operator can tell cash-flow events from speculative
   trades at a glance. */
.tv-act-state-harvest {
  border-left-color: #C4A35A; background: rgba(196,163,90,0.08);
}
.tv-act-glyph.tv-act-harvest { color: #C4A35A; }

@media (max-width: 720px) {
  .tv-card-campaign-cashflow { font-size: 42px; letter-spacing: -1px; }
  .tv-card-campaign-of { font-size: 22px; }
  .tv-card-campaign-target { font-size: 18px; }
  .tv-card-campaign-pct { font-size: 15px; }
  .tv-card-campaign-row-val { font-size: 16px; }
}

/* Carousel chrome — clickable mini-card thumbnails + pause button.
   The active thumbnail's underline doubles as the rotation timer, so
   we get progress feedback without a separate full-width bar. */
.tv-intel-nav {
  display: flex; align-items: stretch; gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
  background: var(--bg-sunken);
}
.tv-intel-thumbs {
  flex: 1 1 auto;
  display: flex; gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Hide native scrollbar — drag still works on touch + mousewheel */
  scrollbar-width: none;
}
.tv-intel-thumbs::-webkit-scrollbar { display: none; }
.tv-intel-thumb {
  position: relative;
  flex: 0 0 auto;
  min-width: 80px; max-width: 130px;
  padding: 6px 10px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(140,126,114,0.04);
  color: var(--fg-dim);
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.tv-intel-thumb:hover { border-color: rgba(232,98,26,0.4); color: var(--fg); }
.tv-intel-thumb[data-active] {
  border-color: var(--accent);
  background: rgba(232,98,26,0.08);
  color: var(--fg);
}
.tv-thumb-title {
  font-size: 9px; letter-spacing: 1.2px; font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.tv-thumb-val {
  font-size: 12px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tv-intel-thumb[data-tone="pos"] .tv-thumb-val,
.tv-intel-thumb[data-tone="pos-dim"] .tv-thumb-val { color: var(--pos); }
.tv-intel-thumb[data-tone="neg"] .tv-thumb-val,
.tv-intel-thumb[data-tone="neg-dim"] .tv-thumb-val { color: var(--neg); }
.tv-intel-thumb[data-tone="warn"] .tv-thumb-val { color: #C4A35A; }
/* Active thumb's underline = the rotation timer (0%→100%). */
.tv-thumb-fill {
  position: absolute; left: 0; bottom: 0;
  height: 2px; width: 0%;
  background: var(--accent);
  transition: width 100ms linear;
}
.tv-intel-pause {
  flex: 0 0 auto;
  align-self: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-dim);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 10px; letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 120ms, color 120ms;
}
.tv-intel-pause:hover { color: var(--accent); border-color: rgba(232,98,26,0.5); }

@media (max-width: 720px) {
  .tv-intel-stage { min-height: 360px; }
  .tv-intel-card { padding: 18px 16px 12px; }
  .tv-intel-card-title { font-size: 13px; letter-spacing: 2px; }
  .tv-intel-card-when { font-size: 11px; }
  .tv-card-body-scores .tv-score-cell { padding: 14px 8px; }
  .tv-card-body-scores .tv-score-v { font-size: 38px; }
  .tv-card-body-scores .tv-score-k { font-size: 11px; }
  .tv-card-body-scores .tv-score-band { font-size: 10px; }
  .tv-card-body-text .tv-score-text { font-size: 17px; }
  .tv-card-body-text .tv-score-drivers { font-size: 13px; }
  .tv-card-macro-value { font-size: 44px; letter-spacing: -1px; }
  .tv-card-macro-badge { font-size: 13px; }
  .tv-card-section-body { font-size: 14px; }
  .tv-card-section-body strong { font-size: 12px; }
  .tv-card-source { font-size: 9px; }
  .tv-card-policy-list .tv-policy-title { font-size: 14px; }
  .tv-intel-thumb { min-width: 70px; padding: 5px 8px 7px; }
  .tv-thumb-title { font-size: 8px; }
  .tv-thumb-val { font-size: 11px; }
  .tv-intel-pause { padding: 4px 8px; font-size: 9px; }
  .tv-intel-nav { padding: 6px 10px 10px; gap: 6px; }
}
.tv-intel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.tv-intel-meta {
  font-size: 14px; letter-spacing: 0.5px;
  color: var(--fg);
  font-weight: 600;
}
.tv-intel-meta-ts { color: var(--accent); font-weight: 700; margin-left: 4px; }

/* LIVE badge — prominent green pulse-on-push indicator with a
   "synced Xs ago" timer that ticks every second. Used in the INTEL
   header + SIGNALS column header so the operator can see at a glance
   whether the SSE pushes are landing. */
.tv-live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  margin-left: 10px;
  border: 1px solid rgba(111,174,126,0.45);
  background: rgba(111,174,126,0.10);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--pos);
  font-weight: 600;
}
.tv-live-badge-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 0 0 rgba(111,174,126,0.6);
}
.tv-live-badge-label { letter-spacing: 1.5px; font-weight: 700; }
.tv-live-badge-ago {
  font-weight: 500; color: var(--fg-dim);
  font-size: 10px;
}
.tv-live-badge-pulse .tv-live-badge-dot { animation: tv-live-badge-flash 1.2s ease-out; }
@keyframes tv-live-badge-flash {
  0%   { box-shadow: 0 0 0 0 rgba(111,174,126,0.7); transform: scale(1); }
  40%  { box-shadow: 0 0 0 8px rgba(111,174,126,0);  transform: scale(1.35); }
  100% { box-shadow: 0 0 0 0 rgba(111,174,126,0);    transform: scale(1); }
}

/* Legacy class kept dormant — old sync-dot replaced by the badge above. */
.tv-intel-sync-dot { display: none; }
.tv-intel-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.tv-intel-section:last-child { border-bottom: none; }
.tv-intel-section-head {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 11px; letter-spacing: 2px; font-weight: 700;
  margin-bottom: 10px;
}

/* SCORE block inside intel — bigger, readable from across the room */
.tv-intel-score { display: flex; flex-direction: column; gap: 12px; }
.tv-intel-score .tv-score-cells {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tv-intel-score .tv-score-cell { padding: 5px 6px; min-width: 0; }
.tv-intel-score .tv-score-v { font-size: 14px; line-height: 1; margin: 1px 0; }
.tv-intel-score .tv-score-k { font-size: 9px; letter-spacing: 1.2px; }
.tv-intel-score .tv-score-band { font-size: 9px; letter-spacing: 1px; }
.tv-intel-score .tv-score-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px; line-height: 1.45;
  color: var(--fg);
}
.tv-intel-score .tv-score-drivers {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; line-height: 1.45;
  color: var(--fg-dim);
  list-style: none; padding: 0; margin: 0;
}
.tv-intel-score .tv-score-drivers li::before {
  content: "· "; color: var(--accent); margin-right: 4px;
}
.tv-intel-score .tv-score-action {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-size: 12px;
  padding-top: 6px; border-top: 1px dashed var(--border);
}
.tv-intel-score .tv-score-hint-k { font-size: 10px; letter-spacing: 1.3px; }

/* Inline sparkline of recent btc_sentiment values */
.tv-score-spark {
  display: block;
  color: var(--fg-dim);
  margin-top: 4px;
}
.tv-score-spark-meta {
  font-size: 10px; letter-spacing: 0.3px;
  margin-top: -2px;
}

/* Lifecycle row: active-until badge + used-in-N-orders badge */
.tv-score-lifecycle {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 11px;
  margin-top: 6px;
}
.tv-score-life-badge {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(111,174,126,0.30);
  background: rgba(111,174,126,0.10);
  color: var(--pos);
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.tv-score-life-badge.tv-score-stale {
  border-color: rgba(201,105,74,0.45);
  background: rgba(201,105,74,0.14);
  color: var(--neg);
}
.tv-score-life-time { font-weight: 500; }
.tv-score-used { font-weight: 600; font-size: 11px; }

/* Cadence footer line */
.tv-score-cadence {
  font-size: 10px; letter-spacing: 0.3px;
  margin-top: 2px;
}

/* MACRO list inside intel — per-ticker row with relationship hint */
.tv-intel-macro { display: flex; flex-direction: column; gap: 8px; }
.tv-intel-macro-list { display: flex; flex-direction: column; gap: 8px; }
.tv-intel-macro-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  border-radius: 3px;
  border-left: 3px solid var(--border);
  background: rgba(140,126,114,0.05);
}
.tv-intel-macro-row.pos { border-left-color: var(--pos); background: rgba(111,174,126,0.06); }
.tv-intel-macro-row.neg { border-left-color: var(--neg); background: rgba(201,105,74,0.06); }
.tv-intel-macro-top {
  display: flex; align-items: baseline; gap: 10px;
  font-variant-numeric: tabular-nums;
}
.tv-intel-macro-label { font-size: 13px; letter-spacing: 1.5px; font-weight: 700; color: var(--fg-dim); min-width: 48px; }
.tv-intel-macro-px    { font-size: 14px; color: var(--fg); font-weight: 500; }
.tv-intel-macro-chg   { font-size: 13px; font-weight: 600; margin-left: auto; }
.tv-intel-macro-row.pos .tv-intel-macro-chg,
.tv-intel-macro-row.pos .tv-intel-macro-label { color: var(--pos); }
.tv-intel-macro-row.neg .tv-intel-macro-chg,
.tv-intel-macro-row.neg .tv-intel-macro-label { color: var(--neg); }
.tv-intel-macro-hint { font-size: 11px; line-height: 1.35; }

/* LAST UPDATE FROM SYDNEE.AI — most recent published brief, full content */
.tv-intel-update { display: flex; flex-direction: column; gap: 8px; }
.tv-intel-update-link {
  margin-left: auto;
  text-decoration: none;
  font-size: 10px;
}
.tv-intel-update-link:hover { color: var(--accent); }
.tv-intel-update-meta {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11px; flex-wrap: wrap;
}
.tv-intel-update-summary {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; line-height: 1.5;
  color: var(--fg);
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
}
.tv-intel-update-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 14px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tv-intel-update-grid .dim {
  display: block; font-size: 10px; letter-spacing: 1.5px; font-weight: 700;
  margin-bottom: 2px;
}
.tv-intel-brief-empty { font-size: 13px; padding: 4px 0; }

/* Triggers vertical list — kept compact under the prose-heavy sections */
.tv-intel-trig-list { display: flex; flex-direction: column; gap: 6px; }
.tv-intel-trig-row {
  display: grid;
  grid-template-columns: 1fr auto 80px auto;
  gap: 8px; align-items: center;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 3px;
  background: rgba(140,126,114,0.05);
  font-variant-numeric: tabular-nums;
}
.tv-intel-trig-fired   { background: rgba(232, 98, 26, 0.10); }
.tv-intel-trig-warming { background: rgba(196,163,90, 0.08); }
.tv-intel-trig-cold    { opacity: 0.55; }
.tv-intel-trig-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-intel-trig-side { font-size: 9px; padding: 2px 5px; letter-spacing: 1.2px; }
.tv-intel-trig-bar {
  height: 4px; background: rgba(140,126,114,0.25);
  border-radius: 2px; overflow: hidden;
}
.tv-intel-trig-fill {
  display: block; height: 100%;
  background: var(--fg-dim);
  transition: width 240ms ease-out;
}
.tv-intel-trig-fired   .tv-intel-trig-fill { background: var(--accent); }
.tv-intel-trig-warming .tv-intel-trig-fill { background: #C4A35A; }
.tv-intel-trig-state .trigger-fired-pill { font-size: 9px; padding: 2px 5px; }
.tv-intel-trig-state { color: var(--fg-dim); font-size: 11px; }

/* When the why-drawer is anchored inside a 65/35 split, it overlays only
   the chart half (left) — sidebar stays visible. */
.tv-chart-row-split .tv-why-panel {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 100%;
  max-width: 440px;
  background: var(--bg-raised);
  border-right: 1px solid var(--border-strong);
  border-left: none;
  transform: translateX(-100%);
  transition: transform 220ms ease-out;
  z-index: 5;
}
.tv-chart-row-split .tv-why-panel.tv-why-open { transform: translateX(0); }
.tv-chart-row-split .tv-why-panel-collapsed { transform: translateX(-100%); }
.tv-chart-row-split:has(.tv-why-open) .tv-why-toggle { display: none; }

/* ── ANALYSIS RAIL — AI-generated brief consumed by viewer + bot ─────── */
.tv-analysis-rail {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg-sunken);
}
.tv-analysis-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  border-left: 3px solid var(--accent);
}
.tv-analysis-head { display: flex; justify-content: space-between; align-items: baseline; }
.tv-analysis-meta { font-size: 10px; letter-spacing: 0.5px; }
.tv-analysis-summary {
  font-size: 14px; line-height: 1.5; color: var(--fg);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}
.tv-analysis-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 16px;
  font-size: 12px;
}
.tv-analysis-cell .dim { font-size: 10px; letter-spacing: 1.5px; font-weight: 700; margin-bottom: 2px; }
.tv-analysis-cell > div:last-child { color: var(--fg); font-weight: 500; }

/* ── Big-screen / TV display scaling ─────────────────────────────────── */
/* The why-panel and chart axis labels read fine on a laptop but are tiny
   from across the room on a TV. Mobile is unaffected (gated to ≥1280px). */
@media (min-width: 1280px) {
  .tv-why-panel { flex: 0 0 380px; }
  .tv-why-title { font-size: 22px; }
  .tv-why-sub { font-size: 11px; letter-spacing: 2px; }
  .tv-why-summary { font-size: 14px; line-height: 1.5; }
  .tv-why-ts { font-size: 12px; }
  .tv-why-row { padding: 12px 14px; }
  .tv-prof-col-head { font-size: 11px; }
}
@media (min-width: 1700px) {
  .tv-why-panel { flex: 0 0 440px; }
  .tv-why-title { font-size: 26px; }
  .tv-why-sub { font-size: 12px; }
  .tv-why-summary { font-size: 16px; line-height: 1.55; }
  .tv-why-ts { font-size: 13px; }
  .tv-why-row { padding: 14px 18px; }
}
@media (min-width: 2200px) {
  .tv-why-panel { flex: 0 0 520px; }
  .tv-why-title { font-size: 32px; }
  .tv-why-sub { font-size: 14px; }
  .tv-why-summary { font-size: 18px; line-height: 1.6; }
  .tv-why-ts { font-size: 15px; }
}
