@charset "UTF-8";
/* ==========================================================================
   AutoArguments Viewer — design system
   --------------------------------------------------------------------------
   Restrained editorial dark theme. Flat neutral surfaces separated by hairline
   borders and subtle elevation (no gradients). One interactive accent (coral)
   drives every hover/focus/link; the per-side data colors (A = coral, B = blue)
   and the verdict color (gold) are reserved for meaning, never decoration.
   ========================================================================== */
:root {
  /* Modernist neutral ground — flat warm-grey, not blue-black "cyber" depth.
     The identity is carried by the primary triad, not by mood or glow. */
  --bg: #1a1917;
  --surface: #222120;
  --surface-2: #2b2927;
  --well: #131211; /* inset reading wells: generated argument text */
  --border: rgba(255, 255, 255, 0.11);
  --border-2: rgba(255, 255, 255, 0.18);
  --text: #f8f7f5;
  --text-2: #c4c0b9;
  --text-3: #6f6a63;
  /* Bauhaus primary triad, each bound to one meaning:
     red = interactive accent / Side A, blue = Side B, yellow = verdict. */
  --accent: #ec4a2e;
  --accent-strong: #f4623f;
  --accent-weak: rgba(236, 74, 46, 0.16);
  --accent-line: rgba(236, 74, 46, 0.85);
  --blue: #4f80e6;
  --blue-weak: rgba(79, 128, 230, 0.18);
  --blue-line: rgba(79, 128, 230, 0.9);
  --gold: #edc134;
  --gold-weak: rgba(237, 193, 52, 0.16);
  --gold-line: rgba(237, 193, 52, 0.9);
  --green: #6fae6a;
  --green-weak: rgba(111, 174, 106, 0.16);
  /* Crisp, rectilinear — neither soft-luxury (14px) nor neo-brutal (0px). */
  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius: 3px;
  --radius-pill: 999px;
  /* Flat: panels read through tone + border, not drop shadows. */
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.4);
  --t-fast: 120ms ease;
  --t: 160ms ease;
  --content-max: 1280px;
  --gutter: 1.25rem;
  --app-bar-h: 60px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

pre {
  margin: 0;
  font: inherit;
}

::selection {
  background: rgba(236, 74, 46, 0.3);
}

/* A single, consistent keyboard-focus treatment for every interactive element. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.run-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   App shell + top bar
   ========================================================================== */
.app-shell {
  min-height: 100vh;
}

/* Slim, persistent brand bar — the consistent route home from any page.
   Full-bleed border with the content aligned to the same gutter as the shells. */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: var(--app-bar-h);
  border-bottom: 1px solid var(--border);
  background: #161413;
  padding-inline: max(var(--gutter), (100% - var(--content-max)) / 2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}

.brand:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* The mark encodes the two debate sides: a coral bar and a blue bar. */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: 26px;
  height: 26px;
  justify-content: center;
  border-radius: 2px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.brand-bar {
  width: 4px;
  height: 13px;
  border-radius: 2px;
}

.brand-bar-a {
  background: var(--accent);
}

.brand-bar-b {
  background: var(--blue);
  height: 9px;
}

.brand-name {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Links to the other apps on this domain: the last thing in the bar, drawn as
   a ghost button so the accent stays reserved for the one primary action. */
.related-sites {
  position: relative;
  display: inline-flex;
  margin-left: auto;
}

.related-sites-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem 0.45rem 0.85rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
}

.related-sites-toggle:hover,
.related-sites-toggle.open {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--border-2);
}

.related-sites-caret {
  width: 0.75rem;
  height: 0.75rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-fast);
}

.related-sites-toggle.open .related-sites-caret {
  transform: rotate(180deg);
}

.related-sites-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.related-sites-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  min-width: 13rem;
  padding: 0.3rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-2), var(--shadow-lg);
}

.related-sites-scrim[hidden],
.related-sites-menu[hidden] {
  display: none;
}

.related-sites-link {
  padding: 0.55rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.related-sites-link:hover,
.related-sites-link:focus-visible {
  outline: none;
  border-left-color: var(--accent);
  background: var(--surface-2);
}

/* ==========================================================================
   Page shells + headers
   ========================================================================== */
.library-shell,
.detail-shell,
.not-found-shell {
  width: min(100% - 2 * var(--gutter), var(--content-max));
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

.page-head,
.run-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* What the person who ran this wrote for its readers, above the verdict. */
.run-note {
  margin: 0 0 2rem;
  /* The whole note is read, so it is as tall as it is. */
}
.run-note .run-note-label {
  display: block;
  color: var(--gold);
}
.run-note .run-note-text {
  margin-bottom: 0.7rem;
  border-left: 2px solid var(--gold-line);
  background: var(--gold-weak);
}
.run-note .artifact-text {
  max-height: none;
  padding: 0.9rem 1.1rem;
}
.run-note .run-note-draft {
  display: block;
  width: 100%;
  min-height: 9rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
.run-note .run-note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* Under a side's panel: where its very short argument is pasted in. */
.side-summary-edit {
  margin: 0.6rem 0;
}
.side-summary-edit .run-note-draft {
  display: block;
  width: 100%;
  min-height: 11rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
.side-summary-edit .run-note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* A text as stored, with its source tags, for copying. */
.source-tag-text {
  margin: 0.5rem 0;
  font-size: 0.8rem;
}
.source-tag-text > summary {
  cursor: pointer;
  color: var(--muted);
}
.source-tag-text > .ghost-button {
  margin: 0.5rem 0;
}
.source-tag-text > pre {
  max-height: 22rem;
  overflow: auto;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
}

/* A run that stopped before the end, and the button that continues it. */
.resume-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: -1rem 0 2rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: var(--gold-weak);
}
.resume-bar > span {
  flex: 1 1 20rem;
}
.resume-bar .panel-error {
  flex-basis: 100%;
  margin: 0;
}

.page-head h1,
.run-head h1,
.panel-head h2,
.not-found-shell h1 {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head h1 {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1.02;
}

.run-head h1 {
  max-width: 60ch;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-sub {
  margin: 0.7rem 0 0;
  color: var(--text-2);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

/* A heading over a strip of its own, sharing the library's hairline rule. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Buttons + ghost links
   ========================================================================== */
.ghost-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.95rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.ghost-link:hover,
.ghost-button:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--border-2);
}

.ghost-link:active,
.ghost-button:active {
  transform: translateY(1px);
}

.back-link {
  margin-bottom: 1.5rem;
  color: var(--text-2);
}

.back-link:hover {
  color: var(--text);
}

/* ==========================================================================
   Surfaces — cards + panels (flat, hairline border, subtle elevation)
   ========================================================================== */
.run-card,
.side-panel,
.evaluation-panel,
.situation-panel,
.ancillary-panel,
.metadata-panel,
.empty-panel,
.not-found-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---- Run library grid + card -------------------------------------------

   Every run in one flow, left to right and then top to bottom, at a density
   that puts a screenful of them in view at once. Each card names its own
   question — reruns of one question come back adjacent from the API, so they
   land next to each other in the flow without needing a heading of their own,
   and only then does the run's directory name appear to tell them apart. */
.run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.7rem;
}

.run-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem 0.95rem;
  transition: border-color var(--t), background var(--t);
}

.run-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

/* The question on the left, what the run read on the right. The title block keeps the
   column it had; the head is the row that holds the two apart. */
.run-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

/* Local only: whether the public site shows a run, its place there, and moving it. */
.deploy-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.2rem;
}

.deploy-toggle,
.deploy-move {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.deploy-move {
  padding: 0.2rem 0.35rem;
  font-size: 0.6rem;
}

.deploy-toggle:hover,
.deploy-move:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.deploy-toggle.is-on {
  border-color: var(--gold-line);
  background: var(--gold-weak);
  color: var(--gold);
  font-weight: 700;
}

.library-deploy-note {
  margin-left: auto;
  font-size: 0.78rem;
}

.run-card-title {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

/* The question, in full. */
.run-card h3 {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.run-card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.run-name {
  color: var(--text-3);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- Status pills ------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.6rem 0.3rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--border);
}

.status-pill::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 0;
  background: currentColor;
}

/* The library card's pill sits inline with the run name rather than owning a
   line, so it shrinks to that line's weight. */
.status-pill-sm {
  gap: 0.3rem;
  padding: 0.1rem 0.4rem 0.1rem 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.status-pill-sm::before {
  width: 0.34rem;
  height: 0.34rem;
}

.status-good {
  color: var(--green);
  background: var(--green-weak);
}

.status-warn {
  color: var(--gold);
  background: var(--gold-weak);
}

.status-muted {
  color: var(--blue);
  background: var(--blue-weak);
}

/* ---- The two theses on a card, each with the evaluation's percentage. --- */
.thesis-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.9rem;
}

.thesis-row {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
}

.thesis-prob {
  flex: 0 0 3.4rem;
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-3);
  letter-spacing: -0.01em;
}

.thesis-row.side-a .thesis-prob {
  color: var(--accent);
}

.thesis-row.side-b .thesis-prob {
  color: var(--blue);
}

.thesis-text {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* On a library card the theses are a glance, not a read: the run's own page has
   them in full. Tightened and clamped to two lines, so every card in a row ends
   at the same height and the grid stays scannable. */
.run-card .thesis-list {
  gap: 0.45rem;
}

.run-card .thesis-row {
  gap: 0.55rem;
}

.run-card .thesis-prob {
  flex-basis: 2.5rem;
  font-size: 1rem;
}

.run-card .thesis-text {
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ==========================================================================
   Verdict bar — one colored segment per side, sized by probability. The gap
   between segments is the residual the evaluation left outside both theses.
   ========================================================================== */
/* Verdict reads as a hard-edged Bauhaus proportion block, not a soft pill. */
.verdict-bar {
  display: flex;
  justify-content: space-between;
  height: 8px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--border);
}

.verdict-segment {
  border-radius: 0;
}

.verdict-segment.side-a {
  background: var(--accent);
}

.verdict-segment.side-b {
  background: var(--blue);
}

.run-card .verdict-bar {
  height: 5px;
}

.verdict-bar-large {
  height: 12px;
}

/* Detail-page headline verdict: percentages lead, theses read as supporting. */
.verdict-strip {
  margin-bottom: 2.25rem;
}

.verdict-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 0.7rem;
}

.verdict-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.4;
}

.verdict-label.side-b {
  text-align: right;
}

.verdict-label strong {
  font-size: 1.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.verdict-label.side-a strong {
  color: var(--accent);
}

.verdict-label.side-b strong {
  color: var(--blue);
}

/* ==========================================================================
   Async + empty states
   ========================================================================== */
.empty-panel {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-2);
}

.empty-title {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.empty-hint {
  margin: 0;
  color: var(--text-3);
  font-size: 0.92rem;
}

.panel-error {
  margin: 0;
  color: var(--accent-strong);
}

.spinner {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.empty-inline {
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--border);
}

.empty-inline p {
  margin: 0;
}

/* ==========================================================================
   Detail page — section rhythm + panels
   ========================================================================== */
.full-case-section,
.side-grid,
.evaluation-panel,
.ancillary-panel,
.metadata-panel {
  margin-top: 2.5rem;
}

/* Sits directly under the evaluation as its companion, so it tucks closer. */
.situation-panel {
  margin-top: 1.25rem;
}

.side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

/* Nested grid inside the full-case section keeps the same column rhythm. */
.full-case-section .side-grid {
  margin-top: 0;
}

.side-panel,
.evaluation-panel,
.situation-panel,
.ancillary-panel,
.metadata-panel {
  padding: 1.5rem;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.panel-head h2 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.16;
}

/* Which step wrote the essay below, so a restarted run's short opening case
   is not mistaken for a finished one. */
.essay-step {
  margin: -0.15rem 0 0;
  color: var(--text-2);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* Per-side accent so each column reads as one side's case at a glance. */
.side-panel {
  border-top: 4px solid transparent;
}

.side-panel.side-a {
  border-top-color: var(--accent-line);
}

.side-panel.side-b {
  border-top-color: var(--blue-line);
}

.side-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.side-eyebrow {
  margin: 0;
}

.side-panel.side-b .side-eyebrow {
  color: var(--blue);
}

.side-prob {
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.side-panel.side-a .side-prob {
  color: var(--accent);
}

.side-panel.side-b .side-prob {
  color: var(--blue);
}

.side-panel h3 {
  margin: 0 0 0.8rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The evaluation leads the page as the headline result, so give it the gold
   verdict accent that the verdict bar and percentages share. */
.evaluation-panel {
  border-top: 4px solid var(--gold-line);
}

.eval-eyebrow {
  color: var(--gold);
}

/* Ancillary working outputs: one column of collapsed phases per side. */
.ancillary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.ancillary-panel .panel-head {
  grid-column: 1/-1;
  margin-bottom: 0;
}

/* ==========================================================================
   Artifact wells — the generated debate text rendered as clean prose
   ========================================================================== */
.artifact-block {
  border-radius: var(--radius-sm);
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--border);
}

.artifact-text {
  max-height: 760px;
  overflow: auto;
  padding: 1.15rem 1.3rem;
  color: #efe8dd;
  font-family: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.artifact-text::-webkit-scrollbar,
.rb-list::-webkit-scrollbar,
.metadata-panel pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.artifact-text::-webkit-scrollbar-thumb,
.rb-list::-webkit-scrollbar-thumb,
.metadata-panel pre::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background-clip: content-box;
  background-color: rgba(255, 255, 255, 0.16);
}

.artifact-text::-webkit-scrollbar-thumb:hover,
.rb-list::-webkit-scrollbar-thumb:hover,
.metadata-panel pre::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

/* ---- Structured rendering of the generated debate text ----------------- */
.md-p {
  margin: 0 0 1rem;
}

.artifact-text > :last-child {
  margin-bottom: 0;
}

.md-h {
  margin: 1.6rem 0 0.6rem;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.005em;
  color: var(--text);
}

.artifact-text > .md-h:first-child {
  margin-top: 0;
}

.md-h1 {
  font-size: 1.5rem;
}

.md-h2 {
  font-size: 1.28rem;
}

.md-h3 {
  font-size: 1.12rem;
}

.md-h4 {
  font-size: 0.82rem;
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.md-rule {
  height: 0;
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.md-li {
  display: flex;
  gap: 0.6rem;
  margin: 0.35rem 0;
  align-items: baseline;
}

.md-marker {
  flex: 0 0 auto;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.md-li-ordered .md-marker {
  min-width: 1.6rem;
  color: var(--accent);
  font-weight: 600;
}

.md-li-body {
  flex: 1;
  min-width: 0;
}

.md-label {
  margin: 0.7rem 0 1rem;
}

.md-label-key {
  margin-right: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}

.cycle-none {
  color: var(--text-3);
}

/* ---- Inline citations: small superscript numbers linking to the source -- */
.src-cite {
  margin-left: 0.1rem;
  color: var(--text-3);
  font-size: 0.7em;
  white-space: nowrap;
}

.src-link {
  padding: 0 0.08rem;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.src-link:hover {
  text-decoration: underline;
}

.src-missing {
  color: var(--text-3);
  cursor: default;
}

.src-sep {
  color: var(--text-3);
}

/* ---- Per-output sources list resolving each citation number ------------- */
.md-sources {
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.md-sources-title {
  margin: 0 0 0.7rem;
  color: var(--text-3);
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.md-sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
}

.md-source-item {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
}

.md-source-num {
  flex: 0 0 auto;
  min-width: 2rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.md-source-link {
  color: var(--blue);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.md-source-link:hover {
  text-decoration: underline;
}

.md-source-link.md-missing {
  color: var(--text-3);
}

/* ==========================================================================
   Collapsible phases (working outputs) + metadata
   ========================================================================== */
.phase-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.phase-item {
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow var(--t-fast);
}

.phase-item[open] {
  box-shadow: inset 0 0 0 1px var(--border-2);
}

.phase-item summary,
.situation-panel summary,
.metadata-panel summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 2.4rem 0.8rem 0.95rem;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  list-style: none;
}

.phase-item summary::-webkit-details-marker,
.situation-panel summary::-webkit-details-marker,
.metadata-panel summary::-webkit-details-marker {
  display: none;
}

/* Custom chevron affordance, pinned right, rotating open/closed. */
.phase-item summary::after,
.situation-panel summary::after,
.metadata-panel summary::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.35rem;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform var(--t);
}

.phase-item[open] summary::after,
.situation-panel[open] summary::after,
.metadata-panel[open] summary::after {
  transform: rotate(-135deg);
}

.phase-item summary:hover,
.situation-panel summary:hover,
.metadata-panel summary:hover {
  color: var(--accent-strong);
}

.phase-item .artifact-block {
  margin: 0 0.7rem 0.7rem;
}

/* Research base: one block per cited source with its snippets + significance. */
.rb-count {
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.82rem;
}

/* Scroll within a bounded height like the other artifact wells, instead of
   spilling the whole source list out when the panel opens. */
.rb-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 760px;
  overflow: auto;
  padding: 1.15rem 1.3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.rb-entry {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--border);
  /* Breathing room when an inline citation centers this entry in the window
     (the centering itself is done in open_in_research_base). */
  scroll-margin-block: 1rem;
}

/* Flash a research-base entry when an inline citation jumps to it
   (CITATIONS_OPEN_RESEARCH_BASE). Starts on the accent, settles to the base. */
.rb-entry.is-target {
  animation: rb-flash 1.8s ease;
}

@keyframes rb-flash {
  from {
    background: var(--accent-weak);
    box-shadow: inset 0 0 0 1px var(--accent-line);
  }
}
.rb-entry-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.rb-source-link {
  color: var(--blue);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rb-source-link:hover {
  text-decoration: underline;
}

.rb-excerpts-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  margin-bottom: 0.35rem;
}

.rb-snippets {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rb-snippet {
  color: var(--text-2);
  line-height: 1.5;
}

/* The situation: the evaluator's plain-facts orientation, collapsed until
   the reader asks for it. Summary styled like the panel headings around it. */
.situation-panel summary {
  padding: 0 2.4rem 0 0;
  font-size: 1.05rem;
}

.situation-panel .artifact-block {
  margin-top: 1.25rem;
}

/* Metadata: raw JSON in a monospace well. */
.metadata-panel summary {
  padding-left: 0;
  padding-top: 0;
}

.metadata-panel pre {
  max-height: 420px;
  overflow: auto;
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 1rem;
  color: var(--text-2);
  background: var(--well);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   404
   ========================================================================== */
.not-found-shell {
  min-height: 320px;
  margin-top: 2.25rem;
  padding: 2.5rem;
}

.not-found-shell h1 {
  margin-bottom: 1rem;
  font-size: 2.4rem;
}

.not-found-shell .ghost-link {
  margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .side-grid,
  .ancillary-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  :root {
    --gutter: 1rem;
  }
  .topic-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .library-shell,
  .detail-shell,
  .not-found-shell {
    padding-top: 1.5rem;
  }
  .page-head,
  .run-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .verdict-labels {
    gap: 1rem;
  }
  .verdict-label strong {
    font-size: 1.5rem;
  }
  .side-panel,
  .evaluation-panel,
  .situation-panel,
  .ancillary-panel,
  .metadata-panel {
    padding: 1.15rem;
  }
  .artifact-text {
    max-height: 620px;
    font-size: 1rem;
    padding: 1rem;
  }
  .rb-list {
    max-height: 620px;
    padding: 1rem;
  }
  .not-found-shell {
    padding: 1.5rem;
  }
}
/* Honor reduced-motion: keep state changes, drop movement + spin. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .run-card:hover {
    transform: none;
  }
}
/* ==========================================================================
   Control plane — starting runs and watching them happen
   --------------------------------------------------------------------------
   Only rendered on a local server that can start runs. The palette is the one
   above: the accent for the single primary action, gold for work in progress,
   green for a run that finished, and the per-side colors for whose line it is.
   ========================================================================== */
.app-bar {
  justify-content: space-between;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 1.5rem;
}

.nav-link {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* The local app's tools, under the site's own bar. It scrolls sideways rather than wrap
   when a phone is too narrow for it. */
.control-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem max(var(--gutter), (100% - var(--content-max)) / 2);
  white-space: nowrap;
}
.control-bar .ghost-link,
.control-bar .primary-button {
  flex: none;
  min-height: 2.1rem;
  padding-block: 0.35rem;
  font-size: 0.86rem;
}
.control-bar .primary-button {
  margin-left: auto;
}

.nav-narrow {
  display: none;
}

.control-bar-label {
  margin-right: 0.3rem;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* One primary action per view: start the run. Everything else stays a ghost
   button, so the accent keeps meaning "this is the thing to press". */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.05rem;
  color: #16110f;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--accent);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

/* ---- New-run form ------------------------------------------------------- */
.form-shell {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

.form-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.5rem;
}

.form-panel + .form-panel {
  margin-top: 1.5rem;
}

.panel-title {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.field {
  display: block;
}

.field + .field {
  margin-top: 1.25rem;
}

.field-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-label.side-a {
  color: var(--accent);
}

.field-label.side-b {
  color: var(--blue);
}

.field-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--well);
  transition: border-color var(--t-fast);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent-line);
}

.field-area {
  resize: vertical;
  line-height: 1.5;
}

.field-hint {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-3);
  font-size: 0.8rem;
  line-height: 1.5;
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.25rem;
  color: var(--text-2);
  font-size: 0.88rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ---- Topic list ---------------------------------------------------------
   Every topic on disk, run or not. A card is a reading surface rather than a
   link — there is no per-topic page — so it borrows the job row's frame and
   drops its hover. */
/* ---- The launch form ------------------------------------------------------
   Everything is on the page at once: panels in a two-column grid, the wide ones
   spanning it, and the start button pinned to the bottom of the window. */
.new-run-shell {
  width: min(100% - 2 * var(--gutter), 94rem);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

.nr-title {
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

.nr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.nr-grid:disabled {
  opacity: 0.7;
}

.nr-grid > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nr-panel, .sf-group {
  min-width: 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.nr-panel.is-full, .sf-group.is-full {
  grid-column: 1/-1;
}

.nr-panel h2, .sf-group-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.nr-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.nr-panel-note, .sf-group-note {
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 400;
}

.nr-segments {
  display: inline-flex;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.nr-segments label {
  padding: 0.3rem 0.9rem;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.nr-segments label.is-selected {
  color: #fff;
  background: var(--accent);
}

.nr-segments label:focus-within {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
}

.nr-segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nr-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.nr-thesis {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--well);
}

.nr-thesis p {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.nr-carry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin-top: 0.85rem;
}

.nr-carry .field-label {
  margin: 0;
}

.nr-warn {
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
}

/* One note: what it is and which steps read it on the left, its boxes on the right. */
.nr-note {
  display: grid;
  grid-template-columns: 31rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.nr-note-about {
  display: grid;
  gap: 0.45rem;
}

.nr-note-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.nr-note-label {
  flex: 0 0 4.2rem;
  color: var(--text-3);
  font-size: 0.72rem;
}

.nr-step {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}

.nr-step:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.nr-step.is-lit {
  border-color: var(--green);
  color: var(--text);
  background: var(--green-weak);
}

.nr-note-remove {
  padding: 0.1rem 0.5rem;
  line-height: 1.3;
}

.nr-note-add {
  justify-self: start;
  margin-top: 0.75rem;
}

.nr-preset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
}

.nr-preset-pick {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nr-preset-pick .field-label {
  margin: 0;
}

.nr-preset-pick .field-input {
  width: auto;
  min-width: 14rem;
}

.nr-preset .nr-panel-note {
  flex: 1;
}

.nr-launch {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

.nr-launch-topic {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.nr-launch .panel-error {
  margin: 0;
}

.nr-launch .primary-button {
  flex: none;
  min-width: 11rem;
}

/* A settings group: its fields flow into as many columns as fit. */
.sf-group-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.85rem;
}

.sf-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem 1rem;
  align-items: start;
}

.sf-group.is-full .sf-fields {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.sf-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sf-field.is-wide, .sf-field.is-check {
  grid-column: 1/-1;
}

.sf-fields .sf-field.is-check + .sf-field.is-check {
  margin-top: -0.4rem;
}

.sf-label {
  margin-bottom: 0.3rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.sf-field.is-changed .sf-label, .sf-field.is-changed .sf-check > span {
  color: var(--accent-strong);
}

.sf-help {
  margin-top: 0.3rem;
  color: var(--text-2);
  font-size: 0.76rem;
  line-height: 1.45;
}

.sf-field.is-check .sf-help {
  margin: 0.1rem 0 0 1.55rem;
}

.sf-field .field-input {
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.sf-model {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sf-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.sf-check input {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.sf-check.is-unavailable {
  opacity: 0.55;
  cursor: default;
}

.sf-paragraphs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.4rem 1rem;
}

.sf-paragraph > span {
  text-transform: capitalize;
}

@media (max-width: 900px) {
  .nr-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .nr-note {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
  }
  .nr-note-about {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .nr-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .nr-launch {
    flex-wrap: wrap;
  }
  .nr-launch .primary-button {
    width: 100%;
  }
}
.topic-filter {
  margin-bottom: 1.4rem;
}

.topic-list {
  display: grid;
  gap: 0.6rem;
}

.topic-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
}

.topic-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.topic-name {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* The name is what is scanned for; the theses under it are read only once the
   eye has stopped, so they sit at the card's supporting weight. */
.topic-card .thesis-list {
  gap: 0.5rem;
}

.topic-card .thesis-prob {
  flex: 0 0 1.1rem;
  font-size: 0.78rem;
  text-align: left;
}

.topic-card .thesis-text {
  font-size: 0.88rem;
}

/* ---- Job list ----------------------------------------------------------- */
.active-runs {
  margin-bottom: 2.4rem;
}

.job-list {
  display: grid;
  gap: 0.6rem;
}

.job-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  background: var(--surface);
  transition: border-color var(--t-fast), background var(--t-fast);
}

.job-row:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.job-row-main {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.job-row-side {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
}

/* On a phone the side goes under the name rather than past the edge. */
@media (max-width: 600px) {
  .job-row {
    flex-wrap: wrap;
  }
  .job-row-side {
    flex-wrap: wrap;
    flex-shrink: 1;
  }
}
.job-topic {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.job-step {
  color: var(--text-3);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-progress {
  margin: 0;
  color: var(--text-2);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* Sections of the in-progress page, and the heading row of a step's own page — a step
   is not a run, so it borrows the run header's shape but carries its state as a row
   of facts rather than as progress along an edge. */
.list-heading {
  margin: 2rem 0 0.9rem;
  color: var(--text-3);
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.step-head-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.step-started {
  color: var(--text-3);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* The run's own progress, drawn along the bottom edge of its row rather than as
   a separate element: the card is the run, so the run's extent is the card's. */
.progress-track {
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--accent-line);
  transition: width var(--t);
}

.status-live {
  color: var(--accent);
  background: var(--accent-weak);
}

.status-queued {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
}

.status-ok {
  color: var(--green);
  background: var(--green-weak);
}

.status-error {
  color: var(--accent);
  background: var(--accent-weak);
}

/* ---- One run, live ------------------------------------------------------ */
.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.job-head-main {
  min-width: 0;
}

.job-head-main h1 {
  margin: 0 0 1rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.job-head-side {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
  flex: 0 0 15rem;
}

.job-head-side .progress-track {
  position: static;
  width: 100%;
}

.job-head-side .job-step {
  max-width: 15rem;
}

/* ---- Timeline ----------------------------------------------------------- */
.log-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem 1.35rem 1.35rem;
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.log-head .panel-title {
  margin-bottom: 0;
}

.log-follow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-3);
  font-size: 0.82rem;
}

.log-body {
  max-height: 26rem;
  scroll-behavior: auto;
  margin-top: 1rem;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--well);
  font-size: 0.82rem;
  line-height: 1.65;
}

.log-line {
  display: flex;
  gap: 0.7rem;
  margin: 0;
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.log-time {
  flex: 0 0 auto;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.log-side {
  flex: 0 0 5.2rem;
  color: var(--text-3);
}

.log-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.log-step {
  margin-top: 0.5rem;
  color: var(--text);
  font-weight: 700;
}

.log-step .log-side {
  color: var(--gold);
}

.log-side-a .log-side {
  color: var(--accent);
}

.log-side-b .log-side {
  color: var(--blue);
}

.log-evaluation .log-side {
  color: var(--gold);
}

.live-run {
  margin-top: 2.4rem;
}

.live-run .detail-shell {
  width: 100%;
  padding: 0;
}

.live-run .back-link {
  display: none;
}

/* Inside a run being watched, the run's own head would repeat the job's — same title,
   same status — and its evaluation panel has nothing in it until the run reaches one. */
.live-run .run-head {
  display: none;
}

.live-run .evaluation-panel:has(.empty-inline) {
  display: none;
}

@media (max-width: 720px) {
  .job-head {
    flex-direction: column;
    gap: 1.25rem;
  }
  .job-head-side {
    justify-items: start;
    flex: 1 1 auto;
    width: 100%;
  }
  .app-nav {
    margin-left: 0.4rem;
  }
  .nav-link {
    padding-inline: 0.4rem;
    font-size: 0.84rem;
  }
  .nav-wide,
  .brand-name {
    display: none;
  }
  .nav-narrow {
    display: inline;
  }
}
@media (max-width: 480px) {
  .app-nav {
    margin-left: 0.2rem;
  }
  .nav-link {
    padding-inline: 0.3rem;
    font-size: 0.8rem;
  }
}
/* ---- The case, read as one document ------------------------------------
   Its opening, then each point with the answer to it and the defence of it,
   then its close — one block, one citation numbering, one sources list. The
   divisions are marked by their labels rather than by containers, so the case
   reads continuously the way it was written. */
/* A division of the case: its opening, a point, its close. Coloured by side and
   set apart from the text above it, because in a case this long these are what a
   reader navigates by. */
.thread-heading {
  margin: 1.8rem 0 0.5rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.artifact-text > .thread-heading:first-child {
  margin-top: 0;
}

.side-panel.side-a .thread-heading {
  color: var(--accent);
}

.side-panel.side-b .thread-heading {
  color: var(--blue);
}

/* A part of the argument over the point above it: quieter than the heading, since
   it belongs to that point rather than dividing the case. */
.thread-label {
  margin: 1.1rem 0 0.35rem;
  color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ---- Run detail: what a run was, beyond the case it produced ------------
   Four panels added below the case: the counts strip above it, and three
   collapsed <details> — the research base, the searches that filled it, and
   how the run was configured. All three are reference rather than reading, so
   they are shut until asked for and share one disclosure style. */
.sub-panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.sub-panel > summary {
  padding: 0.7rem 1rem;
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--t-fast);
}

.sub-panel > summary:hover {
  color: var(--text);
}

.sub-panel[open] > summary {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.sub-panel > *:not(summary) {
  padding-inline: 1rem;
}

.sub-panel > *:not(summary):last-child {
  padding-bottom: 1rem;
}

/* ---- Raw debug transcripts ---------------------------------------------
   A transcript is operational evidence rather than part of the argument, so it gets a
   denser browser: a narrow file list stays visible beside one scrollable raw reader. */
.debug-summary-count {
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.debug-intro {
  margin: 0.9rem 0 0;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.debug-browser {
  display: grid;
  grid-template-columns: minmax(14rem, 0.34fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.debug-file-list {
  min-width: 0;
  max-height: 85vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}

.debug-list-heading {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.debug-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 1rem;
}

.debug-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.debug-toggle {
  padding: 0.35rem 0.7rem;
  border-right: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast);
}

.debug-toggle:last-child {
  border-right: 0;
}

.debug-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.debug-toggle.is-on {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.debug-refresh {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.debug-group {
  border-bottom: 1px solid var(--border);
}

.debug-group > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--well);
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 1;
}

.debug-group-name {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.debug-group-count {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.debug-file-list ul {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--border);
}

.debug-file-row {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0.18rem;
  padding: 0.7rem 0.75rem;
  background: var(--surface);
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}

.debug-file-row:hover,
.debug-file-row.is-selected {
  background: var(--surface-2);
}

.debug-file-row.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.debug-file-row strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.debug-file-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.debug-file-side {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.debug-file-side.is-side-a {
  color: var(--accent);
}

.debug-file-side.is-side-b {
  color: var(--blue);
}

.debug-file-side.is-evaluation {
  color: var(--gold);
}

.debug-file-time,
.debug-file-size {
  color: var(--text-3);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.debug-file-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  color: var(--text-3);
  font-size: 0.7rem;
}

.debug-outcome {
  font-weight: 700;
}

.debug-outcome.is-open {
  color: var(--gold);
}

.debug-outcome.is-failed {
  color: var(--accent-strong);
}

.debug-file-name {
  color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.debug-reader {
  min-width: 0;
  max-height: 85vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}

.debug-reader-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.debug-reader-task {
  margin: 0 0 0.15rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.debug-reader-when {
  margin: 0 0 0.2rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.debug-reader-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.6rem;
}

.debug-reader-actions .debug-toggle {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.debug-fields {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.76rem;
}

.debug-fields dt {
  color: var(--text-3);
  font-weight: 600;
}

.debug-fields dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.debug-section,
.debug-part {
  border-bottom: 1px solid var(--border);
}

.debug-section > summary,
.debug-part > summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0.95rem;
  cursor: pointer;
}

.debug-section > summary {
  color: var(--text);
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.debug-part > summary {
  padding-left: 1.6rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.debug-part:last-child {
  border-bottom: 0;
}

.debug-sections .debug-content {
  max-height: 520px;
  border-top: 1px solid var(--border);
}

.debug-none {
  margin: 0;
  padding: 0.8rem 0.95rem;
  color: var(--text-3);
  font-size: 0.8rem;
}

.debug-reader-head code {
  color: var(--text-3);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.debug-content {
  max-height: 720px;
  overflow: auto;
  padding: 1rem;
  color: #e1ddd5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.debug-empty,
.debug-reader-empty {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: var(--well);
  font-size: 0.86rem;
}

.debug-empty .panel-error {
  margin: 0;
}

.debug-reader-empty {
  min-height: 12rem;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
}

.debug-reader-empty .panel-error {
  margin: 0;
}

@media (max-width: 760px) {
  .debug-browser {
    grid-template-columns: 1fr;
  }
  .debug-file-list,
  .debug-content {
    max-height: 520px;
  }
}
/* ---- The counts strip -------------------------------------------------- */
/* Flex rather than grid: the cell count varies with the run, and a grid's empty
   trailing tracks read as a hole in the strip when the row wraps. */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  margin: 0.9rem 0 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.stat-cell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 64px;
  padding: 0.6rem 0.55rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* The trailing cell of each row and of the strip carry no rule of their own; the
   container's border closes them off. */
.stat-cell:last-child {
  border-right: 0;
}

.stat-value {
  color: var(--text);
  font-size: 1.05rem;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-name {
  color: var(--text-3);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Research base ----------------------------------------------------- */
/* One flat list, however many rounds filled it: the base is a single accumulating
   thing, and the panel says so. It scrolls in place (max-height above) rather than
   spilling a hundred entries down the page. */
.rb-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.rb-id {
  flex: none;
  margin-left: auto;
  color: var(--text-3);
  font-size: 0.72rem;
}

.rb-quote {
  margin: 0 0 0.5rem;
  padding-left: 0.7rem;
  border-left: 2px solid var(--border-2);
  color: var(--text-2);
  font-size: 0.86rem;
}

.rb-says {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ---- Searches ---------------------------------------------------------- */
.query-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.query-row {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--border);
}

.query-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.query-step {
  flex: none;
  color: var(--text-3);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.query-text {
  flex: 1 1 16rem;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.query-yield {
  flex: none;
  color: var(--text-3);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.q-sources {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.q-source {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: 0.82rem;
}

.q-source a {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.q-source a:hover {
  color: var(--text);
}

.q-mark {
  flex: none;
  width: 1em;
  font-weight: 700;
  text-align: center;
}

/* Kept, read but unused, never loaded — the three fates of a search result. */
.q-source.is-used .q-mark {
  color: var(--green);
}

.q-source.is-unused .q-mark {
  color: var(--text-3);
}

.q-source.is-failed .q-mark {
  color: var(--accent);
}

.q-source.is-failed a {
  color: var(--text-3);
  text-decoration: line-through;
}

/* ---- How the run was built --------------------------------------------- */
.run-meta h4 {
  margin: 1rem 0 0.5rem;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta-facts {
  margin-top: 0.9rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.meta-fact strong {
  color: var(--text);
}

.meta-background p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.program-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--border);
  list-style: none;
  overflow: hidden;
}

.program-step {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.4rem 0.7rem;
  background: var(--surface);
}

.program-index {
  flex: none;
  min-width: 1.4em;
  color: var(--text-3);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.program-step code {
  color: var(--text);
  font-size: 0.82rem;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.4rem 1.6rem;
  margin-top: 0.4rem;
}

.spec-group h4 {
  margin-top: 0.9rem;
}

.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.spec-name {
  color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.spec-value {
  color: var(--text);
  overflow-wrap: anywhere;
  text-align: right;
}

/* A group whose values are lists, not single settings: it takes the full width and
   stacks name over value, because a long comma list right-aligned in a value column
   wraps into an unreadable ragged block. */
.spec-group.is-wide {
  grid-column: 1/-1;
}

.spec-group.is-wide .spec-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.spec-group.is-wide .spec-value {
  text-align: left;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---- Deleting parts of a run -------------------------------------------
   Destructive, so it reads as such: the row states what it holds, the button
   arms before it fires, and a part that cannot go yet says what is in its way
   rather than simply being dead. */
.reset-panel > summary {
  color: var(--accent);
}

.reset-intro,
.reset-hint {
  margin: 0.9rem 0 0;
  color: var(--text-2);
  font-size: 0.84rem;
  line-height: 1.55;
}

.reset-hint {
  padding-bottom: 1rem;
  color: var(--text-3);
}

.reset-hint strong {
  color: var(--text-2);
}

.reset-note {
  margin: 0.7rem 0 0;
  padding: 0.5rem 0.7rem;
  border-left: 2px solid var(--green);
  background: var(--green-weak);
  color: var(--text);
  font-size: 0.84rem;
}

.part-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0.9rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--border);
  list-style: none;
  overflow: hidden;
}

.part-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
}

/* A part the run never produced is dimmed rather than hidden: the list is also
   how you read what this run actually has. */
.part-row.is-absent {
  opacity: 0.45;
}

.part-row.is-ready .part-label {
  color: var(--text);
}

.part-text {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.part-label {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 700;
}

.part-detail {
  color: var(--text-3);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.part-hint {
  flex: 1 0 100%;
  margin: 0.15rem 0 0;
  color: var(--text-3);
  font-size: 0.78rem;
  line-height: 1.45;
}

.part-row.is-blocked .part-hint {
  color: var(--gold);
}

.part-action {
  flex: none;
}

.confirm-pair {
  display: flex;
  gap: 0.4rem;
}

.danger-button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background var(--t-fast), color var(--t-fast);
}

.danger-button:hover:not(:disabled) {
  background: var(--accent-weak);
}

.danger-button.is-confirm {
  background: var(--accent);
  color: #1a1917;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost-button {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
}

.ghost-button:hover {
  color: var(--text);
}

/* ---- Case history ------------------------------------------------------ */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.version-entry > summary {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.82rem;
}

.version-entry > summary:hover {
  color: var(--text);
}

.version-entry[open] > summary {
  color: var(--text);
}

.version-size {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---- The program as a timeline ----------------------------------------- */
.program-step {
  display: block;
  padding: 0.45rem 0.7rem;
}

.program-line {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.step-runs {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0.25rem 0 0 2.1rem;
}

.step-run {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.76rem;
}

.step-side {
  flex: none;
  width: 1.1em;
  font-weight: 700;
  text-transform: uppercase;
}

.step-side.side-a {
  color: var(--accent);
}

.step-side.side-b {
  color: var(--blue);
}

.step-when {
  flex: none;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.step-note {
  color: var(--text-2);
}

/* ---- Running a step by hand -------------------------------------------- */
.runner-panel > summary {
  color: var(--gold);
}

.action-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.action-tab {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  transition: background var(--t-fast), color var(--t-fast);
}

.action-tab:hover {
  color: var(--text);
}

.action-tab.is-on {
  border-color: var(--gold-line);
  background: var(--gold-weak);
  color: var(--gold);
  font-weight: 700;
}

/* A field that is one on/off answer rather than a list to pick from: the same tab styling
   as the action row above it, so an on toggle reads as on at a glance. */
.runner-toggle {
  align-self: start;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.runner-toggle:hover {
  color: var(--text);
}

.runner-toggle.is-on {
  border-color: var(--gold-line);
  background: var(--gold-weak);
  color: var(--gold);
  font-weight: 700;
}

/* "Summarize the verdict": what it reads, and its prompt to rewrite. */
.runner-summary {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.runner-summary-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.runner-prompt {
  width: 100%;
  min-height: 14rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  resize: vertical;
}

.runner-summary-note {
  margin: 0;
  color: var(--text-3);
  font-size: 0.78rem;
  line-height: 1.5;
}

.runner-summary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.action-about {
  margin: 0.6rem 0 0;
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.5;
}

.runner-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.runner-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.runner-field > span {
  color: var(--text-3);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.runner-field select,
.runner-field input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
}

/* A model box (components/model_choice.rs), on the run forms and the bench's run page:
   once "Search OpenRouter…" is picked, a search over OpenRouter's list under it. */
.model-choice {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.model-choice .field-error {
  color: var(--accent-strong);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.or-search {
  position: relative;
}
.or-search input {
  width: 100%;
}

/* On the step runner the model box takes what is left of its row, so the search results
   under it have room for a model's name. */
.runner-model {
  flex: 1 1 18rem;
}
.runner-model select {
  width: 100%;
}

.or-results {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.or-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.or-row:last-child {
  border-bottom: 0;
}
.or-row:hover, .or-row.hi {
  background: var(--accent-weak);
}
.or-row b {
  font-size: 0.9rem;
}
.or-row code {
  grid-column: 1;
  color: var(--text-3);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
.or-row .price {
  grid-row: 1/span 2;
  grid-column: 2;
  align-self: center;
  color: var(--text-2);
  font-size: 0.78rem;
  text-align: right;
  white-space: nowrap;
}

.or-note {
  padding: 0.6rem 0.8rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.runner-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
}

.primary-button {
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: #1a1917;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.runner-wait {
  color: var(--text-3);
  font-size: 0.78rem;
}

.runner-output {
  margin-top: 0.8rem;
}

/* A step a re-run executed again: what is shown is the latest pass. */
.step-again {
  flex: none;
  color: var(--gold);
  font-size: 0.7rem;
}

/* ---- Watching a hand-run step happen ------------------------------------
   One pane per side, because a step run on both sides runs them at once and a
   single column would interleave two conversations. Each pane holds what its
   calls were sent and the reply arriving into it. */
.trace-panes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.trace-pane {
  display: flex;
  flex: 1 1 22rem;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  overflow: hidden;
}

.trace-pane h4 {
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-pane.side-a h4 {
  color: var(--accent);
}

.trace-pane.side-b h4 {
  color: var(--blue);
}

/* Column-reverse keeps the newest text in view without scripting a scroll: the
   box sits at its own end until the reader scrolls back up it. */
.trace-scroll {
  display: flex;
  flex-direction: column-reverse;
  max-height: 420px;
  padding: 0.6rem 0.7rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.trace-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trace-call {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
}

.trace-line {
  margin: 0;
  color: var(--text-3);
  font-size: 0.76rem;
}

.trace-error {
  margin: 0.8rem 0 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.trace-think,
.trace-out,
.trace-context pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The reasoning channel and the answer, told apart the way the transcript tells
   them apart. */
.trace-think {
  color: var(--text-3);
}

.trace-out {
  color: var(--text);
}

.trace-context > summary {
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.74rem;
}

.trace-context > summary:hover {
  color: var(--text-2);
}

.trace-context pre {
  max-height: 320px;
  margin-top: 0.4rem;
  padding: 0.5rem 0.6rem;
  border-left: 2px solid var(--border-2);
  color: var(--text-2);
  overflow: auto;
}

/* The case written again at the end. Inside a disclosure panel, so it gets the
   panel's own padding rather than the well's inset. */
.revision-block {
  margin: 0.9rem 0 0;
  background: transparent;
  box-shadow: none;
}

.revision-block .artifact-text {
  padding: 0;
}

.spec-group {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* The bar does not wrap, so on the narrowest phones the brand gives up its mark
   and the menu button tightens to keep both on one line. */
@media (max-width: 380px) {
  .brand-mark {
    display: none;
  }
  .related-sites-toggle {
    padding-inline: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
}
/* ==========================================================================
   The bench — what every bench page shares: a reply and the judge's reading
   of it, and the small pieces those are made of. Side A is coral and Side B
   blue, as everywhere else; gold is the side a reply's own verdict took.
   Each page's own layout is in its partial, imported after this one.
   ========================================================================== */
:root {
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --neither: rgba(255, 255, 255, 0.07);
  --neither-line: rgba(255, 255, 255, 0.35);
}

.muted {
  color: var(--text-2);
}

.faint {
  color: var(--text-3);
}

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 0.78rem;
}

.grow {
  flex: 1;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.notice {
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--gold-weak);
  color: var(--text);
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-left: 3px solid var(--c, var(--text-3));
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.code-chip span {
  color: var(--text-2);
  font-weight: 500;
}

.bench-side {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: var(--radius);
  color: #141210;
  font-size: 0.7rem;
  font-weight: 800;
}
.bench-side.a {
  background: var(--accent);
}
.bench-side.b {
  background: var(--blue);
}
.bench-side.none {
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-3);
}

.bench-thesis {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
  margin: 0.2rem 0;
  color: var(--text-2);
  font-size: 0.84rem;
}
.bench-thesis.compact span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hc {
  color: var(--text-3);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.hc.n {
  color: var(--text-2);
}
.hc.toward {
  color: var(--gold);
}

.fair-chip {
  min-width: 2.2rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--c);
  border-radius: var(--radius);
  color: var(--c);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* --- A reply, as a row that opens ------------------------------------------ */
.bench-replies {
  margin: 0.8rem 0 1rem;
}

.bench-reply {
  margin-bottom: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-reply:hover {
  border-color: var(--border-2);
}
.bench-reply.open {
  border-color: var(--accent-line);
}
.bench-reply.open .chev {
  transform: rotate(90deg);
  color: var(--accent);
}

.bench-reply-head {
  display: flex;
  align-items: center;
}
.bench-reply-head > .bench-reply-row {
  flex: 1;
  min-width: 0;
}

.bench-reply-row {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 12rem) auto minmax(0, 1fr) auto 1.4rem;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.reply-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.reply-id b {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
}

.reply-conclusion,
.reply-summary {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-summary {
  color: var(--text-2);
}

.reply-codes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.chev {
  justify-self: end;
  color: var(--text-3);
  font-size: 1.3rem;
  transition: transform var(--t-fast);
}

/* --- The reply opened -------------------------------------------------------- */
.bench-reply-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  align-items: start;
  border-top: 1px solid var(--border);
}

.reply-main {
  min-width: 0;
  padding: 1.1rem 1.2rem;
}

.reply-side {
  min-width: 0;
  max-height: min(80vh, 52rem);
  overflow: auto;
  padding: 1.1rem;
  border-left: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.bench-block {
  margin-bottom: 1.1rem;
}
.bench-block > summary {
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.bench-asked {
  margin-top: 0.6rem;
}

.block-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
  color: var(--text-2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.block-label .faint, .block-label .status-pill {
  letter-spacing: 0;
  text-transform: none;
}

.key-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.key-swatch i {
  width: 12px;
  height: 8px;
}
.key-swatch i.sa {
  background: var(--accent-weak);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.key-swatch i.sb {
  background: var(--blue-weak);
  box-shadow: inset 0 -2px 0 var(--blue);
}
.key-swatch i.so {
  background: var(--neither);
  box-shadow: inset 0 -2px 0 var(--neither-line);
}

.bench-well {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.bench-well.sys {
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 0.4rem;
  color: var(--text-3);
  font-size: 0.82rem;
}
.bench-well.prompt {
  max-height: 30rem;
  overflow: auto;
  color: var(--text-2);
  font-size: 0.9rem;
}
.bench-well.response {
  max-height: min(70vh, 46rem);
  overflow: auto;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.07rem;
  line-height: 1.62;
}
.bench-well mark {
  border-radius: 1px;
  background: transparent;
  color: inherit;
}
.bench-well mark[data-all] {
  cursor: pointer;
}
.bench-well mark.sa {
  background: var(--accent-weak);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.bench-well mark.sb {
  background: var(--blue-weak);
  box-shadow: inset 0 -2px 0 var(--blue);
}
.bench-well mark.so {
  background: var(--neither);
  box-shadow: inset 0 -2px 0 var(--neither-line);
}
.bench-well mark.flash {
  outline: 2px solid var(--gold);
}

.side-block {
  margin-bottom: 1.3rem;
}

.side-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
  font-weight: 800;
}
.side-title .faint {
  font-weight: 500;
  font-size: 0.8rem;
}

.kv {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.25rem 0.7rem;
  margin: 0 0 0.8rem;
  font-size: 0.84rem;
}
.kv dt {
  color: var(--text-2);
}
.kv dd {
  margin: 0;
}

.why {
  color: var(--text-2);
  font-size: 0.8rem;
}

.why.defence {
  margin-top: 0.25rem;
}

.why.gold {
  color: var(--gold);
}

.bench-finding {
  margin-bottom: 0.45rem;
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--c, var(--accent));
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  cursor: pointer;
}
.bench-finding:hover {
  background: #33302d;
}
.bench-finding.plain {
  cursor: default;
}
.bench-finding.plain:hover {
  background: var(--surface-2);
}
.bench-finding.flash {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.bench-finding .f-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.bench-finding .f-head b {
  font-weight: 800;
}
.bench-finding .f-label {
  margin: 0.3rem 0 0.1rem;
  font-size: 0.86rem;
  font-weight: 700;
}
.bench-finding .sev {
  margin-left: auto;
  color: var(--text-3);
  font-size: 0.72rem;
  white-space: nowrap;
}
.bench-finding q {
  display: block;
  margin: 0.25rem 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 0.92rem;
  quotes: "“" "”";
}

.working {
  margin-top: 0.45rem;
  color: var(--text-2);
  font-size: 0.8rem;
}
.working summary {
  color: var(--text-3);
  cursor: pointer;
}
.working .pre {
  max-height: 22rem;
  overflow: auto;
  margin-top: 0.35rem;
  white-space: pre-wrap;
}

.checks h4 {
  margin: 0.7rem 0 0.3rem;
  color: var(--text-2);
  font-size: 0.78rem;
}
.checks ul {
  margin: 0;
  padding-left: 1rem;
}
.checks li {
  margin: 0.3rem 0;
}
.checks p {
  margin: 0.15rem 0 0;
}
.checks q {
  color: var(--text);
}

.chk {
  padding: 0 0.35rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.chk.ok {
  background: var(--surface-2);
  color: var(--text-3);
}
.chk.bad {
  background: var(--gold-weak);
  color: var(--gold);
}

/* The case page's panel of every model's evaluation. */
.bench-case {
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .bench-reply-body {
    grid-template-columns: 1fr;
  }
  .reply-side {
    border-top: 1px solid var(--border);
    border-left: 0;
    max-height: none;
  }
  .bench-reply-row {
    grid-template-columns: minmax(0, 1fr) auto auto 1.4rem;
  }
  .bench-reply-row .reply-summary,
  .bench-reply-row .reply-codes {
    display: none;
  }
}
/* ==========================================================================
   The two halves of the site in the top bar, and the open one's pages under
   it (lib.rs, SiteBars).
   ========================================================================== */
.section-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* A custom test's topic, way of failing and twin (bench_custom.rs). */
.cx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.cx-chips .tag-dim {
  border-color: var(--accent-line);
  color: var(--text);
}
.cx-chips .tag-pair {
  border-style: dashed;
}

/* ==========================================================================
   The failure map (/sophistry/map): tables of scores, each cell tinted by how
   good it is, scrolling sideways on a narrow screen rather than squeezing.
   ========================================================================== */
.bench-map {
  /* Every cell opens what made it, across the whole cell. */
}
.bench-map .map-section {
  margin-top: 2rem;
}
.bench-map .map-section h2 {
  margin-bottom: 0.3rem;
  font-size: 1.15rem;
}
.bench-map .map-section > .muted {
  max-width: 52rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.bench-map .map-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bench-map .map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.bench-map .map-table th, .bench-map .map-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.bench-map .map-table th {
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: help;
}
.bench-map .map-table .first {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  text-align: left;
  white-space: normal;
  min-width: 11rem;
}
.bench-map .map-table tbody tr:last-child td {
  border-bottom: none;
}
.bench-map .heat {
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--text);
  font-weight: 700;
}
.bench-map .heat.none {
  background: none;
  color: var(--text-3);
  font-weight: 400;
}
.bench-map .heat.pair {
  position: relative;
  font-weight: 500;
}
.bench-map .heat .pair-score {
  margin-left: 0.45rem;
  color: var(--c);
  font-weight: 800;
}
.bench-map .heat a {
  display: block;
  margin: -0.45rem -0.6rem;
  padding: 0.45rem 0.6rem;
  color: inherit;
  text-decoration: none;
}
.bench-map .heat a:hover {
  background: color-mix(in srgb, var(--c) 22%, transparent);
}
.bench-map .map-table th a, .bench-map .map-table .first a, .bench-map .map-fails a {
  color: inherit;
  text-decoration: none;
}
.bench-map .map-table th a:hover, .bench-map .map-table .first a:hover, .bench-map .map-fails a:hover {
  color: var(--accent-strong);
}
.bench-map .map-fails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}
.bench-map .map-fails {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-map .map-fails h3 {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}
.bench-map .map-fails ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.86rem;
  line-height: 1.6;
}

/* The bar's link back to a bench job (local only), gold while one runs. */
.control-bar .jobs-link.busy {
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}

/* ==========================================================================
   What the leaderboard (/sophistry), the pages its scores open and the judging
   page share: the form controls, the filters, the panels and the pickers,
   under .bench-board. The leaderboard's own tables are bench-pages.scss's.
   ========================================================================== */
.bench-board .page-head {
  flex-wrap: wrap;
  align-items: flex-end;
}
.bench-board .board-lede {
  max-width: 50rem;
  font-size: 0.95rem;
  line-height: 1.55;
  font-variant-numeric: normal;
}
.bench-board select,
.bench-board input[type=search] {
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  outline: none;
  background: var(--well);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.bench-board select:focus {
  border-color: var(--accent-line);
}
.bench-board input[type=checkbox] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}
.bench-board .field-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}
.bench-board .check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-2);
  font-size: 0.86rem;
  cursor: pointer;
}
.bench-board .check:hover {
  color: var(--text);
}
.bench-board .small-button {
  min-height: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}
.bench-board .small-link {
  min-height: 0;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
}
.bench-board .link-button {
  padding: 0;
  background: none;
  color: var(--text-3);
  font-size: 0.76rem;
  text-align: left;
}
.bench-board .link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}
.bench-board .link-button.armed {
  color: var(--gold);
  font-weight: 700;
}

/* --- The head's filters ------------------------------------------------------ */
.board-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  max-width: 100%;
}
.board-filters select {
  max-width: 16rem;
}

/* --- Notices ------------------------------------------------------------------ */
.board-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}
.board-banner select {
  max-width: 18rem;
}

/* --- Panels ------------------------------------------------------------------ */
.board-panel {
  margin-bottom: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.board-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.board-panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.board-panel-head > .faint {
  font-size: 0.8rem;
}

/* --- Pickers: what to show, and what counts ---------------------------------- */
.rank-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1.2rem 0.9rem;
  color: var(--text-2);
  font-size: 0.84rem;
}
.rank-order .seg {
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.82rem;
}
.rank-order .seg.on {
  border-color: var(--accent-line);
  background: var(--accent-weak);
  color: var(--text);
  font-weight: 700;
}

.parts-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
  padding: 0 1.2rem 0.9rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.items-pick {
  padding: 0 1.2rem 0.9rem;
  color: var(--text-2);
  font-size: 0.84rem;
}
.items-pick summary {
  width: fit-content;
  cursor: pointer;
}
.items-pick .pick-all {
  display: flex;
  gap: 0.8rem;
  margin: 0.4rem 0 0 1rem;
}
.items-pick .list {
  display: grid;
  gap: 0.25rem;
  max-height: 22rem;
  overflow: auto;
  margin: 0.5rem 0 0.2rem 1rem;
}
.items-pick .list label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.items-pick .list .mono {
  color: var(--text-3);
  font-size: 0.76rem;
}

/* --- The judging page's grid --------------------------------------------------- */
.bench-board .matrix-wrap {
  overflow-x: auto;
}

.bench-board .hc.unread {
  color: var(--gold);
}

/* --- A line at the foot of the page -------------------------------------------- */
.bench-toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  z-index: 50;
  max-width: min(36rem, 100% - 2rem);
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  /* The page heads stack, starting at the left; the leaderboard's keeps its "A" beside it. */
  .bench-board .page-head {
    align-items: flex-start;
  }
  .bench-board .lb-head {
    flex-direction: row;
    align-items: flex-end;
  }
  .board-filters select,
  .board-banner select {
    max-width: 100%;
  }
  .bench-board .bench-reply-head {
    flex-wrap: wrap;
  }
}
/* Which judge a reading is, when the board has more than one. */
.judge-tag {
  border-color: var(--blue-weak);
  color: var(--blue);
}

/* ==========================================================================
   Judging (/sophistry/judging): a judge, whose replies, and the items to read,
   each with the judges that have read it.
   ========================================================================== */
.bench-judging .jd-setup {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
}
.bench-judging .jd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.bench-judging .jd-row a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-2);
}
.bench-judging .jd-label {
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bench-judging .jd-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.bench-judging .board-panel-head .link-button {
  margin-left: 0.8rem;
}

.jd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.jd-table th {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}
.jd-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.jd-table .jd-pick {
  width: 2rem;
}
.jd-table .jd-name {
  font-weight: 600;
}
.jd-table .jd-judges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.jd-judge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.78rem;
}
.jd-judge > b:first-child {
  font-weight: 700;
}
.jd-judge .link-button {
  font-size: 0.74rem;
}
.jd-judge .danger {
  color: var(--accent);
}

/* Beside a model's place on the leaderboard: the lab that made it. */
td.lb-rank {
  white-space: nowrap;
}

.lab-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.45rem;
  color: var(--text);
  vertical-align: -0.15em;
  cursor: default;
}
.lab-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.lab-mark.letters {
  color: var(--text-2);
  width: auto;
  min-width: 1rem;
  padding: 0 0.15rem;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.lb-views {
  padding-top: 0.75rem;
}

/* The models hidden from the leaderboard (local only), at the foot of the page. */
.lb-hidden-list {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem 1.1rem;
}

.lb-hidden-one {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
}
.lb-hidden-one b {
  color: #e2776b;
}
.lb-hidden-one .mono {
  font-size: 0.72rem;
}
.lb-hidden-one button {
  margin-left: auto;
}

/* ==========================================================================
   The leaderboard, and the pages its numbers open: a reply (rp), a model (mp)
   and an item (ip). A score is always its number in the score colour (--c),
   on a faint wash of it; a cell or chip that holds one is a link to what made it.
   ========================================================================== */
/* --- A score that opens what made it ----------------------------------------- */
.score-link {
  display: inline-block;
  min-width: 2.35rem;
  padding: 0.14rem 0.35rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 0.86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-decoration: none;
  transition: background var(--t-fast);
}
.score-link:hover {
  background: color-mix(in srgb, var(--c) 30%, transparent);
}
.score-link.none {
  background: transparent;
  color: var(--text-3);
}

.samples {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.samples .times {
  color: var(--text-3);
  font-size: 0.66rem;
  font-weight: 700;
}
.samples.split .score-link {
  min-width: 1.9rem;
}

/* A score given because the reply could not be read. */
.score-x {
  margin-left: 0.2rem;
  color: #f0484a;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: help;
}

/* --- The leaderboard --------------------------------------------------------- */
.lb-head {
  margin-bottom: 1.2rem;
}

.lb-lede {
  max-width: 72ch;
}

.lb-filters {
  margin-bottom: 1.2rem;
}

.lb-notice {
  margin-bottom: 1.2rem;
}

.lb-panel {
  margin-bottom: 1.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.lb-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.lb-panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.lb-panel-head > .faint {
  max-width: 90ch;
  font-size: 0.8rem;
}

.lb-wrap {
  overflow-x: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  /* A heading that orders the table by its column. */
}
.lb-table th {
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.lb-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.lb-table tbody tr:last-child td {
  border-bottom: 0;
}
.lb-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}
.lb-table th.lb-part, .lb-table th.lb-col, .lb-table td.lb-cell {
  text-align: center;
}
.lb-table th button {
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.lb-table th button:hover {
  color: var(--text);
}
.lb-table th.sorted {
  color: var(--text);
}

.lb-rank {
  width: 2.4rem;
  color: var(--text-3);
  font-weight: 700;
  text-align: right;
}

td.lb-model {
  min-width: 13rem;
}
td.lb-model a {
  color: var(--text);
  text-decoration: none;
}
td.lb-model a:hover b {
  color: var(--accent-strong);
}
td.lb-model b {
  font-weight: 800;
}

.lb-spec {
  display: block;
  color: var(--text-3);
  font-size: 0.72rem;
}

td.lb-score {
  white-space: nowrap;
}
td.lb-score a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--c);
  text-decoration: none;
}
td.lb-score b {
  min-width: 2.2rem;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.lb-bar {
  display: inline-block;
  width: 5.5rem;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.lb-bar i {
  display: block;
  height: 100%;
  background: var(--c);
}

.lb-partial {
  margin-left: 0.5rem;
  padding: 0.02rem 0.4rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: help;
}

td.lb-cell a {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.18rem 0.3rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-weight: 800;
  text-decoration: none;
}
td.lb-cell a:hover {
  background: color-mix(in srgb, var(--c) 30%, transparent);
}
td.lb-cell a.none {
  background: transparent;
  color: var(--text-3);
}

.lb-empty {
  padding: 1.4rem !important;
  color: var(--text-3);
  text-align: center;
}

/* What a model's pass, or one reply to an item, costs. */
.lb-cost {
  padding-right: 0.6rem;
  color: var(--text-2);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.lb-cost.none {
  color: var(--text-3);
}

/* What each model has answered: a local server's column only. */
.lb-answered {
  white-space: nowrap;
  font-size: 0.78rem;
}
.lb-answered span {
  display: block;
  color: var(--text-2);
  line-height: 1.35;
}
.lb-answered span.short {
  color: var(--gold);
}
.lb-answered span.unscored {
  color: var(--text-3);
}

.lb-how {
  padding: 0.7rem 1.1rem 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.86rem;
}
.lb-how > summary {
  width: fit-content;
  color: var(--text-2);
  cursor: pointer;
}
.lb-how > summary:hover {
  color: var(--text);
}

.lb-how-body {
  padding-top: 0.6rem;
}
.lb-how-body ul {
  max-width: 86ch;
  margin: 0 0 0.9rem;
  padding-left: 1.1rem;
}
.lb-how-body li {
  margin: 0.3rem 0;
}
.lb-how-body .parts-pick, .lb-how-body .items-pick {
  padding: 0 0 0.7rem;
}

/* The grid of every result. */
.lb-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.lb-tools .rank-order {
  padding: 0;
}

.lb-search {
  width: min(18rem, 100%);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--well);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.lb-search:focus {
  border-color: var(--accent-line);
  outline: none;
}

/* The grid is as tall as its rows and scrolls only sideways. Its own bar would be at its
   foot, a long way down, so it is hidden and the one below it, which stays at the foot of
   the window, moves it instead. */
.lb-grid-wrap {
  overflow-x: auto;
  scrollbar-width: none;
}
.lb-grid-wrap::-webkit-scrollbar {
  display: none;
}

.lb-grid-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  overflow-x: auto;
  background: var(--surface);
  /* As wide as the grid, so the two scroll alike. */
}
.lb-grid-bar div {
  height: 1px;
  min-width: calc(24rem + var(--n) * 2.75rem + 8rem);
}

/* Columns share the width there is, down to a number's width; only past that does the
   grid scroll sideways. */
.lb-grid {
  --item: 17rem;
  --mean: 3rem;
  table-layout: fixed;
  width: 100%;
  min-width: calc(var(--item) + var(--mean) + var(--n) * 2.75rem + 8rem);
  border-collapse: separate;
  border-spacing: 0;
  /* Where the Chinese labs' models start, when they are put on the right. */
  /* A model's name leans up from the foot of its column, on one line. */
  /* A score is a tile that fills its cell, so the grid reads as a heat map. */
  /* Samples that disagree: one above the other. */
  /* The heading spans the table, so its label is what keeps still when it scrolls. */
}
.lb-grid .lb-c-item {
  width: var(--item);
}
.lb-grid .lb-c-mean {
  width: var(--mean);
}
.lb-grid .lb-c-tail {
  width: 8rem;
}
.lb-grid col.over {
  background: rgba(255, 255, 255, 0.05);
}
.lb-grid th.split, .lb-grid td.split {
  box-shadow: inset 2px 0 0 var(--text-3);
}
.lb-grid th, .lb-grid td {
  border-bottom: 0;
}
.lb-grid thead {
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border-2);
}
.lb-grid thead th {
  vertical-align: bottom;
}
.lb-grid th.lb-col {
  position: relative;
  height: 10.4rem;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.84rem;
  font-weight: 600;
  /* The lab's logo stays upright while the name runs up at an angle. */
}
.lb-grid th.lb-col a {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  overflow: hidden;
  max-width: 13.5rem;
  color: var(--text-2);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: left bottom;
}
.lb-grid th.lb-col a:hover, .lb-grid th.lb-col.over a {
  color: var(--text);
}
.lb-grid th.lb-col .lab-mark {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0 0.35rem 0 0;
  vertical-align: -0.18em;
  transform: rotate(45deg);
}
.lb-grid .lb-item {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}
.lb-grid .lb-mean {
  position: sticky;
  left: var(--item);
  z-index: 1;
  padding-right: 0.5rem;
  padding-left: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  text-align: right;
}
.lb-grid thead .lb-item,
.lb-grid thead .lb-mean {
  z-index: 2;
}
.lb-grid td.lb-item {
  padding: 0.3rem 0.6rem;
}
.lb-grid td.lb-mean {
  font-size: 0.95rem;
  font-weight: 800;
}
.lb-grid .lb-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.3;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.lb-grid .lb-title:hover {
  color: var(--accent-strong);
}
.lb-grid tbody tr:hover td {
  background: transparent;
}
.lb-grid tbody tr:hover td.lb-item,
.lb-grid tbody tr:hover td.lb-mean {
  background: #2d2b29;
}
.lb-grid td.lb-cell {
  height: 2.7rem;
  padding: 1px;
  font-size: 0.9rem;
  text-align: center;
}
.lb-grid td.lb-cell.split {
  padding-left: 5px;
}
.lb-grid .samples {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 1px;
  height: 2.3rem;
}
.lb-grid .score-link,
.lb-grid .samples.split .score-link {
  display: grid;
  flex: 1;
  place-items: center;
  min-width: 0;
  padding: 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 17%, transparent);
  font-size: inherit;
}
.lb-grid .score-link:hover,
.lb-grid .samples.split .score-link:hover {
  background: color-mix(in srgb, var(--c) 36%, transparent);
}
.lb-grid .score-link.none,
.lb-grid .samples.split .score-link.none {
  background: rgba(255, 255, 255, 0.03);
}
.lb-grid .samples.split {
  flex-direction: column;
  font-size: 0.77rem;
}
.lb-grid .times,
.lb-grid .score-x {
  position: absolute;
  top: 1px;
  right: 2px;
  margin: 0;
  font-size: 0.56rem;
  line-height: 1;
}
.lb-grid .score-x {
  top: auto;
  bottom: 1px;
  font-size: 0.6rem;
}
.lb-grid tr.lb-group th {
  padding: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}
.lb-grid .lb-group-name {
  position: sticky;
  left: 0;
  display: inline-block;
  max-width: min(64rem, 80vw);
  padding: 1.1rem 0.6rem 0.4rem;
}
.lb-grid .lb-group-name span {
  margin-left: 0.6rem;
  color: var(--text-3);
  font-weight: 500;
}

.lb-tools-gap {
  width: 0.6rem;
}

.lb-tools-label {
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- What every detail page shares ------------------------------------------- */
.rp-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  color: var(--text-3);
  font-size: 0.8rem;
}
.rp-crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.rp-crumbs a:hover {
  color: var(--accent-strong);
}

.rp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
}

.rp-title h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.rp-title h1 a {
  color: inherit;
  text-decoration: none;
}
.rp-title h1 a:hover {
  color: var(--accent-strong);
}
.rp-title h1.question {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
}

.rp-about {
  max-width: 82ch;
  margin: 0.3rem 0 0.6rem;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.rp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0;
  color: var(--text-3);
  font-size: 0.82rem;
}
.rp-meta > * + *::before {
  content: "·";
  margin-right: 0.5rem;
}

.rp-model {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.rp-model:hover {
  color: var(--accent-strong);
}

.rp-score {
  min-width: 7.5rem;
  padding: 0.7rem 1rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 9%, var(--surface));
  text-align: center;
}
.rp-score b {
  display: block;
  color: var(--c);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rp-score span {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-how {
  max-width: 96ch;
  margin: 0.2rem 0 1.2rem;
  padding: 0.55rem 0.85rem;
  border-left: 3px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* One reply in full, beside the list it was picked from: the model's side over the
   judge's, side by side only when there is room. */
.rd .rp-how {
  margin: 0.6rem 0 1rem;
}
.rd .rp-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
}

@media (min-width: 1700px) {
  .rd .rp-body {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}
/* The model on the left, the judge on the right; one after the other when narrow. */
.rp-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: 1.8rem;
}

/* No judge: the rule's reading is a narrow note beside the model, not a column of its own. */
.rp-body.ruled {
  grid-template-columns: minmax(0, 1fr) minmax(7rem, max-content);
  gap: 1.2rem;
}

.rp-rule-read {
  max-width: 14rem;
  font-size: 0.82rem;
}
.rp-rule-read .rp-col-head {
  margin-bottom: 0.5rem;
}
.rp-rule-read .rp-conclusion {
  margin: 0;
}

@media (max-width: 1000px) {
  .rp-body,
  .rp-body.ruled {
    grid-template-columns: minmax(0, 1fr);
  }
  .rp-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .rp-score {
    justify-self: start;
  }
}
.rp-col {
  min-width: 0;
}

.rp-col-head {
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rp-step {
  margin-bottom: 1.7rem;
}
.rp-step > h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 800;
}
.rp-step > p {
  margin: 0 0 0.6rem;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.rp-n {
  display: inline-grid;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.76rem;
  place-items: center;
}

.rp-fold {
  margin: 0.45rem 0;
}
.rp-fold > summary {
  padding: 0.25rem 0;
  color: var(--text-2);
  font-size: 0.84rem;
  cursor: pointer;
}
.rp-fold > summary:hover {
  color: var(--text);
}
.rp-fold[open] > summary {
  margin-bottom: 0.35rem;
}
.rp-fold > .bench-well {
  max-height: 28rem;
  overflow: auto;
  font-size: 0.86rem;
}
.rp-fold.inner {
  margin-left: 0.2rem;
}

.bench-well.code {
  max-height: 28rem;
  overflow: auto;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.5;
}

/* On a reply's page the reply is the point: shown whole, not in a scrolling box. */
.rp-body .bench-well.response {
  max-height: none;
  overflow: visible;
}

/* In a thread, what the model was sent is the quiet part, in a box that scrolls; what it
   said back is the part to read, in full-strength text, twenty lines before it scrolls. */
.bench-well.sent {
  max-height: 26rem;
  overflow: auto;
  color: #c4bfb7;
  font-size: 0.9rem;
  line-height: 1.5;
}

.bench-well.said {
  max-height: calc(20lh + 1.7rem + 2px);
  overflow-y: auto;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

.rp-part {
  margin: 0.6rem 0;
}

.rp-part-label {
  margin-bottom: 0.3rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.rp-turn {
  margin: 0.9rem 0 0.35rem;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-note {
  margin: 0.4rem 0;
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.45;
}

.rp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.5rem 0 0;
  color: var(--text-3);
  font-size: 0.78rem;
}

.rp-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.4rem 0 0.5rem;
}

.rp-defs {
  margin: 0.3rem 0 0;
  padding-left: 1rem;
  color: var(--text-2);
  font-size: 0.82rem;
}
.rp-defs li {
  margin: 0.55rem 0;
}
.rp-defs b {
  color: var(--text);
}

.rp-sub {
  margin: 1.1rem 0 0.5rem;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.rp-clean {
  color: var(--green);
  font-weight: 700;
}

.rp-conclusion {
  margin: 0 0 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.9rem;
  line-height: 1.45;
}

.rp-verdict {
  margin-bottom: 0.9rem;
}

.rp-theses {
  margin-bottom: 0.7rem;
}

.rp-checks {
  margin: 0.3rem 0 0.6rem;
  padding: 0;
  list-style: none;
}
.rp-checks li {
  display: flex;
  gap: 0.55rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.86rem;
}
.rp-checks li:last-child {
  border-bottom: 0;
}
.rp-checks .mark {
  flex: none;
  width: 1rem;
  font-weight: 800;
}
.rp-checks li.ok .mark {
  color: var(--green);
}
.rp-checks li.bad {
  color: var(--text);
}
.rp-checks li.bad .mark {
  color: var(--accent-strong);
}

.rp-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  color: var(--text);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}
.rp-numbers b {
  margin-right: 0.2rem;
  color: var(--text-3);
  font-weight: 700;
}

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* --- A model's page ---------------------------------------------------------- */
.mp-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.5rem;
  margin: 1.1rem 0 1.8rem;
}

.mp-part {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.8rem;
  line-height: 1.25;
  text-decoration: none;
}
.mp-part b {
  color: var(--c);
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.mp-part i {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--c);
}
.mp-part:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.mp-section {
  margin-bottom: 2rem;
  scroll-margin-top: calc(var(--app-bar-h) + 4rem);
}

.mp-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.mp-section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.mp-section-head > .faint {
  font-size: 0.8rem;
}

.mp-section-score {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mp-section-what {
  max-width: 90ch;
  margin: 0.3rem 0 0.6rem;
  color: var(--text-3);
  font-size: 0.84rem;
}

.mp-table {
  width: 100%;
  border-collapse: collapse;
}
.mp-table th {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.mp-table th a {
  color: inherit;
}
.mp-table td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.mp-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.mp-cell {
  width: 1%;
  text-align: center;
  white-space: nowrap;
}

.mp-what a {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}
.mp-what a:hover {
  color: var(--accent-strong);
}

.mp-note {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-3);
  font-size: 0.78rem;
}

.mp-topic {
  margin-right: 0.45rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.68rem;
  font-weight: 700;
}

.mp-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.4rem;
}

.mp-topic-score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  color: var(--text-2);
  font-size: 0.82rem;
  text-decoration: none;
}
.mp-topic-score b {
  color: var(--c);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.mp-topic-score:hover {
  border-color: var(--border-2);
  color: var(--text);
}
.mp-topic-score.on {
  border-color: var(--accent-line);
  color: var(--text);
}

.mp-only {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 1.6rem;
}
.mp-only a {
  font-weight: 700;
}

/* --- An item's page ---------------------------------------------------------- */
.ip-about {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.6rem;
  margin: 0.8rem 0 1.8rem;
}
.ip-about .rp-sub:first-child {
  margin-top: 0;
}

@media (max-width: 900px) {
  .ip-about {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ip-model a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.ip-model a:hover {
  color: var(--accent-strong);
}

.ip-table .mp-what {
  color: var(--text-2);
  font-size: 0.85rem;
}

/* A list to pick from, and beside it what the picked row stands for (.pk): the item's,
   the model's and the custom tests' pages. The list keeps still while what it shows
   scrolls. */
.pk {
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.2rem;
}

.pk-wide .pk {
  grid-template-columns: minmax(18rem, 27rem) minmax(0, 1fr);
}

.cx-pick {
  padding: 0 1.2rem 1.2rem;
}

.pk-list {
  position: sticky;
  top: calc(var(--app-bar-h) + 4rem);
  max-height: calc(100vh - var(--app-bar-h) - 5rem);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.pk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  padding: 0.7rem 0.7rem 0.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.86rem;
  scroll-margin-top: 0.4rem;
}
.pk-head b {
  font-weight: 800;
}
.pk-head .faint {
  font-size: 0.74rem;
}

.pk-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.pk-row:last-child {
  border-bottom: 0;
}
.pk-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.pk-row.on {
  background: var(--accent-weak);
  box-shadow: inset 3px 0 0 var(--accent);
}

.pk-place {
  min-width: 1rem;
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pk-main {
  grid-column: 2;
  min-width: 0;
}

.pk-score {
  grid-column: 3;
}

.pk-page {
  grid-column: 4;
}

.pk-title {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.pk-sub {
  display: block;
  margin-top: 0.1rem;
  color: var(--text-3);
  font-size: 0.76rem;
  line-height: 1.35;
}

.pk-page {
  color: var(--text-3);
  font-size: 0.8rem;
  text-decoration: none;
}

.pk-page:hover {
  color: var(--accent-strong);
}

.pk-shown {
  min-width: 0;
}
.pk-shown .cx-run:first-child {
  margin-top: 0;
}

.pk-none {
  margin: 0;
  padding: 1.2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .pk,
  .pk-wide .pk {
    grid-template-columns: minmax(0, 1fr);
  }
  .pk-list {
    position: static;
    max-height: 18rem;
  }
}
.cx-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.2rem;
}
.cx-split .cx-reply {
  margin-top: 0;
}
.cx-split .bench-well.response {
  max-height: 34rem;
}

@media (max-width: 900px) {
  .cx-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* The scatter plot under the leaderboard: the score here against the Artificial Analysis
   Intelligence Index. */
.sc-wrap {
  position: relative;
  padding: 0.8rem 0.8rem 0;
}

/* On a phone the chart keeps a size its names can be read at and scrolls sideways. */
.sc-scroll {
  overflow-x: auto;
}

@media (max-width: 760px) {
  .sc-wrap {
    min-width: 52rem;
  }
}
.sc {
  display: block;
  width: 100%;
  height: auto;
}

.sc-grid {
  stroke: var(--text);
  stroke-opacity: 0.07;
  stroke-width: 1;
}

.sc-grid.down {
  stroke-opacity: 0.035;
}

.sc-tick {
  fill: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.sc-axis {
  fill: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sc-name {
  fill: var(--text);
  fill-opacity: 0.82;
  font-size: 12px;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.sc-leader {
  stroke: var(--text);
  stroke-opacity: 0.28;
  stroke-width: 1;
}

.sc-trend {
  stroke: var(--text);
  stroke-opacity: 0.22;
  stroke-width: 2;
  stroke-linecap: round;
}

.sc-hit {
  fill: transparent;
}

.sc-point {
  cursor: pointer;
}

.sc-disc {
  fill: var(--surface-2);
  stroke: var(--border-2);
  stroke-width: 1.25;
}

.sc-disc.partial {
  stroke-dasharray: 3 3;
  stroke: var(--text-3);
}

.sc-point.over .sc-disc {
  stroke: var(--text);
  stroke-dasharray: none;
}

.sc-logo {
  color: var(--text);
  fill: currentColor;
  overflow: visible;
  pointer-events: none;
}

.sc-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 0.1rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
}
.sc-tip span {
  color: var(--text-2);
}

.sc-note {
  margin: 0;
  padding: 0.4rem 1.1rem 0.9rem;
  font-size: 0.8rem;
}

.sc-key {
  margin-right: 1rem;
  white-space: nowrap;
}

.sc-key i {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.4rem;
  border: 1.5px dashed var(--text-3);
  border-radius: 50%;
  vertical-align: -0.05rem;
}

.lb-systems {
  position: relative;
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

.lb-system-button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  white-space: nowrap;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.lb-system-button:hover {
  border-color: var(--text-3);
  color: var(--text);
}
.lb-system-button.on {
  border-color: var(--accent-line);
  background: var(--accent-weak);
  color: var(--text);
}

.lb-system-pop {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 30;
  width: min(40rem, 100vw - 2rem);
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}
.lb-system-pop .bench-well.prompt {
  max-height: min(60vh, 32rem);
}

.lb-system-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.lb-system-pop-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.lb-system-close {
  flex: none;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.lb-system-close:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.lb-system-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
}

/* Phones: the prompt opens as a sheet over the whole page, scrolled as one piece, with a
   close button big enough to tap. */
@media (max-width: 760px) {
  .lb-system-button {
    height: 2.5rem;
    padding: 0 0.8rem;
    font-size: 0.95rem;
  }
  .lb-system-backdrop {
    background: rgba(0, 0, 0, 0.6);
  }
  .lb-system-pop {
    position: fixed;
    inset: 0.75rem;
    z-index: 30;
    width: auto;
    display: flex;
    flex-direction: column;
    padding: 1rem;
  }
  .lb-system-pop .bench-well.prompt {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
  .lb-system-pop-head {
    align-items: center;
  }
  .lb-system-pop-head h3 {
    font-size: 1rem;
    line-height: 1.35;
  }
  .lb-system-close {
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
  }
}
/* Phones: the ranking drops each model's id and bar so its numbers fit, and the grid's
   frozen columns narrow, its cost going, so the models' columns have room beside them. */
@media (max-width: 760px) {
  .lb-panel-head {
    padding: 0.8rem 0.9rem;
  }
  .lb-table th {
    padding: 0.5rem 0.4rem;
  }
  .lb-table td {
    padding: 0.4rem 0.4rem;
  }
  .lb-rank {
    width: 1.6rem;
  }
  td.lb-model {
    min-width: 8.5rem;
    font-size: 0.88rem;
    line-height: 1.3;
  }
  .lb-spec {
    display: none;
  }
  .lb-bar {
    display: none;
  }
  td.lb-score b {
    min-width: 0;
    font-size: 1.2rem;
  }
  .lb-grid {
    --item: 8.5rem;
    --mean: 2.4rem;
    min-width: calc(var(--item) + var(--mean) + var(--n) * 2.6rem + 2rem);
  }
  .lb-grid .lb-c-tail {
    width: 2rem;
  }
  .lb-grid td.lb-item {
    padding: 0.3rem 0.45rem;
  }
  .lb-grid .lb-title {
    font-size: 0.8rem;
  }
  .lb-grid th.lb-col {
    height: 8.6rem;
    font-size: 0.76rem;
  }
  .lb-grid th.lb-col a {
    max-width: 11rem;
  }
  .lb-grid-bar div {
    min-width: calc(10.9rem + var(--n) * 2.6rem + 2rem);
  }
}
/* Charts to post: each card as it will look, with its two downloads. */
.pc-lede {
  margin: -0.6rem 0 1.4rem;
  color: var(--text-2);
}

.pc-set {
  margin: 2.4rem 0 0.9rem;
  font-size: 1.15rem;
}

.pc-set-note {
  margin: -0.5rem 0 1rem;
}

.pc-live > .lb-panel {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.pc-head {
  align-items: center;
}

.pc-saves {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.pc-image {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ==========================================================================
   The bench's run page and job monitor (local only). Everything is scoped
   to the page it belongs to, so the other bench pages' partials can use the
   same short names for their own things.
   ========================================================================== */
/* A bench job in a jobs list: the run page's and the in-progress page's. */
.job-row .bench-error {
  color: var(--accent);
}

.bench-setup,
.bench-job {
  /* The app's own panel head stacks its lines; these are one line of title and tools. */
}
.bench-setup input[type=text],
.bench-setup input[type=search],
.bench-setup input[type=number],
.bench-setup select,
.bench-setup textarea,
.bench-job input[type=text],
.bench-job input[type=search],
.bench-job input[type=number],
.bench-job select,
.bench-job textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  background: var(--well);
  transition: border-color var(--t-fast);
}
.bench-setup input:focus,
.bench-setup select:focus,
.bench-setup textarea:focus,
.bench-job input:focus,
.bench-job select:focus,
.bench-job textarea:focus {
  outline: none;
  border-color: var(--accent-line);
}
.bench-setup input[type=checkbox],
.bench-job input[type=checkbox] {
  flex: none;
  accent-color: var(--accent);
}
.bench-setup textarea,
.bench-job textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}
.bench-setup code,
.bench-job code {
  font-family: var(--mono);
  font-size: 0.85em;
}
.bench-setup .panel,
.bench-job .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-setup .panel-pad,
.bench-job .panel-pad {
  padding: 1.1rem 1.2rem;
}
.bench-setup .panel-head,
.bench-job .panel-head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.bench-setup .panel-head h2,
.bench-job .panel-head h2 {
  font-size: 1.15rem;
}
.bench-setup .panel-note,
.bench-job .panel-note {
  margin: 0.8rem 1.2rem 0;
  color: var(--text-3);
  font-size: 0.82rem;
}
.bench-setup .bench-section,
.bench-job .bench-section {
  margin-top: 1.2rem;
}
.bench-setup .empty-inline,
.bench-job .empty-inline {
  padding: 0.8rem 1.2rem;
  color: var(--text-3);
  font-size: 0.86rem;
}
.bench-setup .ghost-button.danger,
.bench-job .ghost-button.danger {
  color: var(--accent);
}
.bench-setup .small-button,
.bench-job .small-button {
  min-height: 0;
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
}
.bench-setup .link-button,
.bench-job .link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
}
.bench-setup .link-button:hover,
.bench-job .link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}
.bench-setup .link-button.wipe-armed,
.bench-job .link-button.wipe-armed {
  color: var(--gold);
  font-weight: 700;
}
.bench-setup .field,
.bench-job .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}
.bench-setup .field + .field,
.bench-job .field + .field {
  margin-top: 0;
}
.bench-setup .field > span,
.bench-job .field > span {
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
}
.bench-setup .field-inline,
.bench-job .field-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}
.bench-setup .check,
.bench-job .check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-2);
  font-size: 0.86rem;
  cursor: pointer;
}
.bench-setup .check:hover,
.bench-job .check:hover {
  color: var(--text);
}
.bench-setup .field-error,
.bench-job .field-error {
  margin-top: 0.45rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.bench-setup .field-hint,
.bench-job .field-hint {
  margin-top: 0.4rem;
  color: var(--text-3);
  font-size: 0.78rem;
}
.bench-setup .count,
.bench-job .count {
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* --- The run page ----------------------------------------------------------- */
.bench-setup {
  /* The browser otherwise scrolls to follow whatever was in view when it moves or
     the content above it changes, as when a test is moved to the top. */
  overflow-anchor: none;
  /* What each service bills, above the per-model rows so it shows without scrolling. */
  /* Models */
  /* Questions, cases and tests */
  /* Failure categories */
  /* The runs in the database */
}
.bench-setup .page-sub {
  max-width: 70ch;
}
.bench-setup .run-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.bench-setup .options-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2rem;
}
.bench-setup .opt-col {
  min-width: 0;
}
.bench-setup .opt-cost {
  display: flex;
  flex-direction: column;
}
.bench-setup .opt-cost .estimate {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
.bench-setup .run-bar {
  position: sticky;
  top: calc(var(--app-bar-h) + 0.5rem);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.8rem 0.55rem 1.2rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.bench-setup .run-bar .muted {
  min-width: 0;
  font-size: 0.86rem;
}
.bench-setup .run-bar .primary-button {
  flex: none;
}
.bench-setup .side-h {
  margin: 1.1rem 0 0.7rem;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bench-setup .side-h:first-child {
  margin-top: 0;
}
.bench-setup .num-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.bench-setup .num-row input {
  width: 100%;
}
.bench-setup .length-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  margin: 0.2rem 0 0.9rem;
}
.bench-setup .length-row input[type=number] {
  width: 5.5rem;
}
.bench-setup .length-row input:disabled {
  opacity: 0.45;
}
.bench-setup .effort-line {
  margin: -0.4rem 0 0.7rem;
  font-size: 0.8rem;
}
.bench-setup .judge-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: -0.2rem 0 0.9rem;
}
.bench-setup .judge-add input {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.8rem;
}
.bench-setup .judge-add .field-error {
  flex-basis: 100%;
}
.bench-setup .estimate p {
  margin: 0 0 0.8rem;
}
.bench-setup .est-table {
  width: 100%;
  margin-bottom: 0.6rem;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.bench-setup .est-table td {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.bench-setup .est-table td:last-child {
  padding-left: 0.6rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.bench-setup .est-bills {
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-2);
  font-size: 0.86rem;
}
.bench-setup .est-bills:empty {
  display: none;
}
.bench-setup .est-bill {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.15rem 0;
}
.bench-setup .est-conflicts {
  margin: 0 0 0.7rem;
  padding: 0.6rem 0.8rem 0.6rem 1.8rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
}
.bench-setup .est-conflicts li + li {
  margin-top: 0.4rem;
}
.bench-setup .est-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.4rem 0 1rem;
  font-size: 0.82rem;
}
.bench-setup .est-total b {
  font-size: 1.5rem;
  font-weight: 800;
  white-space: nowrap;
}
.bench-setup .model-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.6rem;
  padding: 1rem 1.2rem;
}
.bench-setup .pick {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}
.bench-setup .pick:hover {
  border-color: var(--border-2);
}
.bench-setup .pick.on {
  border-color: var(--accent-line);
  background: var(--accent-weak);
}
.bench-setup .pick.off {
  opacity: 0.5;
  cursor: not-allowed;
}
.bench-setup .pick.bad {
  border-color: var(--accent-line);
  background: transparent;
}
.bench-setup .pick input {
  margin-top: 0.25rem;
}
.bench-setup .pick b {
  display: block;
  font-size: 0.92rem;
}
.bench-setup .pick .grow-col {
  flex: 1;
  min-width: 0;
}
.bench-setup .pick .spec {
  display: block;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}
.bench-setup .pick .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.bench-setup .pick select.effort {
  padding: 0.1rem 0.3rem;
  font-size: 0.72rem;
}
.bench-setup .pick .problem {
  display: block;
  margin-top: 0.35rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.bench-setup .pick .x {
  padding: 0 0.1rem;
  background: none;
  color: var(--text-3);
  font-size: 1.1rem;
  line-height: 1;
}
.bench-setup .pick .x:hover {
  color: var(--text);
}
.bench-setup .add-model {
  padding: 0 1.2rem 1rem;
}
.bench-setup .add-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bench-setup .add-row input {
  flex: 1;
  min-width: 0;
}
.bench-setup .personas {
  padding: 0 1.2rem 1rem;
}
.bench-setup .personas summary {
  margin-bottom: 0.6rem;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.bench-setup .personas p {
  margin: 0 0 0.5rem;
  color: var(--text-3);
  font-size: 0.82rem;
}
.bench-setup .personas .model-pick {
  padding: 0.4rem 0 0;
}
.bench-setup .item-filters {
  display: flex;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.bench-setup .item-filters input {
  flex: 1;
  min-width: 0;
}
.bench-setup .item-kind {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.8rem;
  padding: 1.1rem 1.2rem 0.4rem;
  border-top: 1px solid var(--border);
}
.bench-setup .item-kind h3 {
  margin: 0;
  font-size: 1rem;
}
.bench-setup .item-kind .faint {
  font-size: 0.8rem;
}
.bench-setup .item-filters + .item-kind {
  border-top: 0;
}
.bench-setup .oq-new {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 1.2rem 0.6rem;
}
.bench-setup .oq-new textarea {
  flex: 1;
  min-height: 3.2rem;
}
.bench-setup .oq-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
  padding: 0.65rem 1.2rem;
  border-top: 1px solid var(--border);
}
.bench-setup .oq-row input[type=checkbox] {
  margin-top: 0.25rem;
}
.bench-setup .oq-row.duplicated {
  outline: 2px solid #d12b2b;
  outline-offset: -2px;
}
.bench-setup .fc-kind {
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.bench-setup .fc-kind p {
  max-width: 95ch;
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.bench-setup .fc-intro {
  min-width: 0;
}
.bench-setup .fc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.6rem 1.2rem 1.1rem;
}
.bench-setup .fc-card {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color var(--t-fast);
}
.bench-setup .fc-card.picked {
  border-color: var(--accent-line);
}
.bench-setup .fc-card.editing {
  border-color: var(--gold-line);
  background: color-mix(in srgb, var(--gold) 5%, var(--surface-2));
}
.bench-setup .fc-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.bench-setup .fc-head input[type=checkbox] {
  margin-top: 0.3rem;
}
.bench-setup .fc-head .oq-acts {
  flex: none;
  max-width: 19rem;
}
.bench-setup .fc-title {
  flex: 1;
  min-width: 0;
}
.bench-setup .fc-title h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}
.bench-setup .fc-name {
  width: 100%;
  font-weight: 650;
}
.bench-setup .fc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.55rem 1.1rem;
  padding: 0.6rem 0;
  border-block: 1px solid var(--border);
}
.bench-setup .fc-fields select,
.bench-setup .fc-fields input[type=number] {
  width: 100%;
}
.bench-setup .fc-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.bench-setup .fc-label {
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bench-setup .fc-value {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.bench-setup .fc-thread {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bench-setup .fc-msg {
  position: relative;
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0.65rem;
}
.bench-setup .fc-msg:not(:last-child)::before {
  position: absolute;
  top: 1.9rem;
  bottom: -0.65rem;
  left: calc(0.85rem - 1px);
  width: 2px;
  background: var(--border-2);
  content: "";
}
.bench-setup .fc-msg.scored .fc-num {
  border-color: var(--gold-line);
  color: var(--gold);
  background: var(--gold-weak);
}
.bench-setup .fc-num {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--well);
}
.bench-setup .fc-msg-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.bench-setup .fc-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.8rem;
  min-height: 1.7rem;
  font-size: 0.8rem;
}
.bench-setup .fc-msg-head select {
  max-width: 18rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}
.bench-setup .fc-who {
  color: var(--text-3);
}
.bench-setup .fc-who b {
  color: var(--text-2);
  font-weight: 600;
}
.bench-setup .fc-who .fc-custom {
  color: var(--blue);
}
.bench-setup .fc-score-tag {
  padding: 0.08rem 0.45rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-xs);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--gold-weak);
}
.bench-setup .fc-chains {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  margin: 0.2rem 1.2rem 0.4rem;
  padding: 0.75rem 0.9rem 0.85rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
}
.bench-setup .fc-chains-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.bench-setup .fc-chains-head h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
}
.bench-setup .fc-chains-head p {
  max-width: 95ch;
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}
.bench-setup .fc-chain .oq-id {
  font-family: inherit;
  font-size: 0.74rem;
}
.bench-setup .fc-moves {
  display: inline-flex;
  gap: 0.8rem;
}
.bench-setup .fc-moves button:disabled {
  visibility: hidden;
}
.bench-setup .fc-text {
  --fc-line: 1.32rem;
  display: block;
  width: 100%;
  max-height: calc(var(--fc-line) * 13 + 1rem + 2px);
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  line-height: var(--fc-line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--well);
  resize: vertical;
}
.bench-setup .fc-edit-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 640px) {
  .bench-setup .fc-head {
    flex-wrap: wrap;
  }
  .bench-setup .fc-head .oq-acts {
    flex-basis: 100%;
    max-width: none;
    justify-content: flex-start;
  }
  .bench-setup .fc-kind {
    flex-wrap: wrap;
  }
}
.bench-setup .oq-text {
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.bench-setup .oq-text.clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}
.bench-setup .oq-more {
  display: block;
  margin-top: 0.2rem;
}
.bench-setup .oq-row.folded {
  align-items: center;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.bench-setup .oq-row.folded input[type=checkbox] {
  margin-top: 0;
}
.bench-setup .oq-row.folded .oq-text {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bench-setup .oq-row.folded .oq-text br,
.bench-setup .oq-row.folded .oq-text .faint,
.bench-setup .oq-row.folded .oq-id {
  display: none;
}
.bench-setup .oq-row.folded .oq-acts {
  flex-wrap: nowrap;
  max-width: none;
}
.bench-setup .oq-id {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.68rem;
}
.bench-setup .oq-id.inline {
  display: inline;
}
.bench-setup .oq-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.8rem;
}
.bench-setup .oq-acts .link-button:disabled {
  opacity: 0.4;
  cursor: default;
  text-decoration: none;
}
.bench-setup .oq-row .oq-acts {
  max-width: 16rem;
}
.bench-setup .oq-edit {
  min-height: 5rem;
  margin-bottom: 0.45rem;
}
.bench-setup .case-what {
  min-width: 0;
}
.bench-setup .case-what b {
  font-size: 0.95rem;
}
.bench-setup .addition {
  padding: 0.6rem 1.2rem 0.9rem;
  border-top: 1px solid var(--border);
}
.bench-setup .addition summary {
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.bench-setup .addition p {
  margin: 0.5rem 0;
  font-size: 0.8rem;
}
.bench-setup .addition textarea {
  min-height: 7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.bench-setup .row-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.bench-setup .cats {
  padding: 0.6rem 0 0.4rem;
}
.bench-setup .cat-group-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.2rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.bench-setup .cat-group-line:hover {
  background: var(--surface-2);
}
.bench-setup .cat-group-line .count {
  margin-left: auto;
}
.bench-setup .cat-group-line .chev {
  width: 1rem;
  color: var(--text-3);
  text-align: center;
}
.bench-setup .cat-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
  padding: 0.55rem 1.2rem 0.55rem 2.4rem;
  font-size: 0.86rem;
}
.bench-setup .cat-row input[type=checkbox] {
  margin-top: 0.2rem;
}
.bench-setup .cat-desc {
  margin-top: 0.25rem;
  color: var(--text-2);
  font-size: 0.82rem;
}
.bench-setup .cat-not {
  margin-top: 0.2rem;
  color: var(--text-3);
  font-size: 0.78rem;
}
.bench-setup .cat-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.4rem 1.2rem 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.bench-setup .cat-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
}
.bench-setup .cat-form .row {
  display: grid;
  grid-template-columns: 8rem 1fr 1fr;
  gap: 0.6rem;
}
.bench-setup .cat-form textarea {
  min-height: 4.5rem;
}
.bench-setup .cat-form textarea.short {
  min-height: 2.6rem;
}
.bench-setup .cat-form .oq-acts {
  justify-content: flex-start;
}
.bench-setup .restore {
  padding: 0.6rem 1.2rem 0.4rem;
  border-top: 1px solid var(--border);
}
.bench-setup .restore summary {
  color: var(--text-2);
  font-size: 0.86rem;
  cursor: pointer;
}
.bench-setup .restore-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.3rem 0;
  font-size: 0.84rem;
}
.bench-setup details.ins > summary {
  padding: 0.9rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.bench-setup details.ins > div {
  padding: 0 1.2rem 1.1rem;
}
.bench-setup details.ins p {
  margin-top: 0;
  font-size: 0.82rem;
}
.bench-setup details.ins textarea {
  min-height: 22rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.bench-setup .run-table {
  width: 100%;
  border-collapse: collapse;
}
.bench-setup .run-table td {
  padding: 0.55rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.bench-setup .run-table tr:last-child td {
  border-bottom: 0;
}
.bench-setup .run-table td.acts {
  text-align: right;
  white-space: nowrap;
}
.bench-setup .run-table td.acts .link-button {
  margin-left: 1rem;
}
.bench-setup .job-list {
  padding: 1rem 1.2rem;
}

.bench-toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  z-index: 50;
  max-width: min(36rem, 100% - 2rem);
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  transform: translateX(-50%);
}

/* --- One job ---------------------------------------------------------------- */
.bench-job {
  width: min(100% - 2 * var(--gutter), 1600px);
}
.bench-job .page-head {
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.bench-job .page-head h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
.bench-job .page-head .eyebrow .status-pill {
  vertical-align: middle;
}
.bench-job .head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.bench-job .phases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.bench-job .phase {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-job .phase.current {
  border-color: var(--accent-line);
}
.bench-job .phase .ph-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.bench-job .phase .ph-top span {
  color: var(--text-2);
  font-weight: 600;
}
.bench-job .phase .progress {
  height: 6px;
  overflow: hidden;
  border-radius: 1px;
  background: var(--well);
}
.bench-job .phase .progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width var(--t);
}
.bench-job .phase.finished .progress i {
  background: var(--green);
}
.bench-job .counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.bench-job .filter-bar {
  position: sticky;
  top: calc(var(--app-bar-h) + 0.5rem);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-job .call-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 0.7rem;
}
.bench-job .call {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-job .call.running {
  border-color: var(--gold-line);
}
.bench-job .call.error {
  border-color: var(--accent-line);
}
.bench-job .call.retried {
  border-color: var(--gold-weak);
}
.bench-job .call-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.bench-job .call-head .who {
  flex: none;
  max-width: 10rem;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bench-job .call-head code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bench-job .call-head .time {
  flex: none;
  color: var(--text-3);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.bench-job .call-head .status-pill,
.bench-job .call-head .tag {
  flex: none;
}
.bench-job .call-prompt {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.78rem;
}
.bench-job .call-prompt summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.bench-job .call-prompt div {
  max-height: 10rem;
  overflow: auto;
  margin-top: 0.35rem;
  color: var(--text-2);
  white-space: pre-wrap;
}
.bench-job .call-think {
  max-height: 5.5rem;
  overflow: hidden;
  padding: 0.45rem 0.75rem 0;
  color: var(--text-3);
  font-size: 0.76rem;
  font-style: italic;
  white-space: pre-wrap;
  mask-image: linear-gradient(transparent, #000 40%);
}
.bench-job .call-text {
  flex: 1;
  max-height: 17rem;
  overflow: auto;
  padding: 0.6rem 0.75rem 0.75rem;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.bench-job .call-text.empty {
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.82rem;
  font-style: italic;
}
.bench-job .call-text.mono-text {
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.5;
}
.bench-job .call-err {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--accent-strong);
  font-size: 0.8rem;
  white-space: pre-wrap;
}
.bench-job .call-foot {
  display: block;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.76rem;
}
.bench-job .call-foot:hover {
  background: var(--surface-2);
  color: var(--text);
}
.bench-job .judge-calls,
.bench-job .job-log {
  margin-top: 1.6rem;
}
.bench-job .log {
  max-height: 14rem;
  overflow: auto;
  margin-top: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.bench-job .log div span {
  margin-right: 0.8rem;
  color: var(--text-3);
}

@media (max-width: 1000px) {
  .bench-setup .options-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .bench-setup .opt-cost .estimate {
    flex: none;
    height: 12rem;
  }
}
@media (max-width: 640px) {
  .bench-setup .oq-row,
  .bench-setup .cat-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .bench-setup .oq-row .oq-acts,
  .bench-setup .cat-row .oq-acts {
    grid-column: 2;
    justify-content: flex-start;
    max-width: none;
  }
  .bench-setup .cat-row {
    padding-left: 1.2rem;
  }
  .bench-setup .cat-form .row {
    grid-template-columns: 1fr;
  }
  .bench-setup .oq-new {
    flex-direction: column;
    align-items: stretch;
  }
  .bench-setup .run-table td {
    padding: 0.5rem 0.8rem;
  }
  .bench-setup .run-table td:nth-child(3) {
    display: none;
  }
  .bench-job .call-grid {
    grid-template-columns: 1fr;
  }
  .bench-job .filter-bar {
    position: static;
  }
}
/* System prompts: which each chosen model is run under, then the prompts themselves. */
.systems-panel > .faint {
  margin: 0 1.2rem 0.6rem;
  font-size: 0.8rem;
}
.systems-panel .row-buttons {
  padding: 0.4rem 1.2rem 0.9rem;
}
.systems-panel .system-matrix {
  margin: 0 1.2rem 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}
.systems-panel .system-model {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1.2rem;
  padding: 0.3rem 0;
  font-size: 0.86rem;
}
.systems-panel .system-model b {
  flex: 0 0 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.systems-panel .system-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
}
.systems-panel .system-tick {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.systems-panel .system-tick input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}
.systems-panel .system-row {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: start;
  padding: 0.45rem 1.2rem;
}
.systems-panel .system-row input[type=text], .systems-panel .system-row textarea {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  background: var(--well);
}
.systems-panel .system-row textarea {
  resize: vertical;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .systems-panel .system-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .systems-panel .system-model b {
    flex-basis: 100%;
  }
}
/* A model some run already has replies from. */
.pick b.used {
  color: #9fd49a;
}

/* Hidden from the leaderboard: red, whatever else it is. */
.pick b.hidden-model {
  color: #e2776b;
}

/* A question, case or test some run already has replies to. */
.oq-row .used .oq-text,
.oq-row b.used,
.fc-title h4.used {
  color: #9fd49a;
}

/* Beside a question, case or test: the judges its replies have had. */
.judged-by {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  white-space: nowrap;
}

/* On an OpenRouter model's card: the provider its calls go to, and the list to pick from. */
.prov-pick {
  align-self: flex-start;
  font-size: 0.74rem;
}

.prov-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.prov-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
}
.prov-row:hover {
  border-color: var(--accent-line);
}
.prov-row.on {
  border-color: var(--accent);
}

/* Hidden from the leaderboard: red, even where it already has replies. */
.oq-row .hidden-item,
.oq-row .hidden-item .oq-text,
.oq-row b.hidden-item,
.fc-title h4.hidden-item {
  color: #e2776b;
}

/* The model list: what to add on top, then a line per model, thinking and system prompt,
   each switched on or off for the run. */
.lineup-add {
  margin: 0 0 0.9rem;
}

.lineup-add .add-row select {
  flex: 0 0 auto;
  max-width: 12rem;
}

.lineup {
  display: grid;
  gap: 0.35rem;
}

.lineup-empty {
  margin: 0.4rem 0;
}

.lineup .line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 7.5rem 11rem 7.5rem 9rem auto;
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  opacity: 0.62;
  transition: opacity 0.1s, border-color 0.1s;
}
.lineup .line:hover {
  opacity: 0.9;
}
.lineup .line.on {
  opacity: 1;
  border-color: var(--accent-line);
  background: var(--accent-weak);
}
.lineup .line.bad {
  border-style: dashed;
}
.lineup .line .line-model {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lineup .line .line-model b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineup .line .line-model b.used {
  color: #9fd49a;
}
.lineup .line .line-model .lab-mark {
  margin: 0 0.45rem 0 0;
}
.lineup .line .line-model b.hidden-model {
  color: #e2776b;
}
.lineup .line .spec {
  overflow: hidden;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineup .line select {
  width: 100%;
}
.lineup .line .line-provider {
  position: relative;
  min-width: 0;
  font-size: 0.78rem;
}
.lineup .line .x {
  padding: 0 0.3rem;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 1.1rem;
  cursor: pointer;
}
.lineup .line .x:hover {
  color: var(--text);
}
.lineup .line .line-problem {
  grid-column: 2/-1;
}

@media (max-width: 900px) {
  .lineup .line {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .lineup .line .line-effort,
  .lineup .line .line-prompt,
  .lineup .line .line-price,
  .lineup .line .line-provider {
    grid-column: 2/-1;
  }
}
/* ==========================================================================
   The bench's Debug page (every model call, as it streams) and its Custom
   tests page. The small controls both use are scoped to the two pages, so
   they cannot reach the rest of the app.
   ========================================================================== */
.bench-debug .bench-lede,
.bench-custom .bench-lede {
  max-width: 50rem;
  font-variant-numeric: normal;
}
.bench-debug .bench-lede a,
.bench-custom .bench-lede a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-2);
}
.bench-debug select,
.bench-debug input[type=search],
.bench-custom select,
.bench-custom input[type=search] {
  min-height: 2.1rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--well);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.bench-debug .field-inline,
.bench-custom .field-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}
.bench-debug .check,
.bench-custom .check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-2);
  font-size: 0.88rem;
  cursor: pointer;
}
.bench-debug .check:hover,
.bench-custom .check:hover {
  color: var(--text);
}
.bench-debug .small-button,
.bench-custom .small-button {
  min-height: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.76rem;
}
.bench-debug .ghost-button.on,
.bench-custom .ghost-button.on {
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.bench-debug .danger,
.bench-custom .danger {
  color: var(--accent);
}
.bench-debug .armed,
.bench-custom .armed {
  background: var(--gold-weak);
  box-shadow: inset 0 0 0 1px var(--gold);
  color: var(--text);
}
.bench-debug .link-button,
.bench-custom .link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.bench-debug .link-button:hover,
.bench-custom .link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}
.bench-debug .link-button.wipe-armed,
.bench-custom .link-button.wipe-armed {
  color: var(--accent);
  font-weight: 700;
}
.bench-debug .seg,
.bench-custom .seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
}
.bench-debug .seg button,
.bench-custom .seg button {
  padding: 0.25rem 0.6rem;
  background: transparent;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
}
.bench-debug .seg button + button,
.bench-custom .seg button + button {
  border-left: 1px solid var(--border-2);
}
.bench-debug .seg button.on,
.bench-custom .seg button.on {
  background: var(--accent);
  color: #fff;
}
.bench-debug .bench-note,
.bench-custom .bench-note {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--gold-weak);
  color: var(--text);
  font-size: 0.9rem;
}

/* --- Debug ------------------------------------------------------------------ */
.bench-debug {
  width: min(100% - 2 * var(--gutter), 1600px);
}
.bench-debug .filter-bar {
  position: sticky;
  top: calc(var(--app-bar-h) + 0.5rem);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-debug .filter-bar input[type=search] {
  flex: 1;
  min-width: 12rem;
}
.bench-debug .filter-bar select {
  max-width: 100%;
}
.bench-debug h3 {
  margin: 0;
  font-size: 1rem;
}

.dbg {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.dbg-list {
  position: sticky;
  top: calc(var(--app-bar-h) + 4.8rem);
  max-height: calc(100vh - var(--app-bar-h) - 5.8rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dbg-empty {
  padding: 1.5rem 1rem;
  color: var(--text-2);
  text-align: center;
}

.dbg-empty a {
  color: var(--text);
  text-decoration: underline;
}

.dbg-ghead {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: left;
}
.dbg-ghead .gcaret {
  width: 0.8rem;
  color: var(--text-3);
}
.dbg-ghead .who {
  min-width: 0;
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dbg-ghead .gcount {
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.dbg-ghead .gcount.g-run {
  color: var(--gold);
}
.dbg-ghead .gcount.g-bad {
  color: var(--accent-strong);
}

.dbg-group.closed .dbg-rows {
  display: none;
}

.dbg-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.15rem 0.55rem;
  width: 100%;
  padding: 0.36rem 0.75rem 0.32rem;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
}
.dbg-row:hover {
  background: var(--surface-2);
}
.dbg-row.sel {
  background: var(--accent-weak);
  box-shadow: inset 2px 0 0 var(--accent);
}
.dbg-row .t {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dbg-row .att {
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}
.dbg-row .d {
  color: var(--text-3);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dbg-row .bar {
  position: relative;
  grid-column: 2/-1;
  height: 3px;
  border-radius: 2px;
  background: var(--well);
}
.dbg-row .bar b {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--text-3);
}

.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

@keyframes dbg-pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.35;
  }
}
.s-running .dot,
.s-running .bar b {
  background: var(--gold);
}

.s-running .dot {
  animation: dbg-pulse 1s infinite alternate;
}

.s-done .dot,
.s-done .bar b {
  background: var(--green);
}

.s-failed .dot,
.s-failed .bar b {
  background: var(--accent);
}

.s-retried .dot,
.s-retried .bar b {
  background: var(--gold);
  opacity: 0.6;
}

.s-stopped .dot,
.s-stopped .bar b {
  background: var(--blue);
}

.dbg-detail {
  min-width: 0;
}

.dbg-placeholder {
  padding: 2rem 1.6rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  color: var(--text-2);
}
.dbg-placeholder h2 {
  margin: 0 0 0.6rem;
}

.dbg-dhead {
  margin-bottom: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dbg-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.dbg-task {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dbg-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.55rem 1.2rem;
  margin-top: 0.9rem;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.dbg-facts > div > span:first-child {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--text-3);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dbg-facts code {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.dbg-attempts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
}
.dbg-attempts > span {
  margin-right: 0.3rem;
  color: var(--text-3);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: none;
  color: var(--text-2);
  font-size: 0.78rem;
}
.att-chip.on {
  border-color: var(--accent-line);
  background: var(--accent-weak);
  color: var(--text);
}

.dbg-err {
  max-height: 14rem;
  overflow: auto;
  margin-top: 0.85rem;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-weak);
  font-family: var(--mono);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dbg-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.7rem;
  margin: 0 0 0.4rem;
}
.dbg-jump span {
  margin-left: 0.4rem;
  color: var(--text-3);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dbg-jump span:first-child {
  margin-left: 0;
}
.dbg-jump .link-button {
  color: var(--text-2);
  font-size: 0.8rem;
}

.dbg-sec {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem;
  margin: 1.3rem 0 0.55rem;
}
.dbg-sec .faint {
  font-size: 0.78rem;
}

/* Each section of a call, and each message of its request, folds under its heading. */
.dbg-fold.closed {
  display: none;
}

.dbg-part {
  scroll-margin-top: calc(var(--app-bar-h) + 5rem);
}

.dbg-fold-head {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0;
  background: none;
  text-align: left;
}
.dbg-fold-head .caret {
  width: 0.8rem;
  flex: none;
  color: var(--text-3);
}
.dbg-fold-head:hover .caret, .dbg-fold-head:hover h3 {
  color: var(--accent);
}
.dbg-fold-head .faint {
  overflow-wrap: anywhere;
}

.dbg-bhead .dbg-fold-head {
  flex: 1;
}

.dbg-block.closed .dbg-bhead {
  border-bottom: 0;
}

.dbg-fold > .dbg-block:last-child {
  margin-bottom: 0;
}

.dbg-none {
  margin: 0;
  padding: 0.6rem 0.85rem;
  color: var(--text-3);
  font-size: 0.8rem;
}

.dbg-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-2);
}

.dbg-block {
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: calc(var(--app-bar-h) + 5rem);
}
.dbg-block.full .dbg-pre {
  max-height: none;
}

.dbg-bhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
}

.role {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.r-system {
  border-color: var(--blue-weak);
  color: var(--blue);
}

.r-user {
  border-color: var(--accent-weak);
  color: var(--accent-strong);
}

.r-assistant {
  border-color: var(--blue-weak);
  color: #8eaef2;
}

.r-reasoning {
  border-color: var(--gold-weak);
  color: var(--gold);
}

.r-answer {
  border-color: var(--green-weak);
  color: var(--green);
}

.dbg-pre {
  max-height: 26rem;
  overflow: auto;
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--well);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.dbg-pre:empty::before {
  content: "—";
  color: var(--text-3);
}
.dbg-pre.caret::after {
  content: "▍";
  color: var(--gold);
  animation: dbg-pulse 0.7s infinite alternate;
}

.dbg-sub {
  padding: 0.3rem 0.85rem;
  border-top: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-size: 0.7rem;
}
.dbg-sub:first-of-type {
  border-top: 0;
}

.jk {
  color: #8eaef2;
}

.js {
  color: #d7c58f;
}

.jn {
  color: var(--green);
}

.jl {
  color: var(--accent-strong);
}

/* --- Custom tests ------------------------------------------------------------- */
.cx-panel {
  margin-bottom: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  padding: 1.1rem 1.3rem 0.5rem;
}
.cx-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.cx-head .mono {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
}

/* What the test is for, right under its name. On a local server it is typed in place: it
   reads as text until hovered or typed in. */
.cx-description {
  max-width: 86ch;
  margin: 0;
  padding: 0 1.3rem 0.9rem;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-wrap;
}

.cx-description-edit {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 1.3rem 0.9rem;
  font-size: 0.82rem;
}
.cx-description-edit textarea {
  width: calc(100% + 1rem);
  max-width: 90ch;
  min-height: 0;
  margin-left: -0.5rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  field-sizing: content;
  transition: border-color 0.12s, background 0.12s;
}
.cx-description-edit textarea::placeholder {
  color: var(--text-3);
  font-style: italic;
}
.cx-description-edit textarea:hover {
  border-color: var(--border);
}
.cx-description-edit textarea:focus {
  outline: none;
  border-color: var(--border-2);
  background: var(--well);
  color: var(--text);
}

.cx-description-error {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}

.cx-body {
  padding: 0.9rem 1.3rem 0.4rem;
  border-top: 1px solid var(--border);
}
.cx-body .muted {
  margin: 0.3rem 0 0.6rem;
}

/* What a test sends, in order: each message under a quiet heading, numbered down a line
   when there are several, six lines showing and the rest scrolling. */
.cx-message {
  position: relative;
  padding-bottom: 0.9rem;
}
.cx-message summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  padding: 0.1rem 0 0.45rem;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}
.cx-message summary::-webkit-details-marker {
  display: none;
}
.cx-message summary:hover {
  color: var(--text-2);
}
.cx-message:not([open]) summary .cx-size::after {
  content: " ·hidden";
}
.cx-message .bench-well {
  max-height: 24rem;
  margin: 0;
  border-color: var(--border);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}
.cx-message.stepped {
  padding-left: 2.3rem;
}
.cx-message.stepped::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  bottom: 0;
  left: 0.72rem;
  width: 1px;
  background: var(--border-2);
}
.cx-message.stepped:last-child::before {
  display: none;
}

.cx-step {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.cx-by {
  padding: 0.08rem 0.5rem;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.cx-by b {
  color: var(--text);
  font-weight: 600;
}

.cx-size {
  margin-left: auto;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.cx-sent .bench-well {
  max-height: calc(6lh + 1.7rem + 2px);
  overflow-y: auto;
}

.cx-fold {
  margin-bottom: 0.5rem;
}

.cx-fold .bench-well {
  margin-top: 0.5rem;
  max-height: 24rem;
}

.cx-none {
  padding: 0 1.2rem 1rem;
}

.cx-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

.cx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.cx-table th,
.cx-table td {
  padding: 0.55rem 1.2rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.cx-table th {
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cx-table tbody tr:last-child td {
  border-bottom: 0;
}

.cx-row {
  cursor: pointer;
}
.cx-row:hover td {
  background: var(--surface-2);
}
.cx-row .chev {
  display: inline-block;
  color: var(--text-3);
  transition: transform var(--t-fast);
}
.cx-row.open .chev {
  transform: rotate(90deg);
  color: var(--accent);
}

.cx-score {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.cx-runs-row > td {
  padding: 0.2rem 1.2rem 1rem;
  background: rgba(0, 0, 0, 0.12);
}

.cx-run {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cx-run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.86rem;
}

.cx-reply {
  margin-top: 0.7rem;
}
.cx-reply .small {
  margin-bottom: 0.3rem;
}
.cx-reply .bench-well {
  max-height: 30rem;
  overflow: auto;
}

@media (max-width: 900px) {
  .dbg {
    grid-template-columns: 1fr;
  }
  .dbg-list {
    position: static;
    max-height: 45vh;
  }
  .bench-debug .filter-bar {
    position: static;
  }
}
@media (max-width: 600px) {
  .cx-head,
  .cx-description,
  .cx-description-edit,
  .cx-body {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  .cx-table th,
  .cx-table td {
    padding: 0.5rem 0.7rem;
  }
  .cx-runs-row > td {
    padding: 0.2rem 0.5rem 0.8rem;
  }
  .cx-run {
    padding: 0.7rem;
  }
}
.dbg-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
}
.dbg-tabs a {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.85rem;
  text-decoration: none;
}
.dbg-tabs a:hover {
  color: var(--text);
  border-color: var(--border-2);
}
.dbg-tabs a.on {
  color: var(--text);
  background: var(--accent-weak);
  border-color: var(--accent-line);
}

.case-search {
  width: calc(100% - 1.5rem);
  margin: 0.75rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  color: var(--text);
}

.case-row,
.call-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.case-row:hover,
.call-row:hover {
  background: var(--surface-2);
}
.case-row.sel,
.call-row.sel {
  background: var(--accent-weak);
  box-shadow: inset 2px 0 0 var(--accent);
}

.case-name {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.case-when,
.call-when {
  flex: none;
  font-size: 0.72rem;
  font-weight: 400;
}

.case-thesis {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-back {
  display: block;
  padding: 0.6rem 0.8rem 0;
  color: var(--text-2);
  font-size: 0.8rem;
  text-decoration: none;
}
.case-back:hover {
  color: var(--text);
}

.case-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0.8rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.case-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.call-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.call-line .grow {
  flex: 1;
}

.call-kind {
  flex: none;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.call-kind.k-write {
  color: var(--accent-strong);
  background: var(--accent-weak);
}
.call-kind.k-research {
  color: var(--blue);
  background: var(--blue-weak);
}
.call-kind.k-eval {
  color: var(--gold);
  background: var(--gold-weak);
}
.call-kind.k-bench {
  color: var(--green);
  background: var(--green-weak);
}

.call-side {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
}
.call-side.s-a {
  color: var(--accent);
}
.call-side.s-b {
  color: var(--blue);
}

.call-what {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-model {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-trouble {
  flex: none;
  color: var(--gold);
  font-size: 0.72rem;
}

.case-reader {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Whether a test is picked for the next run, on its own page: pressed to pick or unpick. */
.cx-in-run.on {
  border-color: #9fd49a;
  color: #9fd49a;
}

/* A test's conversations from before it was edited (local only): out of the way, under the
   models, each opened to read. */
.cx-earlier {
  margin: 0 1.3rem 1.2rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
}
.cx-earlier > summary {
  color: var(--text-2);
  font-size: 0.85rem;
  cursor: pointer;
}
.cx-earlier > p {
  margin: 0.5rem 0;
}

.cx-earlier-one {
  border-top: 1px solid var(--border);
}
.cx-earlier-one summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.cx-earlier-score {
  margin-left: auto;
  color: var(--c);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cx-earlier-thread {
  padding: 0 0 0.8rem;
}

/* The library's order picker, at the left of the row its Refresh button ends. */
.library-order {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.library-order .field-label {
  margin: 0;
}

.library-order .field-input {
  width: auto;
  min-width: 13rem;
}

/* ---- Prompt library, on the new-run page ---- */
.pl-panel {
  --pl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pl-how {
  margin: 0 0 0.85rem;
  max-width: 62rem;
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1.6;
}

.pl-panel code {
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-xs);
  background: var(--well);
  color: var(--text);
  font-family: var(--pl-mono);
  font-size: 0.82em;
}

.pl-unsaved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.85rem;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
}

.pl-body {
  display: grid;
  grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

/* The list stays in view while a long prompt scrolls past it. */
.pl-side {
  position: sticky;
  top: calc(var(--app-bar-h) + 0.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  max-height: calc(100vh - var(--app-bar-h) - 1.5rem);
}

.pl-side .field-input {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.pl-only {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.pl-list {
  flex: 1;
  min-height: 8rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}

.pl-folder-name {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.3rem 0.6rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.pl-folder-name:hover {
  color: var(--text);
}

.pl-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0.45rem 0.1rem 0.6rem;
  border-left: 2px solid transparent;
}

.pl-row:hover {
  background: var(--surface);
}

.pl-row.is-open {
  border-left-color: var(--accent);
  background: var(--surface-2);
}

.pl-row-name {
  flex: 1;
  min-width: 0;
  padding: 0.18rem 0;
  border: 0;
  background: none;
  overflow: hidden;
  color: var(--text);
  font-family: var(--pl-mono);
  font-size: 0.8rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.pl-row.is-unused .pl-row-name, .pl-row.is-off .pl-row-name {
  color: var(--text-3);
}

.pl-fold {
  flex: none;
  padding: 0 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.pl-fold:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.pl-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--text-3);
  border-radius: 50%;
}

.is-sent > .pl-dot, .is-sent > .pl-use-head > .pl-dot {
  border-color: var(--green);
  background: var(--green);
}

.is-included > .pl-dot, .is-included > .pl-use-head > .pl-dot {
  border-color: var(--blue);
  background: var(--blue);
}

.is-off > .pl-dot, .is-off > .pl-use-head > .pl-dot {
  border-color: var(--gold);
}

.pl-edited {
  flex: none;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
}

.pl-none {
  margin: 0;
  padding: 0.8rem;
  color: var(--text-3);
  font-size: 0.85rem;
}

.pl-new {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pl-main {
  min-width: 0;
}

.pl-editor {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pl-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
}

.pl-panel code.pl-name {
  padding: 0.15rem 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.pl-file {
  color: var(--text-3);
  font-size: 0.76rem;
}

.pl-tabs {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.pl-use {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
}

.pl-use-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pl-use-line {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.7;
}

.pl-on {
  color: var(--green);
}

.pl-off {
  color: var(--gold);
}

.pl-chip {
  margin: 0 0.1rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  background: var(--gold-weak);
  color: var(--gold);
  font-family: var(--pl-mono);
  font-size: 0.76rem;
  cursor: pointer;
}

.pl-chip:hover {
  background: rgba(237, 193, 52, 0.3);
}

.pl-chip.is-missing {
  border-color: var(--accent-line);
  background: none;
  color: var(--accent-strong);
  cursor: default;
}

/* The text box and, laid exactly over it, the same text with only its names showing.
   Both sit in one grid cell, so the box is as tall as the text and never scrolls. */
.pl-edit {
  display: grid;
}

.pl-edit.is-hidden {
  display: none;
}

.pl-text, .pl-mirror, .pl-sent {
  grid-area: 1/1;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--pl-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  tab-size: 4;
}

.pl-text {
  width: 100%;
  min-height: 6rem;
  overflow: hidden;
  resize: none;
  background: var(--well);
  color: var(--text);
}

.pl-text:focus {
  outline: none;
  border-color: var(--accent-line);
}

.pl-mirror {
  z-index: 1;
  min-height: 6rem;
  border-color: transparent;
  color: transparent;
  pointer-events: none;
  user-select: none;
}

.pl-mark {
  border-radius: var(--radius-xs);
  color: inherit;
}

.pl-mirror .pl-mark {
  pointer-events: auto;
  cursor: default;
}

.pl-mirror .pl-mark.is-link {
  cursor: pointer;
}

.pl-mark.is-prompt {
  background: rgba(237, 193, 52, 0.3);
  box-shadow: 0 0 0 1px var(--gold-line);
}

.pl-mark.is-value {
  background: var(--blue-weak);
  box-shadow: 0 0 0 1px rgba(79, 128, 230, 0.5);
}

.pl-mark.is-missing {
  background: var(--accent-weak);
  box-shadow: 0 0 0 1px var(--accent-line);
}

.pl-mirror .pl-mark.is-link:hover {
  background: rgba(237, 193, 52, 0.5);
}

.pl-how .pl-mark, .pl-legend .pl-mark {
  padding: 0.05rem 0.3rem;
  color: var(--text);
  font-family: var(--pl-mono);
  font-size: 0.82em;
}

.pl-sent {
  background: var(--well);
  color: var(--text-2);
}

.pl-peek {
  position: fixed;
  z-index: 50;
  width: 36rem;
  max-width: calc(100vw - 2rem);
  max-height: 45vh;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.pl-peek-head {
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--gold);
  font-family: var(--pl-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.pl-peek-body {
  padding: 0.5rem 0.65rem;
  color: var(--text);
  font-family: var(--pl-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.pl-values {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.pl-values-head {
  color: var(--text-2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pl-value {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: 0.75rem;
  align-items: baseline;
  color: var(--text-2);
  line-height: 1.7;
}

.pl-value > code {
  justify-self: start;
  background: var(--blue-weak);
}

.pl-problem {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.pl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pl-save:not(:disabled) {
  border-color: var(--green);
  color: var(--text);
  background: var(--green-weak);
}

.pl-legend {
  color: var(--text-3);
  font-size: 0.76rem;
}

.pl-delete {
  margin-left: auto;
}

@media (max-width: 760px) {
  .pl-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .pl-side {
    position: static;
    max-height: none;
  }
  .pl-list {
    max-height: 16rem;
  }
  .pl-value {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
