: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;
  --good: #006300;
}
* { 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 20px; max-width: 760px; color: var(--text-secondary); }

.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 { 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)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { 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; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.fig { margin: 4px 0 6px; }
.fig img { display: block; width: 100%; height: auto; }
.fig img[hidden] { display: none; }
.fig.narrow img { max-width: 440px; margin: 0 auto; }

/* plotly.js figures (dashboard/charts.js) */
.plot { width: 100%; height: 290px; }
.plot-tall { height: 360px; }
@media (max-width: 900px) { .plot { height: 260px; } .plot-tall { height: 320px; } }
.plot .modebar { background: none !important; }
.plot .modebar-btn path { fill: var(--text-muted) !important; }
.plot .modebar-btn:hover path { fill: var(--text-primary) !important; }
.plot .hoverlayer .hovertext { filter: drop-shadow(0 2px 6px rgba(11, 11, 11, 0.10)); }
/* the shape key: identity is never carried by colour alone */
.key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 0 4px;
  color: var(--text-secondary); font-size: 12px; }
.key-item { display: inline-flex; align-items: center; gap: 5px; }
.key-item svg { fill: none; stroke: var(--text-secondary); stroke-width: 1.4; overflow: visible; }
.note { color: var(--text-muted); font-size: 13px; }
.steps, .plain, .findings { padding-left: 20px; margin: 8px 0; }
.steps li, .plain li, .findings li { margin-bottom: 8px; color: var(--text-secondary); }
.steps strong, .plain strong, .findings strong { color: var(--text-primary); }
.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); } }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 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; }

.filters { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.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: 170px;
}
.segmented { display: inline-flex; border: 1px solid var(--axis); border-radius: 9px; padding: 2px; background: var(--surface); }
.segmented button {
  appearance: none; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-secondary); padding: 6px 12px; border-radius: 7px; cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--grid); color: var(--text-primary); }
.segmented button:focus-visible, 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; position: sticky; top: 0; background: var(--surface); }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
tr.selected td { font-weight: 650; background: #eef4fc; }
td .dot { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }


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