/* =============================================================================
   trade-hub — design system v2
   Aesthetic: pure black canvas. Bloomberg×Linear density.
   Rule 1: every institutional value gets a plain-English pair.
   Rule 2: outlines carry color state, not fills. Numbers stay pure white.
   Rule 3: three visual weights, hard hierarchy.
   ========================================================================== */

/* ---------- Tokens -------------------------------------------------------- */
:root {
  /* Canvas */
  --bg-0: #000000;
  --bg-1: #0a0a0b;
  --bg-2: #131316;
  --bg-3: #1c1c22;

  /* Borders */
  --border-hair: #1e1e24;
  --border-soft: #2d2d36;
  --border-strong: #45454f;

  /* Text — bright, high-contrast for pure black backgrounds */
  --text-primary: #ffffff;
  --text-secondary: #c8cad2;
  --text-tertiary: #8a8f99;
  --text-dim: #5a5f6a;

  /* State colors — OLED-tuned */
  --tl-green: #00d68f;
  --tl-green-soft: rgba(0, 214, 143, 0.14);
  --tl-green-glow: rgba(0, 214, 143, 0.35);

  --tl-yellow: #ffb020;
  --tl-yellow-soft: rgba(255, 176, 32, 0.14);
  --tl-yellow-glow: rgba(255, 176, 32, 0.35);

  --tl-red: #ff3d5a;
  --tl-red-soft: rgba(255, 61, 90, 0.14);
  --tl-red-glow: rgba(255, 61, 90, 0.35);

  --tl-gray: #7a7f8a;
  --tl-gray-soft: rgba(122, 127, 138, 0.14);
  --tl-gray-glow: rgba(122, 127, 138, 0.30);

  --tl-orange: #ff7a1a;
  --tl-orange-soft: rgba(255, 122, 26, 0.14);
  --tl-orange-glow: rgba(255, 122, 26, 0.35);

  /* Data emphasis */
  --data-cyan: #33c7ff;
  --data-violet: #b39aff;
  --data-amber: #ffd166;

  /* Type */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-med: 220ms;
}

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

html, body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: transparent; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.mono, .num, code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- App shell ----------------------------------------------------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* ==========================================================================
   NAV BAR — tabs only, minimal. Height grows for stacked control buttons.
   ========================================================================== */
.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 8px var(--space-5);
  border-bottom: 1px solid var(--border-hair);
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  letter-spacing: -0.015em;
  font-size: 17px;
}
.nav .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tl-green);
  box-shadow: 0 0 12px var(--tl-green);
}
.nav .brand .accent { color: var(--text-tertiary); font-weight: 500; }

.nav .tabs {
  display: flex;
  gap: 2px;
  margin-left: var(--space-6);
}
.nav .tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  position: relative;
}
.nav .tab:hover { color: var(--text-primary); background: var(--bg-2); }
.nav .tab.active { color: var(--text-primary); }
.nav .tab.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -16px;
  height: 2px;
  background: var(--tl-green);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--tl-green);
}
.nav .spacer { flex: 1; }
.nav .clock {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- ACTIVE toggle + Refresh (paired controls) ------------------- */
.control-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.active-toggle,
.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1.5px solid var(--tl-red);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tl-red);
  background: rgba(255, 61, 90, 0.08);
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
  min-width: 128px;
  white-space: nowrap;
}
.active-toggle .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--tl-red); box-shadow: 0 0 6px var(--tl-red); }

/* ON state — both controls switch to green when ACTIVE mode is on */
.active-toggle.on {
  color: var(--tl-green);
  border-color: var(--tl-green);
  background: rgba(0, 214, 143, 0.1);
}
.active-toggle.on .pip { background: var(--tl-green); box-shadow: 0 0 8px var(--tl-green); animation: pulse 2s var(--ease) infinite; }

/* Refresh button color follows ACTIVE state */
.control-stack.on .refresh-btn {
  color: var(--tl-green);
  border-color: var(--tl-green);
  background: rgba(0, 214, 143, 0.1);
}
.refresh-btn .icon {
  display: inline-block;
  width: 12px; height: 12px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transition: transform var(--dur-med) var(--ease);
}
.refresh-btn:hover .icon { transform: rotate(180deg); }
.refresh-btn.spinning .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.4); }
}

/* ==========================================================================
   TOP STRIP — the head-trader summary. Appears on every tab.
   ========================================================================== */
.topstrip {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(1200px 200px at 50% -20%, rgba(255,255,255,0.02), transparent 70%),
    var(--bg-0);
}

/* Event day warning banner (conditional) */
.event-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 16px;
  margin-bottom: var(--space-4);
  border: 1px solid rgba(255, 61, 90, 0.55);
  border-radius: var(--radius-md);
  background: rgba(255, 61, 90, 0.06);
  font-size: 13px;
  font-weight: 700;
  color: var(--tl-red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.event-banner.hidden { display: none; }

/* Verdict block — the biggest thing on the app */
.verdict-block {
  text-align: center;
  margin-bottom: var(--space-4);
}
.verdict-word {
  font-family: var(--font-mono);
  font-size: 68px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-3);
}
.verdict--bullish { color: var(--tl-green); text-shadow: 0 0 40px var(--tl-green-glow); }
.verdict--bearish { color: var(--tl-red); text-shadow: 0 0 40px var(--tl-red-glow); }
.verdict--neutral { color: var(--text-primary); text-shadow: 0 0 24px rgba(255,255,255,0.15); }
.verdict--chop    { color: var(--tl-yellow); text-shadow: 0 0 40px var(--tl-yellow-glow); }

.tape-read {
  max-width: 780px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Netdrift READ line — second voice under tape-read */
.netdrift-read {
  max-width: 780px;
  margin: 8px auto 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
}
.netdrift-read.agree   { color: var(--data-cyan); background: rgba(51, 199, 255, 0.08); }
.netdrift-read.diverge { color: var(--tl-yellow); background: rgba(255, 176, 32, 0.08); }
.netdrift-read.muted   { color: var(--text-dim); }
.netdrift-read:empty   { display: none; }

/* State chips row */
.chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Row 2 chips — slightly smaller (regime backdrop, changes slowly) */
.chip--row2 {
  padding: var(--space-3) var(--space-4);
}
.chip--row2 .value { font-size: 17px; }
.chip--row2 .plain { font-size: 12.5px; line-height: 1.5; }

/* --- COT chip: rich content styling ------------------------------------ */
.cot-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.cot-dot--green  { background: var(--tl-green);  box-shadow: 0 0 8px var(--tl-green); }
.cot-dot--yellow { background: var(--tl-yellow); box-shadow: 0 0 8px var(--tl-yellow); }
.cot-dot--red    { background: var(--tl-red);    box-shadow: 0 0 8px var(--tl-red); }

.cot-nets {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-hair);
  border-bottom: 1px solid var(--border-hair);
}
.cot-net-row {
  display: contents;
}
.cot-net-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cot-net-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

.cot-synopsis {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.cot-cross {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-top: 1px solid var(--border-hair);
  line-height: 1.5;
}
.cot-cross strong { color: var(--tl-yellow); font-weight: 700; }

.cot-asof {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-hair);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.chip {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-1);
  transition: border-color var(--dur-med) var(--ease);
}
.chip--green  { border-color: var(--tl-green); }
.chip--yellow { border-color: var(--tl-yellow); }
.chip--red    { border-color: var(--tl-red); }

.chip .label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.chip .value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.chip .plain {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Hero numbers row */
.hero-nums {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-hair);
}
.hnum {
  text-align: center;
  cursor: help;
  position: relative;
}
.hnum .k {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.hnum .v {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.hnum .delta {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}
.hnum .delta.up { color: var(--tl-green); }
.hnum .delta.dn { color: var(--tl-red); }

/* Tooltip pattern for hero numbers (on hover) */
.hnum .tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  width: 240px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.7);
  text-align: left;
  white-space: normal;
}
.hnum:hover .tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Compact horizontal ladder in top strip — brighter labels + larger numbers */
.ladder-mini {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-1);
}
.ladder-mini .track {
  position: relative;
  height: 58px;
  margin: 18px 0 var(--space-3);
}
.ladder-mini .line {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--tl-green) 0%, var(--tl-yellow) 50%, var(--tl-red) 100%);
  transform: translateY(-50%);
  opacity: 0.7;
  border-radius: 2px;
}
.ladder-mini .marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ladder-mini .marker .dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-0);
  background: var(--text-secondary);
}
.ladder-mini .marker.put .dot   { background: var(--tl-green);    box-shadow: 0 0 12px var(--tl-green),  0 0 20px var(--tl-green-glow); }
.ladder-mini .marker.call .dot  { background: var(--tl-red);      box-shadow: 0 0 12px var(--tl-red),    0 0 20px var(--tl-red-glow); }
.ladder-mini .marker.flip .dot  { background: var(--tl-yellow);   box-shadow: 0 0 12px var(--tl-yellow), 0 0 20px var(--tl-yellow-glow); }
.ladder-mini .marker.pin .dot   { background: var(--data-violet); box-shadow: 0 0 12px var(--data-violet), 0 0 20px rgba(179, 154, 255, 0.4); }
/* ES dot — base (neutral / at VWAP) */
.ladder-mini .marker.here .dot {
  background: var(--text-primary);
  width: 22px; height: 22px;
  box-shadow: 0 0 16px rgba(255,255,255,0.9), 0 0 32px rgba(255,255,255,0.4);
}

/* ES dot — above VWAP (bullish, green) */
.ladder-mini .marker.here.bull .dot {
  background: var(--tl-green);
  box-shadow: 0 0 18px var(--tl-green), 0 0 36px var(--tl-green-glow);
}

/* ES dot — below VWAP (bearish, red) */
.ladder-mini .marker.here.bear .dot {
  background: var(--tl-red);
  box-shadow: 0 0 18px var(--tl-red), 0 0 36px var(--tl-red-glow);
}
.ladder-mini .marker .lbl {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
/* Match label color to dot color for instant visual grouping */
.ladder-mini .marker.put  .lbl { color: var(--tl-green); }
.ladder-mini .marker.call .lbl { color: var(--tl-red); }
.ladder-mini .marker.flip .lbl { color: var(--tl-yellow); }
.ladder-mini .marker.pin  .lbl { color: var(--data-violet); }
.ladder-mini .marker.here .lbl {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}
.ladder-mini .marker.here.bull .lbl { color: var(--tl-green); }
.ladder-mini .marker.here.bear .lbl { color: var(--tl-red); }
.ladder-mini .foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: var(--space-3);
}
/* Ladder freshness strip: small metadata row showing walls/basis/session
   staleness. Sits below the foot row. Green when live, amber when aging,
   red when frozen/stale. */
.ladder-freshness {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
}
.ladder-freshness-item.live   { color: #22c55e; }
.ladder-freshness-item.aging  { color: #eab308; }
.ladder-freshness-item.stale  { color: #ef4444; }
.ladder-freshness-item.frozen { color: #94a3b8; }
.ladder-freshness-sep { color: rgba(148,163,184,0.35); }

/* Universal freshness strip — same visual treatment as ladder-freshness
   but reusable via <div data-freshness-for="walls,basis,session"> tags on
   every tab. */
.tl-freshness {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.tl-freshness-item.live   { color: #22c55e; }
.tl-freshness-item.aging  { color: #eab308; }
.tl-freshness-item.stale  { color: #ef4444; }
.tl-freshness-item.frozen { color: #94a3b8; }
.tl-freshness-sep { color: rgba(148,163,184,0.35); }
/* Top row label (Put Wall / Level Ladder / Call Wall) also bigger + brighter */
.ladder-mini .head-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  font-weight: 700;
}
.ladder-mini .head-row .left  { color: var(--tl-green); }
.ladder-mini .head-row .right { color: var(--tl-red); }

/* Ladder zoom control — added 2026-07-31.
   Lets the user zoom the visible ES=F price range around spot from ±10 pts
   (tight pin scalping view) to ±200 pts (wide view showing gamma flip when
   spot is far from it). Default ±30 pts shows all near-spot PW1/PW2/PW3 +
   CW1/CW2/CW3 walls with typical 5-10 pt spacing. */
.ladder-mini .ladder-zoom {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.ladder-mini .ladder-zoom-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.ladder-mini #ladder-zoom-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--tl-green) 0%, var(--tl-yellow) 50%, var(--tl-red) 100%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.ladder-mini #ladder-zoom-slider:hover {
  opacity: 1;
}
.ladder-mini #ladder-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-2);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
.ladder-mini #ladder-zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-2);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
.ladder-mini .ladder-zoom-value {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Support styles for extra wall markers (PW2/PW3/CW2/CW3) on the compact
   ladder. Same visual language as PW1/CW1 but at slightly lower opacity and
   NO text labels — only PW1/CW1 keep their labels to prevent overlap.
   PW2/CW2/PW3/CW3 remain as visible dots (users can hover for a tooltip). */
.ladder-mini .marker.put-2 .dot,
.ladder-mini .marker.put-3 .dot {
  background: var(--tl-green);
  box-shadow: 0 0 8px var(--tl-green), 0 0 14px var(--tl-green-glow);
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(0.85);
}
.ladder-mini .marker.call-2 .dot,
.ladder-mini .marker.call-3 .dot {
  background: var(--tl-red);
  box-shadow: 0 0 8px var(--tl-red), 0 0 14px var(--tl-red-glow);
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(0.85);
}
/* Hide text labels for secondary/tertiary walls — tooltip-only. */
.ladder-mini .marker.put-2  .lbl,
.ladder-mini .marker.put-3  .lbl,
.ladder-mini .marker.call-2 .lbl,
.ladder-mini .marker.call-3 .lbl {
  display: none;
}
/* Stagger vertical offset so nearby wall labels don't overlap when tight. */
.ladder-mini .marker.put   { transform: translate(-50%, -50%); }
.ladder-mini .marker.call  { transform: translate(-50%, -50%); }
.ladder-mini .marker.flip  .lbl { margin-top: 22px; }
.ladder-mini .marker.pin   .lbl { margin-top: 42px; }

/* When a marker is OUTSIDE the current zoom window, show as a clipped edge
   indicator on the appropriate side. */
.ladder-mini .marker.clipped {
  opacity: 0.4;
  pointer-events: none;
}
.ladder-mini .marker.clipped .lbl {
  font-style: italic;
}

/* ==========================================================================
   MAIN — tab content area with tab-panel routing
   Fill the viewport minus small side gutters. On a 34" ultrawide the app
   should feel like a real workstation, not a boxed-in webpage.
   ========================================================================== */
.main {
  padding: var(--space-5) 24px;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Tab panels — only .active is visible */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==========================================================================
   DATA TAB — subscription-grade metric reference
   Design language: SpotGamma / MenthorQ / UnusualWhales premium feel
   ========================================================================== */
:root {
  --data-accent-violet:  #b39aff;
  --data-accent-amber:   #ffb547;
  --data-accent-cyan:    #4dd0e1;
  --data-accent-green:   #00d68f;
  --data-accent-blue:    #6ba8ff;
  --data-accent-magenta: #ff6ec7;
}

.data-tab {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.data-tab .nd-main-grid { margin-top: 4px; }
.data-tab .nd-main { display: flex; flex-direction: column; gap: var(--space-5); }

/* Cross-reference line at the bottom of each category card (links to the
   dedicated tab that owns the live/full version of that data). */
.data-category-crossref {
  margin-top: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  font-style: italic;
  padding-left: 2px;
}

/* Demo mode banner */
.data-demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255,181,71,0.14), rgba(255,181,71,0.04));
  border: 1px solid rgba(255,181,71,0.35);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.data-demo-banner-tag {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,181,71,0.25);
  color: #ffb547;
  white-space: nowrap;
}
.data-demo-banner code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 11px;
}

/* --- HERO --- */
.data-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg, 12px);
  background: radial-gradient(1200px 400px at 15% 0%, rgba(179,154,255,0.14), transparent 60%),
              radial-gradient(900px 350px at 85% 100%, rgba(77,208,225,0.10), transparent 60%),
              linear-gradient(135deg, #0e1116 0%, #14181f 100%);
  border: 1px solid rgba(179,154,255,0.25);
  padding: 48px 40px;
}
.data-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(179,154,255,0.06), transparent);
  pointer-events: none;
}
.data-hero-inner { position: relative; z-index: 1; max-width: 900px; }
.data-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--data-accent-violet);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.data-hero-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 14px 0;
  background: linear-gradient(135deg, #ffffff 0%, #b39aff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.data-hero-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 28px 0;
  max-width: 720px;
}
.data-hero-stats {
  display: flex;
  gap: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.data-hero-stat-value {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  color: var(--data-accent-violet);
  line-height: 1;
  margin-bottom: 6px;
}
.data-hero-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* --- LEGEND --- */
.data-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* --- BADGES --- */
.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-badge--live       { background: rgba(0,214,143,0.14);  color: #00d68f; border: 1px solid rgba(0,214,143,0.35); }
.data-badge--live::before      { content: "●"; color: #00d68f; font-size: 10px; }
.data-badge--computed   { background: rgba(77,208,225,0.14); color: #4dd0e1; border: 1px solid rgba(77,208,225,0.35); }
.data-badge--notwired   { background: rgba(255,181,71,0.12); color: #ffb547; border: 1px solid rgba(255,181,71,0.30); }
.data-badge--authblocked{ background: rgba(255,80,80,0.14);  color: #ff5050; border: 1px solid rgba(255,80,80,0.35); }

/* --- CATEGORY --- */
.data-category { display: flex; flex-direction: column; gap: 20px; }
.data-category-header {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent);
  border-left: 4px solid;
}
.data-category--violet  .data-category-header { border-left-color: var(--data-accent-violet); }
.data-category--amber   .data-category-header { border-left-color: var(--data-accent-amber); }
.data-category--cyan    .data-category-header { border-left-color: var(--data-accent-cyan); }
.data-category--green   .data-category-header { border-left-color: var(--data-accent-green); }
.data-category--blue    .data-category-header { border-left-color: var(--data-accent-blue); }
.data-category--magenta .data-category-header { border-left-color: var(--data-accent-magenta); }

.data-category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.data-category-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}
.data-category--violet  .data-category-dot { background: var(--data-accent-violet);  color: var(--data-accent-violet); }
.data-category--amber   .data-category-dot { background: var(--data-accent-amber);   color: var(--data-accent-amber); }
.data-category--cyan    .data-category-dot { background: var(--data-accent-cyan);    color: var(--data-accent-cyan); }
.data-category--green   .data-category-dot { background: var(--data-accent-green);   color: var(--data-accent-green); }
.data-category--blue    .data-category-dot { background: var(--data-accent-blue);    color: var(--data-accent-blue); }
.data-category--magenta .data-category-dot { background: var(--data-accent-magenta); color: var(--data-accent-magenta); }
.data-category-blurb {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--font-ui);
}

/* --- METRIC GRID --- */
.data-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* --- METRIC CARD --- */
.data-metric-card {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%), var(--bg-1);
  border: 1px solid var(--border-hair);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.data-metric-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.5;
}
.data-metric-card--violet  { color: var(--data-accent-violet); }
.data-metric-card--amber   { color: var(--data-accent-amber); }
.data-metric-card--cyan    { color: var(--data-accent-cyan); }
.data-metric-card--green   { color: var(--data-accent-green); }
.data-metric-card--blue    { color: var(--data-accent-blue); }
.data-metric-card--magenta { color: var(--data-accent-magenta); }

.data-metric-card:hover {
  transform: translateY(-2px);
  border-color: currentColor;
  box-shadow: 0 8px 24px rgba(0,0,0,0.30), 0 0 0 1px currentColor;
}
.data-metric-card.is-dim { opacity: 0.72; }
.data-metric-card.is-dim:hover { opacity: 1; }

.data-metric-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.data-metric-icon {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: currentColor;
}
.data-metric-title-block { flex: 1; min-width: 0; }
.data-metric-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}
.data-metric-badge-row {
  display: flex;
  gap: 6px;
}

.data-metric-value-block {
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-metric-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.data-metric-card.is-live .data-metric-value { color: currentColor; }
.data-metric-subvalue {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

.data-metric-livenote {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid currentColor;
  border-radius: 4px;
}

/* --- DETAILS DISCLOSURE --- */
.data-metric-details {
  margin-top: auto;
}
.data-metric-details summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: background 0.15s, color 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.data-metric-details summary::-webkit-details-marker { display: none; }
.data-metric-details summary:hover {
  background: rgba(255,255,255,0.05);
  color: currentColor;
}
.data-metric-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 14px;
}
.data-metric-details[open] .data-metric-chevron { transform: rotate(90deg); color: currentColor; }

.data-metric-details-body {
  padding: 16px 4px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.data-metric-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: currentColor;
  margin-bottom: 6px;
  opacity: 0.85;
}
.data-metric-section-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.data-metric-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.data-metric-footer-item {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  line-height: 1.5;
}
.data-metric-footer-label {
  color: currentColor;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
  opacity: 0.9;
}

/* Elements scoped to specific tabs via [data-visible-on="tabname"] */
.hidden-by-tab { display: none !important; }

/* ==========================================================================
   NETDRIFT PANEL — Live tab right column (Phase P2)
   ========================================================================== */
.netdrift-panel {
  border-radius: var(--radius-md);
  border: 2px solid var(--tl-yellow);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--bg-1);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.netdrift-panel--green  { border-color: var(--tl-green); }
.netdrift-panel--yellow { border-color: var(--tl-yellow); }
.netdrift-panel--red    { border-color: var(--tl-red); }

.netdrift-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-hair);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}
.netdrift-panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.netdrift-panel-dot {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.netdrift-panel--green  .netdrift-panel-dot { background: var(--tl-green);  color: var(--tl-green); }
.netdrift-panel--yellow .netdrift-panel-dot { background: var(--tl-yellow); color: var(--tl-yellow); }
.netdrift-panel--red    .netdrift-panel-dot { background: var(--tl-red);    color: var(--tl-red); }
.netdrift-panel-title {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.netdrift-panel-state {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
}
.netdrift-panel--green  .netdrift-panel-state { color: var(--tl-green); }
.netdrift-panel--yellow .netdrift-panel-state { color: var(--tl-yellow); }
.netdrift-panel--red    .netdrift-panel-state { color: var(--tl-red); }
.netdrift-panel-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.netdrift-panel-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.netdrift-panel-read {
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid currentColor;
  border-radius: 4px;
  color: var(--tl-yellow);
}
.netdrift-panel--green .netdrift-panel-read { color: var(--tl-green); }
.netdrift-panel--red   .netdrift-panel-read { color: var(--tl-red); }
.netdrift-read-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.netdrift-read-body {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.netdrift-tickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.netdrift-ticker {
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-hair);
  border-radius: 6px;
}
.netdrift-ticker-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.netdrift-ticker-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}
.netdrift-ticker-freshness {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border-radius: 3px;
}
.netdrift-ticker-freshness--live  { background: rgba(0,214,143,0.15); color: var(--tl-green); }
.netdrift-ticker-freshness--stale { background: rgba(255,181,71,0.15); color: var(--tl-yellow); }
.netdrift-ticker-etf {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.netdrift-ticker-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.netdrift-metric {
  padding: 6px 8px;
  background: rgba(0,0,0,0.20);
  border-radius: 4px;
}
.netdrift-metric-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.netdrift-metric-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.netdrift-metric-value.pos { color: var(--tl-green); }
.netdrift-metric-value.neg { color: var(--tl-red); }
.netdrift-ticker-divergence {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.netdrift-ticker-divergence--aligned    { background: rgba(0,214,143,0.10); color: var(--tl-green); }
.netdrift-ticker-divergence--developing { background: rgba(255,181,71,0.10); color: var(--tl-yellow); }
.netdrift-ticker-divergence--divergence { background: rgba(255,80,80,0.12);  color: var(--tl-red); }
.netdrift-ticker-session {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
}
.netdrift-ticker-nodata {
  padding: 12px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11px;
}
.netdrift-break-context {
  padding: 10px 12px;
  border: 1px dashed currentColor;
  border-radius: 4px;
}
.netdrift-break-context-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.netdrift-break-context-body {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}
.netdrift-panel-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  padding-top: 8px;
  border-top: 1px solid var(--border-hair);
}

/* ==========================================================================
   LEVEL BREAK ALERTS PANEL
   ========================================================================== */
.alerts-panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hair);
  background: var(--bg-1);
  overflow: hidden;
}
.alerts-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hair);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.alerts-panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.alerts-panel-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.alerts-panel-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.alerts-panel-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.alerts-panel-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}
.alerts-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  font-style: italic;
}
.alert-item {
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid;
  background: rgba(255,255,255,0.02);
}
.alert-item--up   { border-left-color: var(--tl-green); }
.alert-item--down { border-left-color: var(--tl-red); }
.alert-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.alert-arrow {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
}
.alert-item--up .alert-arrow   { color: var(--tl-green); }
.alert-item--down .alert-arrow { color: var(--tl-red); }
.alert-label {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.alert-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}
.alert-context {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}
.alert-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   COT TAB — dedicated positioning surface
   ========================================================================== */
.cot-tab {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}
.cot-tab .nd-main-grid { margin-top: 4px; }
.cot-tab .nd-main { display: flex; flex-direction: column; gap: var(--space-4); }

.cot-section {
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.cot-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-3);
}
.cot-section-note {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-bottom: var(--space-3);
}

/* Section 1 — Header grid */
.cot-header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.cot-header-cell {
  padding: var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
}
.cot-header-cell--green  { border-color: var(--tl-green); }
.cot-header-cell--yellow { border-color: var(--tl-yellow); }
.cot-header-cell--red    { border-color: var(--tl-red); }
.cot-header-cell .lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.cot-header-cell .state {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.cot-header-cell .asof {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 10px;
}

/* Header net lines — stacked, each colored green/red */
.cot-header-nets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin: 8px 0;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-hair);
}
.cot-header-net-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 13px;
}
.cot-header-net-line .grp {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-ui);
  font-weight: 700;
}
.cot-header-net-line .val {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-primary);
}
.cot-header-net-line .val.pos { color: var(--tl-green); }
.cot-header-net-line .val.neg { color: var(--tl-red); }

/* Group-total column (repeated Net at end of row, bold + colored) */
.cot-table tbody td.group-total {
  font-weight: 800;
  font-size: 14px;
  border-left: 2px solid var(--border-strong);
  padding-left: 16px;
}
.cot-table tbody td.group-total.pos { color: var(--tl-green); }
.cot-table tbody td.group-total.neg { color: var(--tl-red); }
.cot-table thead th:last-child {
  border-left: 2px solid var(--border-strong);
  padding-left: 16px;
}

/* Sections 2 & 5 — Data tables */
.cot-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin-top: var(--space-3);
}
.cot-table thead th {
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.cot-table thead th:first-child { text-align: left; }
.cot-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border-hair);
  text-align: right;
  color: var(--text-primary);
  white-space: nowrap;
}
.cot-table tbody tr:last-child td { border-bottom: 0; }
.cot-table tbody td.grp {
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text-primary);
}
.cot-table tbody td.net {
  font-weight: 700;
  font-size: 13.5px;
}
.cot-table tbody td.net.pos { color: var(--tl-green); }
.cot-table tbody td.net.neg { color: var(--tl-red); }
.cot-table tbody td.pct {
  color: var(--text-secondary);
  font-size: 12px;
}
.cot-table tbody td.pct.extreme {
  color: var(--tl-yellow);
  font-weight: 700;
}
.cot-table tbody td.delta {
  color: var(--data-cyan);
  font-weight: 700;
}

/* Section 3 — Interpretation */
.cot-interp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.cot-interp-cell {
  padding: var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
}
.cot-interp-cell--green  { border-color: var(--tl-green); }
.cot-interp-cell--yellow { border-color: var(--tl-yellow); }
.cot-interp-cell--red    { border-color: var(--tl-red); }
.cot-interp-cell .lbl {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.cot-interp-cell .headline {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}
.cot-interp-cell .detail {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
}
.cot-interp-cell .read {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--border-hair);
  font-style: italic;
}

.cot-section-trade-guide {
  padding: var(--space-4);
  border: 1.5px dashed var(--tl-green);
  border-radius: var(--radius-md);
  background: rgba(0, 214, 143, 0.05);
}
.cot-section-trade-guide .lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--tl-green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.cot-section-trade-guide .guide-primary {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 10px;
  font-weight: 500;
}
.cot-section-trade-guide .guide-cross {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 214, 143, 0.3);
}
.cot-section-trade-guide .guide-cross strong { color: var(--tl-yellow); }

/* Section 4 — Reference */
.cot-reference {
  background: var(--bg-1);
}
.cot-ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.cot-ref-cell {
  padding: var(--space-4);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.cot-ref-cell .h {
  font-size: 13px;
  font-weight: 800;
  color: var(--data-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.cot-ref-cell .who,
.cot-ref-cell .do,
.cot-ref-cell .when {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}
.cot-ref-cell strong { color: var(--text-primary); font-weight: 700; }

.cot-ref-callout {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1.5px solid var(--data-violet);
  border-radius: var(--radius-md);
  background: rgba(179, 154, 255, 0.05);
}
.cot-ref-callout .h {
  font-size: 13px;
  font-weight: 800;
  color: var(--data-violet);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.cot-ref-callout div {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
}
.cot-ref-callout div:last-child { margin-bottom: 0; }
.cot-ref-callout strong { color: var(--text-primary); font-weight: 700; }
.cot-ref-callout em { color: var(--data-amber); font-style: italic; }

/* Understanding COT — education panel */
.cot-understanding {
  border-color: var(--data-amber);
  border-width: 1.5px;
}
.cot-understand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.cot-understand-card {
  padding: var(--space-4);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.cot-understand-card--placeholder {
  border-style: dashed;
  background: transparent;
}
.cot-understand-card .h {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--data-amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}
.cot-understand-card .body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px 0;
}
.cot-understand-card .body p:last-child { margin-bottom: 0; }
.cot-understand-card .body strong { color: var(--text-primary); font-weight: 700; }
.cot-understand-card .body em { color: var(--data-cyan); font-style: italic; }
.cot-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 4px;
}
.cot-mini-table thead th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.cot-mini-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-hair);
  color: var(--text-primary);
}
.cot-mini-table tbody tr:last-child td { border-bottom: 0; }
.cot-mini-table tbody td:nth-child(2) {
  color: var(--data-amber);
  font-weight: 800;
}

/* TFF read paragraph under TFF tables */
.cot-tff-read {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-2);
  border-left: 3px solid var(--data-cyan);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  font-style: italic;
}

/* Card primitive */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.card + .card { margin-top: var(--space-3); }
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  line-height: 1.2;
}
.card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Live tab 3-column grid.
   align-items: start prevents flex-stretch that would blow out heights, but
   also means right column can leave a big blank space when left column is
   much taller. The right column has its own vertical scroll if it overflows;
   we keep align-items: start and let the natural column heights speak. */
.live-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 380px;
  gap: var(--space-4);
  align-items: start;
}
/* Right column: sticky positioning keeps sidebar/Netdrift/Alerts visible as
   the user scrolls down the taller left column of education cards. */
.live-grid > .stack:last-child {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
@media (max-width: 1280px) { .live-grid > .stack:last-child { position: static; max-height: none; } }
@media (max-width: 1600px) { .live-grid { grid-template-columns: 320px 1fr 340px; } }
@media (max-width: 1280px) { .live-grid { grid-template-columns: 1fr; } }

/* Consensus rows */
.consensus-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-hair);
}
.consensus-row:last-child { border-bottom: 0; }
.consensus-row .spec { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.consensus-row .role { color: var(--text-tertiary); font-size: 12px; font-weight: 500; }

/* Traffic light pill */
.traffic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
}
.traffic .pip { width: 8px; height: 8px; border-radius: 50%; }
.traffic--green  { color: var(--tl-green);  border-color: var(--tl-green); background: var(--tl-green-soft); }
.traffic--green .pip { background: var(--tl-green); box-shadow: 0 0 8px var(--tl-green); }
.traffic--yellow { color: var(--tl-yellow); border-color: var(--tl-yellow); background: var(--tl-yellow-soft); }
.traffic--yellow .pip { background: var(--tl-yellow); box-shadow: 0 0 8px var(--tl-yellow); }
.traffic--red    { color: var(--tl-red);    border-color: var(--tl-red); background: var(--tl-red-soft); }
.traffic--red .pip { background: var(--tl-red); box-shadow: 0 0 8px var(--tl-red); }

.consensus-sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-strong);
}
.consensus-sum .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); font-weight: 700; }
.consensus-sum .val { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text-primary); }

/* ==========================================================================
   FULL VERTICAL LADDER (center panel on Live tab)
   Bigger prices, brighter names, more saturated dots, VWAP row.
   ES rung colors green/red based on its position vs VWAP.
   ========================================================================== */
.ladder-full {
  position: relative;
  padding: var(--space-5) var(--space-5) var(--space-4);
}
.ladder-full .ladder-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-5);
  text-align: center;
}
.ladder-full .rung {
  position: relative;
  padding: 18px var(--space-4) 18px var(--space-6);
  border-left: 3px solid var(--border-hair);
  margin-left: 14px;
  transition: border-left-color var(--dur-med) var(--ease);
}
.ladder-full .rung + .rung { margin-top: 6px; }
.ladder-full .rung .head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: 8px;
}
.ladder-full .rung .name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ladder-full .rung .val {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ladder-full .rung .dist {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-left: auto;
}
.ladder-full .rung .plain {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Circle marker on the vertical border-left rail */
.ladder-full .rung::before {
  content: "";
  position: absolute;
  top: 24px;
  left: -10px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 3px solid var(--text-secondary);
  z-index: 2;
}

/* CALL WALL — red (ceiling) */
.ladder-full .rung.call { border-left-color: rgba(255, 61, 90, 0.4); }
.ladder-full .rung.call::before {
  border-color: var(--tl-red);
  background: var(--tl-red);
  box-shadow: 0 0 16px var(--tl-red), 0 0 32px var(--tl-red-glow);
}
.ladder-full .rung.call .name { color: var(--tl-red); }
.ladder-full .rung.call .val { color: var(--tl-red); }

/* 0DTE PIN — violet (magnet) */
.ladder-full .rung.pin { border-left-color: rgba(179, 154, 255, 0.4); }
.ladder-full .rung.pin::before {
  border-color: var(--data-violet);
  background: var(--data-violet);
  box-shadow: 0 0 16px var(--data-violet), 0 0 32px rgba(179, 154, 255, 0.4);
}
.ladder-full .rung.pin .name { color: var(--data-violet); }
.ladder-full .rung.pin .val { color: var(--data-violet); }

/* VWAP — cyan (institutional mean) */
.ladder-full .rung.vwap { border-left-color: rgba(51, 199, 255, 0.4); }
.ladder-full .rung.vwap::before {
  border-color: var(--data-cyan);
  background: var(--data-cyan);
  box-shadow: 0 0 16px var(--data-cyan), 0 0 32px rgba(51, 199, 255, 0.4);
}
.ladder-full .rung.vwap .name { color: var(--data-cyan); }
.ladder-full .rung.vwap .val { color: var(--data-cyan); }

/* ES CURRENT — colored by position vs VWAP (green above, red below) */
.ladder-full .rung.here {
  padding: 22px var(--space-4) 22px var(--space-6);
}
.ladder-full .rung.here::before {
  width: 22px; height: 22px;
  left: -13px;
  top: 26px;
}
.ladder-full .rung.here .name { font-size: 15px; font-weight: 800; }
.ladder-full .rung.here .val { font-size: 40px; letter-spacing: -0.025em; }

/* ES above VWAP = bullish (green) */
.ladder-full .rung.here.bull {
  border-left-color: var(--tl-green);
  background: linear-gradient(90deg, var(--tl-green-soft), transparent 60%);
}
.ladder-full .rung.here.bull::before {
  background: var(--tl-green);
  border-color: var(--tl-green);
  box-shadow: 0 0 20px var(--tl-green), 0 0 40px var(--tl-green-glow);
}
.ladder-full .rung.here.bull .name { color: var(--tl-green); }
.ladder-full .rung.here.bull .val { color: var(--tl-green); text-shadow: 0 0 20px var(--tl-green-glow); }

/* ES below VWAP = bearish (red) */
.ladder-full .rung.here.bear {
  border-left-color: var(--tl-red);
  background: linear-gradient(90deg, var(--tl-red-soft), transparent 60%);
}
.ladder-full .rung.here.bear::before {
  background: var(--tl-red);
  border-color: var(--tl-red);
  box-shadow: 0 0 20px var(--tl-red), 0 0 40px var(--tl-red-glow);
}
.ladder-full .rung.here.bear .name { color: var(--tl-red); }
.ladder-full .rung.here.bear .val { color: var(--tl-red); text-shadow: 0 0 20px var(--tl-red-glow); }

/* ES at VWAP = neutral (white) */
.ladder-full .rung.here.neutral {
  border-left-color: var(--text-primary);
  background: linear-gradient(90deg, rgba(255,255,255,0.08), transparent 60%);
}
.ladder-full .rung.here.neutral::before {
  background: var(--text-primary);
  border-color: var(--text-primary);
  box-shadow: 0 0 18px rgba(255,255,255,0.7), 0 0 36px rgba(255,255,255,0.3);
}

/* GAMMA FLIP — yellow (regime boundary) */
.ladder-full .rung.flip { border-left-color: rgba(255, 176, 32, 0.4); }
.ladder-full .rung.flip::before {
  border-color: var(--tl-yellow);
  background: var(--tl-yellow);
  box-shadow: 0 0 16px var(--tl-yellow), 0 0 32px var(--tl-yellow-glow);
}
.ladder-full .rung.flip .name { color: var(--tl-yellow); }
.ladder-full .rung.flip .val { color: var(--tl-yellow); }

/* PUT WALL — green (floor) */
.ladder-full .rung.put { border-left-color: rgba(0, 214, 143, 0.4); }
.ladder-full .rung.put::before {
  border-color: var(--tl-green);
  background: var(--tl-green);
  box-shadow: 0 0 16px var(--tl-green), 0 0 32px var(--tl-green-glow);
}
.ladder-full .rung.put .name { color: var(--tl-green); }
.ladder-full .rung.put .val { color: var(--tl-green); }

/* Setup zone highlight when a Playbook setup fires */
.ladder-full .rung.setup-zone {
  border-left-color: var(--tl-green);
  background: linear-gradient(90deg, var(--tl-green-soft), transparent);
}

/* Proximity alert badges on ladder rungs */
.ladder-full .rung .dist .prox-alert,
.ladder-full .rung .dist .prox-watch {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ladder-full .rung .dist .prox-alert {
  color: var(--tl-red);
  background: rgba(255, 61, 90, 0.15);
  animation: pulse 1.4s var(--ease) infinite;
}
.ladder-full .rung .dist .prox-watch {
  color: var(--tl-yellow);
  background: rgba(255, 176, 32, 0.15);
}

/* Setup tracker inside Live center */
.setup-tracker {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1.5px solid var(--tl-green);
  border-radius: var(--radius-md);
  background: var(--tl-green-soft);
}
.setup-tracker.dormant {
  border-color: var(--border-hair);
  background: var(--bg-1);
}
.setup-tracker.dormant .label { color: var(--text-tertiary); }

/* ==========================================================================
   BOTTOM STATUS STRIP
   ========================================================================== */
.bottombar {
  height: 34px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  border-top: 1px solid var(--border-soft);
  background: var(--bg-0);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.bottombar .kv { display: flex; gap: 6px; }
.bottombar .kv .k { color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.bottombar .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.bottombar .dot.ok  { background: var(--tl-green); box-shadow: 0 0 6px var(--tl-green); }
.bottombar .dot.bad { background: var(--tl-red); box-shadow: 0 0 6px var(--tl-red); }

/* ==========================================================================
   BACKEND HEALTH SECTION — full-width band below main content.
   Grid so many checks fit on one row; separate scroll area if it overflows.
   ========================================================================== */
.health-band {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--border-soft);
  background: var(--bg-0);
}
.health-band .band-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.health-band .band-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.health-band .band-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.health-band .band-summary .ok-count { color: var(--tl-green); }
.health-band .band-summary .fail-count { color: var(--tl-red); }

.health-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 6px;
}
.health-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: 8px var(--space-3);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  font-size: 12px;
  min-width: 0;
}
.health-item .status { font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; }
.health-item.ok .status { color: var(--tl-green); }
.health-item.fail .status { color: var(--tl-red); }
.health-item.ok  { border-left: 3px solid var(--tl-green); }
.health-item.fail { border-left: 3px solid var(--tl-red); }
.health-item .label { color: var(--text-primary); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-item .detail { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
}
.btn:hover { border-color: var(--tl-green); color: var(--tl-green); background: var(--bg-2); }

/* ---------- Utility ------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.dim { color: var(--text-tertiary); }
.tt { text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; }

/* ==========================================================================
   PLACEHOLDER (for tabs not yet built)
   ========================================================================== */
.hub-tab-placeholder {
  padding: 60px 40px;
  text-align: center;
  border: 1px dashed var(--border-hair);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  max-width: 720px;
  margin: 40px auto;
}
.hub-tab-placeholder-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.hub-tab-placeholder-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   NETDRIFT TAB
   Faithful port of netdrift.drklealtrades.com adapted for the hub.
   ES/NQ toggle · "what this means" banner · prominent READ · chart in
   ES/NQ prices natively · GEX ladder · trade plan · converter reference.
   ========================================================================== */
.nd-loading {
  padding: 60px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.nd-tab {
  width: 100%;
  margin: 0;
  padding: 8px 4px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Session ribbon */
.nd-session-ribbon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent);
  font-family: var(--font-mono);
  font-size: 12px;
}
.nd-session--bull    { border-left-color: var(--tl-green);  background-color: rgba(0,214,143,0.06); }
.nd-session--bear    { border-left-color: var(--tl-red);    background-color: rgba(255,80,80,0.06); }
.nd-session--warn    { border-left-color: var(--tl-yellow); background-color: rgba(255,181,71,0.06); }
.nd-session--neutral,
.nd-session--closed  { border-left-color: #6b7280;          background-color: rgba(107,114,128,0.10); }
.nd-session-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 10px currentColor;
}
.nd-session--bull    .nd-session-dot { color: var(--tl-green); }
.nd-session--bear    .nd-session-dot { color: var(--tl-red); }
.nd-session--warn    .nd-session-dot { color: var(--tl-yellow); }
.nd-session--neutral .nd-session-dot,
.nd-session--closed  .nd-session-dot { color: #94a3b8; }
.nd-session-label {
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.nd-session-desc {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Instrument toggle row */
.nd-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.nd-toggle-group {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-1);
}
.nd-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nd-toggle:hover:not(.active) {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.nd-toggle.active {
  background: linear-gradient(135deg, #60a5fa 0%, #4d8ce6 100%);
  color: #0b1220;
}
.nd-refresh {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nd-refresh:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }

/* "What this means for ES/NQ" banner */
.nd-meaning {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid;
  background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent);
}
.nd-meaning--bull    { border-color: rgba(0,214,143,0.4);  background-color: rgba(0,214,143,0.06); }
.nd-meaning--bear    { border-color: rgba(255,80,80,0.4);  background-color: rgba(255,80,80,0.06); }
.nd-meaning--warn    { border-color: rgba(255,181,71,0.4); background-color: rgba(255,181,71,0.06); }
.nd-meaning--neutral { border-color: rgba(148,163,184,0.35); background-color: rgba(148,163,184,0.05); }
.nd-meaning-headline {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.nd-meaning--bull    .nd-meaning-headline { color: var(--tl-green); }
.nd-meaning--bear    .nd-meaning-headline { color: var(--tl-red); }
.nd-meaning--warn    .nd-meaning-headline { color: var(--tl-yellow); }
.nd-meaning--neutral .nd-meaning-headline { color: #94a3b8; }
.nd-meaning-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  font-weight: 500;
}

/* THE READ */
.nd-read {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-left: 4px solid;
}
.nd-read--bull    { border-left-color: var(--tl-green); }
.nd-read--bear    { border-left-color: var(--tl-red); }
.nd-read--warn    { border-left-color: var(--tl-yellow); }
.nd-read--neutral { border-left-color: #94a3b8; }
.nd-read-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.nd-read-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.nd-read--bull .nd-read-text { color: var(--tl-green); }
.nd-read--bear .nd-read-text { color: var(--tl-red); }
.nd-read--warn .nd-read-text { color: var(--tl-yellow); }
.nd-read-explainer {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Main grid — matches Live tab pattern: fixed side rails, middle fills.
   Education left rail (360px) | GRAPH column (fills all remaining) | Sidebar (380px). */
.nd-main-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 380px;
  gap: var(--space-4);
  align-items: start;
  width: 100%;
}
@media (max-width: 1600px) {
  .nd-main-grid { grid-template-columns: 320px minmax(0, 1fr) 340px; }
}
@media (max-width: 1280px) {
  .nd-main-grid { grid-template-columns: 1fr; }
}

.nd-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nd-edu  { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nd-edu .nd-understanding { margin-top: 0; }
.nd-edu .nd-understanding-grid { grid-template-columns: 1fr; }
.nd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  /* Sticky sidebar: stays visible as the taller center column scrolls,
     preventing the large empty-space bug when main content is much longer
     than sidebar content. Falls back to static on narrow screens. */
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
@media (max-width: 1280px) {
  .nd-sidebar { position: static; max-height: none; }
}

/* Give the chart a proper minimum height so it dominates the middle column.
   Chart.js is configured with responsive:true + maintainAspectRatio:false,
   so it fills its container. We give the container an explicit height and
   let Chart.js size the canvas itself — do NOT position the canvas absolute. */
.nd-chart-canvas-wrap {
  position: relative;
  height: 520px;
  width: 100%;
}

/* Big tiles */
.nd-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.nd-tile {
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
}
.nd-tile-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.nd-tile-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}
.nd-tile-value.pos { color: var(--tl-green); }
.nd-tile-value.neg { color: var(--tl-red); }
.nd-tile-value.nd-tile-price { color: #60a5fa; }
.nd-tile-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Chart wrapper */
.nd-chart-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.nd-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.nd-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  color: var(--text-secondary);
}
.nd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}
.nd-swatch {
  width: 10px; height: 10px; border-radius: 2px;
}
.nd-chart-reset {
  background: transparent;
  border: 1px solid var(--border-hair);
  color: var(--text-tertiary);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
}
.nd-chart-reset:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.nd-chart-canvas-wrap {
  position: relative;
  height: 380px;
}
.nd-chart-hint {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: right;
}

/* GEX ladder */
.nd-ladder {
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.nd-ladder-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
}
.nd-ladder-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-hair);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.nd-ladder-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.nd-ladder-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.nd-ladder-table {
  display: block;
}
.nd-ladder-row {
  display: grid;
  grid-template-columns: 60px 180px 1fr 1fr 100px 130px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.nd-ladder-row:last-child { border-bottom: 0; }
.nd-ladder-head {
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nd-ladder-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.06em;
}
.nd-ladder-tag--call { background: rgba(0,214,143,0.14);  color: var(--tl-green); }
.nd-ladder-tag--put  { background: rgba(255,80,80,0.14);   color: var(--tl-red); }
.nd-ladder-tag--flip { background: rgba(255,181,71,0.14);  color: var(--tl-yellow); }
.nd-ladder-tag--spot { background: rgba(96,165,250,0.14);  color: #60a5fa; }
.nd-ladder-role {
  color: var(--text-secondary);
  font-size: 12px;
}
.nd-ladder-idx, .nd-ladder-fut {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.nd-ladder-idx strong, .nd-ladder-fut strong { color: var(--text-primary); font-weight: 700; }
.nd-ladder-row--spot { background: rgba(96,165,250,0.05); }
.nd-ladder-row--spot .nd-ladder-fut strong { color: #60a5fa; font-size: 13px; }
.nd-ladder-dist {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--text-tertiary);
}
.nd-ladder-dist.pos { color: var(--tl-green); }
.nd-ladder-dist.neg { color: var(--tl-red); }
.nd-ladder-size {
  display: flex; gap: 6px; align-items: center; justify-content: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
}
.nd-wall-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.nd-wall-badge--small  { background: rgba(148,163,184,0.15); color: #94a3b8; }
.nd-wall-badge--medium { background: rgba(255,181,71,0.20);  color: var(--tl-yellow); }
.nd-wall-badge--huge   { background: rgba(255,80,80,0.25);   color: var(--tl-red); }
.nd-wall-val { color: var(--text-tertiary); }

/* Sidebar cards */
.nd-card {
  background: var(--bg-1);
  border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.nd-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.nd-card-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.nd-card-empty {
  padding: 14px 0;
  color: var(--text-tertiary);
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
}

/* Trade plan */
.nd-card--plan { border-left: 3px solid; }
.nd-plan--long  { border-left-color: var(--tl-green); }
.nd-plan--short { border-left-color: var(--tl-red); }
.nd-plan-side {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.nd-plan--long  .nd-plan-side { color: var(--tl-green); }
.nd-plan--short .nd-plan-side { color: var(--tl-red); }
.nd-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.nd-plan-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.nd-plan-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}
.nd-plan-stop   { color: var(--tl-red); }
.nd-plan-target { color: var(--tl-green); }
.nd-plan-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Converter table */
.nd-conv-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.nd-conv-table th {
  text-align: right;
  padding: 5px 6px;
  color: var(--text-tertiary);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-hair);
}
.nd-conv-table th:first-child { text-align: left; }
.nd-conv-table td {
  text-align: right;
  padding: 5px 6px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.nd-conv-table td:first-child { text-align: left; color: var(--text-secondary); }
.nd-conv-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 8px;
}

/* Key levels card */
.nd-key-levels {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nd-key-level {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  border-left: 3px solid;
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
  font-size: 11.5px;
  align-items: baseline;
}
.nd-key-level--call { border-left-color: var(--tl-green); }
.nd-key-level--put  { border-left-color: var(--tl-red); }
.nd-key-level--flip { border-left-color: var(--tl-yellow); }
.nd-key-level-label {
  color: var(--text-secondary);
  font-weight: 700;
}
.nd-key-level-fut {
  color: var(--text-primary);
  font-weight: 800;
}
.nd-key-level-idx {
  color: var(--text-tertiary);
  font-size: 10px;
}

/* Footer */
.nd-footer {
  padding-top: 10px;
  border-top: 1px solid var(--border-hair);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
}

/* Range picker for Netdrift chart */
.nd-chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nd-range-picker {
  display: inline-flex;
  border: 1px solid var(--border-hair);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.20);
}
.nd-range-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid var(--border-hair);
}
.nd-range-btn:last-child { border-right: none; }
.nd-range-btn:hover:not(.active) {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.nd-range-btn.active {
  background: rgba(96,165,250,0.20);
  color: #60a5fa;
}

/* Differential tile emphasis */
.nd-tiles--4col { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1600px) { .nd-tiles--4col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px)  { .nd-tiles--4col { grid-template-columns: 1fr; } }

.nd-tile--diff {
  border-width: 1.5px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--bg-1);
}
.nd-tile--diff-pos { border-color: rgba(0,214,143,0.45); }
.nd-tile--diff-neg { border-color: rgba(255,80,80,0.45); }
.nd-tile--diff .nd-tile-sub {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.nd-tile--diff-pos .nd-tile-sub { color: var(--tl-green); }
.nd-tile--diff-neg .nd-tile-sub { color: var(--tl-red); }

/* Netdrift contextual Understanding panel */
.nd-understanding {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(96,165,250,0.06), rgba(96,165,250,0.02));
  border: 1px solid rgba(96,165,250,0.25);
  border-radius: 10px;
}
.nd-understanding-header { margin-bottom: 14px; }
.nd-understanding-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: #60a5fa;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.nd-understanding-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}
.nd-understanding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) { .nd-understanding-grid { grid-template-columns: 1fr; } }
.nd-understanding-card {
  padding: 14px 16px;
  background: rgba(0,0,0,0.20);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
}
.nd-understanding-card-h {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.nd-understanding-card-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Side-by-side education row: contextual Understanding | in-depth Netdrift Explained */
.nd-edu-row {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1200px) { .nd-edu-row { grid-template-columns: 1fr; } }

.nd-edu-col { min-width: 0; }
.nd-edu-col .nd-understanding { margin-top: 0; }
/* When Understanding is in a narrow side column, stack its cards */
.nd-edu-col--summary .nd-understanding-grid { grid-template-columns: 1fr; }

/* In-depth Netdrift Explained panel (ported material from netdrift repo) */
.nd-explained {
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.nd-explained-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-hair);
}
.nd-explained-concept {
  padding: 12px 14px;
  background: rgba(0,0,0,0.20);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.55;
}
.nd-explained-lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.nd-explained-line { padding: 8px 10px; background: rgba(0,0,0,0.10); border-left: 2px solid var(--border-hair); border-radius: 3px; }
.nd-explained-synthesis {
  padding: 12px 14px;
  background: rgba(0,0,0,0.20);
  border-radius: 6px;
}
.nd-explained-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-hair);
  font-size: 11px;
  color: var(--text-tertiary);
}
.nd-explained b { color: var(--text-primary); font-weight: 700; }
.nd-explained i { font-style: italic; }

/* Netdrift data-age badge (in session ribbon) */
.nd-session-ribbon { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nd-data-age {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border-hair);
}
.nd-data-age--live  { color: #22c55e; border-color: rgba(34,197,94,0.4);  background: rgba(34,197,94,0.10); }
.nd-data-age--stale { color: #94a3b8; border-color: rgba(148,163,184,0.4); background: rgba(148,163,184,0.10); }
.nd-data-age--warn  { color: #f59e0b; border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.12); }

/* ============================================================================
   GAMMA TAB — .gm-* classes. Layout wrapper reuses .nd-main-grid / .nd-main /
   .nd-edu / .nd-sidebar / .nd-tiles / .nd-chart-wrap / .nd-ladder /
   .nd-understanding from the Netdrift block above. Only gamma-specific
   pieces (synthesized read card, horizontal ladder, 0DTE/abs-net/surface
   sections) get new classes here.
   ============================================================================ */

.gamma-tab { width: 100%; margin: 0; display: flex; flex-direction: column; gap: 16px; }

.gm-basis-note {
  font-size: 11px; color: #64748b; letter-spacing: 0.02em;
  padding: 2px 4px;
}

.gm-tooltip {
  cursor: help; color: #64748b; font-size: 11px; border-bottom: 1px dotted #64748b;
}

/* ---- Synthesized Gamma Read (headline card) ---- */
.gm-synth {
  border: 2px solid #6b7280; border-radius: 12px; padding: 18px 22px;
  background: rgba(148,163,184,0.05);
  display: flex; flex-direction: column; gap: 10px;
}
.gm-synth--bull    { border-color: var(--tl-green); background: rgba(0,214,143,0.06); }
.gm-synth--bear    { border-color: var(--tl-red);   background: rgba(255,61,90,0.06); }
.gm-synth--warn    { border-color: var(--tl-yellow); background: rgba(255,176,32,0.06); }
.gm-synth--neutral { border-color: #6b7280; background: rgba(107,114,128,0.08); }

.gm-synth-top { display: flex; align-items: center; justify-content: space-between; }
.gm-synth-title { font-size: 12px; letter-spacing: 0.08em; color: #94a3b8; font-weight: 700; text-transform: uppercase; }
.gm-synth-conf { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; }
.gm-synth-conf--good { background: var(--tl-green-soft); color: var(--tl-green); }
.gm-synth-conf--warn { background: var(--tl-yellow-soft); color: var(--tl-yellow); }
.gm-synth-conf--bad  { background: rgba(255,61,90,0.14); color: var(--tl-red); }

.gm-synth-badge {
  font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em;
}
.gm-synth--bull .gm-synth-badge { color: var(--tl-green); }
.gm-synth--bear .gm-synth-badge { color: var(--tl-red); }
.gm-synth--warn .gm-synth-badge { color: var(--tl-yellow); }
.gm-synth--neutral .gm-synth-badge { color: #94a3b8; }

.gm-synth-oneliner { font-size: 16px; line-height: 1.5; color: var(--text-primary); max-width: 100%; }

.gm-synth-plan { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.gm-synth-plan-row { padding: 6px 10px; border-left: 3px solid #6b7280; font-size: 13px; background: rgba(255,255,255,0.02); border-radius: 0 6px 6px 0; }
.gm-synth-plan--primary { border-left-color: var(--tl-green); }
.gm-synth-plan--alt     { border-left-color: var(--tl-yellow); }
.gm-synth-plan--trap    { border-left-color: var(--tl-red); }

.gm-synth-signals { display: flex; flex-direction: column; gap: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; margin-top: 6px; }
.gm-synth-signal--good { color: var(--tl-green); }
.gm-synth-signal--bad  { color: var(--tl-red); }
.gm-synth-signal--warn { color: var(--tl-yellow); }
.gm-synth-signal--neutral { color: #94a3b8; }

.gm-synth-foot { font-size: 11px; color: #64748b; margin-top: 6px; }

/* ---- Sections ---- */
.gm-section { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; background: rgba(255,255,255,0.015); }
.gm-section-title { font-size: 12px; letter-spacing: 0.08em; color: #94a3b8; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; }
.gm-section-caption { font-size: 11px; letter-spacing: 0; color: #64748b; font-weight: 500; text-transform: none; margin-top: 4px; }
.gm-card-body { font-size: 12.5px; line-height: 1.5; color: #cbd5e1; margin-top: 4px; }
.gm-unavailable { font-size: 12px; color: var(--tl-yellow); background: rgba(255,176,32,0.08); border: 1px solid rgba(255,176,32,0.25); border-radius: 6px; padding: 8px 12px; }
.gm-meaning { font-size: 12.5px; line-height: 1.5; color: #cbd5e1; margin-top: 10px; padding: 8px 10px; background: rgba(255,255,255,0.02); border-radius: 6px; }
.gm-fallback-banner { font-size: 12px; color: var(--tl-yellow); background: rgba(255,176,32,0.08); border: 1px solid rgba(255,176,32,0.25); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.gm-footer-meta { font-size: 11px; color: #64748b; padding: 6px 2px; }

/* ---- Horizontal Levels Ladder (primary levels viz) ---- */
.gm-hladder-wrap { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 18px 20px 14px; background: rgba(255,255,255,0.015); width: 100%; }
.gm-hladder-title { font-size: 12px; letter-spacing: 0.08em; color: #94a3b8; font-weight: 700; text-transform: uppercase; margin-bottom: 22px; }
.gm-hladder-title-note { text-transform: none; letter-spacing: normal; font-weight: 400; color: #64748b; font-size: 11px; }
.gm-hladder-track { position: relative; height: 110px; margin: 0 10px 8px; border-radius: 8px; overflow: visible; }
.gm-hladder-gradient {
  position: absolute; left: 0; right: 0; top: 50%; height: 6px; transform: translateY(-50%);
  border-radius: 4px;
  background: linear-gradient(to right,
    rgba(255,61,90,0.55) 0%,
    rgba(255,61,90,0.30) calc(var(--flip-pct, 50%) - 15%),
    rgba(148,163,184,0.25) var(--flip-pct, 50%),
    rgba(0,214,143,0.30) calc(var(--flip-pct, 50%) + 15%),
    rgba(0,214,143,0.55) 100%);
}
.gm-hladder-wrap { padding: 22px 24px 20px !important; }
.gm-hladder-title { font-size: 14px !important; margin-bottom: 30px !important; }
.gm-hladder-title-note { font-size: 12px !important; }
.gm-hladder-track { height: 150px !important; }

.gm-hladder-tick { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; width: 130px; }
.gm-hladder-pill {
  font-size: 13px; font-weight: 800; letter-spacing: 0.05em; padding: 5px 13px; border-radius: 999px;
  text-transform: uppercase; white-space: nowrap; position: relative;
}
.gm-hladder-pill--pw   { background: rgba(255,61,90,0.18); color: var(--tl-red); border: 1px solid rgba(255,61,90,0.5); }
.gm-hladder-pill--cw   { background: rgba(0,214,143,0.18); color: var(--tl-green); border: 1px solid rgba(0,214,143,0.5); }
.gm-hladder-pill--flip { background: rgba(96,165,250,0.18); color: #60a5fa; border: 1px solid rgba(96,165,250,0.5); }
.gm-hladder-pill--spot { background: #fff; color: #0b0f19; border: 1px solid #fff; font-size: 14px; padding: 6px 16px; font-weight: 900; }

.gm-hladder-tick--sm .gm-hladder-pill { font-size: 11px; opacity: 0.90; }
.gm-hladder-tick--md .gm-hladder-pill { font-size: 12px; }
.gm-hladder-tick--lg .gm-hladder-pill { font-size: 13px; font-weight: 800; }
.gm-hladder-tick--xl .gm-hladder-pill { font-size: 14px; }

.gm-hladder-pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tl-green);
  margin-left: 6px; animation: gm-pulse 1.4s ease-in-out infinite;
}
@keyframes gm-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.7); } }

.gm-hladder-price { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-top: 4px; font-variant-numeric: tabular-nums; }
.gm-hladder-gex { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-top: 3px; }
.gm-hladder-gex--pw { background: rgba(255,61,90,0.15); color: var(--tl-red); }
.gm-hladder-gex--cw { background: rgba(0,214,143,0.15); color: var(--tl-green); }
.gm-hladder-dsig { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.gm-hladder-dist { position: absolute; top: 62px; font-size: 11.5px; font-weight: 600; color: #94a3b8; text-align: center; pointer-events: none; }

.gm-hladder-read { font-size: 15px; line-height: 1.55; color: var(--text-primary); padding: 14px 18px; margin-top: 14px; background: rgba(255,255,255,0.03); border-radius: 8px; border-left: 4px solid #60a5fa; }

.gm-hladder-detail { margin-top: 12px; }
.gm-hladder-detail summary { cursor: pointer; font-size: 11px; color: #94a3b8; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 0; }
.gm-hladder-detail[open] summary { color: var(--text-primary); }

/* ---- 0DTE section ---- */
.gm-zd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gm-zd-tile { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 10px 12px; }
.gm-zd-label { font-size: 10.5px; letter-spacing: 0.06em; color: #94a3b8; text-transform: uppercase; }
.gm-zd-value { font-size: 20px; font-weight: 800; margin-top: 4px; color: var(--text-primary); }
.gm-zd-value.pos { color: var(--tl-green); }
.gm-zd-value.neg { color: var(--tl-red); }
.gm-zd-top { margin-top: 12px; }
.gm-zd-top-title { font-size: 11px; color: #94a3b8; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.gm-zd-strike { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 4px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.gm-zd-strike .pos { color: var(--tl-green); }
.gm-zd-strike .neg { color: var(--tl-red); }

/* ---- Absolute vs Net gamma section ---- */
.gm-an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gm-an-tile { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 12px 14px; }
.gm-an-label { font-size: 10.5px; letter-spacing: 0.06em; color: #94a3b8; text-transform: uppercase; }
.gm-an-value { font-size: 22px; font-weight: 800; margin-top: 4px; color: var(--text-primary); }
.gm-an-value.pos { color: var(--tl-green); }
.gm-an-value.neg { color: var(--tl-red); }
.gm-an-sub { font-size: 11px; color: #94a3b8; margin-top: 6px; line-height: 1.4; }

/* ---- Surface section ---- */
.gm-surface-wrap { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; background: rgba(255,255,255,0.015); width: 100%; }
.gm-plot-el { background: #0b0f19; border-radius: 8px; }

/* ---- Top flows ---- */
.gm-flows-note { font-size: 11px; color: #64748b; margin-bottom: 8px; line-height: 1.4; }

@media (max-width: 1000px) {
  .gm-hladder-tick { width: 64px; }
  .gm-an-grid { grid-template-columns: 1fr; }
  .gm-zd-grid { grid-template-columns: 1fr; }
}

/* ===========================================================================
   GAMMA++ ADDITIONS — .gm-drift-*, .gm-freshflow-*, .gm-charmproj-*, .gm-verify-*
   Appended per Gamma++ task: Intraday Drift, Fresh Flow, Charm/Vanna
   Projection, Independent Verification. No max-width caps added — all
   sections inherit full-width ultrawide fill from .gm-section / .nd-main.
   =========================================================================== */

/* ---- Intraday Gamma Drift ------------------------------------------------ */
.gm-drift-section { width: 100%; }
.gm-drift-chart-wrap {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
}
.gm-drift-collecting {
  background: var(--tl-yellow-soft);
  border: 1px solid rgba(255,176,32,0.25);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}
.gm-drift-collecting-title {
  font-weight: 600;
  color: var(--tl-yellow);
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.gm-drift-collecting-sub {
  font-size: 12.5px;
  color: #b7bfcf;
  line-height: 1.5;
}

/* ---- Fresh Flow by Strike ------------------------------------------------- */
.gm-freshflow-section { width: 100%; }
.gm-freshflow-table { width: 100%; }
.gm-ff-hot { color: var(--tl-red); font-weight: 700; }
.gm-ff-warm { color: var(--tl-yellow); font-weight: 600; }
.gm-ff-neutral { color: #8892a6; }
.gm-ff-dirbadge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.gm-ff-dir-callbuy { background: var(--tl-green-soft); color: var(--tl-green); }
.gm-ff-dir-callsell { background: rgba(0,214,143,0.06); color: #6fd9b8; border: 1px solid rgba(0,214,143,0.25); }
.gm-ff-dir-putbuy { background: var(--tl-red-soft); color: var(--tl-red); }
.gm-ff-dir-putsell { background: rgba(255,61,90,0.06); color: #f39aab; border: 1px solid rgba(255,61,90,0.25); }
.gm-ff-dir-mixed { background: rgba(255,255,255,0.06); color: #b7bfcf; }

/* ---- Charm/Vanna Projected Forward --------------------------------------- */
.gm-charmproj-section { width: 100%; }
.gm-charmproj-wrap { margin-top: 14px; width: 100%; }
.gm-charmproj-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #cfd6e4;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.gm-charmproj-table { width: 100%; }
.gm-charmproj-peak {
  background: rgba(255,176,32,0.10) !important;
  box-shadow: inset 3px 0 0 var(--tl-yellow);
}
.gm-charmproj-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tl-yellow);
  color: #1a1400;
  vertical-align: middle;
}

/* ---- Independent Verification / Data Cross-Check panel -------------------- */
.gm-verify-panel { width: 100%; }
.gm-verify-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}
.gm-verify-icon {
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.gm-verify-green { background: var(--tl-green-soft); color: var(--tl-green); border: 1px solid rgba(0,214,143,0.25); }
.gm-verify-yellow { background: var(--tl-yellow-soft); color: var(--tl-yellow); border: 1px solid rgba(255,176,32,0.25); }
.gm-verify-red { background: var(--tl-red-soft); color: var(--tl-red); border: 1px solid rgba(255,61,90,0.25); }

/* ---- Shared education collapsibles (all 4 features) ----------------------- */
.gm-edu-details {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.015);
}
.gm-edu-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #9fb0d0;
  letter-spacing: 0.01em;
  outline: none;
}
.gm-edu-details summary:hover { color: #c7d4ec; }
.gm-edu-body { margin-top: 8px; font-size: 12px; line-height: 1.55; color: #b7bfcf; }
.gm-edu-body p { margin: 0 0 8px 0; }
.gm-edu-body p:last-child { margin-bottom: 0; }
.gm-edu-body b { color: #d9e0ee; }

/* ============================================================================
   GM-LIVESYN — "Current Situation + Trade This Way" dynamic synthesis block.
   Inserted directly under each major Gamma-tab section's data. Muted
   background so it doesn't visually compete with the data ABOVE it; green
   accents for do-this actions, red for don't-do-this warnings.
   ============================================================================ */
.gm-livesyn {
  margin-top: 10px;
  padding: 10px 14px 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(255,255,255,0.018);
  font-size: 13px;
  line-height: 1.5;
}
.gm-livesyn-situation {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 5px;
}
.gm-livesyn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96,165,250,0.6);
  animation: gm-livesyn-pulse 1.8s infinite;
  flex: 0 0 auto;
}
@keyframes gm-livesyn-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(96,165,250,0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(96,165,250,0); }
  100% { box-shadow: 0 0 0 0 rgba(96,165,250,0); }
}
.gm-livesyn-situation-body {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 10px;
}
.gm-livesyn-trade {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tl-yellow);
  margin-bottom: 5px;
}
.gm-livesyn-trade-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gm-livesyn-trade-row {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.015);
  color: var(--text-secondary);
}
.gm-livesyn-trade-row.gm-livesyn-trade-good {
  color: var(--tl-green);
  border-left: 3px solid var(--tl-green);
  background: rgba(0,214,143,0.05);
}
.gm-livesyn-trade-row.gm-livesyn-trade-bad {
  color: var(--tl-red);
  border-left: 3px solid var(--tl-red);
  background: rgba(255,61,90,0.05);
}

/* ==========================================================================
   REGIME TAB — .rg-* classes.
   Reuses .nd-main-grid / .nd-edu / .nd-main / .nd-sidebar / .nd-tile /
   .nd-tiles / .nd-toggle-row / .nd-toggle / .nd-refresh / .nd-understanding /
   .nd-understanding-grid / .nd-ladder-header / .nd-ladder-title as-is (see
   Netdrift tab CSS above — no redefinition needed).
   Reuses .gm-synth* / .gm-section / .gm-card-body / .gm-unavailable /
   .gm-livesyn* structurally; .rg-synth / .rg-livesyn* below add the
   regime-specific 5-color badge system and net-new visual widgets
   (percentile bars, event table, phase track, VIX curve, divergence flag).
   ========================================================================== */

.regime-tab { width: 100%; margin: 0; }

/* ---- session ribbon ------------------------------------------------------ */
.rg-session-ribbon {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  padding: 6px 12px; border-radius: 6px; margin-bottom: 10px;
  background: rgba(255,255,255,0.03); color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.06);
}
.rg-session-dot { width: 7px; height: 7px; border-radius: 50%; background: #6b7280; flex: 0 0 auto; }
.rg-session-ribbon--good .rg-session-dot { background: var(--tl-green); }
.rg-session-ribbon--warn .rg-session-dot { background: var(--tl-yellow); }
.rg-session-ribbon--neutral .rg-session-dot { background: #6b7280; }

/* ---- synthesized regime read card: 5-state border/badge color system ---- */
.rg-synth { }
.rg-synth--normal    { border-color: #6b7280; background: rgba(107,114,128,0.07); }
.rg-synth--opex       { border-color: #d4a017; background: rgba(212,160,23,0.08); }
.rg-synth--quad        { border-color: var(--tl-red); background: rgba(255,61,90,0.07); }
.rg-synth--event      { border-color: #fb923c; background: rgba(251,146,60,0.08); }
.rg-synth--postopex    { border-color: #3b82f6; background: rgba(59,130,246,0.08); }

.rg-badge {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin: 6px 0 8px;
}
.rg-badge--normal    { background: rgba(107,114,128,0.18); color: #cbd5e1; }
.rg-badge--opex       { background: rgba(212,160,23,0.20);  color: #d4a017; }
.rg-badge--quad        { background: rgba(255,61,90,0.16);  color: var(--tl-red); }
.rg-badge--event      { background: rgba(251,146,60,0.18);  color: #fb923c; }
.rg-badge--postopex    { background: rgba(59,130,246,0.18);  color: #3b82f6; }

/* ---- plain-english tooltips ---------------------------------------------- */
.rg-tip { position: relative; border-bottom: 1px dotted #64748b; cursor: help; }
.rg-tip-icon {
  display: inline-block; width: 13px; height: 13px; line-height: 13px; text-align: center;
  border-radius: 50%; background: rgba(255,255,255,0.10); color: #94a3b8;
  font-size: 9px; font-weight: 800; margin-left: 3px; vertical-align: 2px;
}
.rg-tip:hover::after, .rg-tip:focus::after {
  content: attr(data-tip);
  position: absolute; left: 0; top: 100%; margin-top: 6px; z-index: 40;
  width: 260px; max-width: 60vw; white-space: normal;
  background: #0f172a; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  padding: 8px 10px; font-size: 11.5px; line-height: 1.5; color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45); font-weight: 400; text-transform: none; letter-spacing: 0;
}

/* ---- section wrapper (mirrors .gm-section, adds muted variant) ---------- */
.rg-section--muted { opacity: 0.85; }
.rg-note { font-size: 12px; color: #94a3b8; line-height: 1.5; margin: 6px 0 10px; }
.rg-cross-ref-list { list-style: none; padding: 0; margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.rg-cross-ref-list li { font-size: 13px; color: var(--text-primary); padding: 6px 10px; background: rgba(255,255,255,0.03); border-left: 3px solid rgba(148,163,184,0.4); border-radius: 0 6px 6px 0; }
.rg-cross-ref-list li b { color: var(--text-primary); }

/* ---- regime pill (per-section state indicator) --------------------------- */
.rg-pill {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
}
.rg-pill--normal    { background: rgba(107,114,128,0.18); color: #cbd5e1; }
.rg-pill--opex       { background: rgba(212,160,23,0.20);  color: #d4a017; }
.rg-pill--quad        { background: rgba(255,61,90,0.16);  color: var(--tl-red); }
.rg-pill--event      { background: rgba(251,146,60,0.18);  color: #fb923c; }
.rg-pill--postopex    { background: rgba(59,130,246,0.18);  color: #3b82f6; }
.rg-pill--extreme     { background: rgba(255,61,90,0.16);  color: var(--tl-red); }
.rg-pill--elevated    { background: rgba(212,160,23,0.20);  color: #d4a017; }

/* ---- playbook / interpretation card -------------------------------------- */
.rg-playbook-card {
  margin-top: 10px; padding: 8px 12px; border-radius: 6px;
  background: rgba(255,255,255,0.02); border-left: 3px solid #6b7280;
}
.rg-playbook-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: #94a3b8; margin-bottom: 3px;
}
.rg-playbook-text { font-size: 12.5px; line-height: 1.55; color: #cbd5e1; }

/* ---- dual horizontal percentile bars (implied correlation) -------------- */
.rg-bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rg-bar-label { flex: 0 0 190px; font-size: 11.5px; color: #94a3b8; }
.rg-pctbar {
  position: relative; flex: 1 1 auto; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.06); overflow: visible;
}
.rg-pctbar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--tl-green), var(--tl-yellow), var(--tl-red));
}
.rg-pctbar-marker {
  position: absolute; top: -3px; width: 2px; height: 14px; background: #fff;
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

/* ---- divergence flag banner ---------------------------------------------- */
.rg-divergence-flag {
  margin-top: 8px; padding: 7px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.rg-divergence-flag--warn { background: rgba(255,176,32,0.10); color: var(--tl-yellow); border: 1px solid rgba(255,176,32,0.3); }
.rg-divergence-flag--ok   { background: rgba(0,214,143,0.08);  color: var(--tl-green);  border: 1px solid rgba(0,214,143,0.25); }

/* ---- OpEx phase track ------------------------------------------------------ */
.rg-phase-track {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0;
}
.rg-phase-step {
  padding: 8px 8px; border-radius: 6px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06); text-align: center;
}
.rg-phase-step--active {
  background: rgba(212,160,23,0.10); border-color: #d4a017;
}
.rg-phase-step-label { font-size: 10.5px; font-weight: 700; color: #cbd5e1; margin-bottom: 3px; }
.rg-phase-step-note { font-size: 10px; color: #94a3b8; line-height: 1.3; }

/* ---- event calendar table -------------------------------------------------- */
.rg-event-table { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.rg-event-row {
  display: grid; grid-template-columns: 90px 90px 1fr 50px 70px; gap: 8px; align-items: center;
  padding: 5px 8px; border-radius: 4px; font-size: 12px; background: rgba(255,255,255,0.015);
}
.rg-event-row--header {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: #64748b; background: none; padding: 0 8px;
}
.rg-event-row--near { background: rgba(251,146,60,0.08); border-left: 3px solid #fb923c; }
.rg-event-date { color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.rg-event-type { color: #60a5fa; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.rg-event-label { color: #cbd5e1; }
.rg-event-days { color: #e2e8f0; font-weight: 700; text-align: right; }
.rg-event-impact { text-align: center; font-size: 10px; font-weight: 800; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; }
.rg-event-impact--high { background: rgba(255,61,90,0.16); color: var(--tl-red); }
.rg-event-impact--medium { background: rgba(255,176,32,0.14); color: var(--tl-yellow); }
.rg-event-impact--low { background: rgba(107,114,128,0.16); color: #cbd5e1; }

/* ---- VIX term structure mini curve ----------------------------------------- */
.rg-vixcurve {
  display: flex; align-items: flex-end; gap: 10px; height: 100px; margin: 12px 4px;
  padding: 0 8px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rg-vixcurve-bar {
  flex: 1 1 auto; max-width: 40px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
}

/* ---- sidebar: key dates ----------------------------------------------------- */
.rg-keydate-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px;
}
.rg-keydate-label { color: #94a3b8; }
.rg-keydate-value { color: #e2e8f0; font-weight: 600; text-align: right; }

/* ---- sidebar: data cross-check --------------------------------------------- */
.rg-xcheck-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 11.5px; }
.rg-xcheck-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.rg-xcheck-dot--ok  { background: var(--tl-green); }
.rg-xcheck-dot--bad { background: var(--tl-red); }
.rg-xcheck-label { flex: 0 0 130px; color: #cbd5e1; }
.rg-xcheck-src { color: #64748b; font-size: 10.5px; }

/* ---- live read synthesis block (Current Situation + Trade This Way) ------- */
.rg-livesyn {
  margin-top: 10px; padding: 10px 14px 12px; border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px; background: rgba(255,255,255,0.018); font-size: 13px; line-height: 1.5;
}
.rg-livesyn-situation {
  display: flex; align-items: center; gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase; color: #60a5fa; margin-bottom: 5px;
}
.rg-livesyn-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96,165,250,0.6); animation: gm-livesyn-pulse 1.8s infinite; flex: 0 0 auto;
}
.rg-livesyn-situation-body { color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; margin-bottom: 10px; }
.rg-livesyn-trade {
  display: flex; align-items: center; gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--tl-yellow); margin-bottom: 5px;
}
.rg-livesyn-trade-body { display: flex; flex-direction: column; gap: 3px; }
.rg-livesyn-trade-row {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5;
  padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.015); color: var(--text-secondary);
}
.rg-livesyn-trade-row.rg-livesyn-trade-good {
  color: var(--tl-green); border-left: 3px solid var(--tl-green); background: rgba(0,214,143,0.05);
}
.rg-livesyn-trade-row.rg-livesyn-trade-bad {
  color: var(--tl-red); border-left: 3px solid var(--tl-red); background: rgba(255,61,90,0.05);
}

/* ---- responsive: collapse phase track / event table on narrower widths --- */
@media (max-width: 1280px) {
  .rg-phase-track { grid-template-columns: repeat(2, 1fr); }
  .rg-event-row, .rg-event-row--header { grid-template-columns: 80px 70px 1fr 40px 60px; }
}

/* ============================================================================
   FLOW TAB — .fl-* classes. Layout wrapper reuses .nd-main-grid / .nd-main /
   .nd-edu / .nd-sidebar / .nd-tile / .nd-tiles / .nd-toggle-row / .nd-toggle /
   .nd-refresh / .nd-understanding from the Netdrift block, and the
   Synthesized Read card + live-read blocks REUSE .gm-synth-* / .gm-livesyn-*
   verbatim (Gamma tab's) for visual consistency, per task instructions.
   Only Flow-specific pieces (CVD tiles, volume profile nodes, tape ticker,
   confluence grid, aggressor bar) get new .fl-* classes here.
   ============================================================================ */
.flow-tab { width: 100%; margin: 0; display: flex; flex-direction: column; gap: 16px; }

/* Bias-colored border variants for the Synthesized Flow Read card, added on
   top of the shared .gm-synth base classes (green=buyers, red=sellers,
   gray=balanced, amber=rotation, orange=exhaustion). */
.fl-synth--buyers    { border-color: var(--tl-green) !important; background: rgba(0,214,143,0.06) !important; }
.fl-synth--sellers   { border-color: var(--tl-red) !important; background: rgba(255,61,90,0.06) !important; }
.fl-synth--balanced  { border-color: #6b7280 !important; background: rgba(107,114,128,0.08) !important; }
.fl-synth--rotation  { border-color: var(--tl-yellow) !important; background: rgba(255,176,32,0.07) !important; }
.fl-synth--exhaustion{ border-color: #fb923c !important; background: rgba(251,146,60,0.07) !important; }
.fl-synth--buyers .gm-synth-badge     { color: var(--tl-green) !important; }
.fl-synth--sellers .gm-synth-badge    { color: var(--tl-red) !important; }
.fl-synth--balanced .gm-synth-badge   { color: #94a3b8 !important; }
.fl-synth--rotation .gm-synth-badge   { color: var(--tl-yellow) !important; }
.fl-synth--exhaustion .gm-synth-badge { color: #fb923c !important; }

/* ---- generic tile grids reused across sections (CVD / VP / VWAP / OR) ---- */
.fl-cvd-tiles, .fl-vp-tiles, .fl-vwap-tiles, .fl-or-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 1100px) {
  .fl-cvd-tiles, .fl-vp-tiles, .fl-vwap-tiles, .fl-or-tiles { grid-template-columns: repeat(2, 1fr); }
}

.fl-vp-nodes {
  margin-top: 12px; display: flex; flex-direction: column; gap: 4px;
  font-size: 12.5px; color: #cbd5e1; line-height: 1.5;
}

.fl-or-hist {
  margin-top: 12px; display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12.5px; color: #cbd5e1;
}
.fl-or-hist b { color: var(--text-primary); }

/* ---- Tape Reading Metrics tiles ---- */
.fl-tape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .fl-tape-grid { grid-template-columns: 1fr; } }
.fl-tape-tile { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 12px 14px; }
.fl-agg-bar {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 8px 0 6px; background: rgba(255,255,255,0.05);
}
.fl-agg-bar-buy { background: var(--tl-green); height: 100%; }
.fl-agg-bar-sell { background: var(--tl-red); height: 100%; }

/* ---- Large Prints Tape (ticker rows) ---- */
.fl-tape-header {
  display: grid; grid-template-columns: 90px 90px 80px 70px 90px; gap: 6px;
  font-size: 10.5px; letter-spacing: 0.06em; color: #94a3b8; text-transform: uppercase;
  padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.fl-tape-scroll { max-height: 320px; overflow-y: auto; }
.fl-tape-row {
  display: grid; grid-template-columns: 90px 90px 80px 70px 90px; gap: 6px; align-items: center;
  padding: 5px 8px; font-size: 12.5px; font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.fl-tape-row.buy { background: rgba(0,214,143,0.04); }
.fl-tape-row.sell { background: rgba(255,61,90,0.04); }
.fl-tape-time { color: #94a3b8; }
.fl-tape-price { color: var(--text-primary); font-weight: 600; }
.fl-tape-size { color: var(--text-primary); }
.fl-tape-side { font-weight: 800; letter-spacing: 0.04em; }
.fl-tape-side.buy { color: var(--tl-green); }
.fl-tape-side.sell { color: var(--tl-red); }
.fl-tape-cum { color: #94a3b8; }

/* ---- GEX x Flow Confluence ---- */
.fl-confluence-grid { display: flex; flex-direction: column; gap: 8px; }
.fl-confluence-row {
  display: grid; grid-template-columns: 160px 1fr 260px; gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: 8px; background: rgba(255,255,255,0.02);
  border-left: 3px solid #6b7280;
}
@media (max-width: 1100px) { .fl-confluence-row { grid-template-columns: 1fr; } }
.fl-confluence-row.toward { border-left-color: var(--tl-yellow); }
.fl-confluence-row.away { border-left-color: #60a5fa; }
.fl-confluence-wall { font-size: 12.5px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.fl-confluence-strike { font-size: 15px; font-weight: 800; color: #60a5fa; }
.fl-confluence-dist { font-size: 12px; color: #94a3b8; }
.fl-confluence-verdict { font-size: 12px; font-weight: 700; text-align: right; }
.fl-confluence-verdict.fade { color: var(--tl-yellow); }
.fl-confluence-verdict.follow { color: #60a5fa; }
@media (max-width: 1100px) { .fl-confluence-verdict { text-align: left; } }

/* ---- Sidebar key stats ---- */
.fl-keystats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fl-keystats-row {
  display: flex; justify-content: space-between; font-size: 13px; padding: 4px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.fl-keystats-row span:first-child { color: #94a3b8; }
.fl-keystats-row span:last-child { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   NEWS TAB — .nw-* classes (Tier-2 #4, after Netdrift/Gamma/Regime/Flow).
   Reuses .nd-main-grid / .nd-edu / .nd-main / .nd-sidebar / .nd-tile /
   .nd-toggle-row / .nd-toggle-group / .nd-refresh / .nd-understanding /
   .nd-understanding-grid / .nd-ladder-header / .nd-ladder-title / .nd-loading
   as-is (Netdrift tab CSS above — no redefinition needed).
   Reuses .gm-synth* / .gm-section* / .gm-card-body / .gm-unavailable
   structurally for the Synthesized Read card + section wrappers.
   .nw-synth--* below add the News-specific 5-color badge system
   (QUIET=gray / ACTIVE=blue / URGENT=amber / EVENT DAY=orange /
   POST-EVENT=purple). .nw-livesyn-* clones .gm-livesyn-*/.rg-livesyn-*
   structurally under a News-specific class prefix per task instructions.
   ============================================================================ */
.news-tab { width: 100%; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.nw-tab-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.02em; }

/* ---- Synthesized News Read badge color variants ---- */
.nw-synth--quiet     { border-color: #6b7280 !important; background: rgba(107,114,128,0.08) !important; }
.nw-synth--active    { border-color: #60a5fa !important; background: rgba(96,165,250,0.07) !important; }
.nw-synth--urgent    { border-color: var(--tl-yellow) !important; background: rgba(255,176,32,0.08) !important; }
.nw-synth--eventday  { border-color: #fb923c !important; background: rgba(251,146,60,0.08) !important; }
.nw-synth--postevent { border-color: #a78bfa !important; background: rgba(167,139,250,0.08) !important; }
.nw-synth--quiet     .gm-synth-badge { color: #94a3b8 !important; }
.nw-synth--active    .gm-synth-badge { color: #60a5fa !important; }
.nw-synth--urgent    .gm-synth-badge { color: var(--tl-yellow) !important; }
.nw-synth--eventday  .gm-synth-badge { color: #fb923c !important; }
.nw-synth--postevent .gm-synth-badge { color: #a78bfa !important; }

/* ---- badges (importance / impact / event tags) ---- */
.nw-badge {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; padding: 2px 7px;
  border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}
.nw-badge--urgent, .nw-badge--high { background: rgba(255,176,32,0.16); color: var(--tl-yellow); }
.nw-badge--med    { background: rgba(96,165,250,0.16); color: #60a5fa; }
.nw-badge--low    { background: rgba(107,114,128,0.16); color: #94a3b8; }

/* ---- Urgent / Breaking news list ---- */
.nw-news-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.nw-news-item {
  padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}
.nw-news-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.nw-news-time { font-size: 11px; color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nw-news-source { font-size: 11px; color: #64748b; margin-left: auto; }
.nw-news-headline { font-size: 13.5px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.nw-news-headline a { color: var(--text-primary); text-decoration: none; }
.nw-news-headline a:hover { color: #60a5fa; text-decoration: underline; }
.nw-news-impact { font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.4; }
.nw-empty {
  font-size: 12.5px; color: #94a3b8; padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.015); border: 1px dashed rgba(255,255,255,0.08);
}

/* ---- Macro calendar list ---- */
.nw-cal-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nw-cal-row {
  display: grid; grid-template-columns: 70px 1fr 60px; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}
.nw-cal-row--soon { border-color: rgba(251,146,60,0.35); background: rgba(251,146,60,0.05); }
.nw-cal-date { font-size: 12px; font-weight: 700; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nw-cal-label { font-size: 13.5px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nw-cal-reaction { font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.4; }
.nw-cal-countdown { font-size: 13px; font-weight: 800; color: #fb923c; text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 900px) { .nw-cal-row { grid-template-columns: 1fr; } .nw-cal-countdown { text-align: left; } }

/* ---- Earnings list ---- */
.nw-earn-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nw-earn-row {
  display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}
.nw-earn-ticker { font-size: 14px; font-weight: 800; color: #60a5fa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nw-earn-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.nw-earn-when { font-size: 11px; color: #64748b; font-weight: 500; margin-left: 6px; }
.nw-earn-stats { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* ---- Small-cap catalysts list ---- */
.nw-cat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nw-cat-subtitle { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; margin: 10px 0 4px; }
.nw-cat-row {
  display: grid; grid-template-columns: 66px 1fr; align-items: start; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}
.nw-cat-date { font-size: 12px; font-weight: 700; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nw-cat-ticker { font-size: 13.5px; font-weight: 800; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nw-cat-type { font-size: 11px; font-weight: 600; color: #64748b; text-transform: none; letter-spacing: 0; }
.nw-cat-why { font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.4; }

/* ---- Fed / Treasury ---- */
.nw-fed-blackout {
  margin-top: 6px; padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
}
.nw-fed-blackout--active { border-color: rgba(167,139,250,0.4); background: rgba(167,139,250,0.07); }
.nw-fed-blackout-label { font-size: 12.5px; font-weight: 800; color: var(--text-primary); }
.nw-fed-blackout-note { font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.4; }
.nw-auction-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.nw-auction-row {
  display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.04);
}
.nw-auction-date { font-size: 12px; font-weight: 700; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nw-auction-tenor { font-size: 13px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.nw-auction-note { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* ---- Macro stress cross-asset grid ---- */
.nw-cross-asset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 6px; }
@media (max-width: 1100px) { .nw-cross-asset-grid { grid-template-columns: repeat(2, 1fr); } }
.nw-risk-lean { margin-top: 10px; font-size: 13px; color: var(--text-secondary); padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,0.02); }
.nw-risk-lean--riskoff .nw-risk-lean b, .nw-risk-lean b { color: inherit; }
.nw-risk-lean--riskoff { color: var(--tl-red); }
.nw-risk-lean--riskon { color: var(--tl-green); }
.nw-risk-lean--neutral { color: #94a3b8; }

/* ---- News x Regime confluence ---- */
.nw-confluence-drivers { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }

/* ---- Live-read blocks: .nw-livesyn* (structural clone of .gm-livesyn*/
   .rg-livesyn* for visual consistency across all tabs) ---- */
.nw-livesyn {
  margin-top: 10px;
  padding: 10px 14px 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(255,255,255,0.018);
  font-size: 13px;
  line-height: 1.5;
}
.nw-livesyn-situation {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 5px;
}
.nw-livesyn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96,165,250,0.6);
  animation: gm-livesyn-pulse 1.8s infinite;
  flex: 0 0 auto;
}
.nw-livesyn-situation-body {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 10px;
}
.nw-livesyn-trade {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tl-yellow);
  margin-bottom: 5px;
}
.nw-livesyn-trade-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nw-livesyn-trade-row {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.015);
  color: var(--text-secondary);
}
.nw-livesyn-trade-row.nw-livesyn-trade-good {
  color: var(--tl-green);
  border-left: 3px solid var(--tl-green);
  background: rgba(0,214,143,0.05);
}
.nw-livesyn-trade-row.nw-livesyn-trade-bad {
  color: var(--tl-red);
  border-left: 3px solid var(--tl-red);
  background: rgba(255,61,90,0.05);
}

/* ============================================================================
   LIVE TAB — MASTER COMMAND CENTER (.lv-*)
   Additive only — reuses .nd-main-grid / .nd-understanding / .gm-hladder-*
   from existing tabs. Color mapping: green=var(--tl-green), red=var(--tl-red),
   amber=var(--tl-yellow), orange=var(--tl-orange), gray=var(--tl-gray).
   ============================================================================ */

.lv-toggle-row { display: flex; justify-content: flex-end; margin-bottom: var(--space-3); }
.lv-toggle { display: inline-flex; border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; }
.lv-toggle-btn {
  background: var(--bg-2); color: var(--text-tertiary); border: none; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; padding: 6px 14px;
}
.lv-toggle-btn.active { background: var(--tl-green-soft); color: var(--tl-green); }
.lv-toggle-btn:not(.active):hover { background: var(--bg-3); color: var(--text-secondary); }

/* ---- Master Synthesis card ---- */
.lv-master {
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  background: var(--bg-2); padding: var(--space-4); margin-bottom: var(--space-4);
  border-left: 4px solid var(--tl-gray);
}
.lv-master--green { border-left-color: var(--tl-green); box-shadow: 0 0 24px -12px var(--tl-green-glow); }
.lv-master--red   { border-left-color: var(--tl-red);   box-shadow: 0 0 24px -12px var(--tl-red-glow); }
.lv-master--amber { border-left-color: var(--tl-yellow); box-shadow: 0 0 24px -12px var(--tl-yellow-glow); }
.lv-master--gray  { border-left-color: var(--tl-gray); }
.lv-master-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.lv-master-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--text-tertiary); text-transform: uppercase; }
.lv-master-confidence { font-size: 11px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.05em; }
.lv-master-badge {
  display: inline-block; font-size: 15px; font-weight: 800; letter-spacing: 0.04em;
  padding: 4px 12px; border-radius: var(--radius-sm); margin-bottom: 10px;
}
.lv-master-badge--green { background: var(--tl-green-soft); color: var(--tl-green); }
.lv-master-badge--red   { background: var(--tl-red-soft);   color: var(--tl-red); }
.lv-master-badge--amber { background: var(--tl-yellow-soft); color: var(--tl-yellow); }
.lv-master-badge--gray  { background: var(--tl-gray-soft);  color: var(--tl-gray); }
.lv-master-oneliner { font-size: 14px; color: var(--text-primary); line-height: 1.5; margin-bottom: 12px; }
.lv-master-plan { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lv-master-plan-row { display: flex; gap: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.lv-plan-label { flex: 0 0 auto; font-weight: 800; font-size: 11px; letter-spacing: 0.06em; color: var(--text-tertiary); min-width: 76px; }
.lv-master-signals-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; }
.lv-master-signals { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lv-master-signal {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 3px 9px; border-radius: 999px; background: var(--bg-3); color: var(--text-secondary);
}
.lv-master-signal--good { color: var(--tl-green); background: var(--tl-green-soft); }
.lv-master-signal--warn { color: var(--tl-yellow); background: var(--tl-yellow-soft); }
.lv-master-signal--bad  { color: var(--tl-red);   background: var(--tl-red-soft); }
.lv-mark { font-weight: 800; }
.lv-master-watch { font-size: 12.5px; color: var(--text-tertiary); border-top: 1px solid var(--border-hair); padding-top: 8px; }

/* ---- Mini-tiles row (6, 180px, 6-col grid) ---- */
.lv-tiles-row {
  display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px;
  margin-bottom: var(--space-4);
}
@media (max-width: 1400px) { .lv-tiles-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .lv-tiles-row { grid-template-columns: repeat(2, 1fr); } }
.lv-tile {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: 10px 12px; cursor: pointer; transition: border-color 0.15s, transform 0.15s;
  min-width: 0;
}
.lv-tile:hover, .lv-tile:focus-visible { border-color: var(--border-strong); transform: translateY(-1px); outline: none; }
.lv-tile-label { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; }
.lv-tile-spark { height: 40px; margin-bottom: 4px; }
.lv-spark { width: 100%; height: 40px; display: block; }
.lv-tile-big { font-size: 18px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.lv-tile-big--pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.lv-tile-big--pill.lv-tile-big--green  { background: var(--tl-green-soft);  color: var(--tl-green); }
.lv-tile-big--pill.lv-tile-big--red    { background: var(--tl-red-soft);    color: var(--tl-red); }
.lv-tile-big--pill.lv-tile-big--amber  { background: var(--tl-yellow-soft); color: var(--tl-yellow); }
.lv-tile-big--pill.lv-tile-big--orange { background: var(--tl-orange-soft); color: var(--tl-orange); }
.lv-tile-big--pill.lv-tile-big--gray   { background: var(--tl-gray-soft);   color: var(--tl-gray); }
.lv-tile-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.lv-tile-empty { font-size: 11px; color: var(--text-dim); font-style: italic; padding: 10px 0; }
.lv-tile--green  { border-top: 2px solid var(--tl-green); }
.lv-tile--red    { border-top: 2px solid var(--tl-red); }
.lv-tile--amber  { border-top: 2px solid var(--tl-yellow); }
.lv-tile--orange { border-top: 2px solid var(--tl-orange); }
.lv-tile--gray   { border-top: 2px solid var(--tl-gray); }

/* ---- Six mini-tab-summary cards (3x2 grid) ---- */
.lv-mini-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: var(--space-4);
}
@media (max-width: 1100px) { .lv-mini-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .lv-mini-grid { grid-template-columns: 1fr; } }
.lv-mini-card {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-left: 3px solid var(--tl-gray);
  border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, transform 0.15s;
}
.lv-mini-card:hover, .lv-mini-card:focus-visible { border-color: var(--border-strong); transform: translateY(-1px); outline: none; }
.lv-mini-card--green { border-left-color: var(--tl-green); }
.lv-mini-card--red   { border-left-color: var(--tl-red); }
.lv-mini-card--gray  { border-left-color: var(--tl-gray); }
.lv-mini-head { display: flex; justify-content: space-between; align-items: center; }
.lv-mini-title { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-secondary); text-transform: uppercase; }
.lv-mini-status { font-size: 9.5px; font-weight: 800; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 4px; }
.lv-mini-status--live { background: var(--tl-green-soft); color: var(--tl-green); }
.lv-mini-status--pending { background: var(--tl-orange-soft); color: var(--tl-orange); }
.lv-mini-status--stale { background: var(--tl-yellow-soft); color: var(--tl-yellow); }
.lv-mini-badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 4px; width: fit-content; }
.lv-mini-badge--green { background: var(--tl-green-soft); color: var(--tl-green); }
.lv-mini-badge--red   { background: var(--tl-red-soft);   color: var(--tl-red); }
.lv-mini-badge--gray  { background: var(--tl-gray-soft);  color: var(--tl-gray); }
.lv-mini-oneliner { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.lv-mini-footer { font-size: 11px; color: var(--text-dim); margin-top: auto; padding-top: 4px; border-top: 1px solid var(--border-hair); }
.lv-stale-banner {
  font-size: 11px; color: var(--tl-orange); background: var(--tl-orange-soft);
  border-radius: 4px; padding: 4px 8px; line-height: 1.35;
}

/* ---- THE TRADE card ---- */
.lv-trade {
  border: 1px solid var(--border-soft); border-left: 4px solid var(--tl-gray);
  border-radius: var(--radius-lg); background: var(--bg-2); padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.lv-trade--green { border-left-color: var(--tl-green); }
.lv-trade--red   { border-left-color: var(--tl-red); }
.lv-trade--gray  { border-left-color: var(--tl-gray); }
.lv-trade-head { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--text-tertiary); text-transform: uppercase; margin-bottom: 10px; }
.lv-trade-override {
  font-size: 12px; font-weight: 700; color: var(--tl-orange); background: var(--tl-orange-soft);
  border-radius: 4px; padding: 5px 10px; margin-bottom: 10px; width: fit-content;
}
.lv-trade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
@media (max-width: 700px) { .lv-trade-grid { grid-template-columns: repeat(2, 1fr); } }
.lv-trade-grid > div { display: flex; flex-direction: column; gap: 2px; }
.lv-trade-k { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-dim); }
.lv-trade-v { font-size: 16px; font-weight: 800; color: var(--text-primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lv-trade-v--green { color: var(--tl-green); }
.lv-trade-v--amber { color: var(--tl-yellow); }
.lv-trade-v--red   { color: var(--tl-red); }
.lv-trade-v--gray  { color: var(--tl-gray); }
.lv-trade-confidence { font-size: 11px; font-weight: 700; color: var(--text-tertiary); letter-spacing: 0.04em; margin-bottom: 6px; }
.lv-trade-rationale { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.lv-trade-reasons { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ---- Sidebar additions (right rail) ---- */
.lv-sidebar-add { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--space-3); }
.lv-sidebar-tile {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: 10px 12px;
}
.lv-sidebar-pills { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px 12px; }
.lv-pill { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); padding: 4px 0; }
.lv-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tl-gray); flex: 0 0 auto; }
.lv-pill--live .lv-pill-dot { background: var(--tl-green); box-shadow: 0 0 6px var(--tl-green-glow); }
.lv-pill--stale .lv-pill-dot { background: var(--tl-yellow); }
.lv-pill-state { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; color: var(--text-dim); }
.lv-pill--live .lv-pill-state { color: var(--tl-green); }
.lv-pill--stale .lv-pill-state { color: var(--tl-yellow); }

/* ============================================================================
   ALNY TAB — pure iframe embed of the user's live alny.drklealtrades.com app.
   No re-rendering, no restructuring; this is chrome around the iframe only.
   ============================================================================ */
.tab-panel[data-tab-panel="alny"] { padding: 0; }
#alny-tab-body {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 800px;
  padding: 0;
}
.alny-iframe {
  width: 100%;
  height: 100%;
  min-height: 800px;
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  background: #0b0f19;
  display: block;
}

/* ============================================================================
   SESSION PREP TAB — iframe embed of sessionprep.drklealtrades.com, with a
   3-button session selector (Asia/London/NY) above the iframe.
   ============================================================================ */
.tab-panel[data-tab-panel="session-prep"] { padding: 0; }
#session-prep-tab-body {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 800px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-tab-selector {
  display: flex;
  gap: 8px;
  padding: 10px 4px 0;
}
.sp-tab-selector-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--border-hair);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim, #9aa4b2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.sp-tab-selector-btn:hover {
  border-color: rgba(96,165,250,0.45);
  color: #e5e9f0;
}
.sp-tab-selector-btn.active {
  background: rgba(96,165,250,0.14);
  color: #60a5fa;
  border-color: rgba(96,165,250,0.6);
}
#session-prep-iframe {
  flex: 1;
  min-height: 760px;
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  background: #0b0f19;
  display: block;
}
.sp-auth-note {
  background: rgba(96,165,250,0.06);
  border: 1px solid rgba(96,165,250,0.35);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 6px 4px 0;
}
.sp-auth-note-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 8px;
}
.sp-auth-note-body {
  font-size: 13px;
  line-height: 1.55;
  color: #d1d5db;
  margin-bottom: 10px;
}
.sp-auth-note-body code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e5e7eb;
}
.sp-auth-note-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sp-auth-note-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(96,165,250,0.5);
  color: #60a5fa;
  text-decoration: none;
  transition: all 0.15s ease;
}
.sp-auth-note-link:hover {
  background: rgba(96,165,250,0.14);
  color: #93c5fd;
}

/* Live Master Read \u2014 two-badge row (direction + gamma regime) */
.lv-master-badges { display: flex; gap: 10px; margin: 10px 0 12px; align-items: center; flex-wrap: wrap; }
.lv-master-badge {
  display: inline-block; padding: 6px 14px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1.5px solid transparent;
}
.lv-master-badge--regime {
  background: rgba(96,165,250,0.10);
  color: #60a5fa;
  border-color: rgba(96,165,250,0.45);
  font-weight: 700;
}
.lv-master-badge--regime-trending {
  background: rgba(255,181,71,0.12);
  color: #ffb547;
  border-color: rgba(255,181,71,0.45);
}
.lv-master-badge--regime-pinning {
  background: rgba(179,154,255,0.10);
  color: #b39aff;
  border-color: rgba(179,154,255,0.45);
}
.lv-master-badge--regime-unknown {
  background: rgba(148,163,184,0.08);
  color: #94a3b8;
  border-color: rgba(148,163,184,0.30);
}

/* ============================================================================
   PLAYBOOK TAB (.pb-*) — Daily Playbook, 10 sections.
   Reuses .nd-main-grid / .nd-edu / .nd-main / .nd-sidebar / .nd-understanding
   / .nd-tile / .gm-card-body / .gm-section / .gm-unavailable / .gm-livesyn-*
   / .nd-toggle* / .btn verbatim from the Gamma/Flow/Netdrift tabs. This block
   only adds NEW classes for the form widgets and section chrome that no
   other (read-only) tab needed — Playbook is the first tab with editable
   fields.
   ============================================================================ */

/* ---- section navigator (left rail, top of .nd-edu) ---------------------- */
.pb-nav { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 12px 14px; background: rgba(255,255,255,0.02); margin-bottom: 4px; }
.pb-nav-title { font-size: 11px; letter-spacing: 0.08em; color: #94a3b8; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; }
.pb-nav-list { display: flex; flex-direction: column; gap: 2px; }
.pb-nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--text-secondary); font-size: 12.5px; transition: background 0.12s, color 0.12s; }
.pb-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.pb-nav-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,214,143,0.12); color: var(--tl-green); font-size: 10.5px; font-weight: 800; flex: none; }
.pb-nav-label { flex: 1; }
.pb-edu-card { }

/* ---- section wrapper (mid column) ---------------------------------------- */
.pb-section { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 16px 18px; background: rgba(255,255,255,0.015); scroll-margin-top: 16px; }
.pb-section--critical { border-color: rgba(255,176,32,0.35); background: rgba(255,176,32,0.03); }
.pb-section-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.pb-section-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,214,143,0.12); color: var(--tl-green); font-size: 13px; font-weight: 900; flex: none; }
.pb-section-title { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.pb-section-sub { font-size: 11.5px; color: #64748b; margin-top: 2px; }

/* ---- field blocks / labels ------------------------------------------------ */
.pb-field-block { margin-top: 14px; }
.pb-field-block:first-of-type { margin-top: 4px; }
.pb-field-label { font-size: 11.5px; letter-spacing: 0.04em; color: #94a3b8; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-auto-badge { font-size: 10px; letter-spacing: 0; text-transform: none; font-weight: 600; color: #60a5fa; background: rgba(96,165,250,0.10); border: 1px solid rgba(96,165,250,0.30); border-radius: 999px; padding: 2px 8px; }
.pb-required { color: var(--tl-red); font-weight: 700; text-transform: none; letter-spacing: 0; }

/* ---- radio-btn grid (single-select pill buttons) -------------------------- */
.pb-radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pb-radio-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02); color: var(--text-secondary); cursor: pointer;
  text-align: left; font-family: inherit; transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.pb-radio-btn:hover { border-color: rgba(0,214,143,0.35); color: var(--text-primary); }
.pb-radio-btn.active { border-color: var(--tl-green); background: rgba(0,214,143,0.10); color: var(--tl-green); }
.pb-radio-title { font-size: 12.5px; font-weight: 700; }
.pb-radio-sub { font-size: 10.5px; color: #64748b; }
.pb-radio-btn.active .pb-radio-sub { color: rgba(0,214,143,0.75); }

/* ---- checkbox grid (multi-select chips) ----------------------------------- */
.pb-checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-checkbox-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02);
  color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.pb-checkbox-btn:hover { border-color: rgba(255,176,32,0.35); }
.pb-checkbox-btn.active { border-color: var(--tl-yellow); background: rgba(255,176,32,0.10); color: var(--tl-yellow); }
.pb-checkbox-btn input { accent-color: var(--tl-yellow); }

/* ---- text inputs / textareas / selects ------------------------------------ */
.pb-textarea, .pb-input, .pb-select {
  width: 100%; background: rgba(255,255,255,0.02); border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 12.5px;
  padding: 8px 10px; transition: border-color 0.12s; box-sizing: border-box;
}
.pb-textarea { resize: vertical; line-height: 1.5; }
.pb-textarea:focus, .pb-input:focus, .pb-select:focus { outline: none; border-color: var(--tl-green); }
.pb-textarea::placeholder, .pb-input::placeholder { color: #4b5563; }
.pb-date-input { background: rgba(255,255,255,0.02); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 12.5px; padding: 6px 10px; }

/* ---- level cards (Layer 2) ------------------------------------------------- */
.pb-level-cards { display: flex; flex-direction: column; gap: 10px; }
.pb-level-card { border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 10px 12px; background: rgba(255,255,255,0.015); }
.pb-level-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pb-level-row label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; letter-spacing: 0.03em; color: #64748b; text-transform: uppercase; font-weight: 700; }

/* ---- chip row (Layer 4 macro proxies) -------------------------------------- */
.pb-chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pb-chip { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); min-width: 80px; }
.pb-chip-label { font-size: 10px; letter-spacing: 0.06em; color: #64748b; font-weight: 700; text-transform: uppercase; }
.pb-chip-val { font-family: var(--font-mono); font-size: 14px; font-weight: 800; color: var(--text-primary); }
.pb-chip-up .pb-chip-val { color: var(--tl-green); }
.pb-chip-down .pb-chip-val { color: var(--tl-red); }
.pb-chip-empty .pb-chip-val { color: #4b5563; }

/* ---- scenario blocks (Layer 6 Primary/Alternate/Trap) ---------------------- */
.pb-scenario { border-radius: 8px; padding: 12px 14px; margin-top: 12px; border: 1.5px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.015); }
.pb-scenario:first-of-type { margin-top: 4px; }
.pb-scenario--primary { border-color: rgba(0,214,143,0.30); }
.pb-scenario--alternate { border-color: rgba(96,165,250,0.30); }
.pb-scenario--trap { border-color: rgba(255,61,90,0.30); }
.pb-scenario-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pb-scenario-weight { font-size: 10px; font-weight: 700; color: #64748b; background: rgba(255,255,255,0.05); border-radius: 999px; padding: 2px 8px; }
.pb-scenario-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pb-scenario-row label, .pb-full-w { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; letter-spacing: 0.03em; color: #64748b; text-transform: uppercase; font-weight: 700; }
.pb-full-w { display: flex; flex-direction: column; gap: 4px; }

/* ---- Layer 7 regime style card (display-only, click-to-expand) ------------- */
.pb-style-card { border-radius: 10px; padding: 16px 18px; background: rgba(179,154,255,0.06); border: 1.5px solid rgba(179,154,255,0.35); }
.pb-style-card-title { font-size: 15px; font-weight: 900; color: #b39aff; margin-bottom: 8px; }
.pb-style-card-body { font-size: 13px; line-height: 1.6; color: var(--text-primary); white-space: pre-line; }
.pb-why-toggle { margin-top: 10px; background: none; border: none; color: #b39aff; font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 4px 0; font-family: inherit; }
.pb-why-toggle:hover { text-decoration: underline; }
.pb-why-panel { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: rgba(0,0,0,0.20); font-size: 12px; line-height: 1.6; color: var(--text-secondary); white-space: pre-line; }

/* ---- Layer 8 risk budget grid ---------------------------------------------- */
.pb-riskbudget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pb-riskbudget-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; letter-spacing: 0.03em; color: #64748b; text-transform: uppercase; font-weight: 700; }

/* ---- Layer 9 callout (educational, invalidation) --------------------------- */
.pb-callout { border-left: 3px solid var(--tl-yellow); background: rgba(255,176,32,0.06); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 1.5; color: #fbd38d; margin-bottom: 12px; }

/* ---- Layer 10 trend grid table --------------------------------------------- */
.pb-trend-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.pb-trend-table th, .pb-trend-table td { padding: 8px 12px; text-align: center; font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.pb-trend-table th { color: #64748b; font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.04em; }
.pb-trend-table td:first-child { text-align: left; color: #94a3b8; font-weight: 700; }
.pb-trend-arrow { font-size: 16px; font-weight: 800; }
.pb-trend-source { font-size: 10.5px; color: #4b5563; margin-top: 8px; }

/* ---- right sidebar: master summary card + quick actions ------------------- */
.pb-summary-card { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; background: rgba(255,255,255,0.02); margin-bottom: 14px; }
.pb-summary-title { font-size: 11.5px; letter-spacing: 0.06em; color: #94a3b8; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; }
.pb-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12.5px; color: var(--text-secondary); }
.pb-summary-row b { color: var(--text-primary); }
.pb-summary-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 10px 0; }
.pb-summary-label { font-size: 10px; letter-spacing: 0.05em; color: #64748b; font-weight: 700; text-transform: uppercase; margin-top: 8px; margin-bottom: 3px; }
.pb-summary-text { font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.pb-summary-text--empty { color: #4b5563; font-style: italic; }
.pb-actions-card { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; background: rgba(255,255,255,0.02); }
.pb-save-status { margin-top: 8px; font-size: 11.5px; color: var(--tl-green); text-align: center; }

@media (max-width: 900px) {
  .pb-scenario-row { grid-template-columns: 1fr 1fr; }
  .pb-level-row { grid-template-columns: 1fr; }
}
