:root {
  color-scheme: dark;
  --bg: #090c12;
  --panel: rgba(18, 24, 36, 0.88);
  --panel-strong: #171e2d;
  --text: #e9edf6;
  --muted: #9aa6b9;
  --border: rgba(255, 255, 255, 0.09);
  --grid: rgba(255, 255, 255, 0.07);
  --accent: #57c3ff;
  --positive: #64d9b1;
  --negative: #ff7f96;
  --shadow: rgba(0, 0, 0, 0.42);
  --equities: #5bbcff;
  --risk-credit: #c18cff;
  --rates: #f1b667;
  --currencies: #6ed8c4;
  --commodities: #ef7aa9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% -10%, #1c2d45 0, #0d111a 43%, var(--bg) 75%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

button, select, input { font: inherit; }
button { cursor: pointer; }

.glow {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
}
.glow-one { width: 520px; height: 520px; top: -180px; right: -120px; background: #3b9eff; }
.glow-two { width: 420px; height: 420px; bottom: 8%; left: -180px; background: #d0528e; }

.shell {
  width: min(1420px, 94vw);
  margin: 0 auto;
  padding: 38px 0 64px;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 22px;
}

.breadcrumb { display: flex; gap: 8px; margin-bottom: 28px; color: var(--muted); font-size: 0.78rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--accent); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 0.95; letter-spacing: -0.055em; }
.subhead { max-width: 700px; margin: 16px 0 0; color: var(--muted); font-size: 1.03rem; }

.meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.meta-card { min-width: 170px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(10, 14, 22, 0.65); box-shadow: 0 12px 30px var(--shadow); }
.meta-card span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.meta-card strong { font-size: 0.84rem; }

.state-panel, .breadth-panel, .radar-panel, .relationships-panel, .ranking-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(25, 33, 49, 0.94), rgba(10, 14, 22, 0.9));
  box-shadow: 0 20px 55px var(--shadow);
}

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 0; font-size: clamp(1.35rem, 2.6vw, 2rem); }
.section-heading p:not(.section-kicker) { max-width: 520px; margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; }
.state-summary { text-align: right; }

.state-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.state-card { min-height: 128px; padding: 17px; border: 1px solid var(--border); border-radius: 17px; background: rgba(8, 12, 19, 0.65); }
.state-card span { display: block; color: var(--muted); font-size: 0.72rem; }
.state-card strong { display: block; margin: 16px 0 8px; font-size: 1.14rem; }
.state-card p { margin: 0; color: var(--muted); font-size: 0.76rem; }
.state-card[data-tone="positive"] strong { color: var(--positive); }
.state-card[data-tone="negative"] strong { color: var(--negative); }

.regime-panel { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(380px, 1.2fr); gap: 20px; margin-top: 20px; padding: 20px; border: 1px solid rgba(87,195,255,0.24); border-radius: 19px; background: rgba(8, 12, 19, 0.72); }
.regime-copy h3 { margin: 0; font-size: clamp(1.45rem, 2.8vw, 2.15rem); letter-spacing: -0.035em; }
.regime-copy > p:not(.section-kicker) { margin: 10px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.regime-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.regime-status { flex: none; padding: 6px 9px; border: 1px solid rgba(87,195,255,0.28); border-radius: 999px; color: var(--accent); font-size: 0.62rem; font-weight: 700; }
.regime-score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.regime-score-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.025); }
.regime-score-grid span, .regime-score-grid small { display: block; color: var(--muted); font-size: 0.59rem; }
.regime-score-grid strong { display: block; margin: 8px 0 4px; font-size: 1rem; }
.regime-quadrant { position: relative; min-height: 290px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(90deg, rgba(255,127,150,0.055) 50%, rgba(91,188,255,0.055) 50%), linear-gradient(180deg, rgba(241,182,103,0.05) 50%, rgba(110,216,196,0.04) 50%); }
.regime-quadrant::before, .regime-quadrant::after { content: ''; position: absolute; background: rgba(164,177,201,0.24); }
.regime-quadrant::before { left: 50%; top: 0; width: 1px; height: 100%; }
.regime-quadrant::after { left: 0; top: 50%; width: 100%; height: 1px; }
.quadrant-label { position: absolute; z-index: 1; max-width: 42%; color: var(--muted); font-size: 0.58rem; }
.quadrant-label strong, .quadrant-label span { display: block; }
.quadrant-label strong { margin-bottom: 3px; color: var(--text); font-size: 0.7rem; }
.top-left { top: 14px; left: 15px; }
.top-right { top: 14px; right: 15px; text-align: right; }
.bottom-left { bottom: 14px; left: 15px; }
.bottom-right { right: 15px; bottom: 14px; text-align: right; }
.axis-label { position: absolute; z-index: 1; color: rgba(164,177,201,0.7); font-size: 0.52rem; letter-spacing: 0.07em; text-transform: uppercase; }
.axis-growth { right: 8px; top: calc(50% + 7px); }
.axis-inflation { left: calc(50% + 7px); top: 8px; transform: rotate(-90deg) translateX(-100%); transform-origin: left top; }
.regime-marker { position: absolute; z-index: 3; left: var(--regime-x); top: var(--regime-y); display: flex; align-items: center; transform: translate(-10px, -10px); }
.regime-marker i { width: 20px; height: 20px; border: 4px solid rgba(255,255,255,0.8); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 7px rgba(87,195,255,0.17), 0 5px 18px rgba(0,0,0,0.6); }
.regime-marker b { max-width: 130px; margin-left: 10px; padding: 5px 7px; border-radius: 7px; background: rgba(5,9,15,0.88); color: var(--text); font-size: 0.59rem; white-space: nowrap; }
.regime-evidence { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.regime-evidence > div { padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.02); }
.regime-evidence h4 { margin: 0 0 10px; font-size: 0.76rem; }
.regime-evidence ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.regime-evidence li { padding: 9px; border-radius: 9px; background: rgba(255,255,255,0.025); }
.regime-evidence li strong, .regime-evidence li span { display: block; }
.regime-evidence li strong { margin-bottom: 4px; color: var(--accent); font-size: 0.55rem; text-transform: uppercase; }
.regime-evidence li span, .regime-empty { margin: 0; color: var(--muted); font-size: 0.62rem; line-height: 1.4; }
.regime-history-link { display:flex; justify-content:space-between; align-items:center; margin-top:12px; padding:13px 16px; border:1px solid rgba(87,195,255,.22); border-radius:13px; color:var(--accent); background:rgba(87,195,255,.055); font-size:.72rem; font-weight:700; text-decoration:none; }
.regime-history-link span { font-size:1rem; }

#breadthSummary { display: flex; max-width: 540px; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.breadth-callout { font-size: 0.9rem; }
.breadth-callout.positive { color: var(--positive); }
.breadth-callout.negative { color: var(--negative); }
.breadth-callout.neutral { color: var(--text); }
.breadth-overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.breadth-stat { padding: 15px 17px; border: 1px solid var(--border); border-radius: 15px; background: rgba(8, 12, 19, 0.65); }
.breadth-stat span { display: block; color: var(--muted); font-size: 0.68rem; }
.breadth-stat strong { display: block; margin-top: 8px; font-size: 1.25rem; }
.breadth-stat.advancing strong { color: var(--positive); }
.breadth-stat.declining strong { color: var(--negative); }
.sector-breadth-heading { display: flex; justify-content: space-between; gap: 14px; margin: 22px 2px 10px; }
.sector-breadth-heading strong { font-size: 0.8rem; }
.sector-breadth-heading span { color: var(--muted); font-size: 0.68rem; }
.sector-breadth-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sector-breadth-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; align-items: center; padding: 12px 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(8, 12, 19, 0.5); }
.sector-breadth-card div:first-child { min-width: 0; }
.sector-breadth-card strong, .sector-breadth-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sector-breadth-card strong { font-size: 0.72rem; }
.sector-breadth-card span { margin-top: 3px; color: var(--muted); font-size: 0.59rem; }
.sector-breadth-card b { font-size: 0.82rem; }
.sector-breadth-card[data-tone="positive"] b { color: var(--positive); }
.sector-breadth-card[data-tone="negative"] b { color: var(--negative); }
.breadth-bar { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255,127,150,0.38); }
.breadth-bar i { display: block; height: 100%; border-radius: inherit; background: var(--positive); }
.breadth-error { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--border); border-radius: 14px; color: var(--muted); font-size: 0.76rem; }

.metric-toggle, .replay-modes, .ranking-toggle { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 13px; background: rgba(8, 12, 19, 0.75); }
.metric-toggle button, .replay-modes button, .ranking-toggle button { border: 0; border-radius: 9px; padding: 9px 14px; color: var(--muted); background: transparent; font-weight: 700; }
.metric-toggle button.active, .replay-modes button.active, .ranking-toggle button.active { color: var(--text); background: rgba(87, 195, 255, 0.18); }

.chart-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: rgba(7, 10, 17, 0.62); scrollbar-color: rgba(87, 195, 255, 0.42) transparent; }
.chart { position: relative; min-width: 1160px; height: 610px; overflow: hidden; }
.axis-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--grid); pointer-events: none; }
.axis-line.zero { height: 2px; background: rgba(255,255,255,0.35); }
.axis-line span { position: sticky; left: 8px; display: inline-block; transform: translateY(-52%); padding: 1px 5px; border-radius: 4px; color: #9aa5b6; background: rgba(8, 12, 18, 0.86); font-size: 0.66rem; }
.column-line { position: absolute; top: 28px; bottom: 50px; width: 1px; background: rgba(255,255,255,0.035); }

.macro-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 50%;
  color: white;
  box-shadow: inset 0 0 22px rgba(255,255,255,0.12), 0 12px 24px rgba(0,0,0,0.38);
  transition: left 420ms ease, top 420ms ease, transform 160ms ease, box-shadow 160ms ease;
  z-index: 3;
}
.macro-bubble:hover, .macro-bubble.pinned { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 14px 30px rgba(0,0,0,0.5); z-index: 5; }
.bubble-content { text-align: center; pointer-events: none; line-height: 1.05; }
.bubble-content strong { display: block; font-size: 0.72rem; }
.bubble-content span { display: block; margin-top: 3px; font-size: 0.58rem; font-weight: 700; }
.ticker-label { position: absolute; bottom: 25px; transform: translateX(-50%); color: var(--muted); text-align: center; font-size: 0.62rem; white-space: nowrap; }
.ticker-label strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 0.66rem; }

.group-equities { background: color-mix(in srgb, var(--equities) 76%, #14243a); }
.group-risk-credit { background: color-mix(in srgb, var(--risk-credit) 74%, #241b36); }
.group-rates { background: color-mix(in srgb, var(--rates) 76%, #352515); }
.group-currencies { background: color-mix(in srgb, var(--currencies) 74%, #12312d); }
.group-commodities { background: color-mix(in srgb, var(--commodities) 72%, #35182a); }

.replay-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; margin-top: 16px; }
.replay-transport { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto; align-items: center; gap: 12px; padding: 4px 4px 4px 8px; }
.replay-transport.is-disabled { opacity: 0.42; pointer-events: none; }
.play-button, footer button { border: 1px solid rgba(87,195,255,0.45); border-radius: 999px; padding: 9px 14px; color: #07111a; background: var(--accent); font-weight: 800; }
#scrubber { width: 100%; accent-color: var(--accent); }
#replayTimestamp { min-width: 150px; font-size: 0.74rem; text-align: center; }
.replay-transport label { color: var(--muted); font-size: 0.7rem; }
.replay-transport select { margin-left: 5px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; color: var(--text); background: #101623; }

.group-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; color: var(--muted); font-size: 0.7rem; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }

.relationship-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.relationship-card { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: rgba(8, 12, 19, 0.66); }
.relationship-card h3 { min-height: 38px; margin: 0; font-size: 0.88rem; }
.relationship-value { display: block; margin: 14px 0 8px; font-size: 1.25rem; }
.relationship-card p { min-height: 44px; margin: 0; color: var(--muted); font-size: 0.68rem; }
.relationship-periods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 14px; }
.relationship-periods span { padding: 6px; border-radius: 8px; background: rgba(255,255,255,0.045); color: var(--muted); font-size: 0.6rem; text-align: center; }
.relationship-correlation-block { margin-top: 9px; }
.relationship-correlation-block small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.55rem; }
.relationship-correlations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.relationship-correlations span { padding: 6px; border: 1px solid rgba(87,195,255,0.12); border-radius: 8px; background: rgba(87,195,255,0.045); color: var(--muted); font-size: 0.6rem; text-align: center; }
.relationship-correlations b { color: var(--text); }

.ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ranking-heading-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.ranking-heading-controls p { margin: 0 !important; }
.ranking-column { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: rgba(8, 12, 19, 0.64); }
.ranking-column h3 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.rank-row { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 15px; border: 0; border-bottom: 1px solid rgba(255,255,255,0.045); color: inherit; background: transparent; text-align: left; }
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: rgba(87,195,255,0.07); }
.rank-number { color: var(--muted); font-size: 0.7rem; }
.rank-name strong { display: block; font-size: 0.76rem; }
.rank-name span { color: var(--muted); font-size: 0.62rem; }
.rank-name em { display: block; margin-top: 3px; color: var(--muted); font-size: 0.58rem; font-style: normal; }
.rank-name em[data-direction="higher"] { color: var(--accent); }
.rank-name em[data-direction="lower"] { color: var(--negative); }
.horizon-dots { display: flex !important; gap: 4px; margin-top: 6px; }
.horizon-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.horizon-dots i[data-direction="higher"] { background: var(--positive); }
.horizon-dots i[data-direction="lower"] { background: var(--negative); }
.trend-rank-row { min-height: 88px; }
.return-positive { color: var(--positive); }
.return-negative { color: var(--negative); }

footer { display: flex; align-items: center; gap: 15px; padding: 22px 4px 0; color: var(--muted); font-size: 0.72rem; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); }
.drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(460px, 94vw); height: 100vh; padding: 32px; overflow-y: auto; transform: translateX(104%); transition: transform 220ms ease; border-left: 1px solid var(--border); background: #111826; box-shadow: -24px 0 60px rgba(0,0,0,0.5); }
.drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; top: 20px; right: 22px; border: 0; color: var(--muted); background: transparent; font-size: 2rem; }
.drawer-kicker { margin-top: 28px; color: var(--accent); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.drawer h2 { margin: 8px 0; font-size: 2rem; }
.drawer-subhead { color: var(--muted); }
.drawer-price { margin: 26px 0; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(7,10,16,0.55); }
.drawer-price span { display: block; color: var(--muted); font-size: 0.68rem; }
.drawer-price strong { display: block; margin-top: 8px; font-size: 1.55rem; }
.drawer-trend { margin: 0 0 18px; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: rgba(7,10,16,0.55); }
.drawer-trend[data-direction="higher"] { border-color: rgba(100,217,177,0.26); }
.drawer-trend[data-direction="lower"] { border-color: rgba(255,127,150,0.26); }
.drawer-trend-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-trend-heading span, .drawer-trend-grid span { display: block; color: var(--muted); font-size: 0.64rem; }
.drawer-trend-heading strong { display: block; margin-top: 5px; font-size: 1.02rem; }
.drawer-trend[data-direction="higher"] .drawer-trend-heading strong { color: var(--accent); }
.drawer-trend[data-direction="lower"] .drawer-trend-heading strong { color: var(--negative); }
.drawer-trend-heading b { padding: 6px 8px; border-radius: 999px; color: var(--text); background: rgba(255,255,255,0.07); font-size: 0.61rem; white-space: nowrap; }
.drawer-trend > p { margin: 12px 0 14px; color: var(--muted); font-size: 0.7rem; }
.drawer-trend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.drawer-trend-grid > div { padding: 11px; border-radius: 11px; background: rgba(255,255,255,0.035); }
.drawer-trend-grid strong, .drawer-trend-grid em { display: block; margin-top: 5px; }
.drawer-trend-grid strong { font-size: 0.82rem; }
.drawer-trend-grid em { font-size: 0.62rem; font-style: normal; }
.drawer-trend-grid em[data-direction="higher"] { color: var(--accent); }
.drawer-trend-grid em[data-direction="lower"] { color: var(--negative); }
.drawer-systematic { margin: 0 0 18px; padding: 17px; border: 1px solid rgba(87,195,255,0.2); border-radius: 16px; background: rgba(7,10,16,0.55); }
.drawer-systematic-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-systematic-heading span, .drawer-horizons span, .drawer-quality-grid span { display: block; color: var(--muted); font-size: 0.64rem; }
.drawer-systematic-heading strong { display: block; margin-top: 5px; font-size: 1.02rem; }
.drawer-systematic-heading b { font-size: 1.35rem; }
.drawer-horizons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.drawer-horizons > div, .drawer-quality-grid > div { padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.035); }
.drawer-horizons strong, .drawer-horizons em { display: block; margin-top: 5px; }
.drawer-horizons strong { font-size: 0.76rem; }
.drawer-horizons em { color: var(--muted); font-size: 0.54rem; font-style: normal; }
.drawer-horizons [data-direction="higher"] strong { color: var(--positive); }
.drawer-horizons [data-direction="lower"] strong { color: var(--negative); }
.drawer-quality-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 8px; }
.drawer-quality-grid strong { display: block; margin-top: 5px; font-size: 0.78rem; }
.drawer-systematic > p { margin: 13px 0 0; color: var(--muted); font-size: 0.66rem; line-height: 1.5; }
.drawer-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.drawer-metric { padding: 14px; border: 1px solid var(--border); border-radius: 14px; }
.drawer-metric span { display: block; color: var(--muted); font-size: 0.64rem; }
.drawer-metric strong { display: block; margin-top: 8px; font-size: 1rem; }
.drawer-note { margin-top: 24px; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }

.error-card { padding: 24px; border: 1px solid rgba(255,127,150,0.45); border-radius: 18px; color: #ffd5dd; background: rgba(90,20,36,0.28); }

@media (max-width: 980px) {
  .state-grid { grid-template-columns: repeat(2, 1fr); }
  .breadth-overview { grid-template-columns: repeat(3, 1fr); }
  .sector-breadth-grid { grid-template-columns: repeat(2, 1fr); }
  .relationship-grid { grid-template-columns: repeat(2, 1fr); }
  .replay-panel { grid-template-columns: 1fr; }
  .regime-panel { grid-template-columns: 1fr; }
  .regime-evidence { grid-column: auto; }
}

@media (max-width: 680px) {
  .shell { width: min(94vw, 620px); padding-top: 24px; }
  .hero, .section-heading, .section-heading.compact { align-items: flex-start; flex-direction: column; }
  .breadcrumb { margin-bottom: 20px; }
  .meta { width: 100%; justify-content: flex-start; }
  .meta-card { flex: 1; min-width: 140px; }
  .state-panel, .breadth-panel, .radar-panel, .relationships-panel, .ranking-panel { padding: 17px; border-radius: 19px; }
  .state-grid, .relationship-grid, .ranking-grid { grid-template-columns: 1fr; }
  .state-summary { text-align: left; }
  .regime-panel { padding: 14px; }
  .regime-title-row { align-items: flex-start; flex-direction: column; }
  .regime-score-grid { grid-template-columns: 1fr; }
  .regime-quadrant { min-height: 300px; }
  .regime-evidence, .regime-evidence ul { grid-template-columns: 1fr; }
  .ranking-heading-controls { width: 100%; align-items: flex-start; }
  .ranking-toggle { width: 100%; }
  .ranking-toggle button { flex: 1; }
  #breadthSummary { align-items: flex-start; text-align: left; }
  .breadth-overview { grid-template-columns: repeat(2, 1fr); }
  .breadth-stat:last-child { grid-column: 1 / -1; }
  .sector-breadth-grid { grid-template-columns: 1fr; }
  .metric-toggle, .replay-modes { width: 100%; }
  .metric-toggle button, .replay-modes button { flex: 1; padding: 9px 7px; font-size: 0.72rem; }
  .chart { height: 560px; }
  .replay-transport { grid-template-columns: auto minmax(90px, 1fr); }
  #replayTimestamp { order: 3; text-align: left; }
  .replay-transport label { order: 4; text-align: right; }
  .relationship-grid { gap: 9px; }
  .relationship-card h3, .relationship-card p { min-height: 0; }
  .drawer { padding: 25px; }
  .drawer-horizons { grid-template-columns: repeat(2, 1fr); }
}
