body {
  font-family: monospace;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.page-shell {
  padding: 20px 24px 48px;
}
.page-stack {
  display: grid;
  grid-template-columns: 920px 176px;
  column-gap: 28px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.page-stack:not(.has-toc) {
  grid-template-columns: 920px;
}
.page-header {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 10px 0;
  overflow: visible;
}
.page-header-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}
.page-stack:not(.has-toc) .page-header {
  grid-column: 1;
}
.page-toc-slot {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
}
.page-toc {
  position: sticky;
  top: var(--sticky-chrome-top, 96px);
  width: 176px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  line-height: 1.35;
  border-left: 1px solid #e2e8f0;
  padding-left: 10px;
}
.page-toc-indicator {
  position: absolute;
  left: -1px;
  width: 3px;
  background: #1e293b;
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
  transition: top 0.15s ease, height 0.15s ease;
}
.page-toc-indicator[hidden] { display: none; }
.page-stack:not(.has-toc) .page-toc-slot,
.page-stack:not(.has-toc) .page-toc {
  display: none;
}
.page-toc[hidden] { display: none; }
.page-toc a {
  position: relative;
  color: #64748b;
  text-decoration: none;
  padding: 2px 0 2px 4px;
  transition: color 0.2s ease;
}
.page-toc a:hover { color: #334155; }
.page-toc a:focus { outline: none; }
.page-table-col {
  grid-column: 1;
  grid-row: 2;
  width: 920px;
  max-width: 100%;
  min-width: 0;
}
.page-table-col table { margin-top: 0; }
.page-stack:not(.has-toc) .page-table-col {
  grid-column: 1;
}
@media (max-width: 960px) {
  .page-stack,
  .page-stack.has-toc {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .page-header,
  .page-table-col,
  .page-stack.has-toc .page-header,
  .page-stack.has-toc .page-table-col {
    grid-column: 1;
    width: 100%;
  }
  .page-table-col { overflow-x: auto; }
  .page-toc { display: none !important; }
}
h2 { font-size: 14px; margin: 24px 0 4px; }
canvas { display: block; margin-bottom: 8px; }
table { border-collapse: collapse; margin: 16px 0; width: 100%; }
#bench-table {
  width: 100%;
}
#bench-table col.col-shrink {
  width: 0;
}
#bench-table th:not(.trend-col),
#bench-table td:not(.trend-cell) {
  white-space: nowrap;
  width: 0;
}
th, td { border: 1px solid #ccc; padding: 6px 12px; text-align: left; }
th { background: #f5f5f5; }
td input { margin-right: 4px; }
.spark-cell { padding: 4px 8px; vertical-align: middle; }
#spark-popover, #spark-popover-2 {
  position: fixed; z-index: 1000; pointer-events: none;
  background: #fff; border: 1px solid #ccc; padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: scale(0.55); opacity: 0;
  transition: transform 0.18s ease, opacity 0.15s ease;
  transform-origin: top left;
}
#spark-popover.show, #spark-popover-2.show { transform: scale(1); opacity: 1; }
#spark-popover .title, #spark-popover-2 .title { font-size: 13px; font-weight: 600; color: #111; margin-bottom: 8px; }
.machine-bar { margin: 0; flex-shrink: 0; }
.machine-picker { position: relative; }
.picker-trigger {
  display: flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 14px; border: 1px solid #ccc; background: #fff;
  min-width: 280px; text-align: left; cursor: pointer;
}
.picker-icon {
  color: #111; font-size: 16px; line-height: 1;
}
.picker-menu {
  display: none; position: absolute; z-index: 1000;
  top: calc(100% + 6px);
  left: 0;
  background: #fff; border: 1px solid #ccc;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  padding: 16px 32px; min-width: 420px; width: max-content;
}
.picker-menu.open { display: block; }
.picker-lattice-row {
  display: grid;
  column-gap: 40px;
  align-items: start;
}
.picker-lattice-row.cols-2 { grid-template-columns: repeat(2, minmax(120px, max-content)); }
.picker-lattice-row.cols-3 { grid-template-columns: repeat(3, minmax(120px, max-content)); }
.picker-lattice-row.cols-4 { grid-template-columns: repeat(4, minmax(120px, max-content)); }
.picker-lattice-col {
  display: flex;
  flex-direction: column;
  row-gap: 6px;
}
.picker-cell {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; padding: 2px 0; border: none; background: none;
  font-family: inherit; text-align: left; cursor: default;
  color: #bbb;
}
.picker-cell.available { color: #888; cursor: pointer; }
.picker-cell.available:hover { color: #111; }
.picker-cell.active { color: #111; font-weight: 600; cursor: pointer; }
.picker-check { pointer-events: none; margin: 0; accent-color: #333; }
.picker-section { font-size: 11px; color: #999; margin: 12px 0 6px; }
.picker-section:first-child { margin-top: 0; }
.picker-list { display: flex; flex-direction: column; gap: 4px; }
.note { font-size: 12px; color: #666; max-width: 52em; line-height: 1.4; }
#bench-table tbody { scroll-margin-top: calc(var(--scroll-marker-y, 108px) + 12px); }
#bench-table .section-head td { font-weight: bold; }
#bench-table tbody.section-alt td { background: #f5f5f5; }
.trend-col,
.trend-cell {
  width: 100%;
  min-width: 148px;
  padding: 4px 6px;
  vertical-align: middle;
}
.spark-wrap,
.spark-dual,
.pct-wrap {
  width: 100%;
  box-sizing: border-box;
}
.spark-mini { display: block; width: 100%; height: 38px; cursor: crosshair; }
.pct-chart { cursor: crosshair; }
.spark-dual {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}
.spark-dual-item {
  flex: 1 1 0;
  min-width: 0;
}
.spark-dual-label { font-size: 9px; color: #888; text-align: center; margin-top: 2px; font-family: monospace; line-height: 1; }
.spark-merged {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: crosshair;
  padding: 2px 122px 2px 0;
}
.spark-merged-legend {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 8px;
  width: 118px;
  line-height: 1.2;
}
/* The popover is wide (444px); let its legend hug the full labels instead of
   clipping at the narrow inline width. Inline trend cell keeps the 118px above. */
.spark-popover-merged .spark-merged-legend {
  width: max-content;
  max-width: 60%;
}
.spark-merged-legend .spark-legend-item {
  gap: 3px;
  white-space: nowrap;
}
.spark-merged-legend .spark-legend-swatch {
  width: 10px;
}
.spark-merged-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
.spark-merged-block .spark-dual-label {
  text-align: left;
}
.spark-legend {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 9px;
  color: #666;
  font-family: monospace;
  line-height: 1;
}
.spark-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.spark-legend-swatch {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}
.spark-legend-swatch.dashed {
  height: 0;
  border-top: 2px dashed;
  background: none;
}
.spark-popover-merged .spark-legend {
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px 14px;
}
.trend-cell[rowspan] { vertical-align: middle; }
.pct-chart {
  font-family: monospace;
  padding: 2px 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
}
.pct-chart-mini { font-size: 10px; min-width: 0; }
.pct-chart-large { font-size: 11px; padding: 10px 12px; min-width: 280px; }
.pct-row {
  display: grid;
  grid-template-columns: 22px minmax(48px, 1fr) auto;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}
.pct-chart-mini .pct-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; }
.pct-row + .pct-row { margin-top: 5px; }
.pct-label, .pct-val { color: #475569; }
.pct-val { text-align: right; white-space: nowrap; }
.pct-bar-track { display: block; height: 8px; }
.pct-chart-large .pct-bar-track { height: 10px; }
.pct-bar { display: block; height: 100%; background: #67768e; }
.memory-run-trend-footer {
  margin-top: 8px;
  font-size: 10px;
  color: #666;
  font-family: monospace;
}
.pct-footer { margin-top: 8px; font-size: 10px; color: #64748b; text-align: center; }

#changelog { margin: 28px 0; }
#changelog h2 { font-size: 14px; margin: 0 0 8px; }
.changelog-list { font-size: 12px; color: #444; line-height: 1.5; max-width: 60em; padding-left: 18px; margin: 0; }
.changelog-list li { margin-bottom: 4px; }
