:root {
  color-scheme: dark;
  --ink: #e6edf3;
  --muted: #96a3b1;
  --panel: #101923;
  --panel-strong: #172432;
  --line: #2b3b4c;
  --cyan: #5bd6dc;
  --amber: #f4c76b;
  --red: #f48b8b;
  --green: #84d6a1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #091018;
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}
main { max-width: 1440px; margin: 0 auto; padding: 32px 38px 56px; }
.topbar { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; margin-bottom: 22px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.035em; }
h2 { margin-bottom: 0; font-size: 20px; }
h3 { font-size: 14px; color: var(--muted); font-weight: 600; }
.subhead, .identity, small { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.top-status { display: grid; gap: 8px; justify-items: end; text-align: right; }
.page-tabs { display: flex; gap: 8px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.page-tab { padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.page-tab:hover { color: var(--ink); background: var(--panel); }
.page-tab.active { border-color: #326c72; background: #10262b; color: var(--cyan); }
.page-tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 8px; }
.badge { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.badge.evidence { border-color: #88733e; color: var(--amber); }
.notice, .state, .card { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.notice { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 15px; margin-bottom: 20px; color: var(--muted); }
.notice strong { color: var(--amber); }
.card { padding: 22px; margin-bottom: 22px; }
.card-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.identity { margin-bottom: 17px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.metric-layout { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(420px, 1.5fr); gap: 18px; align-items: stretch; }
.metrics, table { width: 100%; border-collapse: collapse; }
.metrics { background: var(--panel-strong); border-radius: 8px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
.metrics th { width: 45%; color: var(--muted); font-weight: 500; }
.chart { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
svg { display: block; width: 100%; height: 220px; overflow: visible; }
.axis { stroke: var(--line); stroke-width: 1; }
.equity { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.drawdown { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; }
.equity-key::before, .drawdown-key::before { content: ""; display: inline-block; width: 18px; height: 3px; margin: 0 5px 3px 0; background: var(--cyan); }
.drawdown-key::before { background: var(--red); }
details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details table { margin-top: 10px; font-size: 12px; }
details th { color: var(--muted); font-weight: 600; }
.state { padding: 36px; text-align: center; }
.research-header { margin: 4px 0 18px; }
.research-header h2 { margin-bottom: 7px; font-size: clamp(24px, 3vw, 34px); }
.research-boundary { border-color: #6f5e36; }
.research-boundary a, .time-link { color: var(--cyan); text-decoration: none; }
.research-boundary a:hover, .time-link:hover { text-decoration: underline; }
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.research-card { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.research-card-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 9px; }
.source-number { color: var(--muted); font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.research-card h3 { margin: 0 0 5px; color: var(--ink); font-size: 18px; }
.time-link { display: inline-block; margin-bottom: 12px; font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.research-card dl { margin: 0; }
.research-card dl div { padding: 9px 0; border-top: 1px solid var(--line); }
.research-card dt { margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.research-card dd { margin: 0; }
@media (max-width: 850px) {
  main { padding: 22px 16px 40px; }
  .topbar, .card-header { display: grid; }
  .top-status { justify-items: start; text-align: left; }
  .metric-layout { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .chart { overflow-x: auto; }
  svg { min-width: 520px; }
}

@media (max-width: 560px) {
  .page-tabs { overflow-x: auto; }
  .page-tab { white-space: nowrap; }
}
