/* ==========================================================================
   MarketBreadth Pro (Planet #16 · MB) — Institutional Thermal Oscilloscope
   Dark Default: Deep Obsidian Slate (#070B10)
   Light Toggle: Crisp Warm Paper (#F6F5F0)
   Accents: Emerald #10B981 | Cyan #06B6D4 | Amber #F59E0B | Crimson #F43F5E
   ========================================================================== */

:root {
  --bg: #070B10;
  --bg-elev: #0C121A;
  --bg-card: #0F1722;
  --bg-card-hover: #141F2E;
  --bg-subtle: rgba(148, 163, 184, 0.08);
  --border: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #EEF3F9;
  --text-soft: #B4C2D4;
  --text-muted: #7C8FA6;

  --emerald: #10B981;
  --emerald-dim: rgba(16, 185, 129, 0.16);
  --cyan: #06B6D4;
  --cyan-dim: rgba(6, 182, 212, 0.16);
  --amber: #F59E0B;
  --amber-dim: rgba(245, 158, 11, 0.16);
  --crimson: #F43F5E;
  --crimson-dim: rgba(244, 63, 94, 0.16);
  --gold: #E5B95C;

  --grid-dot: rgba(148, 163, 184, 0.07);
  --chart-grid: rgba(148, 163, 184, 0.12);
  --chart-axis: #7C8FA6;
  --hud-bg: rgba(9, 14, 22, 0.94);
  --hud-border: rgba(148, 163, 184, 0.34);
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #F6F5F0;
  --bg-elev: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAF9F5;
  --bg-subtle: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #111827;
  --text-soft: #334155;
  --text-muted: #5B6B7F;

  --emerald: #059669;
  --emerald-dim: rgba(5, 150, 105, 0.13);
  --cyan: #0891B2;
  --cyan-dim: rgba(8, 145, 178, 0.13);
  --amber: #D97706;
  --amber-dim: rgba(217, 119, 6, 0.14);
  --crimson: #E11D48;
  --crimson-dim: rgba(225, 29, 72, 0.13);
  --gold: #A16207;

  --grid-dot: rgba(15, 23, 42, 0.055);
  --chart-grid: rgba(15, 23, 42, 0.09);
  --chart-axis: #5B6B7F;
  --hud-bg: rgba(255, 255, 255, 0.96);
  --hud-border: rgba(15, 23, 42, 0.18);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100%;
}

.osc-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 18% 8%, rgba(16, 185, 129, 0.07), transparent 40%),
    radial-gradient(circle at 86% 14%, rgba(6, 182, 212, 0.06), transparent 38%),
    radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
}

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

.muted {
  color: var(--text-muted);
}

.pos { color: var(--emerald); }
.neg { color: var(--crimson); }
.warn { color: var(--amber); }
.cool { color: var(--cyan); }

/* ================= TOPBAR ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon {
  display: inline-flex;
  color: var(--emerald);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-pro {
  color: var(--emerald);
  font-weight: 700;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-cta,
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.nav-cta:hover,
.nav-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.nav-cta--broker {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--emerald-dim);
  color: var(--emerald);
}

.nav-cta--broker:hover {
  border-color: var(--emerald);
}

.nav-cta--club {
  border-color: rgba(229, 185, 92, 0.45);
  background: rgba(229, 185, 92, 0.14);
  color: var(--gold);
}

[data-theme="light"] .nav-cta--club {
  background: rgba(161, 98, 7, 0.1);
}

.nav-btn--poster {
  border-color: rgba(6, 182, 212, 0.45);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.nav-btn--icon {
  width: 36px;
  padding: 0;
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ================= MAIN SHELL ================= */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Telemetry Strip */
.telemetry-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.telemetry-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-soft);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.34);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.meta-item {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.meta-sep { color: var(--text-muted); }

.timeframe-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tf-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}

.tf-btn,
.tab-pill,
.series-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.tf-btn:hover,
.tab-pill:hover,
.series-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.tf-btn.active,
.tab-pill.active {
  background: var(--emerald-dim);
  border-color: rgba(16, 185, 129, 0.55);
  color: var(--emerald);
}

.series-pill {
  opacity: 0.48;
}

.series-pill.active {
  opacity: 1;
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text);
}

/* ================= CARDS ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head--chart,
.card-head--wrap {
  flex-wrap: wrap;
  align-items: center;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.22;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

/* ================= HERO GRID ================= */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.regime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid currentColor;
}

.regime-badge.tone-emerald { color: var(--emerald); background: var(--emerald-dim); }
.regime-badge.tone-cyan { color: var(--cyan); background: var(--cyan-dim); }
.regime-badge.tone-amber { color: var(--amber); background: var(--amber-dim); }
.regime-badge.tone-crimson { color: var(--crimson); background: var(--crimson-dim); }

.gauge-layout {
  display: grid;
  grid-template-columns: minmax(230px, 285px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.gauge-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gauge-svg-wrap {
  width: 100%;
  max-width: 280px;
}

.gauge-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.gauge-scale-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.gauge-scale-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.gauge-scale-legend span::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.leg-cyan::before { background: var(--cyan); }
.leg-amber::before { background: var(--amber); }
.leg-emerald::before { background: var(--emerald); }
.leg-crimson::before { background: var(--crimson); }

.gauge-verdict {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.verdict-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--cyan);
  font-family: var(--font-mono);
}

.verdict-headline {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.verdict-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}

.regime-matrix-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.rm-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.rm-pill:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--text);
}

.rm-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.45;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.rm-pill.is-active {
  color: var(--text);
  font-weight: 800;
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.rm-pill.is-active.tone-emerald { border-color: rgba(16, 185, 129, 0.55); color: var(--emerald); }
.rm-pill.is-active.tone-emerald .rm-pill-dot { background: var(--emerald); opacity: 1; box-shadow: 0 0 8px var(--emerald); }
.rm-pill.is-active.tone-amber { border-color: rgba(245, 158, 11, 0.55); color: var(--amber); }
.rm-pill.is-active.tone-amber .rm-pill-dot { background: var(--amber); opacity: 1; box-shadow: 0 0 8px var(--amber); }
.rm-pill.is-active.tone-cyan { border-color: rgba(6, 182, 212, 0.55); color: var(--cyan); }
.rm-pill.is-active.tone-cyan .rm-pill-dot { background: var(--cyan); opacity: 1; box-shadow: 0 0 8px var(--cyan); }

.factor-box {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.factor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.factor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.factor-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.factor-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.factor-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.factor-fill {
  height: 100%;
  border-radius: 999px;
  transform-origin: left center;
  transition: width 0.68s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s ease;
  animation: mbBarSpring 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================= 2x2 KPI GRID ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.22s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.26s ease;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.kpi-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.kpi-pill--pos { color: var(--emerald); background: var(--emerald-dim); border-color: rgba(16, 185, 129, 0.35); }
.kpi-pill--neg { color: var(--crimson); background: var(--crimson-dim); border-color: rgba(244, 63, 94, 0.35); }
.kpi-pill--warn { color: var(--amber); background: var(--amber-dim); border-color: rgba(245, 158, 11, 0.35); }
.kpi-pill--cool { color: var(--cyan); background: var(--cyan-dim); border-color: rgba(6, 182, 212, 0.35); }

.kpi-main {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-sub-slash {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.split-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
}

.split-bar-adv {
  background: var(--emerald);
  height: 100%;
  border-radius: 999px 0 0 999px;
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.split-bar-dec {
  background: var(--crimson);
  height: 100%;
  border-radius: 0 999px 999px 0;
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.inline-jump {
  display: inline-flex;
  align-items: center;
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.inline-jump:hover { text-decoration: underline; }

.ma-triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ma-cell {
  padding: 8px 8px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ma-cell-hd {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ma-cell-val {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.ma-mini-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.ma-mini-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transform-origin: left center;
  transition: width 0.68s cubic-bezier(0.22, 1, 0.36, 1);
  animation: mbBarSpring 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.osc-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.osc-pair--gauges {
  gap: 8px;
}

.mini-dial-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mini-dial-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-dial-svg {
  width: 48px;
  height: 30px;
  flex-shrink: 0;
}

.mini-dial-svg svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.mini-kicker {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.osc-val {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.zbt-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: visible;
}

.zbt-zone-os {
  position: absolute;
  left: 0;
  width: 40%;
  height: 100%;
  border-radius: 999px 0 0 999px;
  background: rgba(6, 182, 212, 0.28);
}

.zbt-zone-th {
  position: absolute;
  left: 61.5%;
  right: 0;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: rgba(16, 185, 129, 0.28);
}

.zbt-marker {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
  transform: translateX(-50%);
  transition: left 0.72s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
}

.zbt-beacon {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  opacity: 0;
  pointer-events: none;
}

.zbt-beacon.is-watch {
  border-color: var(--cyan);
  animation: mbHtmlBeacon 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.zbt-beacon.is-fired {
  border-color: var(--emerald);
  animation: mbHtmlBeacon 1.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* ================= CHARTS GRID ================= */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-legend,
.chart-toggles,
.chart-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-soft);
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-emerald { background: var(--emerald); }
.dot-cyan { background: var(--cyan); }
.dot-amber { background: var(--amber); }
.dot-crimson { background: var(--crimson); }
.dot-slate { background: #94A3B8; }
.dot-bar {
  border-radius: 2px;
  background: linear-gradient(90deg, var(--emerald) 50%, var(--crimson) 50%);
}

.chart-stage {
  position: relative;
  width: 100%;
  min-height: 270px;
}

.chart-stage svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  touch-action: pan-y;
}

.chart-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 12;
  pointer-events: none;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 11.5px;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  min-width: 170px;
  max-width: 240px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.chart-hud.visible { opacity: 1; }

.hud-date {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11.5px;
  color: var(--text);
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hud-k { color: var(--text-muted); font-family: var(--font-sans); }

/* Mag-7 Concentration Panel */
.mag7-panel {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mag7-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mag7-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mag7-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.mag7-score {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--amber-dim);
  color: var(--amber);
}

.mag7-spreads {
  font-size: 11.5px;
  color: var(--text-muted);
}

.mag7-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.m7-chip {
  padding: 7px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, background 0.18s ease, box-shadow 0.2s ease;
}

.m7-chip:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.m7-chip.is-xray-active {
  border-color: var(--emerald);
  background: var(--emerald-dim);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.m7-sym {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.m7-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.m7-ret {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.osc-footer-notes {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-soft);
}

/* ================= 11-SECTOR HEATMAP MATRIX ================= */
.section-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sector-card {
  text-align: left;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  overflow: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.26s ease, background 0.2s ease;
}

.sector-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sec-accent, var(--emerald));
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.sector-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--sec-accent, var(--emerald)) 12%, transparent), transparent 58%);
  opacity: 0.75;
}

.sector-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.sector-card:hover::before {
  width: 6px;
}

.sector-card.is-xray-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.45), 0 10px 26px rgba(6, 182, 212, 0.14);
}

.sector-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sector-etf {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
}

.sector-name {
  font-size: 12.5px;
  color: var(--text-soft);
  font-weight: 600;
}

.sector-score {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-subtle);
}

.sector-rets {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.sector-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.sbar-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sbar-lbl {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.sbar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.sbar-track > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transform-origin: left center;
  transition: width 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  animation: mbBarSpring 0.76s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--bar-delay, 0ms);
}

.sector-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 7px;
}

.sector-drill-hint {
  color: var(--cyan);
  font-weight: 700;
}

/* ================= 52W TAPE TABLE ================= */
.tape-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select,
.filter-input {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.filter-input { width: 175px; }
.filter-select:focus,
.filter-input:focus { border-color: var(--cyan); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background-color 0.16s ease;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

.data-table tbody tr.is-xray-row {
  background: var(--cyan-dim);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sec-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.sec-tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.ticker-xray-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ticker-xray-btn:hover,
.ticker-xray-btn.is-xray-active {
  border-color: rgba(6, 182, 212, 0.45);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.ticker-strong {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ================= DRAWER & MODAL ================= */
.drawer-backdrop[hidden],
.modal-backdrop[hidden] {
  display: none !important;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.sector-drawer {
  width: min(560px, 100vw);
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border-strong);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.55);
  transform: translateX(32px);
  opacity: 0.92;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.drawer-backdrop.is-open .sector-drawer {
  transform: translateX(0);
  opacity: 1;
}

.drawer-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-close:hover {
  border-color: var(--border-strong);
}

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dm-box {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.dm-k {
  font-size: 10.5px;
  color: var(--text-muted);
}

.dm-v {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}

.drawer-subhead {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-row {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ma-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.ma-pill.on {
  background: var(--emerald-dim);
  color: var(--emerald);
}

.member-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.pos52-bar {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.pos52-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
}

/* Poster Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(4, 7, 12, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.poster-modal {
  width: min(640px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
}

.poster-preview-wrap {
  display: flex;
  justify-content: center;
  background: #05080D;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
}

.poster-preview-img {
  width: 100%;
  max-width: 440px;
  height: auto;
  border-radius: 8px;
  display: block;
}

.poster-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.action-btn--primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #04130D;
  border-color: transparent;
  flex: 1;
}

/* ================= FOOTER ================= */
.site-footer {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-disclaimer {
  font-size: 11.5px;
  opacity: 0.82;
}

.title-with-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.title-hint-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.34);
  white-space: nowrap;
}

.sector-summary-tile {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.08) 0%, rgba(16, 185, 129, 0.06) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
}

.sector-summary-tile .sector-etf {
  color: var(--cyan);
}

/* ================= KINETIC TELEMETRY, REPLAY DECK & X-RAY (v6.0) ================= */
.telemetry-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tf-btn--csv {
  border-color: rgba(6, 182, 212, 0.36);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.tf-btn--csv:hover {
  border-color: var(--cyan);
  color: var(--text);
}

/* Breadth Regime Playhead Replay Deck */
.replay-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 94%, var(--cyan) 6%) 0%, var(--bg-elev) 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.replay-deck.is-replaying {
  border-color: rgba(6, 182, 212, 0.56);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.28), 0 12px 30px rgba(6, 182, 212, 0.12);
}

.replay-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.replay-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--text);
}

.replay-btn--play {
  border-color: rgba(16, 185, 129, 0.48);
  background: var(--emerald-dim);
  color: var(--emerald);
}

.replay-btn--play.is-playing {
  border-color: rgba(6, 182, 212, 0.65);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.replay-btn--speed {
  min-width: 40px;
  padding: 0 9px;
}

.replay-btn--jump {
  font-size: 11.5px;
}

.replay-btn--reset {
  border-color: rgba(245, 158, 11, 0.48);
  background: var(--amber-dim);
  color: var(--amber);
}

.replay-btn[hidden] {
  display: none !important;
}

.replay-scrubber-wrap {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.replay-hud-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-soft);
}

.replay-mode-tag {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.replay-mode-tag.is-scrub {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: rgba(6, 182, 212, 0.45);
}

.replay-date {
  font-weight: 800;
  color: var(--text);
}

.replay-stat {
  color: var(--text-soft);
}

.scrubber-track-shell {
  display: flex;
  align-items: center;
  width: 100%;
}

.replay-scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.replay-scrubber::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.35), rgba(16, 185, 129, 0.48), rgba(245, 158, 11, 0.42));
  border: 1px solid var(--border);
}

.replay-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.72);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.replay-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

.replay-scrubber::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.35), rgba(16, 185, 129, 0.48), rgba(245, 158, 11, 0.42));
  border: 1px solid var(--border);
}

.replay-scrubber::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.72);
}

/* Cross-Planet X-Ray Ticker Focus Strip */
.xray-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.xray-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.xray-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.36);
}

.xray-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: mbPulseDot 2.1s ease-in-out infinite;
}

.xray-active-sym {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
}

.xray-active-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.xray-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.xray-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.xray-chip:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  color: var(--text);
}

.xray-chip.active {
  border-color: rgba(6, 182, 212, 0.6);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.xray-launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(229, 185, 92, 0.45);
  background: rgba(229, 185, 92, 0.12);
  color: var(--gold);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s ease, background 0.16s ease;
}

.xray-launch-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(229, 185, 92, 0.22);
}

/* Hero 30D Thermal Pulse Micro-Sparkline */
.hero-spark-wrap {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.hero-spark-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-spark-svg svg {
  width: 100%;
  height: 44px;
  display: block;
  overflow: visible;
}

/* Drawer Cross-Planet X-Ray Strip */
.drawer-xray-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(6, 182, 212, 0.32);
  background: var(--cyan-dim);
}

.drawer-xray-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  margin-right: 4px;
  font-family: var(--font-mono);
}

.drawer-xray-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.drawer-xray-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-1px);
}

.member-ticker-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.member-ticker-btn:hover,
.member-ticker-btn.is-active {
  border-color: rgba(6, 182, 212, 0.45);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.member-row {
  animation: mbRowReveal 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--row-delay, 0ms);
}

.pos52-fill {
  transform-origin: left center;
  animation: mbBarSpring 0.66s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--row-delay, 0ms);
}

/* ================= KINETIC SVG ANIMATIONS & BEACONS ================= */
.gauge-needle-pivot {
  transform-box: view-box;
  transform-origin: 140px 132px;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-needle-pivot {
  transform-box: view-box;
  transform-origin: 28px 28px;
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.svg-draw-path {
  stroke-dasharray: var(--path-len, 1200);
  stroke-dashoffset: 0;
  animation: mbStrokeDraw 0.92s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.svg-beacon-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: mbSvgBeacon 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.svg-beacon-ring--delay {
  animation-delay: 0.75s;
}

.svg-bar-rise {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: mbBarRise 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.playhead-line {
  pointer-events: none;
  transition: opacity 0.16s ease;
}

@keyframes mbStrokeDraw {
  from {
    stroke-dashoffset: var(--path-len, 1200);
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes mbBarSpring {
  from {
    transform: scaleX(0);
    opacity: 0.45;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes mbBarRise {
  from {
    transform: scaleY(0.15);
    opacity: 0.25;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes mbRowReveal {
  from {
    transform: translateX(12px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes mbSvgBeacon {
  0% {
    transform: scale(0.85);
    opacity: 0.85;
  }
  70% {
    transform: scale(2.35);
    opacity: 0;
  }
  100% {
    transform: scale(2.35);
    opacity: 0;
  }
}

@keyframes mbHtmlBeacon {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  75% {
    transform: scale(2.0);
    opacity: 0;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

@keyframes mbPulseDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ================= RESPONSIVE BREAKPOINTS ================= */
@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .sector-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .sector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .replay-scrubber-wrap {
    min-width: 100%;
  }
  .xray-strip {
    align-items: center;
  }
  .xray-head {
    order: 1;
    flex: 1;
  }
  .xray-launch-btn {
    order: 2;
  }
  .xray-chips {
    order: 3;
    flex-basis: 100%;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    padding: 10px 14px;
    gap: 8px;
  }
  .shell {
    padding: 12px 12px 36px;
    gap: 12px;
  }
  .card {
    padding: 14px;
  }
  .chart-stage {
    min-height: auto;
  }
  .gauge-layout {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .sector-grid {
    grid-template-columns: 1fr;
  }
  .mag7-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .factor-list {
    grid-template-columns: 1fr;
  }
  .regime-matrix-pills {
    grid-template-columns: 1fr;
  }
  .replay-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
  }
  .replay-btn--play,
  .replay-btn--reset {
    grid-column: 1 / -1;
  }
  .replay-stat--spy {
    display: none;
  }
  .xray-chips {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
  }
  .xray-chips::-webkit-scrollbar {
    display: none;
  }
  .xray-chip {
    flex-shrink: 0;
    padding: 0 11px;
  }
  .xray-launch-btn {
    width: 100%;
    order: 4;
  }
  #div-pair-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .sort-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .sort-controls .tf-label {
    grid-column: 1 / -1;
    margin-bottom: -2px;
  }
  .filter-input {
    width: 100%;
    flex: 1;
    min-width: 140px;
  }
  /* Guarantee >= 40px mobile touch targets across ALL interactive controls */
  .brand-mark,
  .inline-jump,
  .nav-cta,
  .nav-btn,
  .tf-btn,
  .tab-pill,
  .series-pill,
  .filter-select,
  .filter-input,
  .replay-btn,
  .replay-scrubber,
  .xray-chip,
  .xray-launch-btn,
  .rm-pill,
  .m7-chip,
  .ticker-xray-btn,
  .sec-tag,
  .drawer-xray-link,
  .member-ticker-btn,
  .kzg-orbit-trigger,
  .kzg-growth-btn,
  .kzg-vote-btn,
  .kzg-vote-input {
    min-height: 40px !important;
  }
  .nav-cta,
  .nav-btn {
    padding: 0 10px;
    font-size: 12px;
  }
  .nav-btn--icon {
    width: 40px;
    padding: 0;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .hero-title {
    font-size: 19px;
  }
  .drawer-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ================= ACCESSIBILITY: REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .svg-draw-path {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
  .svg-beacon-ring,
  .zbt-beacon,
  .xray-pulse-dot {
    animation: none !important;
    opacity: 0.4 !important;
  }
}

