/* Results dashboard. Same tokens as the matplotlib figures and the plotly
   layouts in dashboard/build.py; dark values are their own steps. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-bg: #eef4fc;
  --button: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #6da7ec;
    --accent-bg: #1f2a38;
    --button: #2a78d6;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #6da7ec;
  --accent-bg: #1f2a38;
  --button: #2a78d6;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
code { font-size: 0.9em; background: var(--grid); padding: 1px 5px; border-radius: 4px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); padding-top: 28px; }
.eyebrow { margin: 0; color: var(--text-muted); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
h1 { margin: 6px 0 8px; font-size: clamp(22px, 3.2vw, 32px); line-height: 1.2; text-wrap: balance; }
.lede { margin: 0 0 14px; max-width: 780px; color: var(--text-secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.button {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--axis); color: var(--text-primary); background: var(--surface);
}
.button:hover { border-color: var(--text-muted); }
.button.primary { background: var(--button); border-color: var(--button); color: #ffffff; }
.button.primary:hover { filter: brightness(1.08); }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.disclaimer { margin: 0 0 16px; max-width: 780px; color: var(--text-muted); font-size: 13px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  appearance: none; border: 0; background: none; color: var(--text-secondary);
  font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tabs button:hover { color: var(--text-primary); }
.tabs button[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

main.wrap { padding-top: 24px; padding-bottom: 24px; }
.tab-panel { display: grid; gap: 16px; }
.tab-panel[hidden] { display: none; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 18px 12px; min-width: 0;
}
.card h2 { margin: 0; font-size: 16px; }
.card .sub { margin: 2px 0 8px; color: var(--text-secondary); font-size: 13px; max-width: 900px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.fig { margin: 4px 0 6px; }
.fig img { display: block; width: 100%; height: auto; }
.fig-note { margin: 2px 0 4px; color: var(--text-secondary); font-size: 12.5px; min-height: 1em; }
.png { margin: 4px 0 2px; font-size: 12px; color: var(--text-muted); }
.png a { color: var(--text-muted); }

.plot { width: 100%; height: 320px; }
.plot.short { height: 250px; }
.plot.tall { height: 400px; }
.plot.double { height: 560px; }
@media (max-width: 600px) { .plot { height: 300px; } .plot.tall { height: 380px; } .plot.double { height: 540px; } }
.plot .modebar { background: none !important; }
.plot .modebar-btn path { fill: var(--text-muted) !important; }
.plot .modebar-btn:hover path { fill: var(--text-primary) !important; }

.note { color: var(--text-muted); font-size: 13px; }
.plain, .findings { padding-left: 20px; margin: 8px 0; }
.plain li, .findings li { margin-bottom: 8px; color: var(--text-secondary); }
.findings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
@media (max-width: 900px) { .findings { grid-template-columns: minmax(0, 1fr); } }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; font-size: 13.5px; }
dl.facts dt { color: var(--text-secondary); }
dl.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.facts dd { margin-bottom: 6px; }
}

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.tile .label { color: var(--text-secondary); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 650; line-height: 1.2; margin-top: 2px; }
.tile .detail { color: var(--text-muted); font-size: 12.5px; }

.control { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
select {
  font: inherit; font-size: 14px; color: var(--text-primary); background: var(--surface);
  border: 1px solid var(--axis); border-radius: 8px; padding: 6px 10px; min-width: 150px; max-width: 100%;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 600; background: var(--surface); }
th:first-child, td:first-child { text-align: left; }
th.left, td.left { text-align: left; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text-primary); }
th[aria-sort="ascending"]::after { content: " \2191"; }
th[aria-sort="descending"]::after { content: " \2193"; }
td .ci { color: var(--text-muted); }
tr.highlight td { background: var(--accent-bg); }
.variants > [hidden] { display: none; }

.footer { color: var(--text-muted); font-size: 13px; padding-bottom: 32px; }
.footer p { margin: 4px 0; }
