/* Stats reuse the site's type, colour tokens, form fields and table anatomy. */
.rider-stats { padding: 56px var(--margin) 0; min-width: 0; }
.public-stats { padding-top: 0; }
.stats-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; }
.stats-heading a { color: var(--cyan); }
.stats-status:not(:empty) { margin-top: 20px; }
.stats-status .button { margin: 8px; }
.stats-coverage { max-width: 75ch; margin: 24px 0 32px; color: var(--muted); }
.stats-overview { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 64px); }
.stats-section { min-width: 0; padding: 28px 0; border-top: 1px solid var(--panel-2); }
.stats-section h3 { margin-bottom: 24px; font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem); line-height: 1.1; }
.stats-overview > :first-child { grid-column: 1 / -1; }
.stats-values { display: flex; flex-wrap: wrap; gap: 24px 36px; font-variant-numeric: tabular-nums; }
.stats-values > div { flex: 1 1 130px; min-width: 0; }
.stats-values dt { color: var(--muted); margin-bottom: 4px; }
.stats-values dd { font-size: 1.375rem; font-weight: 800; overflow-wrap: anywhere; }
.stats-values dd.stats-note { font-size: 0.875rem; font-weight: 400; margin-top: 6px; }
.stats-note { color: var(--muted); max-width: 75ch; font-size: 0.875rem; }
p.stats-note { margin-top: 18px; }
.stats-mode { margin-top: 28px; max-width: 540px; font-variant-numeric: tabular-nums; }
.stats-mode p { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-mode p span { margin-left: auto; }
.stats-mode-bar { display: flex; overflow: hidden; height: 10px; border-radius: 5px; background: var(--panel-2); margin-top: 10px; }
.stats-race { background: var(--cyan); }
.stats-showoff { background: var(--orange); }
.stats-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.stats-filters > .field { flex: 1 1 150px; min-width: 0; }
.stats-filters > .field:first-child { flex-basis: 220px; }
.stats-filters input, .stats-filters select { width: 100%; }
.stats-more { flex-basis: 100%; }
.stats-more summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--cyan); font-weight: 700; width: fit-content; }
.stats-more > .stats-filters { padding: 12px 0; }
.stats-more .stats-note { flex-basis: 100%; margin: 0; }
.stats-table-status { margin-top: 18px; color: var(--muted); min-height: 1.5em; }
.stats-table { margin: 12px 0 0; }
.stats-table th button { min-height: 44px; min-width: 44px; display: inline-block; }
.stats-table td { vertical-align: top; }
.stats-pager { padding: 16px 0 12px; }
.stats-pager .pages { flex-wrap: wrap; }
.stats-pager button:disabled { opacity: 0.5; cursor: default; }
[data-rider-title] { overflow-wrap: anywhere; }
[data-rider-subtitle] { display: flex; align-items: center; gap: 12px; }
[data-rider-subtitle] img { width: 40px; height: 50px; border-radius: 6px; object-fit: cover; background: var(--orange); }
@media (max-width: 760px) {
  .stats-overview { grid-template-columns: 1fr; }
  .stats-pager { align-items: start; }
  .stats-pager .pages { gap: 10px; }
  .stats-filters { gap: 12px; }
  .stats-filters > .field { flex-basis: 140px; }
  .stats-filters > .field:first-child { flex-basis: 100%; }
}
.stats-metrics-table { margin: 0; }
.stats-metrics-table th, .stats-metrics-table td { padding: 12px 16px; white-space: normal; min-width: 120px; }
.stats-metrics-table td { font-variant-numeric: tabular-nums; }
.stats-metrics-table small { display: block; color: var(--muted); margin-top: 6px; font-size: 0.8125rem; }
.stats-metrics-table th[scope="row"] { font-weight: 600; }
.stats-metrics-table thead th { text-transform: none; font-style: normal; }
