/* Max Flow visualizer styles
 * Doubles as the base stylesheet for the whole algorithm-visualization suite —
 * fenwick.css, segment-tree.css, dfs-bfs.css and convex-hull.css all extend
 * the variables and component classes defined here.
 */
:root {
  --bg: oklch(0.98 0.008 80);
  --surface: oklch(0.995 0.005 80);
  --surface-2: oklch(0.96 0.008 80);
  --ink: oklch(0.22 0.02 80);
  --ink-soft: oklch(0.42 0.015 80);
  --muted: oklch(0.6 0.015 80);
  --line: oklch(0.86 0.012 80);
  --line-strong: oklch(0.78 0.015 80);
  --accent: oklch(0.62 0.16 50);
  --accent-soft: oklch(0.93 0.06 60);
  --accent-deep: oklch(0.45 0.16 45);
  --cool: oklch(0.55 0.12 245);
  --cool-soft: oklch(0.93 0.04 240);
  --good: oklch(0.58 0.13 145);
  --good-soft: oklch(0.94 0.05 145);
  --warn: oklch(0.7 0.14 80);
  --shadow: 0 1px 0 oklch(0.92 0.01 80), 0 8px 30px -15px oklch(0.4 0.05 80 / 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'system-ui', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
}

button {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--ink-soft);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
button.primary:hover:not(:disabled) { background: oklch(0.32 0.02 80); }
button.accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button.accent:hover:not(:disabled) { background: var(--accent-deep); }
button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  padding: 4px 8px;
}
button.ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}

input[type="number"], input[type="text"], select {
  font-family: 'system-ui', monospace;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 5px;
  width: 100%;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: -1px;
  border-color: var(--accent);
}

.app {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 38px);
}

.canvas-wrap {
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, oklch(0.85 0.01 80) 1px, transparent 1px) 0 0/24px 24px,
    var(--bg);
  overflow: hidden;
}
.canvas-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.canvas-wrap.running svg { cursor: default; }

.canvas-hint {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 360px;
  box-shadow: var(--shadow);
}
.canvas-hint b { color: var(--ink); font-weight: 600; }
.canvas-hint kbd {
  font-family: 'system-ui', monospace;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
}

.flow-readout {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  text-align: right;
  min-width: 140px;
}
.flow-readout .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.flow-readout .value {
  font-family: 'system-ui', monospace;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.flow-readout .value .delta {
  color: var(--accent);
  font-size: 18px;
  margin-left: 6px;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 38px);
  overflow: hidden;
}

.sidebar header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.sidebar h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.sidebar .subtitle {
  font-size: 12px;
  color: var(--muted);
}

.sidebar-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.sidebar-section h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}
.sidebar-section .row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.sidebar-section .row:last-child { margin-bottom: 0; }
.sidebar-section .row label {
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 50px;
}

.scroll-region {
  flex: 1;
  overflow-y: auto;
}

.edge-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 60px 22px;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
  font-family: 'system-ui', monospace;
  font-size: 12px;
}
.edge-row .arrow { text-align: center; color: var(--muted); }
.edge-row select { padding: 3px 6px; font-size: 12px; }
.edge-row input { padding: 3px 6px; font-size: 12px; text-align: right; }
.edge-row .del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  font-size: 14px;
  border-radius: 4px;
}
.edge-row .del:hover { color: oklch(0.55 0.18 30); background: var(--surface-2); }

/* Step controls */
.step-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.step-controls button { flex: 1; padding: 8px; }
.step-controls .spacer { flex: 0; padding: 0 4px; color: var(--muted); font-family: 'system-ui', monospace; font-size: 12px; }

.step-explain {
  background: var(--accent-soft);
  border: 1px solid oklch(0.85 0.08 60);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: oklch(0.3 0.06 50);
  line-height: 1.5;
  height: 7.5em;
  overflow-y: auto;
}
.step-explain.error { background: oklch(0.95 0.05 25); border-color: oklch(0.8 0.1 25); color: oklch(0.4 0.12 25); }
.step-explain.done { background: var(--good-soft); border-color: oklch(0.78 0.1 145); color: oklch(0.32 0.1 145); }
.step-explain .kind {
  display: inline-block;
  font-family: 'system-ui', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface);
  border-radius: 3px;
  padding: 1px 6px;
  margin-bottom: 6px;
  color: oklch(0.45 0.1 50);
}

.log-list {
  font-family: 'system-ui', monospace;
  font-size: 11.5px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.log-list .line {
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-list .line:hover { background: var(--surface-2); }
.log-list .line.active { background: var(--accent-soft); color: oklch(0.3 0.08 50); font-weight: 500; }
.log-list .line .idx { color: var(--muted); margin-right: 8px; }

.preset-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.preset-row button { flex: 1; min-width: 0; }

/* SVG node + edge styles — colors/sizes driven by format-controls CSS vars */
.node circle {
  fill: var(--node-fill, var(--surface));
  stroke: var(--node-stroke, var(--ink));
  stroke-width: 1.5;
  transition: fill 0.18s, stroke 0.18s, stroke-width 0.18s;
}
.node text {
  font-family: var(--label-font, 'system-ui', monospace);
  font-size: var(--node-font-size, 14px);
  font-weight: var(--node-font-weight, 600);
  fill: var(--node-text-color, var(--ink));
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}
.node.source circle { stroke: var(--good); stroke-width: 2.5; }
.node.sink circle { stroke: var(--accent-deep); stroke-width: 2.5; }
.node.selected circle { stroke: var(--cool); stroke-width: 3; }
.node.visited circle { fill: var(--cool-soft); stroke: var(--cool); }
.node.current circle { fill: var(--cool); stroke: var(--cool); }
.node.current text { fill: white; }
.node.on-path circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.node:hover circle { stroke-width: 2.5; }
.node { cursor: grab; }
.node:active { cursor: grabbing; }

.node-badge {
  font-family: var(--label-font, 'system-ui', monospace);
  font-size: 9px;
  fill: var(--muted);
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.edge .line {
  stroke: var(--edge-color, var(--line-strong));
  stroke-width: var(--edge-width, 1.5);
  fill: none;
  transition: stroke 0.18s, stroke-width 0.18s;
}
.edge .hit { stroke: transparent; stroke-width: 14; fill: none; cursor: pointer; }
.edge.discovered .line { stroke: var(--cool); stroke-width: calc(var(--edge-width, 1.5) + 0.5px); }
.edge.on-path .line { stroke: var(--accent); stroke-width: var(--edge-width-active, 3px); }
.edge.saturated .line { stroke: var(--accent-deep); }
.edge.has-flow .line { stroke: var(--edge-flow-color, var(--accent)); }

/* Min-cut overlay (max-flow terminal step) */
.node.cut-s circle { fill: var(--good-soft); stroke: var(--good); stroke-width: 2.5; }
.node.cut-t circle { fill: oklch(0.93 0.06 25); stroke: oklch(0.6 0.2 25); stroke-width: 2.5; }
.edge.cut-edge .line { stroke: oklch(0.55 0.2 25); stroke-width: 4; stroke-dasharray: 3 3; }
.edge.cut-edge .edge-label-bg { fill: oklch(0.95 0.06 25); }

.edge-label {
  font-family: var(--label-font, 'system-ui', monospace);
  font-size: var(--label-font-size, 11.5px);
  font-weight: 500;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
  user-select: none;
  pointer-events: none;
}
.edge-label-bg {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1;
  rx: 4;
}
.edge.has-flow .edge-label { fill: var(--accent-deep); }
.edge.on-path .edge-label { fill: var(--accent-deep); font-weight: 600; }

/* Speed slider */
.speed-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-soft);
}
.speed-row input[type="range"] { flex: 1; }

.empty-msg {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* Paste-graph textarea */
.graph-text {
  width: 100%;
  font-family: 'system-ui', monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 92px;
  box-sizing: border-box;
}
.graph-text:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: -1px;
  border-color: var(--accent);
}
.graph-text-error {
  margin-top: 6px;
  font-size: 11.5px;
  color: oklch(0.45 0.14 25);
  background: oklch(0.97 0.04 25);
  border: 1px solid oklch(0.85 0.08 25);
  border-radius: 4px;
  padding: 4px 8px;
}

/* Formatting panel */
.fmt-block { display: flex; flex-direction: column; gap: 6px; }
.fmt-group-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 2px;
}
.fmt-group-title:first-child { margin-top: 0; }
.fmt-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  align-items: center;
}
.fmt-label {
  font-size: 11.5px;
  color: var(--ink-soft);
}
.fmt-control input[type="number"],
.fmt-control input[type="text"] {
  font-size: 11.5px;
  padding: 3px 6px;
  width: 100%;
}
.fmt-color {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 6px;
  align-items: center;
}
.fmt-color input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}
.fmt-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.fmt-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }
.fmt-color input[type="text"] {
  font-family: 'system-ui', monospace;
  font-size: 11px;
}
.fmt-hint {
  grid-column: 2;
  font-size: 10.5px;
  color: var(--muted);
}

/* Overview / about */
.overview {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.overview p { margin: 0 0 8px; }
.overview p:last-child { margin-bottom: 0; }
.overview b { color: var(--ink); font-weight: 600; }
.overview .term {
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 0 4px;
  color: oklch(0.32 0.1 50);
  font-weight: 500;
}
.overview .term-cool {
  background: var(--cool-soft);
  border-radius: 3px;
  padding: 0 4px;
  color: oklch(0.35 0.1 245);
  font-weight: 500;
}

details.overview-details > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  user-select: none;
  list-style: none;
}
details.overview-details > summary::-webkit-details-marker { display: none; }
details.overview-details > summary::before {
  content: '▸';
  display: inline-block;
  width: 14px;
  transition: transform 0.15s;
}
details.overview-details[open] > summary::before { transform: rotate(90deg); }

/* Pseudocode */
.pseudocode {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 0;
  font-family: 'system-ui', monospace;
  font-size: 11px;
  line-height: 1.65;
  color: var(--ink-soft);
  overflow-x: auto;
}
.pseudocode .pline {
  padding: 1px 12px 1px 8px;
  display: block;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.pseudocode .pline.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: oklch(0.3 0.08 50);
  font-weight: 500;
}
.pseudocode .pline .num {
  color: var(--muted);
  margin-right: 10px;
  display: inline-block;
  width: 14px;
  text-align: right;
}
.pseudocode .pline.active .num { color: var(--accent-deep); }
.pseudocode .kw { color: oklch(0.45 0.14 280); font-weight: 500; }

/* Phase pill */
.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'system-ui', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 3px 10px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.phase-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.phase-pill.search { color: oklch(0.35 0.1 245); border-color: var(--cool); }
.phase-pill.search .dot { background: var(--cool); }
.phase-pill.augment { color: oklch(0.35 0.12 50); border-color: var(--accent); }
.phase-pill.augment .dot { background: var(--accent); }
.phase-pill.done { color: oklch(0.35 0.1 145); border-color: var(--good); }
.phase-pill.done .dot { background: var(--good); }
.phase-pill.init .dot { background: var(--ink); }

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  vertical-align: middle;
  margin-right: 6px;
}
.legend .sw-source { border-color: var(--good); background: var(--surface); }
.legend .sw-sink { border-color: var(--accent-deep); background: var(--surface); }
.legend .sw-visited { background: var(--cool-soft); border-color: var(--cool); }
.legend .sw-current { background: var(--cool); border-color: var(--cool); }
.legend .sw-path { background: var(--accent-soft); border-color: var(--accent); }
.legend .sw-edge-flow { width: 16px; height: 3px; background: var(--accent); border-radius: 2px; border: none; }
.legend .sw-edge-path { width: 16px; height: 3px; background: var(--accent); border-radius: 2px; border: none; box-shadow: 0 0 0 1px var(--accent-deep); }
.legend .sw-edge-discovered { width: 16px; height: 3px; background: var(--cool); border-radius: 2px; border: none; }

/* ---------- Shared topic navigation: fixed top bar across every page ---------- */
.topic-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 38px;
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  margin: 0;
  padding: 4px 14px;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 oklch(0.92 0.01 80);
  overflow-x: auto;
  overflow-y: hidden;
}
.topic-nav::-webkit-scrollbar { height: 4px; }
.topic-nav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
.topic-nav::before {
  content: ''; display: none;
  font-family: 'system-ui', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}
.topic-pill {
  font-family: 'system-ui', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 10px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.topic-pill:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.topic-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.nav-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--line-strong);
  margin: 0 5px;
  flex-shrink: 0;
  align-self: center;
}
/* Make all pages leave room for the fixed bar */
html, body { padding-top: 38px; }
.app, .suite-page, .fenwick-page, .hull-page, .traversal-page, .segtree-page {
  height: calc(100vh - 38px);
}
.sidebar { height: calc(100vh - 38px); }
.canvas-wrap { height: 100%; }

/* ---------- Shared inline step-bar (replaces sidebar Controls section) ---------- */
.step-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'system-ui', monospace;
  font-size: 12px;
  margin-left: auto;
  min-width: fit-content;
}
.step-bar.disabled { opacity: 0.55; }
.step-bar button {
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px;
  font-family: inherit;
}
.step-bar button:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--ink-soft);
}
.step-bar button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.step-bar button.play {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  min-width: 70px;
  justify-content: center;
  text-align: center;
}
.step-bar button.play:hover:not(:disabled) {
  background: oklch(0.32 0.02 80);
}
.step-bar button.reset {
  color: var(--muted);
}
.step-bar .counter {
  color: var(--muted);
  font-size: 11px;
  padding: 0 6px;
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
}
.step-bar .speed {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 8px;
  margin-left: 4px;
}
.step-bar .speed input[type="range"] {
  width: 70px;
  cursor: pointer;
}
.step-bar .empty-msg {
  font-style: italic;
  color: var(--muted);
  margin-left: 8px;
  padding: 0 4px;
  font-family: 'system-ui', sans-serif;
}

/* Generic 2-column shell page used by segment-tree, dfs-bfs, orientation */
.suite-page {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 38px);   /* leave room for the fixed 38px top nav, else bottom content (op bars) falls off-screen */
}

/* ---------- Shared chip rows (used by every page that picks an algorithm or op) ---------- */
.algo-chip-row {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  flex-wrap: wrap;
}
.algo-chip {
  font-family: 'system-ui', sans-serif;
  font-size: 11.5px;
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-soft);
  white-space: nowrap;
  flex: 1 1 auto;
}
.algo-chip.active {
  background: var(--ink);
  color: var(--bg);
}
.algo-chip:hover:not(:disabled):not(.active) {
  background: var(--surface);
}
.algo-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Directed / undirected toggle (shared) */
.dir-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
}
.dir-toggle button {
  font-family: 'system-ui', sans-serif;
  font-size: 11px;
  background: transparent;
  border: none;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-soft);
}
.dir-toggle button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}

/* Compare-with link used between Fenwick / Segment tree */
.compare-link {
  font-size: 11px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 4px 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.compare-link:hover { color: var(--ink); border-color: var(--ink-soft); }
.suite-stage {
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, oklch(0.85 0.01 80) 1px, transparent 1px) 0 0/24px 24px,
    var(--bg);
  overflow: auto;
}
.suite-stage.scroll {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.suite-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.suite-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.cross-readout {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'system-ui', monospace;
  font-size: 12px;
  color: var(--ink-soft);
}
.cross-readout .val { font-size: 16px; font-weight: 600; }
.cross-readout .val.pos { color: oklch(0.55 0.18 30); }
.cross-readout .val.neg { color: var(--good); }
.cross-readout .val.zero { color: var(--muted); }
.row-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.complexity-note {
  font-family: 'system-ui', monospace;
  font-size: 11px;
  color: var(--good);
  background: var(--good-soft);
  border: 1px solid oklch(0.78 0.08 145);
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-block;
}
