/* StarSkirmish Bench page (/bench/). Shared header and palette: /assets/site.css, /assets/theme.css. */
/* StarSkirmish palette (matches web/landing/assets/theme.css) */
:root {
  color-scheme: dark;
  --star-bg: #000;
  --star-panel: rgba(16, 22, 32, 0.82);
  --star-panel-solid: #10161f;
  --star-border: rgba(80, 110, 150, 0.35);
  --star-text: #d8dee6;
  --star-muted: #8a9bb3;
  --star-accent: #00aaff;
  --star-good: #58c184;
  --star-bad: #e0645c;
  --bg-dark: #000;
  --bg-panel: rgba(16, 22, 32, 0.82);
  --bg-highlight: #1a1a2e;
  --bg-code: #0d1117;
  --accent-1: #3695F4;
  --accent-2: #F44336;
  --accent-gold: #00aaff;
  --text-main: #d8dee6;
  --text-dim: #8a9bb3;
  --text-code: #c9d1d9;
  --border-color: rgba(80, 110, 150, 0.35);
  --syntax-keyword: #ff7b72;
  --syntax-string: #a5d6ff;
  --syntax-function: #d2a8ff;
  --syntax-comment: #8b949e;
  --syntax-number: #79c0ff;
}

/* ============================================
   RESET & BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
}


/**
 * Home Page Styles - Research Report Theme
 */

.home-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: transparent;
  visibility: visible; /* Override critical CSS that hides content until styles load */
}

/* Main Container */
.report-container {
  padding: 3rem 2rem 4rem;
}

.report-content {
  max-width: 720px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--star-text);
  line-height: 1.7;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

/* Report Header */
.report-header {
  text-align: center;
  margin-bottom: 2rem;
}

.report-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.title-brand {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(
    90deg,
    #FFD700 0%,
    #FFF8DC 25%,
    #FFD700 50%,
    #DAA520 75%,
    #FFD700 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 3s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

.title-preview {
  font-size: 0.55em;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--star-muted);
  vertical-align: middle;
  margin-left: 0.35em;
}

.title-subtitle {
  display: block;
  font-family: "Conthrax", sans-serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
}


.report-tagline {
  font-family: "Conthrax", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 400;
  color: var(--star-muted);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.report-tagline::before,
.report-tagline::after {
  content: '//';
  color: var(--star-border);
  margin: 0 0.5rem;
}

.report-byline {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.byline-author {
  color: var(--star-text);
  font-weight: 500;
}

.byline-sep {
  margin: 0 0.6rem;
  color: var(--star-muted);
}

/* Teaser clip above the byline (an animated WebP) */
.report-teaser {
  display: flex;
  justify-content: center;
  margin: 0 0 1.25rem;
}

.teaser-gif {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* No play glyph over the poster when iOS Low Power Mode blocks playback; it stays a still frame. */
.teaser-gif::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.teaser-gif::-webkit-media-controls { display: none !important; }

/* HUD frame: a dark panel with accent corner brackets, as on the StarSkirmish game screens. --hud-corner sets
   the bracket length; the brackets sit over the border's corners (background-origin: border-box). */
.report-tldr, .fav-panel {
  --hud-corner: 14px;
  --hud-bracket: rgba(0, 170, 255, 0.85);
  border: 1px solid var(--star-border);
  border-radius: 2px;
  background:
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) top left / var(--hud-corner) 1px,
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) top left / 1px var(--hud-corner),
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) top right / var(--hud-corner) 1px,
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) top right / 1px var(--hud-corner),
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) bottom left / var(--hud-corner) 1px,
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) bottom left / 1px var(--hud-corner),
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) bottom right / var(--hud-corner) 1px,
    linear-gradient(var(--hud-bracket), var(--hud-bracket)) bottom right / 1px var(--hud-corner),
    linear-gradient(180deg, rgba(0, 170, 255, 0.07), rgba(0, 170, 255, 0) 45%),
    var(--star-panel);
  background-repeat: no-repeat;
  background-origin: border-box;
  box-shadow: inset 0 0 24px rgba(0, 170, 255, 0.05), 0 0 24px rgba(0, 0, 0, 0.35);
}

/* HUD heading: Conthrax label in the accent, glowing, with a rule that fades out to the right. */
.tldr-title, .fav-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Conthrax", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--star-accent);
  text-shadow: 0 0 8px rgba(0, 170, 255, 0.45);
}
.tldr-title::after, .fav-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 170, 255, 0.45), rgba(0, 170, 255, 0));
}

/* TLDR Section */
.report-tldr {
  margin-bottom: 2.5rem;
  padding: 1.5rem 2rem;
  position: relative;
}

.tldr-title {
  font-size: 0.9rem;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  padding-bottom: 0;
  border-bottom: none;
}

.tldr-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: none;
}

.tldr-list li {
  position: relative;
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
  color: var(--star-text);
  font-weight: 400;
  line-height: 1.6;
}

.tldr-list li:last-child {
  margin-bottom: 0;
}

/* diamond markers, like waypoints */
.tldr-list li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--star-accent);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(0, 170, 255, 0.8);
}

/* Leaderboard Section */
.leaderboard-container {
  margin-top: 1rem;
}

.leaderboard-loading,
.leaderboard-error {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--star-panel);
  border: 1px solid var(--star-border);
  border-radius: 8px;
  overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(80, 110, 150, 0.2);
}

.leaderboard-table th {
  font-family: "Conthrax", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  font-weight: 400;
  color: var(--star-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(0, 170, 255, 0.05);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tbody tr:hover {
  background: rgba(0, 170, 255, 0.06);
}

.leaderboard-table .rank-col {
  width: 50px;
  text-align: center;
  color: var(--star-muted);
  font-weight: 600;
}

.leaderboard-table .name-col {
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.leaderboard-table .name-col .model-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 3px;
}

.leaderboard-table .wins-col {
  width: 70px;
  text-align: center;
  color: var(--star-good);
  font-weight: 600;
}

.leaderboard-table .losses-col {
  width: 70px;
  text-align: center;
  color: var(--star-bad);
  font-weight: 600;
}

.leaderboard-table .winpct-col {
  width: 80px;
  text-align: center;
  color: var(--star-text);
  font-weight: 600;
  white-space: nowrap;
}

.leaderboard-table .elo-col {
  width: 70px;
  text-align: center;
  color: var(--star-accent);
  font-weight: 700;
}

/* Mobile-only abbreviated headers */
.leaderboard-table .mobile-header {
  display: none;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
  /* Container adjustments */
  .report-container {
    padding: 1.5rem 1rem 3rem;
  }

  .report-content {
    font-size: 0.95rem;
  }

  /* Header adjustments */
  .report-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .title-brand {
    font-size: 1.75rem;
  }

  .title-subtitle {
    font-size: 1rem;
  }

  .report-tagline {
    font-size: 0.9rem;
    letter-spacing: 2px;
  }

  .report-tagline::before,
  .report-tagline::after {
    display: none;
  }

  /* TLDR section */
  .report-tldr {
    padding: 1.25rem 1.25rem;
    margin-bottom: 2rem;
  }

  .tldr-list {
    padding-left: 1rem;
  }

  .tldr-list li {
    font-size: 0.9rem;
    padding-left: 0.25rem;
  }

  .tldr-list li::before {
    left: -0.85rem;
  }

  /* Leaderboard table mobile */
  .leaderboard-table {
    font-size: 0.85rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.6rem 0.5rem;
  }

  .leaderboard-table th {
    font-size: 0.6rem;
    letter-spacing: 0.5px;
  }

  /* Show abbreviated headers on mobile */
  .leaderboard-table .mobile-header {
    display: inline;
  }

  .leaderboard-table .desktop-header {
    display: none;
  }

  .leaderboard-table .rank-col {
    width: 30px;
  }

  .leaderboard-table .wins-col,
  .leaderboard-table .losses-col {
    width: 40px;
  }

  .leaderboard-table .winpct-col {
    width: 50px;
  }

  .leaderboard-table .elo-col {
    width: 50px;
  }

  .leaderboard-table .name-col .model-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
  }

  /* Report sections */
  .report-section h2 {
    font-size: 1.1rem;
  }

  /* Standings footnotes */
  .standings-footnotes .footnote {
    font-size: 0.8rem;
  }

  /* Teaser gif */
  .teaser-gif {
    border-radius: 6px;
  }
}

/* Standings Footnotes */
.standings-footnotes {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--star-border);
}

.standings-footnotes .footnote {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.standings-footnotes .footnote:last-child {
  margin-bottom: 0;
}

.standings-footnotes .footnote sup {
  color: var(--star-accent);
  font-weight: 600;
  margin-right: 0.25rem;
}

.standings-footnotes .footnote code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  background: rgba(0, 170, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #9fdcff;
}

.standings-footnotes .footnote a {
  color: var(--star-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 170, 255, 0.3);
  transition: all 0.2s ease;
}

.standings-footnotes .footnote a:hover {
  color: #e6f6ff;
  border-bottom-color: var(--star-accent);
}

/* Report Sections */
.report-section {
  margin-bottom: 2rem;
}

.report-section h2 {
  font-family: "Conthrax", sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--star-border);
  letter-spacing: 2px;
}

.report-section h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.report-section p {
  margin-bottom: 1rem;
}

.report-section p:last-child {
  margin-bottom: 0;
}

/* A heading that opens a group of sections (Implementation Details): bigger, heavier and set
   off from the section above, with an accent rule instead of the usual hairline. */
.report-section.part-heading { margin: 4rem 0 1.5rem; }
.report-section.part-heading h2 {
  font-family: "Conthrax-Bold", "Conthrax", sans-serif;
  font-size: 1.6rem;
  letter-spacing: 3px;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--star-accent);
  text-shadow: 0 0 18px rgba(0, 170, 255, 0.35);
}
@media (max-width: 600px) { .report-section.part-heading h2 { font-size: 1.25rem; letter-spacing: 2px; } }

/* Rating Calculation: the formula steps as small white cards, side by side when there is room; native MathML. */
.formula-cards { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; margin: 0; }
@media (max-width: 760px) { .formula-cards { grid-template-columns: minmax(0, 1fr); } }
.formula { background: #fff; border-radius: 14px; padding: 16px 18px; color: #1a1a1a; overflow-x: auto; display: flex; flex-direction: column; }
.formula-lbl { display: block; font-size: 0.85rem; line-height: 1.5; color: #6b6b6b; margin-bottom: 0.6rem; }
.formula math { font-family: 'STIX Two Math', 'Cambria Math', 'Latin Modern Math', math; font-size: 1.1rem; color: #1a1a1a; margin-top: auto; margin-bottom: auto; }
.formula-note { display: block; font-size: 0.8rem; line-height: 1.5; color: #8a8a8a; margin-top: 0.6rem; }
@media (max-width: 480px) { .formula { padding: 14px 12px; } .formula math { font-size: 0.85rem; } }

/* "Jump to implementation details" button between the bench and the setup sections. */
.jump-row { display: flex; justify-content: center; margin: 0.5rem 0 2.5rem; }
.jump-btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: "Conthrax", sans-serif; font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--star-muted); text-decoration: none;
  padding: 12px 24px; border: 1px solid var(--star-border); border-radius: 4px; background: rgba(0, 0, 0, 0.35);
  transition: color .2s ease, border-color .2s ease, text-shadow .2s ease;
}
.jump-btn:hover, .jump-btn:focus-visible {
  color: #fff; border-color: var(--star-accent); outline: none;
  text-shadow: 0 0 10px var(--star-accent);
}

/* Section header links (anchor links) */
.section-link {
  color: inherit;
  text-decoration: none;
}

.section-link::after {
  content: ' #';
  opacity: 0;
  transition: opacity 0.15s ease;
}

.section-link:hover::after {
  opacity: 0.5;
  color: var(--star-accent);
}

/* Content links (inside paragraphs) */
.report-section p a {
  color: var(--star-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 170, 255, 0.3);
  transition: all 0.2s ease;
}

.report-section p a:hover {
  color: #e6f6ff;
  border-bottom-color: var(--star-accent);
  text-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
}

/* Lists */
.report-list {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.report-list li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.report-list li strong {
  color: #ffffff;
}

/* ============================================
   IN-CONTEXT LEARNING CHARTS
   ============================================ */

.charts-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.charts-container .aa-card { margin: 0; }

.chart-wrapper {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 0;
}

.chart-title {
  font-family: "Conthrax", sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--star-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  text-align: center;
}

.line-chart {
  width: 100%;
  min-height: 200px;
  background: var(--star-panel);
  border: 1px solid var(--star-border);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  padding: 1rem;
}

.line-chart.cost-chart-no-legend {
  border-radius: 8px;
}

/* Chart.js sizes its own canvas; forcing width/height here made it fight its resize observer (charts jittered). */
.line-chart canvas {
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0;
  padding: 0.75rem;
  background: var(--star-panel);
  border: 1px solid var(--star-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--star-text);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-label {
  white-space: nowrap;
}

.report-section .chart-title { font-family: "Conthrax", sans-serif; font-size: 0.7rem; font-weight: 400; color: var(--star-muted); letter-spacing: 1.5px; }

/* Custom Chart.js Tooltip */
.chartjs-tooltip {
  background: var(--star-panel-solid);
  border: 1px solid rgba(0, 170, 255, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Inter', -apple-system, sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chartjs-tooltip .tooltip-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.chartjs-tooltip .tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--star-text);
  font-size: 12px;
}

.chartjs-tooltip .tooltip-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chartjs-tooltip .tooltip-label {
  color: var(--star-text);
}

.chartjs-tooltip .tooltip-value {
  font-weight: 600;
  color: #fff;
}

/* Mobile chart adjustments */
@media (max-width: 768px) {
  .chart-wrapper {
    padding: 0;
  }

  .chart-title {
    font-size: 0.85rem;
  }

  .line-chart {
    padding: 0.75rem 0.5rem;
    min-height: 180px;
  }

  .chart-legend {
    gap: 0.5rem 0.75rem;
    padding: 0.6rem 0.5rem;
  }

  .legend-item {
    font-size: 0.7rem;
    gap: 0.3rem;
  }

  .legend-color {
    width: 10px;
    height: 10px;
  }

  .legend-icon {
    width: 14px;
    height: 14px;
  }
}

/* ============================================
   MODEL BREAKDOWN CARDS (Dark Theme)
   ============================================ */

.model-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.model-card {
  background: var(--star-panel);
  border: 1px solid var(--star-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  position: relative;
}

/* Card Header */
.model-card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--star-border);
}

.model-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
}

.model-card-titles {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.model-card-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}

.model-card-tagline {
  font-family: "Conthrax", sans-serif;
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--star-accent);
}

/* Card Details */
.model-card-details {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.model-card-details li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  color: var(--star-text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.model-card-details li:last-child {
  margin-bottom: 0;
}

.model-card-details li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--star-accent);
  font-weight: 700;
}

/* Favorite strategy / unit panels */
.fav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.fav-panel {
  --hud-corner: 10px;
  position: relative;
  padding: 0.875rem 1rem 1rem;
}

.fav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 22px;
  margin-bottom: 0.6rem;
}

.fav-label {
  flex: 1;
  font-size: 0.55rem;
  letter-spacing: 1.5px;
}

.fav-body {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--star-text);
}

.fav-body strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.unit-fav {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.unit-fav + .unit-fav {
  margin-top: 0.75rem;
}

.unit-icons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.unit-icon {
  width: 48px;
  height: 48px;
  border-radius: 2px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(0, 170, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 170, 255, 0.25);
}

@media (max-width: 768px) {
  .fav-grid {
    grid-template-columns: 1fr;
  }
}

/* Replay clip beside a model card: to its right on wide screens, under it otherwise. The video spans the
   figure; the caption and the expand button share the row under it. */
.model-clip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: start;
  margin: 1rem 0 0;
}

/* Expand / minimize: only where clips sit beside the cards (1440px and up). Beside a card it sits under the
   clip at the right; with the clips inline it sits outside the clip's top right corner. */
.clip-toggle {
  display: none;
  margin-top: 0.5rem;
  width: 30px;
  height: 30px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--star-border);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--star-text);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.clip-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}
.clip-toggle:hover, .clip-toggle:focus-visible {
  color: #fff;
  border-color: var(--star-accent);
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.45);
  outline: none;
}

.model-clip video {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid var(--star-border);
  background: #000;
}

.model-clip figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--star-muted, #8a8a8a);
}

@media (min-width: 1440px) {
  .model-row {
    display: grid;
    grid-template-columns: 720px min(480px, calc(50vw - 360px - 4rem));
    gap: 1.5rem;
    align-items: start;
    width: max-content;
  }

  .model-clip {
    margin: 0;
  }

  .clip-toggle {
    display: flex;
  }

  /* Clips inline: each under its card, full card width, as on phones. */
  .clips-inline .model-row {
    display: block;
    width: auto;
  }

  .clips-inline .model-clip {
    margin: 1rem 0 0;
  }

  .clips-inline .clip-toggle {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    margin: 0;
  }
}

/* Good Start Labs partner card, in their branding: warm off-white, near-black text, Jost, a serif headline
   and black pill buttons. It closes the page, after Future Work, at every width. Its rules are scoped under
   .partner-card so the page's heading and paragraph styles don't reach it. It starts collapsed; Get in touch
   slides the form open. */
.partner-card {
  margin: 2.5rem 0 0;
  padding: 1.5rem;
  border-radius: 16px;
  background: #fafaf9;
  color: #0c0a09;
  font-family: 'Jost', -apple-system, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

.partner-logo {
  display: inline-block;
  line-height: 0;
}

.partner-logo img {
  width: auto;
  height: 28px;
}

.partner-card .partner-title {
  margin: 1.1rem 0 0.4rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #0c0a09;
  text-transform: none;
}

.partner-card .partner-text {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  color: #44403c;
}

.partner-button {
  padding: 0.6rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: #1c1917;
  color: #fafaf9;
  font: 500 0.9rem 'Jost', -apple-system, sans-serif;
  cursor: pointer;
}

.partner-button:hover, .partner-button:focus-visible {
  background: #44403c;
}

.partner-button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* The drawer animates its height from 0 to the form's (grid rows 0fr to 1fr). */
.partner-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.partner-card.open .partner-drawer {
  grid-template-rows: 1fr;
}

.partner-card.open #rl-open {
  display: none;
}

.partner-form {
  display: grid;
  gap: 0.7rem;
  min-height: 0;
  overflow: hidden;
}

/* Labels in Space Mono, as on the Good Start Labs contact form. */
.partner-form label {
  display: grid;
  gap: 0.35rem;
  font: 400 0.8rem 'Space Mono', ui-monospace, monospace;
  color: #0c0a09;
}

/* Honeypot for bots: off screen, not announced, never tabbed to. */
.partner-form .partner-trap {
  position: absolute;
  left: -9999px;
}

.partner-form input, .partner-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  background: #fff;
  color: #0c0a09;
  font: 400 0.95rem 'Jost', -apple-system, sans-serif;
}

.partner-form textarea {
  resize: vertical;
}

.partner-form ::placeholder {
  color: #a8a29e;
}

.partner-form input:focus, .partner-form textarea:focus {
  outline: 2px solid #0c0a09;
  outline-offset: -1px;
}

.partner-form .partner-button {
  justify-self: start;
  margin-top: 0.3rem;
}

.partner-card .partner-status {
  margin: 0;
  font-size: 0.85rem;
  color: #44403c;
}

.partner-card .partner-status:empty {
  display: none;
}

.partner-card .partner-status.error {
  color: #b91c1c;
}

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

/* Mobile adjustments for model cards */
@media (max-width: 768px) {
  .model-card {
    padding: 1rem 1.25rem;
  }

  .model-card-header {
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
  }

  .model-card-icon {
    width: 36px;
    height: 36px;
  }

  .model-card-name {
    font-size: 1rem;
  }

  .model-card-tagline {
    font-size: 0.55rem;
  }

  .model-card-details li {
    font-size: 0.85rem;
    padding-left: 0.875rem;
  }
}

/* ============================================
   FOOTER SPACER
   ============================================ */

.report-footer-spacer {
  height: 4rem;
}



/* ---- hillclimb additions ---- */
/* ---- Artificial Analysis-style index chart ---- */
.aa-card { position: relative; background: #fff; border-radius: 14px; padding: 28px 28px 18px; margin: 28px 0 8px; color: #1a1a1a; box-shadow: 0 0 0 1px rgba(255,255,255,0.06); }
.aa-card .aa-title { color: #111 !important; border: 0; padding: 0; margin: 0 0 8px; text-transform: none; letter-spacing: 0; font-family: Georgia, 'Times New Roman', serif !important; font-size: 1.75rem !important; font-weight: 400 !important; line-height: 1.2; }
.aa-sub { font-size: 0.85rem; color: #8a8a8a; line-height: 1.5; max-width: 560px; margin: 0 0 24px !important; }
.aa-scroll { overflow-x: auto; }
.aa-chart { position: relative; padding-left: 56px; }
@media (max-width: 768px) { .aa-chart { min-width: 660px; } .aa-card { padding: 20px 16px 14px; } .aa-card .aa-title { font-size: 1.4rem !important; } }
.aa-plot { position: relative; height: 260px; display: flex; align-items: flex-end; gap: 4px; padding: 0 2px; }
.aa-grid { position: absolute; left: 0; right: 0; z-index: 0; border-top: 1.5px dotted #d6d6d6; }
.aa-bar { position: relative; flex: 1; border-radius: 4px 4px 0 0; display: flex; align-items: center; justify-content: center; z-index: 1; }
.aa-bar span { color: #fff; font: 500 12px 'Inter', sans-serif; }
.aa-bar.low span { position: absolute; bottom: 100%; margin-bottom: 4px; color: #333; }
.aa-icons, .aa-labels { display: flex; gap: 4px; padding: 0 2px; }
.aa-icons { border-top: 1.5px solid #e5e5e5; padding-top: 8px; }
.aa-icons > div, .aa-labels > div { flex: 1; display: flex; justify-content: center; }
.aa-icons img { width: 20px; height: 20px; }
.aa-icons .aa-tier { width: 20px; height: 20px; border-radius: 4px; background: #9a9a9a; color: #fff; font: 700 10px 'Inter', sans-serif; display: flex; align-items: center; justify-content: center; }
.aa-labels { height: 118px; }
.aa-labels > div { position: relative; }
.aa-labels span { position: absolute; top: 6px; right: 50%; transform-origin: top right; transform: rotate(-45deg); white-space: nowrap; font: 400 11.5px 'Inter', sans-serif; color: #333; text-align: right; line-height: 1.15; }
.aa-labels b { font-weight: 600; }
.aa-labels em { font-style: normal; color: #8a8a8a; font-size: 10.5px; }
/* On a phone the twelve columns don't fit: the same bars run sideways, one row each. */
.aa-rows { display: none; }
@media (max-width: 600px) {
  .aa-scroll { display: none; }
  .aa-rows { display: grid; grid-template-columns: 20px auto 1fr; align-items: center; gap: 9px 8px; }
  .aa-rows img, .aa-rows .aa-tier { width: 20px; height: 20px; }
  .aa-rows .aa-tier { border-radius: 4px; background: #9a9a9a; color: #fff; font: 700 10px 'Inter', sans-serif; display: flex; align-items: center; justify-content: center; }
  .aa-row-label { font: 400 12.5px 'Inter', sans-serif; color: #333; line-height: 1.15; white-space: nowrap; }
  .aa-row-label b { font-weight: 600; }
  .aa-row-label em { display: block; font-style: normal; color: #8a8a8a; font-size: 10.5px; }
  .aa-row-track { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .aa-row-bar { height: 18px; border-radius: 0 4px 4px 0; flex: none; }
  .aa-row-track span { font: 500 12px 'Inter', sans-serif; color: #333; font-variant-numeric: tabular-nums; }
}
.aa-card-follow { margin-top: 1.5rem; }
.aa-note { font-size: 0.78rem; color: #8a8a8a; line-height: 1.5; margin: 12px 0 0 !important; }
/* Chart.js charts and the standings table inside AA cards */
.aa-card .line-chart { background: transparent; border: 0; border-radius: 0; padding: 0; min-height: 0; }
.aa-card .chart-legend { background: transparent; border: 0; padding: 14px 0 0; }
.aa-card .legend-item { color: #333; }
.aa-card .legend-color { width: 14px; height: 3px; border-radius: 2px; }
.aa-card .legend-item .lab-icon { width: 18px; height: 18px; margin-right: 0; }
.aa-pill { position: absolute; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .12s;
  display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 999px; white-space: nowrap;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06); font: 500 12px 'Inter', sans-serif; color: #333; }
.aa-pill .lab-icon { width: 22px; height: 22px; margin-right: 0; }
.aa-pill b { color: #111; font-weight: 700; }
.aa-card .leaderboard-container { margin: 0 -28px; }
.aa-card .leaderboard-table { background: transparent; border: 0; border-radius: 0; font-size: 0.92rem; }
.aa-card .leaderboard-table th { background: transparent; font-family: 'Inter', -apple-system, sans-serif; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: #8a8a8a; border-bottom: 1.5px solid #e5e5e5; padding-top: 0.5rem; }
.aa-card .leaderboard-table td { border-bottom: 1px solid #f0f0f0; }
.aa-card .leaderboard-table th:first-child, .aa-card .leaderboard-table td:first-child { padding-left: 28px; }
.aa-card .leaderboard-table th:last-child, .aa-card .leaderboard-table td:last-child { padding-right: 28px; }
.aa-card .leaderboard-table tbody tr:hover { background: #f7f7f8; }
.aa-card .leaderboard-table .rank-col { color: #8a8a8a; font-weight: 500; }
.aa-card .leaderboard-table .name-col { color: #111; font-weight: 500; }
.aa-card .leaderboard-table .wins-col { color: #2e7d32; font-weight: 500; }
.aa-card .leaderboard-table .losses-col { color: #c62828; font-weight: 500; }
.aa-card .leaderboard-table .winpct-col { color: #333; font-weight: 500; }
.aa-card .leaderboard-table .elo-col { color: #111; font-weight: 700; }
.aa-card .leaderboard-table td { font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  .aa-card .leaderboard-container { margin: 0 -16px; }
  .aa-card .leaderboard-table th:first-child, .aa-card .leaderboard-table td:first-child { padding-left: 12px; }
  .aa-card .leaderboard-table th:last-child, .aa-card .leaderboard-table td:last-child { padding-right: 12px; }
}

.lab-icon img { width: 68%; height: 68%; display: block; }
.lab-icon {
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  color: #10161f; font: 700 9px 'Inter', sans-serif; letter-spacing: 0;
  margin-right: 10px; vertical-align: middle; flex-shrink: 0;
}
.model-card-header .lab-icon { width: 36px; height: 36px; font-size: 13px; margin-right: 0; }
.leaderboard-table tr.ref-row td { color: #999; font-style: italic; }
.leaderboard-table tr.ref-row td.name-col { color: #888; }
.leaderboard-table tr.ref-row .lab-icon { background: #bbb !important; }
.leaderboard-table .top3-col { text-align: right; color: #555; font-variant-numeric: tabular-nums; width: 70px; white-space: nowrap; }
.leaderboard-table .runs-col { color: #999; font-size: 0.8rem; font-family: 'Fira Code', monospace; white-space: nowrap; }
.report-section code, .model-card-details code, .fav-body code {
  font-family: 'Fira Code', monospace; font-size: 0.82em;
  background: rgba(0, 170, 255, 0.1); color: #9fdcff; padding: 1px 5px; border-radius: 3px;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.stat-box { background: var(--star-panel); border: 1px solid var(--star-border); border-radius: 8px; padding: 14px 12px; text-align: center; }
.stat-num { font-family: "Conthrax", sans-serif; font-size: 1.35rem; color: var(--star-accent); display: block; }
.stat-lbl { font-size: 0.72rem; color: var(--star-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pending-card { opacity: 0.6; border-style: dashed !important; }
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .leaderboard-table .runs-col, .leaderboard-table .top3-col { display: none; }
  .leaderboard-container { overflow-x: auto; }
  .leaderboard-table .name-col { white-space: normal; font-size: 0.8rem; }
  .leaderboard-table td, .leaderboard-table th { padding-left: 6px; padding-right: 6px; }
  .leaderboard-table .lab-icon { margin-right: 6px; }
}
