.bench {
  --s1: #2a78d6;
  --s2: #eb6834;
  --ref: #8a8780;
  --grid: #ebe9e3;
  --phase: #f1efe9;
  padding-top: 56px;
  padding-bottom: 96px;
  max-width: 1080px;
}

@media (prefers-color-scheme: dark) {
  .bench {
    --s1: #3987e5;
    --s2: #d95926;
    --ref: #7d7a74;
    --grid: #26262b;
    --phase: #18181c;
  }
}

.top nav a.current { color: var(--text); font-weight: 600; }

.bench-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 22ch;
}

.bench-head .lede { max-width: 62ch; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 40px 0 24px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.tile .value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tile .label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.run-note {
  color: var(--muted);
  max-width: 78ch;
  margin-bottom: 32px;
}

.run-note strong { color: var(--text); }

.chart-card {
  margin: 0 0 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 24px 16px;
}

.chart-card figcaption h2 {
  font-size: 1.3rem;
  margin: 0 0 4px;
}

.chart-card figcaption p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid currentColor;
}

.legend i.dash { border-top-style: dashed; }

.chart {
  position: relative;
  touch-action: pan-y;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .phase { fill: var(--phase); }
.chart .phase-label { fill: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ref { stroke: var(--ref); stroke-dasharray: 5 4; }
.chart .cross { stroke: var(--text); stroke-width: 1; opacity: 0.35; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .direct { font-size: 12px; font-weight: 600; fill: var(--text); }

.tooltip {
  position: absolute;
  top: 8px;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  min-width: 170px;
  opacity: 0;
  transition: opacity 80ms;
}

.tooltip.on { opacity: 1; }

.tooltip .t-head {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.tooltip .row {
  display: grid;
  grid-template-columns: 14px auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}

.tooltip .row i {
  width: 14px;
  height: 0;
  border-top: 2px solid currentColor;
}

.tooltip .row b {
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.tooltip .row span { color: var(--muted); }

.table-view {
  margin: 8px 0 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.table-view summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
}

.table-scroll {
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid var(--border);
}

.table-view table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.table-view th, .table-view td {
  padding: 6px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.table-view th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

.setup h2 { font-size: 1.6rem; }

.setup dl {
  display: grid;
  gap: 0;
  margin: 0 0 24px;
}

.setup dl div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setup dt { color: var(--muted); }
.setup dd { margin: 0; }

.callout-plain {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 10px;
  padding: 16px 20px;
  color: var(--muted);
}

@media (max-width: 600px) {
  .chart-card { padding: 18px 14px 10px; }
  .setup dl div { grid-template-columns: 1fr; gap: 2px; }
}
