/* ── Body / main overrides ─────────────────────────────── */

:root {
  --navbar-height: 64px;
  --announce-height: 0px; /* the competition strip's height while it shows; phail_base.html sets it */
}

body {
  overflow: auto !important;
  background-attachment: fixed;
}

.main {
  max-height: none !important;
}

.main--full-screen {
  height: calc(100dvh - var(--navbar-height) - var(--announce-height));
}

.breadcrumbs {
  flex: 1;
}

/* ── Competition strip above the navbar, in the competition site's violet ── */

.announce {
  --announce-ground: #5d52f6;
  --announce-pill: #e0ff4f;
  --announce-pill-text: #052b42;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.5rem 2.75rem 0.5rem 0;
  background: var(--announce-ground);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.35;
}

.announce[hidden] { display: none; }

.announce-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

/* The line once, for screen readers; the moving copies are aria-hidden. */
.announce-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.announce-ticker {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
}

/* Two identical halves, so a shift of -50% loops without a jump. */
.announce-track {
  display: flex;
  width: max-content;
  animation: announce-scroll 60s linear infinite;
}

.announce-item { white-space: nowrap; }

.announce-item::after {
  content: "\2726";
  margin: 0 1.25rem;
  color: var(--announce-pill);
}

.announce-link:hover .announce-track,
.announce-link:focus-visible .announce-track { animation-play-state: paused; }

@keyframes announce-scroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .announce-track { animation: none; }
}

.announce-cta {
  flex: none;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--announce-pill);
  color: var(--announce-pill-text);
  font-weight: 700;
  white-space: nowrap;
}

.announce-link:hover .announce-cta { background: #ffffff; }

.announce-close {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  padding: 0.4rem;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.announce-close:hover { color: #ffffff; }

@media (max-width: 640px) {
  .announce {
    padding-right: 2.25rem;
    font-size: 0.85rem;
  }

  .announce-link { gap: 0.6rem; }

  .announce-cta { padding: 0.25rem 0.65rem; }

  .announce-close { right: 0.3rem; }
}

/* ── PhAIL Navbar ─────────────────────────────────────── */

.phail-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-height);
  box-sizing: border-box;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(rgba(10, 15, 30, 0.95), rgba(10, 15, 30, 0.9), rgba(10, 15, 30, 0.7));
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.navbar-brand-mark-link {
  display: inline-flex;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
}

.navbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.navbar-brand-name {
  align-self: flex-start;
  font-size: 1.8rem;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.navbar-brand-name:hover { color: var(--accent); }

.navbar-brand-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.navbar-brand-byline {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.navbar-brand-link,
.navbar-sponsor a,
.footer-link {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px dotted rgba(148, 163, 184, 0.4);
  transition: color 0.18s;
}

.navbar-brand-link { color: var(--text-muted); }

.navbar-brand-link:hover,
.navbar-sponsor a:hover,
.footer-link:hover {
  color: var(--accent);
}

/* ── Nav links ────────────────────────────────────────── */

.navbar-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.navbar-links a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.08s;
}

.navbar-links a:hover {
  color: var(--accent);
  background-color: rgba(177, 231, 79, 0.1);
}

.navbar-links a.active {
  background-color: var(--accent);
  color: var(--text-invert);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.9), 0 10px 24px rgba(177, 231, 79, 0.35);
}

.navbar-links a.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(177, 231, 79, 0.5);
}

/* The Benchmarks menu: a summary in the shape of a link, and a panel of links under it. */
.navbar-menu { position: relative; }

.navbar-menu summary {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}

.navbar-menu summary::-webkit-details-marker { display: none; }
.navbar-menu summary::after { content: ' \25BE'; font-size: 0.75em; }
.navbar-menu summary:hover { color: var(--accent); background-color: rgba(177, 231, 79, 0.1); }
.navbar-menu:has(a.active) summary { color: var(--accent); }

.navbar-menu-items {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(10, 15, 30, 0.98);
}

.navbar-menu-items a { border-radius: 8px; }

/* ── Navbar sponsor ───────────────────────────────────── */

.navbar-sponsor {
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Page header ─────────────────────────────────────── */

.page-header p { max-width: none; }

.page-kicker a {
  color: var(--accent);
  text-decoration: none;
}

.page-kicker a:hover {
  text-decoration: underline;
}

.page-header p a { color: var(--accent); text-decoration: none; }
.page-header p a:hover { text-decoration: underline; }

/* ── Table ────────────────────────────────────────────── */

.table-wrapper {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: #0c1120;
}

tbody tr:has(.cell-baseline) {
  background: linear-gradient(to right, rgba(147, 197, 253, 0.06), rgba(147, 197, 253, 0.03));
}

tbody tr:has(.cell-baseline):hover {
  background: linear-gradient(to right, rgba(147, 197, 253, 0.12), rgba(147, 197, 253, 0.08));
}

.cell-with-icon a {
  color: inherit;
  text-decoration: none;
}

.cell-with-icon a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

/* The rank header only: a second header row starts with a score column. */
.episodes-table thead tr:first-child th:first-child { padding-right: 0; }

.episodes-table td:first-child {
  width: 1ch;
  padding-right: 0;
  color: var(--text-muted);
}

.episodes-table tr:has(.cell-tags) td:first-child {
  vertical-align: top;
  padding-top: 0.85rem;
}

/* ── Leaderboard (home) ───────────────────────────────── */

.leaderboard-table .cell-score { text-align: right; }

.score-value,
.score-range { white-space: nowrap; }

/* The model column takes the spare width. It stays in view when more benchmarks than fit scroll sideways. */
.leaderboard-table .cell-model { width: 100%; position: sticky; left: 0; z-index: 1; background: #0c1120; }

/* An opaque cell hides the row's hover, so the model cell paints the hover itself. */
.leaderboard-table tbody tr:hover td.cell-model {
  background: linear-gradient(var(--accent-muted), var(--accent-muted)), #0c1120;
}

.leaderboard-table td.cell-model { padding-right: 2.1rem; color: inherit; }

/* One column per benchmark, as wide as its header card, with a rule before it. */
.leaderboard-table th.cell-benchmark,
.leaderboard-table td.cell-score {
  min-width: 15rem;
  border-left: 1px solid var(--border-subtle);
  padding-left: 1.5rem;
}

.leaderboard-table th.cell-benchmark {
  padding: 0.6rem;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  vertical-align: bottom;
}

.leaderboard-table th.cell-benchmark .metric-head { display: flex; margin: 0.6rem 0.3rem 0 0; }

/* The reference row: a person, the scale for the models, set apart from the ranked rows under it. */
tbody tr.row-reference { background: linear-gradient(to right, rgba(147, 197, 253, 0.06), rgba(147, 197, 253, 0.03)); }
.leaderboard-table tr.row-reference td { border-bottom: 1px solid var(--border-strong); }
.leaderboard-table tr.row-reference td.cell-model { background: #111a2c; }
tbody tr.row-reference:hover { background: linear-gradient(to right, rgba(147, 197, 253, 0.12), rgba(147, 197, 253, 0.08)); }
.leaderboard-table tr.row-reference:hover td.cell-model { background: #1c273b; }

.reference-tag {
  margin-left: 0.6rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
  white-space: nowrap;
}

.table-updated { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--text-muted); }

/* Under the home table: one episode that plays in place, and a link to its benchmark's episode list. */
.home-replay {
  display: grid;
  grid-template-columns: minmax(0, 32rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin: 2.5rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: #0c1120;
}

.home-replay-video { display: block; }
.home-replay-clip { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-radius: 8px; background: #000; }
.home-replay-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; color: var(--text-secondary); }
.home-replay-text h2 { margin: 0 0 0.5rem; font-size: 1.35rem; color: var(--text-primary); }
.home-replay-link { margin-top: 0.9rem; font-weight: 650; color: var(--accent); text-decoration: none; }
.home-replay-link:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .home-replay { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; margin-top: 1.75rem; padding: 0.5rem 0.5rem 0.9rem; }
  .home-replay-text { padding: 0 0.25rem; }
}

/* The benchmark's column header is a card that opens its page. */
.benchmark-card {
  --benchmark-card-bg: #0c1426;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.9rem 0.45rem 0.45rem;
  border: 1px solid rgba(177, 231, 79, 0.38);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(177, 231, 79, 0.13), rgba(177, 231, 79, 0.02) 65%), var(--benchmark-card-bg);
  box-shadow: 0 14px 32px -16px rgba(177, 231, 79, 0.5);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  /* Safari otherwise sizes the column narrower than the card's text. */
  min-width: max-content;
}

.benchmark-card:hover {
  border-color: rgba(177, 231, 79, 0.75);
  box-shadow: 0 18px 40px -14px rgba(177, 231, 79, 0.6);
  transform: translateY(-1px);
}

.benchmark-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* The benchmark's pictogram: an SVG in the site's palette, on the card's own surface. */
.benchmark-pictogram {
  flex: 0 0 3.5rem;
  height: 3.5rem;
  border-radius: 8px;
  background: rgba(10, 15, 30, 0.6);
}

.benchmark-pictogram img {
  display: block;
  width: 100%;
  height: 100%;
}

.benchmark-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}

.benchmark-name {
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* A line breaks between words only, never at the hyphen in "pick-and-place". */
.benchmark-word { white-space: nowrap; }

.benchmark-short-name,
.model-short-name { display: none; }

.benchmark-size {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .benchmark-card { transition: none; }

  .benchmark-card:hover { transform: none; }
}

/* A metric's column header: the name, and its unit on the line under it, the same shape for every metric. */
.metric-head {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.metric-unit {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
}

/* A value and its ± range. The range keeps one width, so a right-aligned column lines up its points; ± sits beside the number. */
.score {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.score .score-range {
  display: inline-flex;
  justify-content: flex-end;
  gap: 0.25em;
  width: 6ch;
}

.score-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.score-range {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* The model's name and a cover link in every other cell take a click anywhere in the row to the model's page. */
.leaderboard-table tbody td { position: relative; }

.row-link::after,
.row-cover {
  content: '';
  position: absolute;
  inset: 0;
}

.leaderboard-table tbody tr:hover .row-link {
  color: #c4b5fd;
  text-decoration: underline;
}

.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.table-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* A phone shows each benchmark and each model by its short name, and each score as its value over its ±. */
@media (max-width: 640px) {
  .leaderboard-table th.cell-benchmark,
  .leaderboard-table td.cell-score { min-width: 0; padding-left: 0.4rem; padding-right: 0.4rem; }
  .leaderboard-table td.cell-model { padding-right: 0.5rem; white-space: normal; }
  .leaderboard-table .cell-icon { width: 20px; height: 20px; margin-right: 0; }
  .benchmark-card { width: fit-content; margin-left: auto; padding: 0.35rem 0.55rem; }
  .benchmark-pictogram,
  .benchmark-name,
  .benchmark-size,
  .model-full-name { display: none; }
  .benchmark-short-name { display: block; font-size: 0.8rem; font-weight: 650; white-space: nowrap; }
  .model-short-name { display: inline; }
  .leaderboard-table .score { flex-direction: column; align-items: flex-end; gap: 0; }
  .leaderboard-table .score-value { font-size: 0.95rem; }
  /* The icon keeps its place left of the name in every row; a name too long for one line wraps beside it. */
  .leaderboard-table .cell-with-icon { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 0.45rem; }
  .leaderboard-table .row-link { font-size: 0.85rem; }
  .reference-tag { grid-column: 2; justify-self: start; margin: 0.2rem 0 0; }
}

/* The model page's benchmark tabs. */
.leaderboard-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.leaderboard-tab[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(177, 231, 79, 0.45);
}

.leaderboard-tab img { width: 1.4rem; height: 1.4rem; }

/* ── Content pages (About, Submit) ────────────────────── */

.main--narrow { max-width: 960px; }

.card--content {
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card--content h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card--content p {
  margin: 0 0 0.75rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.card--content p:last-child { margin-bottom: 0; }

.card--content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.card--content a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}

.card--content a:hover { opacity: 0.85; }

.bullet-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.bullet-list li { margin-bottom: 0.4rem; }

.card--content ol {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card--content ol li { margin-bottom: 0.4rem; }

/* Prose tables scroll within their card instead of overrunning narrow viewports. */
.card--content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.about-grid .card--content { margin-bottom: 0; }
.about-grid .code-block { font-size: 0.75rem; }

.card--cta {
  border-color: rgba(177, 231, 79, 0.2);
  background: linear-gradient(135deg, rgba(177, 231, 79, 0.04), transparent 60%), var(--card-bg);
}

/* ── Code blocks ─────────────────────────────────────── */

.code-tabs-bar {
  display: flex;
}

.code-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.code-tab + .code-tab { border-left: none; }
.code-tab:hover { color: var(--text-primary); }

.code-tab.active {
  color: var(--text-primary);
  background: rgba(177, 231, 79, 0.06);
  border-bottom-color: transparent;
}

.code-tabs .code-block {
  margin-top: 0;
  border-top-left-radius: 0;
}

.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.code-block code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

.code-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.code-copy:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ── Site footer ──────────────────────────────────────── */

.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at left bottom, rgba(177, 231, 79, 0.12), transparent 60%), var(--bg-body);
  padding: 0.9rem 1.5rem 1.4rem;
}

.site-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-separator { opacity: 0.5; }

/* The "Keep in touch" form above the footer line. */
.updates-form {
  max-width: 1400px;
  margin: 0 auto 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.updates-text { flex: 0 1 auto; }

/* iOS Safari zooms into a field whose text is under 16 px. */
.updates-form input[type="email"] {
  flex: 0 1 16rem;
  padding: 0.45rem 0.8rem;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.updates-form input[type="email"]::placeholder { color: var(--text-muted); }

.updates-form input[type="email"]:focus {
  outline: none;
  border-color: rgba(177, 231, 79, 0.55);
  box-shadow: 0 0 0 2px rgba(177, 231, 79, 0.15);
}

.updates-status { color: var(--accent); }
.updates-status.is-error { color: #ff8a80; }

@media (max-width: 520px) {
  .updates-form input[type="email"], .updates-form button { flex: 1 1 100%; }
}

/* ── Cookie consent banner ────────────────────────────── */

.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.4rem 2.2rem;
  background: rgba(15, 20, 40, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(177, 231, 79, 0.08);
}

.cookie-banner[hidden] { display: none; }
.cookie-banner-text { font-size: 1rem; color: var(--text-secondary); }
.cookie-banner-buttons { display: flex; gap: 0.5rem; }

.cookie-btn {
  padding: 0.55rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.cookie-btn--decline {
  background: transparent;
  color: var(--text-soft);
  border-color: rgba(148, 163, 184, 0.25);
}

.cookie-btn--decline:hover {
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.45);
}

.cookie-btn--accept {
  background: var(--accent);
  color: var(--text-invert);
  border: none;
}

.cookie-btn--accept:hover {
  box-shadow: 0 4px 16px rgba(177, 231, 79, 0.35);
}

/* ── Hamburger button (hidden on desktop) ────────────── */

.navbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.navbar-hamburger:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.1);
}

.navbar-hamburger .close-icon { display: none; }
.navbar-hamburger[aria-expanded="true"] .hamburger-icon { display: none; }
.navbar-hamburger[aria-expanded="true"] .close-icon { display: block; }

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 960px) {
  .phail-navbar { padding-inline: 1.1rem; }
  .main { padding-inline: 1.1rem; }
  /* minmax(0,1fr) — not bare 1fr — so the column can shrink below the code
     blocks' min-content width and they scroll instead of overrunning. */
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .cookie-banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    transform: none;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.2rem;
  }
}

/* ── Mobile: hamburger menu + video viewer ───────────── */

.mobile-only { display: none; }

@media (max-width: 960px) {
  :root { --navbar-height: 48px; }

  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .sidebar, .sidebar-toggler { display: none !important; }

  .phail-navbar {
    padding: 0 0.8rem;
    height: var(--navbar-height);
  }

  .navbar-brand-icon { width: 28px; height: 28px; }
  .navbar-brand-name { font-size: 1.3rem; }
  .navbar-brand-byline { display: none; }

  .navbar-hamburger { display: flex; }

  .navbar-links {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0;
    background: rgba(10, 15, 30, 0.99);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    z-index: 99;
  }

  .navbar-links.open { display: flex; }

  /* On a phone the Benchmarks menu lists its links in place, indented under its name. */
  .navbar-menu summary { display: block; padding: 0.7rem 1.2rem; font-size: 0.95rem; border-radius: 0; }
  .navbar-menu-items { position: static; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; }
  .navbar-menu-items a { padding-left: 2.2rem; }

  .navbar-links a {
    display: block;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 0;
  }

  .navbar-links a.active {
    background-color: rgba(177, 231, 79, 0.12);
    color: var(--accent);
    box-shadow: none;
  }

  .main--full-screen .header { padding: 0.3rem 0.5rem; }
  .main--full-screen .breadcrumbs { font-size: 0.85rem; flex-wrap: wrap; gap: 0.2rem; }
  .episode-nav { font-size: 0.85rem; }
  .episode-container { height: calc(100vh - var(--navbar-height) - var(--announce-height) - 5rem); }

  #mobile-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
  }

}

/* ── Eval CTA (homepage hero) ─────────────────────────── */

.eval-cta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 0.25rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(177, 231, 79, 0.3);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(177, 231, 79, 0.08), transparent 70%);
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, transform 0.08s;
}

.eval-cta:hover {
  border-color: rgba(177, 231, 79, 0.55);
  background: rgba(177, 231, 79, 0.12);
  transform: translateY(-1px);
}

.eval-cta-text { font-size: 0.95rem; }
.eval-cta-text strong { color: var(--text-primary); font-weight: 650; }
.eval-cta-arrow { color: var(--accent); font-weight: 700; font-size: 1.1rem; }

/* ── Hero two-column (homepage) ───────────────────────── */

.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-copy { flex: 1 1 420px; }
.hero-copy .page-kicker,
.hero-copy h1 { margin-top: 0; }

.eval-cta--hero {
  flex: 0 0 auto;
  align-self: center;
  max-width: 380px;
  margin: 0;
  padding: 1.1rem 1.4rem;
  border-radius: 16px;
}

.eval-cta--hero .eval-cta-text { font-size: 0.9rem; line-height: 1.5; }
.eval-cta--hero .eval-cta-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

@media (max-width: 760px) {
  .eval-cta--hero { flex: 1 1 100%; align-self: stretch; max-width: none; }
}

/* ── Interest form (eval page) ────────────────────────── */

.interest-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
/* `display: flex` above would keep a hidden form on screen. */
.interest-form[hidden] { display: none; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* iOS Safari zooms into a field whose text is under 16 px. */
.interest-form input {
  flex: 1 1 220px;
  padding: 0.65rem 0.9rem;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.interest-form input::placeholder { color: var(--text-muted); }

.heard-from {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.heard-from legend { float: left; margin-right: 0.3rem; padding: 0; }
.heard-from label { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.heard-from input[type="checkbox"] { flex: none; margin: 0; accent-color: var(--accent); }
.interest-form .heard-from input[type="text"] { flex: 0 1 12rem; padding: 0.3rem 0.6rem; }

.interest-form input:focus {
  outline: none;
  border-color: rgba(177, 231, 79, 0.55);
  box-shadow: 0 0 0 2px rgba(177, 231, 79, 0.15);
}

.interest-error { margin-top: 1rem !important; color: #ff8a80; }

.interest-thanks {
  margin-top: 1rem !important;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 520px) {
  .interest-form > input, .interest-form button { flex: 1 1 100%; }
}

/* ── Benchmark page ───────────────────────────────────── */

/* Wider than the other pages: a wide screen gives the charts beside the table more room. */
.main.bench { max-width: 110rem; }

/* Short replays at the top of the page. Each plays its episode's exterior camera and opens its model's page at this
   benchmark. */
.bench-replays {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.replay-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.5rem 0.5rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: #0c1120;
  color: var(--text-secondary);
  text-decoration: none;
}

.replay-card:hover { border-color: rgba(177, 231, 79, 0.6); }
/* The card shows the top 16:9 of its video: of a Pick and Place video, the exterior camera over the wrist camera. */
.replay-card video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-radius: 8px; background: #000; }
.replay-model { display: inline-flex; align-items: center; font-weight: 600; color: var(--text-primary); }
.replay-model .cell-icon { width: 18px; height: 18px; margin-right: 0.45rem; }
.replay-task { font-size: 0.85rem; }
.replay-caption { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* A phone scrolls the replays sideways, so they keep one row. */
@media (max-width: 640px) {
  .bench-replays {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 75%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .replay-card { scroll-snap-align: start; }
}

/* The charts past the Reliability chart, folded under one line. */
.bench-more { margin-top: 2rem; }

.bench-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-invert);
  font-size: 1rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(177, 231, 79, 0.25);
  transition: box-shadow 0.18s, transform 0.08s;
}

.bench-more > summary::-webkit-details-marker { display: none; }
.bench-more > summary::before { content: '\25B8'; transition: transform 0.15s; }
.bench-more[open] > summary::before { transform: rotate(90deg); }
.bench-more > summary:hover { box-shadow: 0 6px 22px rgba(177, 231, 79, 0.45); transform: translateY(-1px); }
.bench-more > .bench-charts { margin-top: 1rem; }

.bench-curve h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }

.bench-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0 0 1rem;
}

.bench-control {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* A select is as wide as its longest option, and a DROID task is a sentence: the page width caps it. */
.bench-control select { min-width: 0; max-width: 100%; }

.bench-control-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.bench-control select,
.bench-compare-pick select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  font: inherit;
}

.bench-control--time { display: flex; margin: 0 0 1rem; }

/* iOS Safari zooms into a field whose text is under 16 px. */
@media (pointer: coarse) {
  .bench-control select, .bench-compare-pick select { font-size: 16px; }
}
.bench-control--time input { flex: 1 1 auto; max-width: 28rem; accent-color: var(--accent); }

.bench-control--time output {
  min-width: 3.2rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* The table keeps its full width beside the charts. Where both do not fit on one line, the charts go below it. */
.bench-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.bench-ranking { flex: 1 1 auto; min-width: 0; }

/* The note wraps to the table's width, and does not set it. */
.bench-ranking .table-note { contain: inline-size; }

.bench.is-loading .bench-layout { opacity: 0.55; transition: opacity 0.15s; }

.bench-table th,
.bench-table td { padding-right: 1.1rem; }
.bench-table .cell-score { width: 8.5rem; min-width: 8.5rem; text-align: right; }
.bench-table .cell-metric-first { border-left: 1px solid var(--border-subtle); }
/* The metric names fill the first header row and their units the second, so each row is level across the metrics. */
.bench-table thead th { vertical-align: bottom; }
.bench-table thead tr:first-child .cell-score { padding-bottom: 0.15rem; border-bottom: 0; }
.bench-table thead tr + tr th { padding-top: 0; border-radius: 0; vertical-align: top; }
.bench-table .cell-runs { text-align: right; }
.bench-table .runs-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  cursor: pointer;
}
.bench-table .runs-link:hover { color: var(--accent); }
.bench-table .cell-model { width: 100%; white-space: normal; }
/* Fixed-width numbers, so moving the time limit never changes the table's width. */
.bench-table td.cell-rank { width: 3ch; white-space: nowrap; }
.bench-table [data-time] { display: inline-block; min-width: 2.4em; text-align: center; font-variant-numeric: tabular-nums; }
.bench-table tbody tr.is-focus td { background: rgba(148, 163, 184, 0.1); }

.bench-swatch {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.5rem;
  border-radius: 2px;
}

.bench-loading { color: var(--text-muted); text-align: center; padding: 1.5rem; }

/* The charts take nearly all the spare width, so the table grows only on a line of its own. */
.bench-charts {
  flex: 1000 1 30rem;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem 1.25rem;
}

.bench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.bench-tabs button {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.bench-tabs button:hover { border-color: var(--border-strong); color: var(--text-primary); }

.bench-tabs button[aria-selected="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-soft-strong);
  color: var(--text-primary);
}

.bench-panel h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }

.bench-panel h3 {
  margin: 1rem 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.bench-question { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--text-muted); }

.bench-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin-bottom: 0.5rem;
}

.bench-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 0.15rem 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
}

.bench-key { display: inline-block; width: 1rem; height: 2px; border-radius: 1px; }
.bench-key--dashed { background-image: repeating-linear-gradient(90deg, var(--bg-surface) 0 3px, transparent 3px 6px); }

.bench-chart { position: relative; }
.bench-svg { display: block; touch-action: pan-y; user-select: none; }

.bench-grid-lines line { stroke: rgba(148, 163, 184, 0.12); stroke-width: 1; }
.bench-baseline { stroke: var(--border-strong); stroke-width: 1; }
.bench-zero { stroke: var(--border-strong); stroke-width: 1; }
.bench-axis { fill: var(--text-muted); font-size: 11px; }

.bench-series { transition: opacity 0.12s; }
.bench-series.is-dim { opacity: 0.15; }
.bench-series.is-focus .bench-line { stroke-width: 3; }

.bench-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bench-line--dashed { stroke-dasharray: 5 4; }
.bench-line--gap { stroke: var(--text-secondary); }
.bench-band { opacity: 0.14; stroke: none; }
.bench-whisker { stroke-width: 1.5; stroke-dasharray: 4 3; }
.bench-dot { stroke: var(--bg-surface); stroke-width: 2; }

.bench-marker line,
.bench-marker-line { stroke: var(--accent); stroke-width: 1.5; }
/* A halo in the panel colour keeps the label readable where it crosses a curve. */
.bench-marker-label { fill: var(--accent); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--bg-surface); stroke-width: 4px; stroke-linejoin: round; }
.bench-crosshair { stroke: var(--text-soft); stroke-width: 1; }
.bench-panel[data-panel="curve"] .bench-svg { cursor: ew-resize; }

.bench-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow-soft);
}

.bench-tooltip-title { color: var(--text-muted); margin-bottom: 0.2rem; }

.bench-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.bench-tooltip-row strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bench-tooltip-label { color: var(--text-secondary); }
.bench-empty { color: var(--text-muted); }

.bench-compare-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.bench-verdict { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--text-secondary); }
.bench-verdict strong { color: var(--text-primary); }
.bench-verdict-now { display: block; margin-top: 0.25rem; }

@media (max-width: 640px) {
  .bench-charts { padding: 0.75rem; }
  .bench-table th,
  .bench-table td { padding-inline: 0.35rem; white-space: normal; }
  .bench-table .cell-score { width: auto; min-width: 0; }
  /* The runs count lives on each model's page; the phone keeps the table to the screen's width. */
  .bench-table .cell-runs { display: none; }
  .bench-table th { font-size: 0.62rem; letter-spacing: 0.04em; }
  /* A metric name breaks only before "@ N s", so every name wraps the same way. */
  .bench-table .metric-at,
  .bench-table .metric-unit { white-space: nowrap; }
  /* The value over its ±, so the two numbers keep two narrow columns. */
  .bench-table .score { flex-direction: column; align-items: flex-end; gap: 0; }
}

/* ── Model page ───────────────────────────────────────── */

/* The model's series colour, the one every chart gives it, marks this model wherever the page shows it. */
/* The swatch and the icon sit on the first line of a name that wraps. */
.model-name {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.15;
}

.model-name > span:last-child { min-width: 0; }

.model-swatch {
  flex: none;
  width: 0.38em;
  height: 0.38em;
  margin-top: 0.385em;
  border-radius: 3px;
  background: var(--model-color);
}

.model-icon { flex: none; width: 1em; height: 1em; margin-top: 0.075em; object-fit: contain; }
.model-header .cell-tags { margin-top: 0.6rem; }

.model-summary,
.model-run,
.model-runs { margin-bottom: 2.75rem; }

.model-section { min-width: 0; }

.model-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.model-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem 1.25rem;
}

.model-lead { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--text-secondary); }

/* Progress through a run: one chart under the benchmarks, with a tab per object. The bands are the report card's
   stack; the mean line wears a halo, so it reads over any band. */

.model-main { display: flex; flex-direction: column; gap: 2rem; min-width: 0; }

.progress-legend,
.droid-progress-legend,
.robolab-progress-legend,
.molmospaces-progress-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.55rem;
  margin-bottom: 1rem;
}

.progress-legend-item { gap: 0.3rem; cursor: default; }
.progress-legend-note { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 0.6rem; font-size: 0.82rem; color: var(--text-muted); }
.progress-key { display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 3px; }
.progress-key--mean { width: 1.1rem; height: 0; border-radius: 0; border-top: 2px dashed var(--text-primary); }

.progress-tabs { margin-bottom: 0.75rem; }

.progress-panel { min-width: 0; }
.progress-panel h3 { margin: 0 0 0.35rem; font-size: 0.92rem; font-weight: 600; color: var(--text-primary); }
.progress-panel h3 span { margin-left: 0.6rem; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.progress-band { stroke: none; transition: opacity 0.08s linear; }
.has-lit .progress-band { opacity: 0.28; }
.has-lit .progress-band.is-lit { opacity: 1; }
.progress-seam { fill: none; stroke: var(--bg-surface); stroke-width: 1; }
.progress-mean-halo { fill: none; stroke: var(--bg-surface); stroke-width: 4; stroke-linejoin: round; opacity: 0.85; }
.progress-mean { fill: none; stroke: var(--text-primary); stroke-width: 1.6; stroke-dasharray: 5 3; stroke-linejoin: round; }
.progress-mean-dot { fill: var(--text-primary); stroke: var(--bg-surface); stroke-width: 2; }
.progress-chart .bench-axis { font-size: 13px; }

.progress-mean-label {
  fill: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--bg-surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.model-benchmark-task { font-weight: 600; }
.model-benchmark-size {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Model card */

/* The short facts fill a grid of up to three columns; the long ones take the full width under them. */
.model-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.model-facts--long { grid-template-columns: minmax(0, 1fr); padding-top: 0; border-top: 0; margin-top: 1rem; }

.model-fact { display: flex; flex-direction: column; gap: 0.25rem; }

.model-fact dt {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.model-fact dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.model-fact dd a { color: var(--accent); text-decoration: none; }
.model-fact dd a:hover { text-decoration: underline; }

.model-fact dd .model-fact-source {
  margin-left: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.model-fact dd .model-fact-source:hover { color: var(--accent); }

.model-run .run-checkpoint { margin: 0; font-weight: 600; }
.model-run .run-step { margin: 0.75rem 0 0; color: var(--text-secondary); }
.model-run .run-step:first-of-type { margin-top: 0; }
.model-run .code-block { margin: 0.4rem 0 0; padding-right: 3rem; overflow-wrap: normal; }
.model-run .run-guide { margin: 0; font-size: 0.92rem; }
.model-run .run-guide a { color: var(--accent); text-decoration: none; }
.model-run .model-fact-source { margin-left: 0.2rem; font-size: 0.75rem; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.model-run .model-fact-source:hover { color: var(--accent); }

/* The facts after the first three fold under one line on a phone; a wider screen shows them open, with no line. */
.model-facts--rest { padding-top: 0; border-top: 0; margin-top: 1rem; }
.model-facts-more > summary {
  display: block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.model-facts-more > summary::-webkit-details-marker { display: none; }
.model-facts-more > summary::after { content: ' \25BE'; }
.model-facts-more[open] > summary::after { content: ' \25B4'; }
@media (min-width: 641px) { .model-facts-more > summary { display: none; } }


/* A phone gives the progress chart the panel's side padding; the axis labels keep it off the border. */
@media (max-width: 640px) {
  .progress-chart { margin-inline: -1.25rem; }
}

@media (max-width: 640px) {
  .page-header h1.model-name { font-size: 1.75rem; }
}

/* ── DROID benchmark ──────────────────────────────────── */

.droid-reach { margin-top: 2.5rem; }
.droid-reach h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }

.reach-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.reach-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }

.reach-swatch { width: 0.75rem; height: 0.75rem; border-radius: 3px; }

.reach-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.6rem 1rem; align-items: center; }
.reach-model { font-size: 0.9rem; color: var(--text-primary); white-space: nowrap; }

/* A 100% bar per model. The 2 px gaps show the surface between the segments. */
.reach-bar { display: flex; gap: 2px; height: 1.1rem; }
.reach-segment { position: relative; min-width: 2px; cursor: default; transition: transform 0.15s, box-shadow 0.15s; }
.reach-segment:first-child { border-radius: 4px 0 0 4px; }
.reach-segment:last-child { border-radius: 0 4px 4px 0; }
.reach-segment:only-child { border-radius: 4px; }

/* A hovered or tapped stage lifts in every bar, and its name shows over the segment under the pointer. */
.reach-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.reach-segment--tip-start .reach-tip { left: 0; transform: none; }
.reach-segment--tip-end .reach-tip { left: auto; right: 0; transform: none; }
.reach-segment.is-lit { transform: translateY(-4px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55); z-index: 2; }
.reach-segment.is-pointed .reach-tip { opacity: 1; }


@media (max-width: 640px) {
  .reach-rows { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .reach-bar { margin-bottom: 0.6rem; }

}

/* ── Episode list ─────────────────────────────────────── */

.bench-episodes { margin-top: 2.5rem; scroll-margin-top: 5rem; }
.bench-episodes h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }

/* positronic's <positronic-replay>, in the site's colours: the list, and the dock its replay opens in at the bottom of
   the window. A rule reaches a node in the element by its part. The list is as wide as its table's columns need, not
   the page, and centered. */
.episode-list {
  --replay-accent: var(--accent);
  --replay-border: var(--border-subtle);
  --replay-muted: var(--text-muted);
  --replay-hover: rgba(177, 231, 79, 0.06);
  --replay-current: rgba(177, 231, 79, 0.12);
  --replay-surface: var(--bg-surface);
  --replay-surface-ink: var(--text-primary);
  --replay-sticky-top: var(--navbar-height);
  display: grid;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  color-scheme: dark;
}

/* The filters take the table's width, not their own. */
.episode-list::part(filters) { width: 0; min-width: 100%; gap: 0.75rem 1.25rem; }
.episode-list::part(filter) { gap: 0.6rem; min-width: 0; max-width: 100%; overflow: hidden; color: var(--text-secondary); font-size: 0.9rem; }
.episode-list::part(filter-label) { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
/* A filter looks like the site's other selects. */
.episode-list::part(filter-select) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  font: inherit;
}
.episode-list::part(count) { margin-left: auto; font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* Width 0: a copy that widened the list would stretch the table it copies. */
.episode-list::part(sticky-head) { width: 0; min-width: 100%; background: var(--panel-bg); }

/* The result in the color the model page's progress card gives it, and the task's difficulty in its own color. */
.episode-list::part(badge) {
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* One row per episode, the task's words first. */
.episode-list::part(table) { font-size: 0.85rem; }
.episode-list::part(head-cell),
.episode-list::part(cell) { padding: 0.55rem 0.8rem; border-top: 1px solid var(--border-subtle); border-bottom: 0; }
.episode-list::part(head-cell) {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
/* A task longer than its column ends in an ellipsis; the cell's title holds the whole task. */
.episode-list::part(cell column-text) { min-width: 12rem; max-width: 26rem; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
/* A column of badges centres them, on a computer; a phone's card keeps each value under its label. */
@media (min-width: 641px) {
  .episode-list::part(cell column-badge),
  .episode-list::part(head-cell column-badge) { text-align: center; }
}
.episode-list::part(row current) { box-shadow: none; }
.episode-list::part(with-icon) { vertical-align: middle; }

.episode-list::part(more) {
  padding: 0.45rem 1.1rem;
  border-color: var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 600;
}
.episode-list::part(more):hover { border-color: rgba(177, 231, 79, 0.6); color: var(--text-primary); }

/* A phone shows each episode as a card: the task, then each value under its label. */
@media (max-width: 640px) {
  .episode-list { display: block; width: auto; }
  .episode-list::part(filters) { width: auto; }
  .episode-list::part(sticky-head),
  .episode-list::part(head-cell) { display: none; }
  .episode-list::part(row) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 0.8rem; padding: 0.5rem 0.2rem; border-top: 1px solid var(--border-subtle); }
  .episode-list::part(cell) { display: block; padding: 0.15rem 0.6rem; border-top: 0; }
  .episode-list::part(cell column-text) { grid-column: 1 / -1; max-width: none; white-space: normal; }
  .episode-list::part(with-icon) { white-space: normal; }
  .episode-list::part(cell column-number) { text-align: left; }

  .episode-list::part(cell)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .episode-list::part(cell column-text)::before { content: none; }
}

/* The benchmark pages' switcher: each benchmark as a pill, the current one marked. */
.bench-switch { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }

.bench-switch-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
}

.bench-switch-item img { width: 1.6rem; height: 1.6rem; }
.bench-switch-item:hover { border-color: rgba(177, 231, 79, 0.6); color: var(--text-primary); }

.bench-switch-item[aria-current='page'] {
  border-color: rgba(177, 231, 79, 0.75);
  background: rgba(177, 231, 79, 0.12);
  color: var(--text-primary);
}

/* The density chart under the Reliability curves: a thin line on a light fill, so five or six models stay readable. */
.bench-chart-title { margin: 1.5rem 0 0.4rem; font-size: 1rem; }
.bench-density { opacity: 0.08; stroke: none; }
.bench-line--thin { stroke-width: 1.5; }

/* The model page: an overview line per benchmark, then a tab per benchmark with its standing, progress and runs. */
@media (max-width: 1100px) {
  .model-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The model card's benchmark lines: one card per benchmark, each opening its tab. */
.model-lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.model-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem 1.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(10, 15, 30, 0.5);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.model-line:hover { border-color: rgba(177, 231, 79, 0.6); }
.model-line:hover .model-benchmark-task { color: var(--accent); }
.model-line-benchmark { display: flex; align-items: center; gap: 0.75rem; }
.model-line-benchmark > span { display: flex; flex-direction: column; gap: 0.1rem; }
.model-line-metric { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.model-line-metric .metric-name { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

/* The model's name opens the list of models; the steps either side of it go to the previous and the next. */
.model-switch { display: flex; align-items: center; gap: 0.75rem; }
.model-switch-menu { position: relative; min-width: 0; }
.model-switch-menu summary { display: flex; align-items: center; gap: 0.5rem; list-style: none; cursor: pointer; }
.model-switch-menu summary::-webkit-details-marker { display: none; }
/* The caret follows the name's last word, so a name that wraps keeps it beside the text. */
.model-switch-menu .model-name > span:last-child::after { content: ' \25BE'; color: var(--text-muted); font-size: 0.45em; vertical-align: middle; }
.model-switch-menu summary:hover .model-name,
.model-switch-menu[open] .model-name { color: var(--accent); }

.model-switch-step {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-decoration: none;
}

.model-switch-step:hover { border-color: rgba(177, 231, 79, 0.6); color: var(--text-primary); }

.model-switch-list {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  z-index: 50;
  min-width: 18rem;
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(10, 15, 30, 0.98);
  list-style: none;
}

.model-switch-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
}

.model-switch-list a:hover { background: rgba(177, 231, 79, 0.1); color: var(--text-primary); }
.model-switch-list a[aria-current='page'] { color: var(--accent); }
.model-switch-list .cell-icon { width: 20px; height: 20px; }

.model-tabs {
  display: inline-grid;
  grid-auto-columns: minmax(9rem, auto);
  grid-auto-flow: column;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--panel-bg);
}

/* A benchmark's full name wraps inside its tab on a phone. */
.model-tabs .leaderboard-tab { white-space: normal; }
.model-tab-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.model-tab-panel[hidden] { display: none; }
.model-tab-panel > .table-note { margin-top: -1rem; }

@media (max-width: 640px) {
  .model-lines { grid-template-columns: minmax(0, 1fr); }
  .model-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-line-benchmark { grid-column: 1 / -1; }
  .model-line-metric { align-items: flex-start; }
  .model-line-metric .score { justify-content: flex-start; }
  .model-tabs { display: grid; grid-auto-columns: 1fr; }
  .model-facts { grid-template-columns: minmax(0, 1fr); }
  .model-switch { gap: 0.4rem; }
  .model-switch-step { width: 2rem; height: 2rem; }
  .model-switch-list { min-width: min(18rem, calc(100vw - 2.5rem)); }
}

/* ── Replay dock ──────────────────────────────────────── */

.episode-list::part(dock) { border-top-color: var(--border-strong); box-shadow: 0 -18px 40px -24px rgba(0, 0, 0, 0.8); }
.episode-list::part(step):enabled:hover,
.episode-list::part(close):hover { border-color: rgba(177, 231, 79, 0.6); color: var(--accent); }
.episode-list::part(position) { color: var(--text-secondary); }
.episode-list::part(title) { font-size: 1rem; color: var(--text-primary); }
.episode-list::part(fact-label) { font-size: 0.7rem; }

/* The Details button has a light tint, and a stronger tint while the details show. */
.episode-list::part(details-toggle) {
  border-color: rgba(177, 231, 79, 0.45);
  background: rgba(177, 231, 79, 0.1);
  color: var(--text-primary);
}
.episode-list::part(details-toggle):hover { border-color: rgba(177, 231, 79, 0.8); background: rgba(177, 231, 79, 0.18); }
.episode-list::part(details-toggle pressed) { border-color: rgba(177, 231, 79, 0.9); background: rgba(177, 231, 79, 0.28); }
.replay-details { display: flex; flex-direction: column; height: 100%; }
.replay-details[aria-busy='true'] { opacity: 0.5; }

/* The note over the full replay page's viewer while the 3D replay builds. */
.replay-panel-note {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  margin: 0;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: rgba(10, 15, 30, 0.8);
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.replay-panel-note[hidden] { display: none; }

/* The credit for what a recording shows that is not ours, beside the episode page's breadcrumbs. */
.episode-credit { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.episode-credit + .sidebar-toggler { margin-left: 0.75rem !important; }
@media (max-width: 960px) { .episode-credit { white-space: normal; } }
