/* Sidebar, peach selection, blue accents, and compact tables follow the reference. */
:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #1764d9;
  --paper: #fff;
  --canvas: #f8f8f8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    14px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
  color: var(--muted);
  padding: 5px 0;
  background: none;
  border: 0;
  font-size: 12px;
}
button:hover,
a:hover {
  color: var(--blue);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 5;
  background: white;
  padding: 10px;
}
.skip-link:focus {
  top: 12px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  border-right: 1px solid var(--line);
  background: #f7f7f7;
  overflow-y: auto;
}
.brand {
  display: block;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.6px;
}
.sidebar nav {
  padding: 20px 16px;
}
.sidebar nav a {
  display: block;
  padding: 10px 16px;
  color: var(--ink);
  border-radius: 5px;
  line-height: 1.5;
  margin-bottom: 3px;
}
.sidebar nav a:hover {
  background: #eee;
}
.sidebar nav a[aria-current="page"] {
  background: #fddeb1;
  font-weight: 600;
}
.nav-label {
  margin: 24px 12px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
main {
  margin-left: 240px;
  min-width: 0;
}
.page-heading {
  background: #0898d7;
  color: #fff7ec;
  padding: 28px 36px;
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
}
h1 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.7px;
}
.content {
  max-width: 1120px;
  margin: auto;
  padding: 28px 40px 48px;
}
.view-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.view-count {
  color: var(--muted);
  font-size: 12px;
}
.chart-panel {
  position: relative;
  margin-bottom: 20px;
}
#scatter-plot {
  display: block;
  width: 100%;
  height: 290px;
  overflow: visible;
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.plot-line {
  stroke: var(--line);
  stroke-width: 1;
}
.plot-point {
  fill: var(--blue);
  stroke: var(--canvas);
  stroke-width: 2;
}
.plot-point.human {
  fill: var(--canvas);
  stroke: var(--blue);
}
.plot-point:hover,
.plot-point:focus {
  stroke: var(--ink);
  stroke-width: 3;
  outline: none;
}
.plot-tooltip {
  position: absolute;
  z-index: 3;
  width: 224px;
  max-width: 100%;
  padding: 14px 16px 11px;
  background: var(--paper);
  border: 1px solid #cbdcf7;
  border-top: 3px solid var(--blue);
  border-radius: 7px;
  box-shadow: 0 6px 24px #172b5024;
  color: var(--ink);
  font-size: 12px;
}
.plot-tooltip-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.plot-tooltip-heading strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.plot-tooltip-kind {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: #fddeb1;
  font-size: 10px;
}
.plot-tooltip-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 9px;
  font-variant-numeric: tabular-nums;
}
.plot-tooltip-metrics dt {
  font-size: 11px;
  color: var(--muted);
}
.plot-tooltip-metrics dd {
  margin: 2px 0 0;
  color: var(--blue);
  font-size: 18px;
  font-weight: 600;
}
.plot-tooltip-meta {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
}
.plot-tooltip-brand {
  display: block;
  margin-top: 10px;
  font-size: 10px;
  color: var(--blue);
  font-weight: 500;
}
.table-wrap {
  min-width: 0;
  overflow: auto;
  max-height: 385px;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 10px;
  z-index: 1;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}
th,
td {
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}
th:first-child,
td:first-child {
  text-align: center;
  width: 40px;
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafbfd;
}
.leader-name {
  font-weight: 500;
}
.player-kind {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  margin-left: 6px;
}
.score-cell {
  font-weight: 600;
  position: relative;
}
.score-bar {
  display: block;
  height: 3px;
  background: #dce9fd;
  border-radius: 2px;
  width: 64px;
  margin: 3px 0 0 auto;
  overflow: hidden;
}
.score-bar i {
  display: block;
  height: 100%;
  background: #3980e7;
}
.incomplete td {
  color: var(--muted);
}
.coverage {
  font-size: 11px;
}
.table-message {
  padding: 32px 18px;
  text-align: left !important;
  color: var(--muted) !important;
  font-weight: 400 !important;
}
.score-note {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 0;
  line-height: 1.6;
}
.recordings {
  margin-top: 22px;
}
.replay-controls {
  display: flex;
  justify-content: flex-end;
  height: 22px;
  margin-bottom: 8px;
}
.replay-controls:has(button[hidden]) {
  display: none;
}
.replay-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 16px;
}
.replay-card {
  position: relative;
  flex: 0 0 calc((100% - 32px) / 3);
  min-width: 0;
  margin: 0;
}
.replay-visual {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f7;
}
.replay-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.no-replay {
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
}
figcaption {
  display: flex;
  align-items: start;
  gap: 8px;
  padding-top: 8px;
}
.replay-caption {
  flex: 1;
  min-width: 0;
}
.replay-caption strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.replay-caption p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.run-details {
  font-size: 12px;
}
.run-details summary {
  list-style: none;
  cursor: pointer;
  padding: 0 5px 4px;
  color: var(--muted);
  font-weight: 600;
}
.run-details summary::-webkit-details-marker {
  display: none;
}
.run-details[open] summary {
  color: var(--blue);
}
.detail-menu {
  position: absolute;
  z-index: 2;
  right: 0;
  top: calc(100% + 6px);
  width: 210px;
  background: white;
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 4px;
  box-shadow: 0 5px 16px #172b5010;
}
.detail-menu p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.detail-menu a {
  display: block;
  padding: 4px 0;
}
#gallery-status {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
#gallery-status:not(:empty) {
  margin-top: 18px;
}
.more-row {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.more-row:has(button:not([hidden])) {
  margin-top: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
noscript p {
  margin: 24px 32px;
}

@media (min-width: 1500px) {
  .replay-card {
    flex-basis: calc((100% - 48px) / 4);
  }
}
@media (max-width: 1050px) {
  .sidebar {
    width: 210px;
  }
  main {
    margin-left: 210px;
  }
  .brand {
    padding-left: 24px;
    font-size: 21px;
  }
  .content {
    padding: 24px;
  }
  .sidebar nav a {
    padding-left: 12px;
    font-size: 13px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 15px 20px;
    font-size: 20px;
    border-bottom: 0;
  }
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 14px 14px;
  }
  #benchmark-links {
    display: contents;
  }
  .nav-label {
    display: none;
  }
  .sidebar nav a {
    padding: 7px 10px;
    margin: 0;
    font-size: 12px;
  }
  main {
    margin-left: 0;
  }
  .page-heading {
    min-height: 85px;
    padding: 24px 20px;
    justify-content: flex-start;
  }
  .content {
    padding: 22px 20px 36px;
  }
  .view-bar {
    gap: 8px;
  }
  h2 {
    font-size: 16px;
  }
  .view-count {
    font-size: 10px;
  }
  #scatter-plot {
    height: 250px;
  }
  .replay-card {
    flex-basis: calc((100% - 16px) / 2);
  }
  .replay-card:nth-child(odd) .detail-menu {
    left: 0;
    right: auto;
  }
  th,
  td {
    padding: 11px 12px;
  }
}
@media (max-width: 360px) {
  .replay-card {
    flex-basis: 100%;
  }
}
