/* === Prior Systems / Combat View === */
:root {
  /* Surfaces — less contrast between layers (calmer) */
  --bg-0:        #050810;
  --bg-1:        #080c17;
  --bg-2:        #0c1220;
  --bg-3:        #11192a;
  --chart-bg:    #03060f;
  --bd-0:        #15202f;        /* most borders */
  --bd-1:        #1f2c40;        /* hover only */
  --bd-2:        #2c3a52;        /* active only */
  --bd-3:        #3a4a66;

  /* Text */
  --fg-0:        #d8e2ee;        /* primary, slightly softer than pure white */
  --fg-1:        #8694a8;
  --fg-2:        #5a6878;
  --fg-3:        #3b4659;
  --fg-4:        #232c3d;

  /* Accents — desaturated, but kept identifiable.
     Used SPARINGLY: chart line, critical events, ONE active element at a time. */
  --cyan:        #5fb8c9;        /* primary (was #22d3ee) */
  --cyan-bri:    #22d3ee;        /* full saturation, reserved for live alerts */
  --cyan-bg:     rgba(95,184,201,0.08);
  --cyan-bg-hi:  rgba(95,184,201,0.14);
  --purple:      #9886c0;
  --blue:        #5079b8;
  --orange:      #c98052;
  --orange-bri:  #fb923c;        /* reserved for big block prints */
  --amber:       #c79550;
  --green:       #4a9d6e;        /* default GEX+ / BUY */
  --green-bri:   #22c55e;        /* reserved for fresh prints, signals */
  --green-soft:  #6dbf94;
  --red:         #b65555;        /* default GEX- / SELL */
  --red-bri:     #ef4444;        /* reserved for stress events */
  --pink:        #b07099;
  --yellow:      #c9a440;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--fg-0);
  overflow-x: auto;       /* allow horizontal scroll if viewport < 1440 */
  overflow-y: hidden;
  height: 100vh;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
canvas { display: block; }

.mono, .num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-2); }
.dim   { color: var(--fg-3); }
.up    { color: var(--green); }
.dn    { color: var(--red); }
.cy    { color: var(--cyan); }
.pp    { color: var(--purple); }
.or    { color: var(--orange); }
.am    { color: var(--amber); }
.yw    { color: var(--yellow); }
.uc    { text-transform: uppercase; letter-spacing: 0.12em; }
.nowrap { white-space: nowrap; }

/* ===================== APP GRID ===================== */
.app {
  display: grid;
  grid-template-rows:
    40px       /* top bar */
    auto       /* header (price block) */
    32px       /* session bands */
    78px       /* stats cards row */
    minmax(0, 1fr)        /* main area */
    104px      /* decision strip */
    26px;      /* footer */
  height: 100vh;
  min-width: 1440px;
  background: var(--bg-0);
  overflow: hidden;
}

/* ===================== TOP BAR ===================== */
.topbar {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--bd-0);
  padding: 0 18px;
  gap: 24px;
  background: linear-gradient(180deg, #060b18 0%, var(--bg-0) 100%);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.brand b {
  color: var(--fg-0);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.brand .sep {
  color: var(--fg-4);
  font-size: 13px;
}
.brand .tag {
  color: var(--fg-3);
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.ticker-tabs {
  display: flex; gap: 4px; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
}
.ticker-tabs .group-lbl {
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.20em;
  font-size: 10px;
  padding: 0 6px 0 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}
.ticker-tabs .group-lbl:first-child { padding-left: 0; }
.ticker-tabs .tk {
  padding: 6px 12px;
  color: var(--fg-1);
  font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background 0.08s, color 0.08s, border-color 0.08s;
}
.ticker-tabs .tk:hover {
  color: var(--fg-0);
  background: var(--bg-2);
  border-color: var(--bd-1);
}
.ticker-tabs .tk.active {
  color: var(--cyan);
  background: var(--cyan-bg);
  border-color: rgba(34,211,238,0.40);
  box-shadow: 0 0 0 1px rgba(34,211,238,0.15) inset;
}

.topright {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--fg-1);
  white-space: nowrap;
}
.topright .live {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--fg-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}
.topright .live .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-bri);
  box-shadow: 0 0 6px var(--green-bri);
  animation: breathe 2.4s ease-in-out infinite;
}
.topright .clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--fg-1);
  font-weight: 400;
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1); }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.30; } }

.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--fg-2);
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.1s;
}
.icon-btn:hover { color: var(--fg-0); background: var(--bg-2); border-color: var(--bd-1); }

/* ===================== HEADER (PRICE BLOCK) ===================== */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 16px 22px 14px;
  gap: 24px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--bd-0);
  min-width: 0;
}
.header .sym-line {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 8px;
  white-space: nowrap;
}
.header .sym {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg-0);
}
.header .sym-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-2);
  letter-spacing: 0.08em;
}
.header .badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.20em;
  padding: 3px 8px;
  border: 1px solid var(--bd-1);
  color: var(--fg-1);
  text-transform: uppercase;
  border-radius: 3px;
}
.header .badge.fut  { color: var(--purple); border-color: rgba(192,132,252,0.5); background: rgba(192,132,252,0.08); }
.header .badge.cash { color: var(--cyan);   border-color: rgba(34,211,238,0.5);  background: var(--cyan-bg); }
.header .badge.etf  { color: var(--blue);   border-color: rgba(59,130,246,0.5);  background: rgba(59,130,246,0.08); }

.header .price-line {
  display: flex; align-items: baseline; gap: 16px;
  white-space: nowrap;
}
.header .price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 52px;
  font-weight: 500;
  color: var(--fg-0);
  letter-spacing: -0.02em;
  line-height: 1;
}
.header .pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 600;
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 10px;
  border-radius: 4px;
}
.header .pct.up { color: var(--green); background: rgba(34,197,94,0.12); }
.header .pct.dn { color: var(--red);   background: rgba(239,68,68,0.12); }
.header .basis {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-2);
  margin-left: 10px;
}
.header .basis b { color: var(--fg-1); font-weight: 500; }
.header .basis .delta { color: var(--purple); margin-left: 8px; }

.header .dte-tabs {
  display: flex; align-items: stretch;
  align-self: start;
  border: 1px solid var(--bd-1);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-1);
}
.header .dte-tabs button {
  padding: 8px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-1);
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
}
.header .dte-tabs button:hover { color: var(--fg-0); background: var(--bg-2); }
.header .dte-tabs button.active {
  color: var(--cyan);
  background: var(--cyan-bg);
  box-shadow: inset 0 -2px 0 var(--cyan);
}
.header .dte-tabs button + button { border-left: 1px solid var(--bd-0); }

/* ===================== SESSION BANDS ===================== */
.sessions {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--bd-0);
  background: var(--bg-0);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}
.sessions .band {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  color: var(--fg-3);
  position: relative;
  cursor: default;
  min-width: 0;
  padding: 0 6px;
}
.sessions .band + .band { border-left: 1px solid var(--bd-0); }
.sessions .band.past { color: var(--fg-2); }
.sessions .band.live {
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(34,211,238,0.12) 0%, rgba(34,211,238,0.03) 100%);
  box-shadow: inset 0 -2px 0 var(--cyan);
}
.sessions .band.live::before {
  content: "";
  position: absolute; left: 8px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transform: translateY(-50%);
}
.sessions .band .time {
  color: var(--fg-3);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-family: 'JetBrains Mono', monospace;
}

/* ===================== STATS CARDS ===================== */
.stats {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--bd-0);
  background: var(--bg-0);
}
.stat {
  padding: 12px 18px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
  justify-content: center;
}
.stat .lbl {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
  display: flex; align-items: center; gap: 7px;
  font-weight: 500;
}
.stat .lbl .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); flex-shrink: 0; }
.stat .lbl .pip.cw { background: var(--green); box-shadow: 0 0 5px var(--green); }
.stat .lbl .pip.pw { background: var(--red); box-shadow: 0 0 5px var(--red); }
.stat .lbl .pip.zg { background: var(--purple); box-shadow: 0 0 5px var(--purple); }
.stat .lbl .pip.mp { background: var(--orange); box-shadow: 0 0 5px var(--orange); }
.stat .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 400;
  color: var(--fg-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: color 0.35s;
}
/* ===================== UNIVERSAL FLASH-ON-CHANGE ===================== */
.flash-up { animation: vital-up 0.7s ease-out; }
.flash-dn { animation: vital-dn 0.7s ease-out; }
.flash-neutral { animation: vital-neutral 0.5s ease-out; }
@keyframes vital-up {
  0%   { color: var(--green-bri); }
  100% {}
}
@keyframes vital-dn {
  0%   { color: var(--red-bri); }
  100% {}
}
@keyframes vital-neutral {
  0%   { color: var(--cyan-bri); }
  100% {}
}
.stat .sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.stat .sub .delta { color: var(--purple); }
.stat .sub .up { color: var(--green); }
.stat .sub .dn { color: var(--red); }

.stat.regime .val {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--cyan);
}
.stat.regime .val.bull { color: var(--green); }
.stat.regime .val.bear { color: var(--red); }
.stat.vix .val.high { color: var(--orange); }
.regime-pip { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 1px 4px; border-radius: 3px; margin-left: 5px; vertical-align: middle; }
.regime-pip.calm          { color: var(--cyan);   background: rgba(95,184,201,.12); }
.regime-pip.normal        { color: var(--green);  background: rgba(74,157,110,.12); }
.regime-pip.transitioning { color: var(--amber);  background: rgba(199,149,80,.12); }
.regime-pip.stress        { color: var(--red);    background: rgba(182,85,85,.18); }

/* VIX regime tints on manifold wrapper */
.three-wrap.vix-calm          { --manifold-tint: rgba(95,184,201,0.04); }
.three-wrap.vix-normal        { --manifold-tint: rgba(74,157,110,0.04); }
.three-wrap.vix-transitioning { --manifold-tint: rgba(199,149,80,0.07); }
.three-wrap.vix-stress        { --manifold-tint: rgba(182,85,85,0.12); }
.three-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--manifold-tint, transparent);
  border-radius: inherit; transition: background .8s ease;
}
/* VIX regime border accent on lab */
.ml.vix-calm          { --lab-accent: var(--cyan);   border-top: 1px solid rgba(95,184,201,0.25); }
.ml.vix-normal        { --lab-accent: var(--green);  border-top: 1px solid rgba(74,157,110,0.20); }
.ml.vix-transitioning { --lab-accent: var(--amber);  border-top: 2px solid rgba(199,149,80,0.40); }
.ml.vix-stress        { --lab-accent: var(--red);    border-top: 2px solid rgba(182,85,85,0.55); }

/* ===================== MAIN GRID ===================== */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px 380px;
  min-height: 0;
  background: var(--bg-0);
  border-bottom: 1px solid var(--bd-0);
  overflow: hidden;
}
.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.col + .col { border-left: 1px solid var(--bd-0); }
.col.ladder-col { display: grid; grid-template-rows: 1.15fr 1fr; min-width: 0; }
.col.ladder-col > * + * { border-top: 1px solid var(--bd-0); }
.col.ladder-col .panel { overflow: hidden; min-width: 0; }

/* ===================== PANEL ===================== */
.panel { display: flex; flex-direction: column; min-height: 0; }
.panel + .panel { border-top: 1px solid var(--bd-0); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 9px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--bd-0);
  flex-shrink: 0;
  gap: 12px;
}
.panel-head .ttl {
  display: flex; align-items: baseline; gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-0);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.panel-head .ttl > span:first-child { white-space: nowrap; flex-shrink: 0; }
.panel-head .ttl .sub {
  color: var(--fg-3);
  font-family: 'JetBrains Mono', monospace;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.panel-head .actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.panel-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.panel-body.scroll { overflow: auto; }
.ladder-col .panel-body.scroll { overflow-x: hidden; overflow-y: auto; }

/* ===================== CHART CONTROLS / OVERLAYS ===================== */
.chart-mode-tabs {
  display: flex;
  border: 1px solid var(--bd-1);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-1);
}
.chart-mode-tabs button {
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.1s;
}
.chart-mode-tabs button + button { border-left: 1px solid var(--bd-0); }
.chart-mode-tabs button.active {
  color: var(--cyan);
  background: var(--cyan-bg);
  font-weight: 600;
}
.chart-mode-tabs button:hover:not(.active) { color: var(--fg-0); background: var(--bg-2); }
.chart-mode-tabs button.lab {
  color: var(--cyan);
  background: rgba(34,211,238,0.06);
  font-weight: 600;
  letter-spacing: 0.14em;
}
.chart-mode-tabs button.lab.active {
  color: var(--bg-0);
  background: var(--cyan);
}
.chart-mode-tabs button.lab::before {
  content: "↗";
  margin-right: 6px;
  opacity: 0.7;
}

.overlay-chips {
  display: flex; flex-wrap: nowrap; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd-0);
  background: var(--bg-0);
  align-items: center;
  overflow-x: auto;
}
.overlay-chips::-webkit-scrollbar { height: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip:hover { color: var(--fg-0); border-color: var(--bd-1); }
.chip.on {
  color: var(--fg-0);
  border-color: var(--bd-1);
}
.chip .pip {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-3);
  flex-shrink: 0;
  transition: opacity 0.1s;
}
.chip.on .pip { opacity: 1; }
.chip:not(.on) .pip { opacity: 0.4; }
.chip.walls .pip { background: var(--green); }
.chip.walls.on .pip { box-shadow: 0 0 6px var(--green); }
.chip.gamma .pip { background: var(--purple); }
.chip.gamma.on .pip { box-shadow: 0 0 6px var(--purple); }
.chip.prior .pip { background: var(--blue); }
.chip.prior.on .pip { box-shadow: 0 0 6px var(--blue); }
.chip.ib .pip    { background: var(--orange); }
.chip.ib.on .pip { box-shadow: 0 0 6px var(--orange); }
.chip.asia .pip    { background: var(--purple); }
.chip.asia.on .pip { box-shadow: 0 0 6px var(--purple); }
.chip.poc .pip    { background: var(--yellow); }
.chip.poc.on .pip { box-shadow: 0 0 6px var(--yellow); }
.chip.path .pip    { background: var(--cyan); }
.chip.path.on .pip { box-shadow: 0 0 6px var(--cyan); }
.chip.ideas .pip    { background: var(--pink); }
.chip.ideas.on .pip { box-shadow: 0 0 6px var(--pink); }

.chart-hint {
  margin-left: auto;
  color: var(--fg-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===================== SPOT CHART CANVAS ===================== */
.chart-wrap {
  position: relative;
  width: 100%; height: 100%;
  background: var(--chart-bg);
}
.chart-canvas { width: 100%; height: 100%; }
.chart-overlay { position: absolute; pointer-events: none; }
.chart-overlay.tl {
  top: 12px; left: 14px;
  display: flex; gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-2);
}
.chart-overlay.tl .k { color: var(--fg-3); margin-right: 5px; font-size: 10px; }
.chart-overlay.br {
  bottom: 8px; right: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.10em;
}

/* ===================== QUOTE LADDER ===================== */
.ladder-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ladder-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-1);
  color: var(--fg-3);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 5px;
  text-align: right;
  border-bottom: 1px solid var(--bd-0);
  font-family: 'Inter', sans-serif;
}
.ladder-table thead th.strike { text-align: center; color: var(--fg-1); font-weight: 600; }
.ladder-table thead th.spacer { border-left: 1px solid var(--bd-0); border-right: 1px solid var(--bd-0); background: var(--bg-2); }
.ladder-table td {
  padding: 4px 5px;
  text-align: right;
  border-bottom: 1px solid rgba(31,41,55,0.4);
  color: var(--fg-1);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.ladder-table td.strike {
  text-align: center;
  background: var(--bg-2);
  color: var(--fg-0);
  font-weight: 500;
  border-left: 1px solid var(--bd-0);
  border-right: 1px solid var(--bd-0);
}
.ladder-table td .oi-bar {
  position: absolute; right: 0; top: 0; bottom: 0;
  background: currentColor;
  opacity: 0.10;
  pointer-events: none;
}
.ladder-table tr.atm td.strike {
  background: var(--cyan-bg-hi);
  color: var(--cyan);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--cyan), inset -2px 0 0 var(--cyan);
}
.ladder-table tr.cw td.strike { box-shadow: inset 0 -2px 0 var(--green); }
.ladder-table tr.pw td.strike { box-shadow: inset 0 -2px 0 var(--red); }
.ladder-table tr.zg td.strike { box-shadow: inset 0 -2px 0 var(--purple); }
.ladder-table td.dim { color: var(--fg-3); }
.ladder-table .c-side { color: var(--green-soft); }
.ladder-table .p-side { color: var(--red); opacity: 0.85; }
.ladder-table td.iv  { color: var(--purple); }
.ladder-table td.greek { color: var(--orange); }

.ladder-legend {
  display: flex; gap: 18px;
  padding: 8px 14px;
  border-top: 1px solid var(--bd-0);
  background: var(--bg-0);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--fg-2);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.ladder-legend .item { display: inline-flex; align-items: center; gap: 6px; }
.ladder-legend .swatch { width: 14px; height: 3px; border-radius: 1px; }

/* ===================== OPTION FLOW TAPE ===================== */
.flow-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--bd-0);
  background: var(--bg-0);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--fg-2);
}
.flow-toolbar .tab {
  padding: 4px 10px;
  border: 1px solid var(--bd-0);
  border-radius: 3px;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-weight: 500;
  font-size: 10px;
  background: var(--bg-1);
  transition: all 0.1s;
}
.flow-toolbar .tab:hover { color: var(--fg-0); border-color: var(--bd-1); background: var(--bg-2); }
.flow-toolbar .tab.on {
  color: var(--cyan);
  background: var(--cyan-bg);
  border-color: rgba(34,211,238,0.4);
  font-weight: 600;
}
.flow-toolbar .right {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
}

.flow-list {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  height: 100%;
  overflow-y: auto;
}
.flow-row {
  display: grid;
  grid-template-columns: 56px 30px 70px 1fr 70px;
  gap: 10px;
  align-items: center;
  padding: 5px 14px;
  border-bottom: 1px solid rgba(31,41,55,0.4);
  color: var(--fg-1);
}
.flow-row.fresh { animation: tape-flash 1.8s ease-out; }
@keyframes tape-flash {
  0%   { background: rgba(95,184,201,0.10); }
  40%  { background: rgba(95,184,201,0.05); }
  100% { background: transparent; }
}
@keyframes row-enter {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.flow-row.fresh { animation: tape-flash 1.8s ease-out, row-enter 0.35s ease-out; }
.flow-row .ts { color: var(--fg-3); font-size: 10px; }
.flow-row .side-pill {
  display: inline-block;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  border-radius: 3px;
  text-align: center;
  font-family: 'Inter', sans-serif;
}
.flow-row .side-pill.B { color: var(--green); background: rgba(34,197,94,0.14); }
.flow-row .side-pill.S { color: var(--red);   background: rgba(239,68,68,0.14); }
.flow-row .strike { color: var(--fg-0); font-weight: 500; text-align: right; }
.flow-row .strike .cp { color: var(--fg-3); margin-left: 4px; font-size: 10px; font-weight: 600; }
.flow-row .strike .cp.C { color: var(--green-soft); }
.flow-row .strike .cp.P { color: var(--red); }
.flow-row .detail { color: var(--fg-2); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-row .detail .tag {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 5px;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--purple);
  background: rgba(192,132,252,0.10);
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
}
.flow-row .detail .tag.SWEEP { color: var(--orange); background: rgba(251,146,60,0.12); }
.flow-row .detail .tag.BLOCK { color: var(--cyan);   background: var(--cyan-bg); }
.flow-row .detail .tag.SPLIT { color: var(--blue);   background: rgba(59,130,246,0.12); }
.flow-row .px    { color: var(--fg-0); text-align: right; }
.flow-row .notional {
  text-align: right;
  font-weight: 500;
  color: var(--fg-0);
}
.flow-row.big .notional { color: var(--purple); font-weight: 600; }
.flow-row.huge .notional { color: var(--orange); font-weight: 700; }

/* ===================== METRICS RAIL (right) ===================== */
.metric-card {
  padding: 14px 18px;
  background: var(--bg-0);
}
.metric-card + .metric-card {
  border-top: 1px solid var(--bd-0);
}
.metric-card .row-top {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 5px;
  gap: 10px;
  min-width: 0;
}
.metric-card .row-top .lbl {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-1);
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}
.metric-card .row-top .lbl .glyph {
  font-family: 'JetBrains Mono', monospace;
  color: var(--fg-3);
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
}
.metric-card .row-top .v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--fg-0);
  white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 8px;
}
.metric-card .row-top .v.up { color: var(--green); }
.metric-card .row-top .v.dn { color: var(--red); }
.metric-card .row-top .v.cy { color: var(--cyan); }
.metric-card .row-top .v.or { color: var(--orange); }
.metric-card .row-top .v.pp { color: var(--purple); }
.metric-card .micro {
  display: flex; gap: 14px; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 5px;
}
.metric-card .micro .delta { color: var(--fg-1); }
.metric-card .spark { width: 100%; height: 28px; display: block; }

.metric-card .badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
}
.badge.tailwind { color: var(--green);  background: rgba(34,197,94,0.12); }
.badge.headwind { color: var(--red);    background: rgba(239,68,68,0.12); }
.badge.calm     { color: var(--cyan);   background: var(--cyan-bg); }
.badge.warn     { color: var(--orange); background: rgba(251,146,60,0.12); }
.badge.toxic    { color: var(--orange); background: rgba(251,146,60,0.18); }

/* charm-by-DTE bars */
.dte-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 6px; }
.dte-bars .b {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
  text-align: center;
  min-width: 0;
}
.dte-bars .b .bar {
  height: 28px;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.dte-bars .b .bar .fill {
  position: absolute; left: 1px; right: 1px;
  background: currentColor;
  opacity: 0.85;
  border-radius: 1px;
}
.dte-bars .b.pos { color: var(--green); }
.dte-bars .b.neg { color: var(--red); }
.dte-bars .b .v { color: var(--fg-1); font-size: 9px; white-space: nowrap; overflow: hidden; }
.dte-bars .b .dte { color: var(--fg-3); font-size: 9px; letter-spacing: 0.04em; font-family: 'Inter', sans-serif; font-weight: 500; }

/* ===================== DECISION STRIP ===================== */
.decision {
  display: grid;
  grid-template-columns: 300px 1fr 1fr 320px;
  gap: 0;
  background: var(--bg-0);
}
.decision > * {
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
  justify-content: center;
}
.decision > * + * { border-left: 1px solid var(--bd-0); }

/* Trade Gate */
.gate { gap: 0 !important; }
.gate-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  justify-content: center;
}
.gate .signal { display: none; } /* semaphore replaced by inline dot on verdict */
.gate .meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gate .meta .verdict {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--fg-1);
  display: inline-flex; align-items: center; gap: 8px;
}
.gate .meta .verdict::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-3);
}
.gate .meta .verdict.go   { color: var(--green); }
.gate .meta .verdict.go::before   { background: var(--green); box-shadow: 0 0 8px var(--green); }
.gate .meta .verdict.wait { color: var(--amber); }
.gate .meta .verdict.wait::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.gate .meta .verdict.no   { color: var(--red); }
.gate .meta .verdict.no::before   { background: var(--red); box-shadow: 0 0 8px var(--red); }
.gate .meta .why {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-2);
  letter-spacing: 0.04em;
  display: flex; flex-wrap: wrap; gap: 4px 10px;
}
.gate .meta .why .item { display: inline-flex; align-items: center; gap: 5px; }
.gate .meta .why .item b { color: var(--fg-0); font-weight: 500; }
.gate .meta .why .dot { width: 6px; height: 6px; border-radius: 50%; }
.gate .meta .why .dot.good { background: var(--green); box-shadow: 0 0 4px var(--green); }
.gate .meta .why .dot.bad  { background: var(--red); box-shadow: 0 0 4px var(--red); }

/* Idea card */
.idea-card { font-family: 'Inter', sans-serif; }
.idea-card .head {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
  margin-bottom: 2px;
}
.idea-card .head .badge {
  font-size: 9px;
  padding: 2px 7px;
  background: rgba(236,72,153,0.14);
  color: var(--pink);
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.idea-card .name {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: 0.02em;
}
.idea-card .name .dir {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.idea-card .name .dir.long  { color: var(--green); background: rgba(34,197,94,0.12); }
.idea-card .name .dir.short { color: var(--red); background: rgba(239,68,68,0.12); }
.idea-card .levels {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 4px;
}
.idea-card .levels .lev .k {
  font-size: 9px; color: var(--fg-3); letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 500;
}
.idea-card .levels .lev .v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--fg-0); font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.idea-card .levels .lev .v.green { color: var(--green); }
.idea-card .levels .lev .v.red   { color: var(--red); }
.idea-card .levels .lev .v.cy    { color: var(--cyan); }

/* Phase */
.phase { font-family: 'Inter', sans-serif; }
.phase .k {
  font-size: 10px; color: var(--fg-2); letter-spacing: 0.20em;
  text-transform: uppercase; font-weight: 500;
}
.phase .v {
  font-size: 16px; color: var(--fg-0); font-weight: 600;
  text-transform: capitalize; letter-spacing: 0.02em;
}
.phase .v.bull { color: var(--green); }
.phase .v.bear { color: var(--red); }
.phase .v.neutral { color: var(--cyan); }
.phase .narrative {
  font-size: 11.5px; color: var(--fg-2); margin-top: 4px;
  line-height: 1.5;
}

/* Confluence */
.confluence { font-family: 'Inter', sans-serif; }
.confluence .k {
  font-size: 10px; color: var(--fg-2); letter-spacing: 0.20em;
  text-transform: uppercase; font-weight: 500;
}
.confluence .list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.confluence .row {
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-1);
  align-items: baseline;
}
.confluence .row .k2 {
  color: var(--fg-3); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 500;
}
.confluence .row .v { font-variant-numeric: tabular-nums; color: var(--fg-0); font-family: 'JetBrains Mono', monospace; }
.confluence .row .d { color: var(--fg-2); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

/* ===================== FOOTER ===================== */
.footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--bd-0);
  background: var(--bg-0);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
}
.footer:hover { color: var(--fg-2); }
.footer .left, .footer .right { display: flex; gap: 18px; align-items: center; white-space: nowrap; }
.footer .feed-pill {
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
}
.footer .feed-pill .led {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
  opacity: 0.6;
}
.footer:hover .feed-pill .led { opacity: 1; box-shadow: 0 0 4px var(--green); }
.footer .feed-pill .led.warn { background: var(--amber); }
.footer .feed-pill .led.off  { background: var(--fg-3); }
.footer .state-btn {
  padding: 3px 12px;
  border: 1px solid var(--bd-1);
  color: var(--fg-1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 3px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  transition: all 0.1s;
}
.footer .state-btn:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-bg); }
.footer .latency { display: inline-flex; align-items: baseline; gap: 5px; }
.footer .latency b { color: var(--fg-0); font-weight: 500; font-family: 'JetBrains Mono', monospace; }

/* ===================== MANIFOLD (basic mode) ===================== */
.three-wrap {
  position: relative; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 40%, #0a1322 0%, #020617 70%, #010410 100%);
}
.three-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.three-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-2);
}
.three-overlay .legend {
  position: absolute; right: 14px; bottom: 14px;
  pointer-events: auto;
  padding: 8px 12px;
  background: rgba(5,8,16,0.75);
  border: 1px solid var(--bd-0);
  border-radius: 4px;
}
.three-overlay .legend .grad {
  width: 160px; height: 8px;
  background: linear-gradient(90deg, #c084fc 0%, #3b82f6 30%, #22d3ee 55%, #fb923c 80%, #ef4444 100%);
  border-radius: 3px;
}
.three-overlay .legend .row {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--fg-3);
  margin-bottom: 4px;
  letter-spacing: 0.14em;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
}
.three-overlay .axis-x {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  letter-spacing: 0.16em; color: var(--fg-3); font-size: 10px;
  font-family: 'Inter', sans-serif; font-weight: 500;
}
.three-overlay .axis-y {
  position: absolute; top: 50%; left: 12px;
  transform: rotate(-90deg) translateY(-50%); transform-origin: left top;
  letter-spacing: 0.16em; color: var(--fg-3); font-size: 10px;
  font-family: 'Inter', sans-serif; font-weight: 500;
}
.three-overlay .stats {
  position: absolute; top: 14px; left: 16px;
  display: flex; gap: 18px;
}
.three-overlay .stats .item .k {
  color: var(--fg-3); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; font-family: 'Inter', sans-serif; font-weight: 600;
}
.three-overlay .stats .item .v {
  color: var(--fg-0); font-size: 13px; font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ===================== HEAT (GEX) ===================== */
.heat-wrap { position: relative; width: 100%; height: 100%; background: var(--chart-bg); }
.heat-canvas { width: 100%; height: 100%; }
.heat-legend {
  position: absolute; top: 12px; right: 14px;
  padding: 6px 10px;
  background: rgba(5,8,16,0.85);
  border: 1px solid var(--bd-0);
  border-radius: 3px;
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--fg-2);
  letter-spacing: 0.10em;
  font-weight: 600;
  text-transform: uppercase;
}
.heat-legend .grad {
  width: 130px; height: 8px;
  background: linear-gradient(90deg, var(--red) 0%, rgba(239,68,68,0.5) 30%, var(--chart-bg) 50%, rgba(34,197,94,0.5) 70%, var(--green) 100%);
  border-radius: 2px;
}

/* ===================== EMPTY STATES ===================== */
.empty-card {
  padding: 18px 0;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.08em;
}
.empty-card.warming { color: var(--cyan); }
.empty-card.stale   { color: var(--amber); }
.empty-card.nodata  { color: var(--fg-3); }
.empty-card .ico {
  display: inline-block; width: 12px; height: 12px; margin-right: 10px;
  vertical-align: middle;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.empty-card.warming .ico { animation: pulse 1.4s ease-in-out infinite; }
.empty-card .sub { display: block; margin-top: 4px; color: var(--fg-3); font-size: 10px; letter-spacing: 0.06em; }

/* ===================== SCROLLBARS ===================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd-1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bd-2); }

/* ============================================================ */
/* ===========  MANIFOLD LAB  (immersive takeover)  =========== */
/* ============================================================ */
.ml {
  display: grid;
  grid-template-rows: 44px 1fr;
  height: 100%;
  background: radial-gradient(ellipse at 30% 20%, #0a1525 0%, #050810 70%, #02050b 100%);
}
.ml-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  gap: 18px;
  background: linear-gradient(180deg, #0a121f 0%, #050810 100%);
  border-bottom: 1px solid var(--bd-0);
  white-space: nowrap;
  overflow: hidden;
}
.ml-tb-left, .ml-tb-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ml-tb-right { justify-content: flex-end; }
.ml-tb-mid { justify-self: center; }
.ml-tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
  background: var(--cyan-bg);
  padding: 4px 12px;
  border: 1px solid rgba(34,211,238,0.5);
  border-radius: 3px;
  font-weight: 700;
}
.ml-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.ml-meta.dim { color: var(--fg-3); }
.ml-close {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-0);
  border: 1px solid var(--bd-2);
  background: var(--bg-2);
  padding: 6px 14px;
  border-radius: 4px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700;
  transition: all 0.1s;
  cursor: pointer;
}
.ml-close:hover {
  color: var(--bg-0);
  border-color: var(--cyan);
  background: var(--cyan);
}

.ml-back {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-1);
  border: 1px solid var(--bd-1);
  background: var(--bg-1);
  padding: 5px 12px 5px 8px;
  border-radius: 4px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
}
.ml-back:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyan-bg);
}

.ml-body {
  display: grid;
  grid-template-columns: 1fr 420px 320px;
  min-height: 0;
}
.ml-body > * + * { border-left: 1px solid var(--bd-0); }

.ml-3d {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  background: radial-gradient(ellipse at 40% 30%, #0c1525 0%, #050810 60%, #02050b 100%);
}
.ml-3d-wrap {
  position: relative;
  width: 100%; height: 100%;
  min-height: 0;
  cursor: grab;
}
.ml-3d-wrap:active { cursor: grabbing; }
.ml-3d-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.ml-3d-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-2);
}
.ml-3d-corner {
  position: absolute;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 5px;
  pointer-events: auto;
}
.ml-3d-corner.tl { top: 0; left: 0; }
.ml-3d-corner.br { bottom: 0; right: 0; text-align: right; align-items: flex-end; }
.ml-3d-corner .dim {
  color: var(--fg-3); letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 10px; margin-right: 6px; font-family: 'Inter', sans-serif; font-weight: 600;
}
.ml-3d-corner .cy { color: var(--cyan); }
.ml-3d-corner .pp { color: var(--purple); }
.ml-mini {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--fg-2);
  border: 1px solid var(--bd-1);
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 500;
}
.ml-mini.on { color: var(--cyan); border-color: rgba(34,211,238,0.5); background: var(--cyan-bg); font-weight: 600; }

.ml-3d-legend {
  position: absolute; bottom: 14px; left: 18px;
  padding: 8px 12px;
  background: rgba(2,5,11,0.75);
  border: 1px solid var(--bd-0);
  border-radius: 4px;
  pointer-events: auto;
}
.ml-3d-legend .row {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--fg-3); margin-bottom: 4px;
  letter-spacing: 0.16em; text-transform: uppercase;
  font-family: 'Inter', sans-serif; font-weight: 600;
}
.ml-3d-legend .grad {
  width: 180px; height: 8px;
  background: linear-gradient(90deg, #c084fc 0%, #3b82f6 30%, #22d3ee 55%, #fb923c 80%, #ef4444 100%);
  border-radius: 3px;
}
.cube-lab .ml-3d-legend .grad.spot {
  background: linear-gradient(90deg, rgba(95,184,201,0.15), rgba(95,184,201,0.95));
}
.cube-lab .ml-3d-legend .grad.levels {
  background: linear-gradient(90deg, rgba(74,157,110,0.18), rgba(152,134,192,0.82));
}
.cube-lab .ml-3d-legend .grad.metrics {
  background: linear-gradient(90deg, rgba(82,97,125,0.12), rgba(201,128,82,0.95));
}

.cube-body .cube-stage { background: radial-gradient(ellipse at 45% 32%, #0b1320 0%, #050810 60%, #02050b 100%); }
.cube-loading {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 7px 11px;
  background: rgba(5,8,16,0.88);
  border: 1px solid var(--bd-0);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--fg-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ml-dte-scrubber {
  padding: 14px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--bd-0);
  background: var(--bg-0);
}
.ml-dte-scrubber .lbl {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--fg-2);
  text-transform: uppercase;
  font-weight: 600;
}
.ml-dte-scrubber input[type=range] {
  -webkit-appearance: none;
  width: 100%; height: 5px;
  background: var(--bg-2);
  border-radius: 3px;
  outline: none;
}
.ml-dte-scrubber input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  cursor: pointer;
  border: 2px solid var(--bg-0);
}
.ml-dte-scrubber .val {
  color: var(--cyan); font-size: 15px; font-weight: 500;
  min-width: 60px; text-align: right;
  font-family: 'JetBrains Mono', monospace;
}
.ml-dte-scrubber .presets { display: flex; gap: 5px; }
.ml-dte-scrubber .preset {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--fg-2);
  border: 1px solid var(--bd-0);
  padding: 4px 8px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: all 0.1s;
}
.ml-dte-scrubber .preset:hover { color: var(--fg-0); border-color: var(--bd-1); background: var(--bg-2); }
.ml-dte-scrubber .preset.active {
  color: var(--cyan); border-color: rgba(34,211,238,0.5);
  background: var(--cyan-bg); font-weight: 600;
}

.ml-slices {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  min-height: 0;
}
.ml-slices > * + * { border-top: 1px solid var(--bd-0); }
.ml-slice-panel { display: flex; flex-direction: column; min-height: 0; }
.ml-slice-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 14px 7px;
  border-bottom: 1px solid var(--bd-0);
  background: linear-gradient(180deg, #0a121f 0%, #050810 100%);
}
.ml-slice-head .ttl {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-0);
  font-weight: 600;
  white-space: nowrap;
}
.ml-slice-head .sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ml-slice-body { flex: 1; min-height: 0; position: relative; }
.ml-slice-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }

.ml-stats {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #060b16 0%, #050810 100%);
  overflow-y: auto;
}
.ml-stat {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--bd-0);
}
.ml-stat-k {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 5px;
  font-weight: 600;
}
.ml-stat-v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 500;
  color: var(--fg-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.ml-stat-v.green { color: var(--green); }
.ml-stat-v.red   { color: var(--red); }
.ml-stat-v.cy    { color: var(--cyan); }
.ml-stat-u { font-size: 12px; color: var(--fg-2); margin-left: 4px; letter-spacing: 0.06em; }
.ml-stat-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-3);
  margin-top: 5px;
  line-height: 1.5;
}
.ml-divider {
  padding: 12px 18px 7px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: var(--bg-1);
  border-top: 1px solid var(--bd-0);
  border-bottom: 1px solid var(--bd-0);
  font-weight: 600;
}
.ml-ridges {
  padding: 10px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.ml-ridge-row {
  display: grid;
  grid-template-columns: 64px auto 1fr;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  align-items: baseline;
}
.ml-ridge-row .k {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}
.ml-ridge-row.pos .k { color: var(--orange); }
.ml-ridge-row.neg .k { color: var(--purple); }
.ml-ridge-row .v {
  font-size: 15px;
  color: var(--fg-0);
  font-variant-numeric: tabular-nums;
}
.ml-ridge-row.pos .v { color: var(--orange); }
.ml-ridge-row.neg .v { color: var(--purple); }
.ml-ridge-row .d { color: var(--fg-3); font-size: 10.5px; text-align: right; }
.ml-hedge { padding: 10px 18px 14px; }
.ml-hedge-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ml-hedge-fill { height: 100%; transition: width 0.3s; }
.ml-hedge-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  display: flex; align-items: center; justify-content: space-between;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.ml-hedge-label .dim { color: var(--fg-2); }
.ml-hedge-label .or { color: var(--orange); font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.ml-hedge-label .up { color: var(--green); font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* ===================== AUTH / BILLING ===================== */

/* Auth loading screen */
.auth-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--bg-0);
}
.auth-loading .auth-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--fg-0);
}
.auth-loading .auth-logo .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan-bri);
}
.auth-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--bd-1);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login wall */
.login-wall {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  padding: 40px 20px;
}
.lw-inner {
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.lw-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--fg-1);
}
.lw-brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan-bri); }
.lw-brand b { color: var(--fg-0); }
.lw-brand .sep { color: var(--fg-3); }
.lw-brand .tag { color: var(--fg-2); }
.lw-headline {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -0.02em;
}
.lw-sub {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--fg-1);
  max-width: 420px;
  line-height: 1.6;
}
.lw-plans {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 8px 0;
}
.lw-plan {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--bd-0);
  border-radius: 8px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  position: relative;
}
.lw-plan.indie {
  border-color: var(--cyan);
  background: rgba(34,211,238,0.04);
}
.lw-plan-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--cyan);
  color: var(--bg-0);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
}
.lw-plan-name {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lw-plan-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-0);
}
.lw-plan-price span { font-size: 12px; color: var(--fg-2); font-family: 'Inter', sans-serif; }
.lw-plan-desc {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--fg-2);
  line-height: 1.5;
}
.lw-cta {
  background: var(--cyan);
  color: var(--bg-0);
  border: none;
  border-radius: 6px;
  padding: 12px 36px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.lw-cta:hover { opacity: 0.88; }
.lw-legal {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--fg-3);
  max-width: 400px;
  line-height: 1.5;
}

/* Plan gate wall (inside app, ticker restricted) */
.plan-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  padding: 40px;
  text-align: center;
  color: var(--fg-2);
}
.pw-icon { color: var(--cyan); opacity: 0.5; }
.pw-title { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600; color: var(--fg-0); }
.pw-sub { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--fg-2); max-width: 280px; }
.pw-cta {
  margin-top: 8px;
  background: var(--cyan);
  color: var(--bg-0);
  border: none;
  border-radius: 5px;
  padding: 9px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pw-cta:hover { opacity: 0.88; }

/* Upgrade modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,8,16,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--bd-1);
  border-radius: 10px;
  width: 520px;
  max-width: calc(100vw - 40px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bd-0);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-0);
}
.modal-err {
  margin: 12px 20px 0;
  padding: 10px 14px;
  background: rgba(182,85,85,0.12);
  border: 1px solid rgba(182,85,85,0.3);
  border-radius: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--red);
}
.plan-cards {
  display: flex;
  gap: 12px;
  padding: 20px;
}
.plan-card {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--bd-0);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-card.current { border-color: var(--cyan); }
.pc-name { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-1); }
.pc-price { font-family: 'JetBrains Mono', monospace; font-size: 24px; font-weight: 700; color: var(--fg-0); }
.pc-price span { font-size: 12px; font-family: 'Inter', sans-serif; color: var(--fg-2); }
.pc-features {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.pc-features li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--fg-1);
}
.pc-features li svg { color: var(--green); flex-shrink: 0; }
.pc-btn {
  margin-top: 4px;
  background: var(--cyan);
  color: var(--bg-0);
  border: none;
  border-radius: 5px;
  padding: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.pc-btn:hover:not(:disabled) { opacity: 0.88; }
.pc-btn:disabled { opacity: 0.5; cursor: default; }
.pc-btn.current { background: var(--bg-3); color: var(--fg-1); border: 1px solid var(--bd-1); }
.modal-footer { padding: 0 20px 16px; text-align: center; }
.link-btn { background: none; border: none; color: var(--fg-2); font-family: 'Inter', sans-serif; font-size: 12px; cursor: pointer; text-decoration: underline; }

/* User menu in topbar */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--bd-0);
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--fg-1);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}
.user-btn:hover { border-color: var(--bd-1); color: var(--fg-0); }
.plan-pip {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.07em;
}
.plan-pip.free     { background: var(--bg-3); color: var(--fg-2); }
.plan-pip.indie    { background: rgba(34,211,238,0.15); color: var(--cyan); }
.plan-pip.academy  { background: rgba(152,134,192,0.15); color: var(--purple); }
.user-email { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-1);
  border: 1px solid var(--bd-1);
  border-radius: 7px;
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
}
.ud-info { padding: 12px 14px; }
.ud-name { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; color: var(--fg-0); }
.ud-plan { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--fg-2); margin-top: 2px; }
.ud-sep { height: 1px; background: var(--bd-0); }
.ud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  color: var(--fg-1);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.ud-item:hover { background: var(--bg-2); color: var(--fg-0); }
.ud-item.upgrade { color: var(--cyan); }

/* Locked ticker tab (free plan) */
.tk.locked { opacity: 0.45; cursor: pointer; }
.tk.locked:hover { opacity: 0.7; border-color: var(--cyan); }
.lock-pip { font-size: 9px; margin-right: 2px; opacity: 0.7; }

/* Upgrade CTA in footer */
.state-btn.upgrade {
  background: rgba(34,211,238,0.12);
  color: var(--cyan);
  border-color: rgba(34,211,238,0.3);
}
.state-btn.upgrade:hover { background: rgba(34,211,238,0.2); }
