/* PyRUA-Lean: the MHLA page's styles (index.css) in the paper's colours, Figure 2's grey #596675 and red #8C0000. */
:root {
  --primary-color: #8C0000;
  --primary-hover: #6B0000;
  --secondary-color: #596675;
  --accent-color: #B03030;
  --text-secondary: #596675;
  --gradient-primary: linear-gradient(135deg, #8C0000 0%, #B03030 100%);
  /* heading underlines and author-link hover lines (pink in MHLA's page) */
  --gradient-accent: linear-gradient(135deg, #8C0000 0%, #596675 100%);
}

.publication-title {
  line-height: 1.25;
}

.accent-text {
  color: var(--primary-color);
  text-shadow: none;
  padding: 0;
}

.title-highlight {
  font-size: inherit;
  text-shadow: none;
  padding: 0;
}

.metric-highlight {
  background: rgba(140, 0, 0, 0.06);
}

.performance-section {
  background: linear-gradient(135deg, rgba(89, 102, 117, 0.05) 0%, rgba(140, 0, 0, 0.03) 100%);
}

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

.performance-card-title {
  margin-bottom: 0.75rem;
}

.metric-value {
  font-size: 1.6rem;
  line-height: 1.2;
  white-space: nowrap;
}

.metric-label {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.benchmarks-note {
  margin-top: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.figure-caption {
  text-align: left;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.pipeline-section {
  padding-top: 0.5rem;
}

.split-row {
  margin-top: 1.5rem;
}

pre#bibtex-code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* the arXiv button until the paper is on arXiv */
.button.is-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* ---- sections added for readers who have not read the paper ---- */
.tldr {
  max-width: 820px;
  margin: 1.25rem auto 0;
  text-align: left;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.6;
  background: rgba(140, 0, 0, 0.04);
  border-left: 3px solid var(--primary-color);
  padding: 0.9rem 1.1rem;
  border-radius: 0 8px 8px 0;
}

.video-section {
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
}

.code-block {
  background: #F7F6F2;
  border: 1px solid #D9DCD2;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-x: auto;
  color: #1e293b;
}

.code-block.small {
  font-size: 0.72rem;
  max-height: 22rem;
  overflow: auto;
}

.code-note,
.speed-note {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 0.6rem;
  text-align: center;
}

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

.clip {
  margin: 0;
  position: relative;
}

.clip video {
  width: 100%;
  display: block;
  border-radius: 10px;
  background: #111;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.clip figcaption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
  line-height: 1.4;
}

.agent-tag {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.45rem;
}

.agent-tag.tool {
  color: #596675;
}

.agent-tag.code {
  color: #8C0000;
}

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

.habit-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.habit-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

.habit-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.habit-card .share {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8C0000;
  background: rgba(140, 0, 0, 0.06);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.habit-card p {
  font-size: 0.93rem;
  line-height: 1.5;
}

.habit-card .source {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: auto;
}

.case {
  margin-top: 2rem;
}

.case-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.case-task {
  color: var(--text-secondary);
  font-style: italic;
  margin: 0.2rem 0 0.6rem;
}

.case-code {
  margin-top: 0.6rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-item figcaption {
  font-size: 0.86rem;
}

.gallery-item .bench {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
}

.speed-tag {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.setup-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.setup-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.setup-card .setup-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: #8C0000;
  margin: 0.25rem 0 0.4rem;
}

.setup-card p {
  font-size: 0.93rem;
  line-height: 1.5;
}

.setup-text {
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .clip-pair,
  .habit-grid,
  .setup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---- syntax highlighting, in the colours of the paper's listings ---- */
.code-block .k { font-weight: 700; color: #1e293b; }
.code-block .s { color: #3F6B3F; }
.code-block .c { color: #8A9099; font-style: italic; }
.code-block .robo { color: #8C0000; font-weight: 700; }
.code-block .nf { color: #1e293b; font-weight: 700; }
.code-block .nb { color: #3E5C76; }
.code-block .m { color: #7A4E13; }

/* ---- one task, two agents ---- */
.duel {
  margin-top: 1rem;
  outline: none;
}

.duel:focus-visible {
  box-shadow: 0 0 0 3px rgba(140, 0, 0, 0.25);
  border-radius: 12px;
}

.duel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.duel-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #D3D9DE;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}

.duel-btn:hover:not(:disabled) { border-color: #8C0000; color: #8C0000; }
.duel-btn:disabled { opacity: 0.4; cursor: default; }
.duel-btn.play { background: #8C0000; border-color: #8C0000; color: #fff; }
.duel-btn.play:hover { background: #6B0000; color: #fff; }
.duel-btn:focus-visible, .callbox:focus-visible, .code-btn:focus-visible { outline: 2px solid #8C0000; outline-offset: 2px; }

.duel-k {
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.duel-strips {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.strip {
  display: grid;
  grid-template-columns: 11.5rem 1fr;
  align-items: center;
  gap: 0.5rem;
}

.strip-label { font-size: 0.88rem; font-weight: 700; }
.strip.tool .strip-label { color: #596675; }
.strip.code .strip-label { color: #8C0000; }

.strip-boxes { display: flex; gap: 4px; }

.callbox {
  font: inherit;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border: 1px solid #C6CCD2;
  background: #EEF0F2;
  color: #596675;
}

.strip.code .callbox { border-color: #E2C2C2; background: #F7ECEC; color: #8C0000; }
.strip.tool .callbox.img { background: #596675; border-color: #596675; color: #fff; }
.strip.code .callbox.img { background: #8C0000; border-color: #8C0000; color: #fff; }
.callbox.solved { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e293b; }
.callbox.current { transform: translateY(-3px); box-shadow: 0 3px 0 0 #F5B700; }
.callbox.solved.current { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e293b, 0 7px 0 0 #F5B700; }

.duel-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.duel-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.duel-panel.tool { border-top: 3px solid #596675; }
.duel-panel.code { border-top: 3px solid #8C0000; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.panel-k { font-size: 0.88rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.panel-views {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.4rem;
}

.panel-views img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #EEF0F2;
}

.panel-meter { display: grid; gap: 0.25rem; }
.meter-bar { height: 8px; border-radius: 999px; background: #EEF0F2; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
.duel-panel.tool .meter-fill { background: #8A96A3; }
.duel-panel.code .meter-fill { background: #8C0000; }
.meter-text { font-size: 0.85rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.panel-status { font-size: 0.88rem; font-weight: 600; min-height: 1.3em; }
.panel-status.solved { color: #1F6F3A; }
.panel-status.done { color: var(--text-secondary); font-weight: 500; }

.panel-action { display: grid; gap: 0.45rem; min-width: 0; }
.panel-action .code-block.small { max-height: 18rem; margin: 0; }

.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.tool-list li { font-size: 0.88rem; line-height: 1.4; overflow-wrap: anywhere; }
.tool-list code { background: #EEF0F2; color: #1e293b; padding: 0.05rem 0.35rem; border-radius: 4px; }
.tool-list .times { font-weight: 700; color: #596675; }
.tool-list .args { color: var(--text-secondary); font-size: 0.82rem; }

.returned { font-size: 0.85rem; font-weight: 600; color: #596675; }
.note { font-size: 0.88rem; color: var(--text-secondary); font-style: italic; line-height: 1.45; }
.cell-head { font-size: 0.85rem; font-weight: 600; color: #8C0000; }

.printed summary { cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); }
.printed pre {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.4;
  background: #fff;
  border: 1px dashed #D9DCD2;
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  max-height: 14rem;
  overflow: auto;
  white-space: pre;
}
.more-note { font-size: 0.78rem; color: var(--text-secondary); }

/* ---- gallery code viewer ---- */
.code-btn {
  font: inherit;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #D3D9DE;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}

.code-btn:hover { border-color: #8C0000; color: #8C0000; }
.gallery-item.active video { box-shadow: 0 0 0 3px #8C0000; }
.gallery-item.active .code-btn { background: #8C0000; border-color: #8C0000; color: #fff; }

.viewer {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: 3px solid #8C0000;
  border-radius: 12px;
  padding: 1rem;
  scroll-margin-top: 1rem;
}

.viewer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.8rem;
  margin-bottom: 0.8rem;
}

.viewer-head .bench { font-weight: 700; }
.viewer-head .task { color: var(--text-primary); }
.viewer-head .count { margin-left: auto; font-size: 0.88rem; color: var(--text-secondary); }

.viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 1rem;
  align-items: start;
}

.viewer-video video {
  width: 100%;
  display: block;
  border-radius: 10px;
  background: #111;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.viewer-cells { display: grid; gap: 0.8rem; min-width: 0; }
.viewer-cell .code-block.small { margin: 0.3rem 0 0; }
.final { font-size: 0.9rem; line-height: 1.5; color: var(--text-primary); }

@media (max-width: 768px) {
  .duel-panels,
  .viewer-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .strip { grid-template-columns: 1fr; }
  .duel-k { margin-left: 0; width: 100%; }
}

/* the paper's code box: warm ground and rule (the template's pre rule would paint it blue-grey) */
pre.code-block {
  background: #F7F6F2;
  border: 1px solid #D9DCD2;
  padding: 0.85rem 1rem;
}

/* gallery viewer: one cell at a time */
.cell-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.cell-tab {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #E2C2C2;
  background: #F7ECEC;
  color: #8C0000;
  cursor: pointer;
}

.cell-tab.active { background: #8C0000; border-color: #8C0000; color: #fff; }
.cell-tab:focus-visible { outline: 2px solid #8C0000; outline-offset: 2px; }
.cell-pane .code-block.small { max-height: 20rem; margin: 0.3rem 0 0; }
.cell-pane { display: grid; gap: 0.5rem; min-width: 0; }
.cell-nav { display: flex; gap: 0.5rem; margin-top: 0.6rem; }

/* the template's pre and code rules are !important; the paper's code box wins them back */
pre.code-block {
  background: #F7F6F2 !important;
  border: 1px solid #D9DCD2 !important;
  padding: 0.85rem 1rem !important;
  font-size: 0.8rem !important;
  box-shadow: none !important;
}

pre.code-block.small {
  font-size: 0.72rem !important;
}

pre.code-block code {
  background: transparent !important;
  padding: 0 !important;
  font-size: inherit !important;
}

.printed pre {
  background: #fff !important;
  border: 1px dashed #D9DCD2 !important;
  padding: 0.6rem 0.7rem !important;
  font-size: 0.72rem !important;
  box-shadow: none !important;
}

/* gallery: a tab per benchmark */
.bench-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
}

.bench-tab {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid #D3D9DE;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}

.bench-tab:hover { border-color: #8C0000; color: #8C0000; }
.bench-tab.active { background: #8C0000; border-color: #8C0000; color: #fff; }
.bench-tab:focus-visible { outline: 2px solid #8C0000; outline-offset: 2px; }
.gallery-grid[hidden] { display: none; }
.gallery-item figcaption { min-height: 2.6em; }

/* contents bar: sticks to the top of the window, one row, scrolls sideways on a phone */
.toc {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-color);
}

.toc-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 0.25rem;
  padding: 0.45rem 1rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.toc-inner::-webkit-scrollbar { display: none; }

.toc a {
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
}

.toc a:hover { color: #8C0000; background: rgba(140, 0, 0, 0.06); }
.toc a.active { color: #fff; background: #8C0000; }
.toc a:focus-visible { outline: 2px solid #8C0000; outline-offset: 2px; }

/* jumping to a section leaves room for the bar */
section[id] { scroll-margin-top: 3.2rem; }

/* ---- 2026-10-14: results tables, the weights button that is not live yet ------------------------------------------- */
.results-table { margin: 1.2rem auto 0.4rem; font-size: 0.92rem; }
.results-table th, .results-table td { text-align: center; vertical-align: middle; white-space: nowrap; }
.results-table th { font-weight: 600; color: #1e293b; }
.results-table .left { text-align: left; }
.results-table tr.ours td { background: #FBF2F3; color: #8C0000; font-weight: 700; }
.table-container { overflow-x: auto; }
.button.coming-soon { opacity: 0.55; cursor: default; }
/* the template spaces only the links of .link-block; this one is not a link */
.link-block .coming-soon { margin: 8px 4px; }
.coder-figure { max-width: 720px; margin: 1.5rem auto 0; }

/* ---- 2026-10-14: interactive charts -------------------------------------------------------------------------------- */
.chart-card { background: #fff; border: 1px solid #E6E9ED; border-radius: 12px; padding: 1.1rem 1.2rem 0.9rem; margin: 1.4rem auto 0; }
.chart-card h3 { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin: 0 0 0.6rem; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid #D5DAE0; border-radius: 8px; overflow: hidden; }
.seg-btn { font: inherit; font-size: 0.82rem; font-weight: 600; color: #475569; background: #fff; border: 0; border-right: 1px solid #E6E9ED;
           padding: 0.32rem 0.7rem; cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: #F5F6F8; }
.seg-btn[aria-pressed="true"] { background: #1e293b; color: #fff; }
.table-btn { border: 1px solid #D5DAE0; border-radius: 8px; margin-left: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.84rem; color: #475569; margin: 0 0 0.5rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.legend-item.is-toggle { cursor: pointer; }
.legend-item.is-toggle[aria-pressed="false"] { opacity: 0.4; text-decoration: line-through; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-swatch.is-line { height: 3px; width: 14px; border-radius: 2px; }
.chart-body { width: 100%; }
.chart-body svg { display: block; overflow: visible; font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
.chart-body text { font-variant-numeric: tabular-nums; }
.chart-note { font-size: 0.8rem; color: #64748b; margin: 0.5rem 0 0; }
.chart-hit { cursor: default; outline: none; }
.chart-hit:focus-visible { outline: 2px solid #3B6FB6; outline-offset: 1px; }
.mark { transition: opacity 0.12s; }
.mark.is-hover { opacity: 0.78; }
.chart-table { margin-top: 0.2rem; }
.chart-tip { position: fixed; z-index: 1000; display: none; pointer-events: none; background: #fff; border: 1px solid #D5DAE0; border-radius: 8px;
             box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12); padding: 0.45rem 0.6rem; font-size: 0.8rem; color: #475569; max-width: 280px; }
.chart-tip-title { font-weight: 600; color: #1e293b; margin-bottom: 0.25rem; }
.chart-tip-row { display: flex; align-items: center; gap: 0.4rem; line-height: 1.5; }
.chart-tip-row strong { color: #0f172a; font-size: 0.86rem; }
.chart-tip-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
/* the three results at the top */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0.4rem auto 0.2rem; }
.glance-card { display: block; background: #fff; border: 1px solid #E6E9ED; border-radius: 12px; padding: 1rem 1.1rem; color: #475569;
               transition: border-color 0.15s, box-shadow 0.15s; }
.glance-card:hover { border-color: #B3261E; box-shadow: 0 6px 18px rgba(140, 0, 0, 0.08); color: #475569; }
.glance-kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #8C0000; }
.glance-value { font-size: 2.1rem; font-weight: 800; color: #0f172a; line-height: 1.15; margin: 0.25rem 0 0.15rem; }
.glance-value small { font-size: 1rem; font-weight: 600; color: #64748b; }
.glance-text { font-size: 0.88rem; line-height: 1.45; }
.glance-more { display: inline-block; margin-top: 0.5rem; font-size: 0.82rem; font-weight: 600; color: #8C0000; }
@media (max-width: 768px) { .glance { grid-template-columns: 1fr; } .table-btn { margin-left: 0; } }

/* ---- 2026-10-14: results panels (columns, a gain pill, tabs, bars that grow into view) ----------------------------- */
.rx-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.rx-tab { font: inherit; font-weight: 600; font-size: 0.88rem; padding: 7px 14px; border-radius: 7px; border: 1px solid #D5DAE0;
          background: #fff; color: #1e293b; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.rx-tab:hover { border-color: #1e293b; }
.rx-tab.on { background: #1e293b; border-color: #1e293b; color: #fff; }
.rx-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 12px; font-weight: 600; font-size: 0.9rem; color: #1e293b; }
.rx-key { display: inline-flex; align-items: center; gap: 8px; }
.rx-key i { width: 14px; height: 14px; border-radius: 3px; background: #CBD2D9; }
.rx-key.ours i { background: linear-gradient(180deg, #8C0000, #D9531E); }
.rx { --plot-h: 250px; position: relative; }
.rx-scroll { overflow-x: auto; scrollbar-width: thin; }
.rx-inner { min-width: 0; }
.rx-plot { position: relative; display: grid; gap: 16px; height: calc(var(--plot-h) + 74px); padding-top: 74px; box-sizing: border-box;
           border-bottom: 1.5px solid #1e293b; background-image: radial-gradient(#D5DAE0 1px, transparent 1.2px); background-size: 14px 14px; }
.rx-g { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 6px; outline: none; transition: opacity 0.25s; }
.rx-g:focus-visible { outline: 2px solid #3B6FB6; outline-offset: 2px; border-radius: 6px; }
.rx-plot.hovering .rx-g { opacity: 0.35; }
.rx-plot.hovering .rx-g.hot { opacity: 1; }
.rx-b { position: relative; width: min(42%, 56px); height: 0; border-radius: 7px 7px 0 0; background: #CBD2D9;
        transition: height 1.1s cubic-bezier(.2, .8, .2, 1); }
.rx-b.ours { background: linear-gradient(180deg, #8C0000 0%, #C2381C 55%, #EE9A7C 100%);
             box-shadow: 0 10px 26px -12px rgba(179, 38, 30, 0.75); }
.rx-b b { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -5px); font-size: 0.82rem; font-weight: 700; color: #64748b;
          white-space: nowrap; opacity: 0; transition: opacity 0.4s; }
.rx-b.ours b { color: #0f172a; font-size: 0.95rem; font-weight: 800; }
.rx-d { position: absolute; left: 50%; bottom: calc(var(--plot-h) * var(--v) + 28px); transform: translate(-50%, 8px); padding: 3px 9px;
        border-radius: 999px; background: #B3261E; color: #fff; font-weight: 800; font-size: 0.82rem; white-space: nowrap; opacity: 0;
        transition: opacity 0.4s, transform 0.4s; }
.rx.in .rx-b b, .rx.in .rx-d { opacity: 1; }
.rx.in .rx-d { transform: translate(-50%, 0); }
.rx-x { display: grid; gap: 16px; margin-top: 10px; }
.rx-x span { text-align: center; line-height: 1.25; }
.rx-x strong { display: block; font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.rx-x small { display: block; font-size: 0.74rem; color: #64748b; margin-top: 2px; }
.rx.dense .rx-plot, .rx.dense .rx-x { gap: 6px; }
.rx.dense .rx-b { width: 46%; max-width: 18px; border-radius: 4px 4px 0 0; }
.rx.dense .rx-b b { font-size: 0.62rem; }
.rx.dense .rx-b b.quiet { display: none; }
.rx.dense .rx-b.ours b { font-size: 0.66rem; }
.rx.dense .rx-d { display: none; }
.rx.dense .rx-x span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 180px; margin: 0 auto; white-space: nowrap;
                       font-size: 0.72rem; font-weight: 600; color: #334155; }
@media (prefers-reduced-motion: reduce) { .rx-b, .rx-d, .rx-b b { transition: none; } }
@media (max-width: 768px) { .rx { --plot-h: 200px; } .rx-plot { gap: 8px; } .rx-x strong { font-size: 0.78rem; } .rx-x small { display: none; } .rx-d { font-size: 0.7rem; padding: 2px 6px; } }
/* phones: a group is too narrow for '2.5× fewer' on one line; stack the ratio over the word so the pills stay inside the card */
@media (max-width: 480px) { .rx-plot { gap: 4px; padding-left: 4px; padding-right: 4px; } .rx-g { gap: 3px; }
  .rx-b { width: 46%; } .rx-b b { font-size: 0.62rem; transform: translate(-50%, -3px); } .rx-b.ours b { font-size: 0.7rem; }
  .rx-d { white-space: normal; width: min-content; text-align: center; line-height: 1.1; padding: 3px 6px; border-radius: 8px; font-size: 0.66rem; } }

/* a one-line subtitle under a section's heading */
.section-sub { text-align: center; color: #64748b; font-size: 1.05rem; margin: -0.4rem auto 1.4rem; max-width: 46rem; }

/* the paper's tables, as HTML */
.paper-table-wrap { margin: 1.4rem auto 0.6rem; overflow-x: auto; }
.paper-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; color: #1e293b; }
.paper-table th, .paper-table td { padding: 0.45rem 0.6rem; text-align: center; vertical-align: middle; white-space: nowrap; }
.paper-table thead tr:first-child th { border-top: 2px solid #1e293b; }
.paper-table thead tr:last-child th { border-bottom: 1px solid #1e293b; }
.paper-table th { font-weight: 600; line-height: 1.25; }
.paper-table th small { font-weight: 400; color: #64748b; }
.paper-table th.group { border-bottom: 1px solid #CBD2D9; }
.paper-table .left { text-align: left; }
.paper-table .sep { border-left: 1px solid #CBD2D9; }
.paper-table tbody tr:last-child td { border-bottom: 2px solid #1e293b; }
.paper-table tr.ours td { background: #FBF2F3; }
.paper-table tr.ref td { color: #8A94A0; border-top: 1px solid #CBD2D9; }

/* the duel's panels: a long printed line scrolls inside its box instead of widening the panel */
.panel-action > * { min-width: 0; max-width: 100%; }
.printed { min-width: 0; }
.panel-action pre, .printed pre { max-width: 100%; overflow: auto; }

/* the template's table rules outrank the ones above: centre the numbers and the column groups, keep the paper's rules */
table.paper-table th, table.paper-table td { text-align: center !important; }
table.paper-table th.left, table.paper-table td.left { text-align: left !important; }
table.paper-table thead tr:first-child th { border-top: 2px solid #1e293b !important; }
table.paper-table thead tr:first-child th.group { border-bottom: 1px solid #94a3b8 !important; }
table.paper-table thead tr:last-child th { border-bottom: 1px solid #1e293b !important; }

/* ---- Figure 1, drawn in the page ------------------------------------------------------------------------------------ */
.figure-one { margin-top: 1.6rem; font-family: 'Times New Roman', Times, 'Liberation Serif', serif; color: #101A2B; }
.f1-panel { position: relative; border: 1.5px dashed #9AA5B1; border-radius: 14px; padding: 2rem 1.3rem 1rem; background: #fff; }
.f1-title { position: absolute; top: -0.85em; left: 50%; transform: translateX(-50%); background: #fff; padding: 0 0.9rem;
            font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 800; font-size: 1.3rem; color: #94070A; white-space: nowrap; }
.f1-top-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 1.2rem; align-items: start; }
.f1-cell { min-width: 0; }
.f1-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; margin: 0 0 0.3rem; }
.f1-label { font-size: 1.45rem; font-weight: 700; color: #101A2B; }
.f1-claim { font-size: 1.12rem; color: #94070A; }
.f1-svg { display: block; width: 100%; height: auto; overflow: visible; }
.f1-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; font-size: 1rem; margin: 0.3rem 0 0.2rem; }
.f1-key { display: inline-flex; align-items: center; gap: 0.5rem; }
.f1-key i { display: inline-block; width: 34px; height: 0; border-top: 2px dashed #8C9AA6; position: relative; }
.f1-key i::after { content: ''; position: absolute; left: 11px; top: -7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #8C9AA6; background: #fff; }
.f1-key.ours i { border-top: 2.5px solid #94070A; }
.f1-key.ours i::after { border-color: #94070A; background: #94070A; }
.f1-key.ours span { font-weight: 700; }
.f1-key.sq i { width: 16px; height: 12px; border: 0; background: #B9C2CB; }
.f1-key.sq i::after { display: none; }
.f1-key.ours.sq i { background: #94070A; }
.f1-foot { font-size: 0.85rem; font-style: italic; color: #7A8794; margin: 0.2rem 0 0; }
.f1-band { text-align: center; margin: 1.4rem auto 1.5rem; }
.f1-band img { width: min(560px, 80%); height: auto; }
.f1-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.f1-d-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0.6rem; align-items: center; }
@media (max-width: 960px) { .f1-top-grid, .f1-bottom { grid-template-columns: 1fr; } .f1-bottom { gap: 2rem; } }
@media (max-width: 560px) { .f1-d-grid { grid-template-columns: 1fr; } .f1-title { font-size: 1rem; } .f1-label { font-size: 1.15rem; } }

/* the two lower panels as tall as each other, their drawings centred in them */
.f1-bottom > .f1-panel { display: flex; flex-direction: column; }
.f1-bottom > .f1-panel > .f1-svg { margin: auto 0; }

/* the name in its colours, above the title */
.hero-logo { margin: 0 auto 1.4rem; }
.hero-logo img { width: min(520px, 86%); height: auto; }

/* ---- 2026-10-21: real-robot demos, contents as a left sidebar on wide screens ------------------------------------- */
.real-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.4rem; }
.real-item { margin: 0; }
.real-item video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #F4F6F8; border-radius: 10px; border: 1px solid #E6E9ED; }
.real-item figcaption { display: flex; justify-content: space-between; align-items: baseline; padding: 0.6rem 0.2rem 0; font-size: 0.95rem; color: var(--text-secondary); }
.real-item figcaption strong { color: #8C0000; font-size: 1.05rem; }
@media (max-width: 960px) { .real-grid { grid-template-columns: 1fr; } }

/* wide screens: the contents move to a quiet list at the top left (as on thinkingmachines.ai), shown after the title block */
@media (min-width: 1480px) {
  .toc {
    position: fixed;
    top: 5.5rem;
    left: 1rem;
    width: 140px;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .toc.shown { opacity: 1; pointer-events: auto; }
  .toc-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0;
    overflow: visible;
    white-space: normal;
  }
  .toc a {
    position: relative;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
    color: #676767;
    padding: 0.32rem 0 0.32rem 0.9rem;
    border-radius: 0;
  }
  .toc a:hover { color: #101A2B; background: none; }
  .toc a.active { color: #101A2B; background: none; font-weight: 500; }
  .toc a.active::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: #8C0000;
  }
  section[id] { scroll-margin-top: 1.5rem; }
}

/* ---- 2026-10-21: phones -------------------------------------------------------------------------------------------- */
/* sections that are also .hero are flex columns; without this their container grows to the widest code line or table */
.section.hero > .container { min-width: 0; width: 100%; }
@media (max-width: 768px) {
  pre.code-block { font-size: 0.72rem !important; }
  .paper-table { font-size: 0.82rem; }
  .paper-table th, .paper-table td { padding: 0.4rem 0.45rem; }
  /* the table scrolls sideways: keep the planner names in view */
  .paper-table th.left, .paper-table td.left { position: sticky; left: 0; z-index: 1; background: #fff; }
  .paper-table tr.ours td.left { background: #FBF2F3; }
}
