:root {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #f5f5f3;
  --ink: #000000;
  --rule: #000000;
  --rule-soft: #d0d0ce;
  --ink-soft: #444444;
  --ink-muted: #74746f;
  --map-contour: #b9b9b4;
  --row-pro: #eef3f1;
  --row-quiet: #ececea;
  --chip-bg: rgba(255, 255, 255, 0.56);
  --chip-bg-hover: rgba(255, 255, 255, 0.88);
  --chip-line: rgba(96, 58, 34, 0.22);
  --chip-line-hover: rgba(96, 58, 34, 0.46);
  --medal-gold: #b58105;
  --medal-silver: #858585;
  --medal-bronze: #9a5427;
  --flag-line: #222222;
  --invert-bg: #000000;
  --invert-ink: #ffffff;
  --wrap: 1120px;
  --line: 1px solid var(--rule);
  --inset: clamp(16px, 4vw, 36px);
  --gap: clamp(16px, 3vw, 28px);
  --font-sans: "PT Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, Helvetica, sans-serif;
  --font-narrow: "PT Sans Narrow", "PT Sans", "Arial Narrow", Arial, sans-serif;
}

/* Inverted print: black paper, white ink. Hairlines are dimmed so dense
   tables do not vibrate, while text and map linework stay pure white. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --paper: #131312;
  --ink: #ffffff;
  --rule: rgba(255, 255, 255, 0.52);
  --rule-soft: rgba(255, 255, 255, 0.2);
  --ink-soft: #b6b6b0;
  --ink-muted: #9a9a94;
  --map-contour: #4b4b47;
  --row-pro: #0d1a13;
  --row-quiet: #1a1a18;
  --chip-bg: rgba(255, 255, 255, 0.07);
  --chip-bg-hover: rgba(255, 255, 255, 0.16);
  --chip-line: rgba(255, 255, 255, 0.26);
  --chip-line-hover: rgba(255, 255, 255, 0.55);
  --medal-gold: #e0ae43;
  --medal-silver: #b9b9b4;
  --medal-bronze: #d08a5c;
  --flag-line: #cfcfc9;
  --invert-bg: #ececea;
  --invert-ink: #000000;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-style: solid;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 10px 12px;
  border: var(--line);
  background: var(--paper);
}

.skip-link:focus {
  left: 8px;
  z-index: 10;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--inset);
}

.wrap--wide {
  max-width: none;
}

.site-header {
  border-bottom: var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  /* the inset is repeated because the shorthand would otherwise drop .wrap's */
  padding: 16px var(--inset);
}

.brand {
  display: flex;
  flex: 0 1 auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

/* The logo is a one-colour drawing, so it is painted as a mask filled with
   currentColor: the same file reads as black ink on paper and as white ink on
   the inverted print, and there is nothing to swap when the theme flips. */
.brand-logo {
  display: block;
  width: clamp(176px, 30vw, 264px);
  max-width: 100%;
  aspect-ratio: 1549 / 431;
  background-color: currentColor;
  -webkit-mask: url("/logo.svg") no-repeat center / contain;
  mask: url("/logo.svg") no-repeat center / contain;
  transition: opacity 140ms ease;
}

.brand:hover .brand-logo {
  opacity: 0.68;
}

.brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* A section label sitting next to the logo, e.g. the admin console. */
.brand-tag {
  min-width: 0;
  font-family: var(--font-narrow);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: flex-end;
  font-family: var(--font-narrow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.nav a:hover {
  border-bottom-color: var(--ink);
}

/* The nav keeps hugging the right edge now that the theme switch follows it. */
.nav {
  margin-left: auto;
}

/* Theme switch: same 34px framed square as the map controls, so it reads as
   part of the site's control vocabulary rather than a bolted-on widget. */
.theme-toggle {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--ink);
  color: var(--bg);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.theme-toggle__icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="dark"] .theme-toggle__icon--moon,
:root:not([data-theme="dark"]) .theme-toggle__icon--sun {
  display: none;
}

@media (hover: none) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }
}

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

.section {
  border-top: var(--line);
  padding: clamp(26px, 5.5vw, 56px) 0;
}

.site-main > .section:first-child {
  border-top: 0;
}

.section--paper {
  background: var(--paper);
}

.section-header {
  display: grid;
  gap: 6px;
  margin-bottom: clamp(16px, 3vw, 28px);
}

.section-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.04;
}

.section-subtitle {
  margin: 0;
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero {
  padding-top: clamp(28px, 6vw, 70px);
}

.hero-grid {
  display: grid;
  gap: clamp(18px, 4vw, 36px);
  min-width: 0;
}

.hero-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

.kicker {
  margin: 0;
  font-family: var(--font-narrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero-title {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  font-size: clamp(34px, 6vw, 72px);
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(16px, 2.4vw, 22px);
  letter-spacing: 0.01em;
}

.stats {
  margin: 8px 0 0;
  padding: 14px 14px;
  border: var(--line);
  display: grid;
  gap: 10px;
  max-width: 360px;
  background: var(--paper);
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}

.stats dt {
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.stats dd {
  margin: 0;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border: var(--line);
  text-decoration: none;
  background: transparent;
  font-family: var(--font-narrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1;
  transition: background-color 120ms ease, color 120ms ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn--ghost {
  background: transparent;
}

.btn--wide {
  min-width: min(260px, 100%);
}

.hero-figure {
  margin: 0;
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.figure-caption {
  margin: 0;
  font-size: 14px;
  max-width: 62ch;
  font-family: var(--font-narrow);
  letter-spacing: 0.06em;
}

.audience-map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audience-map-button {
  width: 34px;
  height: 34px;
  border: var(--line);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 22px/1 var(--font-narrow);
  cursor: pointer;
}

.audience-map-button:hover,
.audience-map-button:focus-visible {
  background: var(--ink);
  color: var(--bg);
  outline: none;
}

.audience-map-toolbar__season {
  min-width: 148px;
  font-family: var(--font-narrow);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.map-hero,
.map-vertical {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  min-width: 0;
}

.map-frame {
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 1;
}

.map-route {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 6 8;
}

.map-river {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2 6;
}

.map-dots circle {
  fill: var(--ink);
}

.map-labels text {
  fill: var(--ink);
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 14px;
}

.map-hachure path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.9;
}

.map-compass circle {
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 1;
}

.map-compass path {
  fill: var(--ink);
}

.map-compass text {
  fill: var(--ink);
  font-family: var(--font-narrow);
  letter-spacing: 0.18em;
  font-size: 14px;
  text-anchor: middle;
}

.map-stamp rect {
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.map-stamp text {
  fill: var(--ink);
  font-family: var(--font-narrow);
  letter-spacing: 0.16em;
  font-size: 14px;
}

.audience-map__contours path {
  fill: none;
  stroke: var(--map-contour);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.audience-map__route {
  stroke-width: 3;
  stroke-dasharray: 9 8;
}

.audience-map__rounds circle {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 4;
}

.audience-map__rounds text {
  fill: var(--ink);
  stroke: var(--bg);
  stroke-width: 5px;
  paint-order: stroke fill;
  stroke-linejoin: round;
  font-family: var(--font-narrow);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.audience-map__rounds text + text {
  stroke-width: 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.audience-map__stamp rect {
  fill: var(--bg);
}

.routes-grid {
  display: grid;
  gap: var(--gap);
  align-items: start;
  min-width: 0;
}

.routes-map-figure {
  min-width: 0;
}

.routes-map {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.routes-map .map-hero {
  height: auto;
}

.routes-map .map-vertical {
  height: 100%;
}

.routes-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.route-item {
  padding: 14px 14px;
  border: var(--line);
  background: var(--bg);
}

.route-title {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.1;
}

.route-note {
  margin: 0;
  max-width: 62ch;
}

.prose {
  display: grid;
  gap: 14px;
  max-width: 70ch;
}

.prose p {
  margin: 0;
  font-size: 16px;
  line-height: 1.72;
}

.cards {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.card {
  border: var(--line);
  padding: 16px 16px;
  background: var(--bg);
}

.card-title {
  margin: 0 0 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 18px;
  line-height: 1.1;
}

.card-meta {
  margin: 0;
  display: grid;
  gap: 10px;
}

.card-meta dt {
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.card-meta dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.cta {
  display: grid;
  gap: 18px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn--wide {
  min-width: 220px;
}

.cta-note {
  margin: 0;
  max-width: 70ch;
}

.ranking {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  appearance: none;
  border: var(--line);
  background: transparent;
  padding: 10px 12px;
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--bg);
}

.tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ranking-rules {
  border: var(--line);
  background: var(--paper);
  padding: 14px;
}

.ranking-rules h3,
.ranking-rules h4,
.ranking-rules p,
.ranking-rules ul {
  margin: 0;
}

.ranking-rules h3,
.ranking-rules h4 {
  font-family: var(--font-narrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-rules h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.ranking-rules h4 {
  font-size: 14px;
  margin-bottom: 6px;
}

.ranking-rules p,
.ranking-rules li {
  font-size: 13px;
  line-height: 1.45;
}

.ranking-rules__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ranking-rules ul {
  padding-left: 18px;
}

.ranking-rules__note {
  margin-top: 10px;
  font-weight: 700;
}

.ranking-rules__cutoff {
  margin-top: 10px;
  padding-top: 10px;
  border-top: var(--line);
  font-weight: 700;
}

.ranking-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
}

.ranking-legend[hidden] {
  display: none;
}

.ranking-legend__swatch {
  flex: none;
  width: 22px;
  height: 12px;
  border: var(--line);
  background: var(--paper);
}

.ranking-row--partial td {
  background: var(--paper);
  color: var(--ink-muted);
}

.ranking-row--partial .audience-name-link {
  color: inherit;
}

.ranking-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ranking-event-filter {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: var(--line);
  padding: 10px 12px 12px;
  background: var(--bg);
}

.ranking-event-filter legend {
  padding: 0 4px;
  font-family: var(--font-narrow);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ranking-event-filter__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ranking-event-option {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  min-width: 58px;
  align-items: center;
  justify-content: center;
  border: var(--line);
  padding: 0 12px;
  background: var(--paper);
  cursor: pointer;
  font-family: var(--font-narrow);
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.ranking-event-option[hidden] {
  display: none;
}

.ranking-event-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ranking-event-option:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
}

.ranking-event-option:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.audience-bike-categories,
.audience-quick-filters {
  grid-column: span 2;
  min-width: 0;
  margin: 0;
  border: var(--line);
  padding: 10px 12px 12px;
  background: var(--bg);
}

.audience-bike-categories legend,
.audience-quick-filters legend {
  padding: 0 4px;
  font-family: var(--font-narrow);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.audience-bike-options,
.audience-filter-options {
  display: grid;
  gap: 8px;
}

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

.audience-filter-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audience-bike-option,
.audience-filter-option {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: var(--line);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--font-narrow);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audience-bike-option input,
.audience-filter-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.audience-bike-option:has(input:checked),
.audience-filter-option:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
}

.audience-bike-option:has(input:checked) .audience-season-box::before,
.audience-filter-option:has(input:checked) .audience-season-box::before {
  content: "✓";
}

.audience-bike-option:has(input:focus-visible),
.audience-filter-option:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.audience-seasons {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: var(--line);
  padding: 10px 12px 12px;
  background: var(--bg);
}

.audience-seasons legend {
  padding: 0 4px;
  font-family: var(--font-narrow);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.audience-season-toolbar,
.audience-season-presets,
.audience-season-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audience-season-toolbar {
  justify-content: space-between;
}

.audience-period {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.audience-season-presets,
.audience-season-options {
  flex-wrap: wrap;
}

.audience-season-preset,
.audience-season-option {
  min-height: 44px;
  border: var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-narrow);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audience-season-preset {
  padding: 8px 12px;
  cursor: pointer;
}

.audience-season-preset:hover,
.audience-season-preset:focus-visible,
.audience-season-preset.is-active {
  background: var(--ink);
  color: var(--bg);
}

.audience-season-option {
  position: relative;
  display: inline-flex;
  flex: 1 0 72px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.audience-season-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.audience-season-option .audience-season-year {
  position: relative;
  pointer-events: none;
}

.audience-season-box {
  display: inline-grid;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  place-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1;
}

.audience-season-option:has(input:checked) .audience-season-box::before {
  content: "✓";
}

.audience-season-option:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
}

.audience-season-option:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 6px;
  border: var(--line);
  padding: 10px 12px;
  background: var(--bg);
}

.field[hidden] {
  display: none;
}

.field span {
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

select {
  appearance: none;
  border: var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
}

.ranking-panel {
  min-width: 0;
  border: var(--line);
  background: var(--bg);
  padding: 14px var(--inset);
  margin: 0 calc(-1 * var(--inset));
  border-left: 0;
  border-right: 0;
}

.ranking .table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: min(70vh, 720px);
}

.muted {
  margin: 0 0 10px;
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.archive-timeline {
  display: block;
  width: 100%;
  height: auto;
}

.archive-timeline__line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 6 8;
}

.archive-timeline__years circle {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 3;
}

.archive-timeline__years text {
  fill: var(--ink);
  font-family: var(--font-narrow);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-anchor: middle;
}

.archive-wrap {
  max-width: 1440px;
}

.archive-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.archive-event-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 230px;
  border: var(--line);
  background: var(--bg);
  padding: 18px;
}

.archive-event-card h3,
.archive-event-card p {
  margin: 0;
}

.archive-event-card h3 {
  min-height: 2.3em;
  font-family: var(--font-narrow);
  font-size: 22px;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.archive-event-card .btn {
  align-self: end;
  margin-top: auto;
}

.archive-event-card__year {
  font-family: var(--font-narrow);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.results-hub-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(280px, 1fr);
  gap: 12px;
  max-width: 780px;
  margin-bottom: 30px;
}

.results-hub-controls select {
  min-height: 44px;
}

.results-years {
  display: grid;
  gap: clamp(30px, 5vw, 52px);
}

.results-year-section {
  display: grid;
  gap: 14px;
}

.results-year-heading {
  margin: 0;
  border-bottom: var(--line);
  padding-bottom: 8px;
  font-family: var(--font-narrow);
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0.04em;
  line-height: 1;
}

.results-event-card {
  min-height: 270px;
}

.results-event-card__date,
.results-event-card__meta {
  font-size: 13px;
}

.results-event-card__meta {
  font-family: var(--font-narrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-event-card__actions {
  display: grid;
  align-self: end;
  gap: 10px;
  margin-top: auto;
}

.results-event-card__actions .btn {
  margin-top: 0;
}

.results-empty {
  margin: 0;
  border: var(--line);
  padding: 36px 18px;
  text-align: center;
}

.archive-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.archive-source {
  font-family: var(--font-narrow);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-protocol-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: flex-end;
}

.archive-event-nav .tab {
  text-decoration: none;
}

.protocol-race-tabs {
  margin-bottom: 14px;
}

.protocol-controls {
  grid-template-columns: minmax(140px, 0.4fr) minmax(260px, 1.6fr);
}

.protocol-controls--all {
  grid-template-columns: minmax(140px, 0.35fr) minmax(180px, 0.5fr) minmax(280px, 1.5fr);
}

.protocol-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  border-top: var(--line);
  border-left: var(--line);
}

.protocol-summary p {
  display: grid;
  gap: 2px;
  margin: 0;
  border-right: var(--line);
  border-bottom: var(--line);
  padding: 10px 12px;
}

.protocol-summary strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.protocol-summary span {
  font-family: var(--font-narrow);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-table.protocol-table {
  min-width: 900px;
}

.racer-hero-card__route-alt {
  stroke-dasharray: 8 9;
}

.racer-summary {
  margin-bottom: 14px;
}

.racer-external-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.racer-external-links[hidden] {
  display: none;
}

.racer-external-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--chip-line);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--font-narrow);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  background: var(--chip-bg);
}

.racer-external-link__logo {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.racer-external-link:hover,
.racer-external-link:focus-visible {
  border-color: var(--chip-line-hover);
  background: var(--chip-bg-hover);
}

.archive-table.racer-table {
  min-width: 940px;
}

.racer-col-year {
  width: 72px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.racer-col-event {
  width: 240px;
}

.racer-col-race {
  width: 220px;
}

.racer-event-link {
  color: inherit;
  font-weight: 700;
}

.diploma-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(280px, 1fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.diploma-copy { align-self: start; }
.diploma-period { max-width: 360px; margin-top: 24px; }
.diploma-period select { min-height: 44px; }
.diploma-preview { width: min(100%, 430px); justify-self: center; border: var(--line); background: #fff; padding: 10px; box-shadow: 12px 12px 0 var(--ink); }
.diploma-preview canvas { display: block; width: 100%; height: auto; background: #f5f5f3; }
.search-page { min-height: calc(100vh - 100px); }
.search-title { margin-bottom: 24px; }
.site-search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 820px; }
.site-search-form .btn { margin: 0; min-width: 120px; }
.site-search-results { display: grid; gap: 36px; margin-top: 36px; max-width: 920px; }
.search-result-group h2 { margin: 0 0 12px; font-family: var(--font-narrow); font-size: 30px; text-transform: uppercase; }
.search-result-list { border-top: var(--line); }
.search-result { display: grid; gap: 2px; padding: 15px 4px; border-bottom: var(--line); text-decoration: none; }
.search-result strong { font-size: 18px; }
.search-result span { font-family: var(--font-narrow); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.search-result:hover, .search-result:focus-visible { background: var(--paper); padding-left: 12px; }

.archive-col-category {
  width: 180px;
  overflow-wrap: anywhere;
}

.archive-years {
  margin-bottom: 14px;
}

.archive-years .tab {
  min-width: 72px;
  min-height: 44px;
}

.archive-controls {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) minmax(120px, 0.55fr) minmax(240px, 1.2fr);
  gap: 12px;
  margin-bottom: 14px;
}

.archive-input {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  border: var(--line);
  background: var(--paper);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.archive-controls select {
  min-height: 44px;
}

.archive-points-note {
  margin: -2px 0 14px;
  max-width: 920px;
  font-size: 12px;
  line-height: 1.5;
}

.archive-input:focus-visible,
.archive-controls select:focus-visible,
.archive-clear:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.archive-panel {
  border: var(--line);
  background: var(--bg);
}

.archive-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.archive-race-title {
  margin: 0 0 2px;
  font-family: var(--font-narrow);
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.archive-table-header .muted {
  margin: 0;
}

.archive-clear {
  min-height: 44px;
  border: var(--line);
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
  font-family: var(--font-narrow);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.archive-clear:hover {
  background: var(--ink);
  color: var(--bg);
}

.archive-table-wrap {
  max-height: min(70vh, 760px);
}

.archive-table {
  table-layout: fixed;
}

.archive-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
}

.archive-table thead th::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  border-bottom: var(--line);
}

.archive-col-place,
.archive-col-bib,
.archive-col-gender,
.archive-col-time,
.archive-col-points {
  width: 100px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.archive-col-place {
  width: 76px;
  text-align: right !important;
}

.archive-col-gender {
  width: 64px;
}

.archive-col-time {
  width: 120px;
  text-align: right !important;
}

.archive-col-points {
  width: 100px;
  text-align: right !important;
  font-weight: 700;
}

.archive-col-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.archive-row-category {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: var(--font-narrow);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.archive-empty {
  padding: 36px 14px !important;
  text-align: center !important;
}

.archive-updated {
  margin: 12px 0 0;
  font-size: 12px;
}

.table--fixed {
  table-layout: fixed;
}

.ranking .table--fixed th,
.ranking .table--fixed td {
  overflow: hidden;
}

.ranking .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
}

.ranking .table thead th::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  border-bottom: var(--line);
}

.ranking .table--fixed .col-name {
  width: 42%;
  max-width: none;
}

.ranking .audience-table .col-name {
  width: auto;
  overflow-wrap: anywhere;
}

.audience-identity {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  line-height: 1.35;
}

.audience-prizes {
  display: inline-flex;
  align-self: center;
  gap: 2px;
}

.audience-trophy {
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.audience-trophy svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.audience-trophy--1 {
  color: var(--medal-gold);
}

.audience-trophy--2 {
  color: var(--medal-silver);
}

.audience-trophy--3 {
  color: var(--medal-bronze);
}

.audience-name-link {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.audience-name-link:hover,
.audience-name-link:focus-visible {
  text-decoration-style: solid;
}

.audience-name__surname {
  font-weight: 700;
  letter-spacing: 0.025em;
}

.audience-name__maiden,
.audience-name__given,
.audience-name__suffix,
.audience-birth-year {
  font-weight: 400;
}

.audience-birth-year {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audience-pro {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  border: 1px solid currentColor;
  padding: 1px 5px;
  color: inherit;
  font-family: var(--font-narrow);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-decoration: none;
}

.audience-pro:hover,
.audience-pro:focus-visible {
  background: var(--ink);
  color: var(--bg);
}

.audience-country {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  gap: 4px;
  font-family: var(--font-narrow);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.audience-country__flag {
  display: inline-block;
  width: 17px;
  height: 11px;
  border: 1px solid var(--flag-line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.audience-country--by .audience-country__flag {
  background: linear-gradient(to bottom, #c8313e 0 67%, #148142 67% 100%);
}

.audience-country__code {
  color: var(--ink-muted);
}

.audience-memorial {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  color: inherit;
  cursor: help;
  font-size: 13px;
  line-height: 1;
}

.audience-row--professional:not(.audience-row--inactive):not(.audience-row--memorial) td {
  background: var(--row-pro);
}

.audience-row--inactive td,
.audience-row--memorial td {
  background: var(--row-quiet);
  color: var(--ink-muted);
}

.audience-row--inactive .audience-birth-year,
.audience-row--memorial .audience-birth-year,
.audience-row--memorial .audience-country__code {
  color: inherit;
}

.audience-hall {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 42px);
  margin-top: clamp(28px, 5vw, 52px);
  border: var(--line);
  padding: clamp(18px, 3vw, 30px);
  background: var(--invert-bg);
  color: var(--invert-ink);
}

.audience-hall__header h3,
.audience-hall__header p,
.audience-hall__member p,
.audience-hall__empty {
  margin: 0;
}

.audience-hall__header h3 {
  font-family: var(--font-narrow);
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.audience-hall__header .kicker {
  margin-bottom: 10px;
}

.audience-hall__list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.audience-hall__empty {
  border: 1px solid currentColor;
  padding: 18px;
  font-size: 14px;
}

.audience-hall__member {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid currentColor;
  padding: 8px 0 12px;
}

.audience-hall__place,
.audience-hall__member strong {
  font-variant-numeric: tabular-nums;
}

.audience-hall .audience-pro:hover,
.audience-hall .audience-pro:focus-visible {
  background: var(--invert-ink);
  color: var(--invert-bg);
}

.ranking .audience-table .audience-col-total {
  border-left: var(--line);
}

.ranking .audience-table th.audience-col-season,
.ranking .audience-table td.audience-col-season {
  border-left: 1px solid var(--rule-soft);
  text-align: center;
}

.ranking .table--fixed .col-gender {
  width: 32px;
}

.ranking .table--fixed .col-place {
  width: 32px;
}

.ranking .table--fixed .col-points {
  width: clamp(46px, 6vw, 70px);
}

.ranking .table--fixed .col-gender,
.ranking .table--fixed .col-place {
  padding-left: 6px;
  padding-right: 6px;
}

.ranking .table--fixed .col-place {
  padding-left: 4px;
  padding-right: 4px;
}

.ranking .table th[data-col="gender"],
.ranking .table th[data-col="place"] {
  padding-left: 6px;
  padding-right: 6px;
}

.ranking .table th[data-col="place"] {
  padding-left: 4px;
  padding-right: 4px;
  white-space: nowrap;
  word-break: normal;
}

.ranking .col-points,
.ranking .col-place {
  text-align: right;
}

.ranking .col-gender {
  text-align: left;
}

.ranking .table th[data-col="gender"],
.ranking .table th[data-col="place"],
.ranking .table th[data-col="name"] {
  text-align: left;
}

.ranking .table--fixed th[data-col="place"],
.ranking .table--fixed th[data-col="total"],
.ranking .table--fixed th[data-col]:not([data-col="gender"]):not([data-col="place"]):not([data-col="name"]) {
  text-align: right;
  white-space: normal;
  word-break: break-word;
  line-height: 1.1;
}

.ranking .table--fixed thead th[data-col]:not([data-col="gender"]):not([data-col="place"]):not([data-col="name"]) {
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
  border-top: var(--line);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

.table--wide {
  min-width: max-content;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: var(--line);
  vertical-align: top;
}

.table th {
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.col-place,
.col-points {
  white-space: nowrap;
  width: 1%;
  font-variant-numeric: tabular-nums;
}

.col-gender {
  white-space: nowrap;
  width: 1%;
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.col-name {
  min-width: 22ch;
  max-width: 48ch;
  white-space: normal;
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: var(--line);
  padding: 22px 0;
}

.footer-row {
  display: grid;
  gap: 10px;
}

.footer-left,
.footer-right {
  margin: 0;
}

.footer-left {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-family: var(--font-narrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.footer-right {
  font-size: 12px;
  max-width: 90ch;
}

.footer-link {
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

@media (min-width: 820px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }

  .hero-figure {
    margin-top: 8px;
    transform: translateX(10px);
  }

  .routes-map-figure {
    margin-top: 0;
    transform: none;
  }

  .routes-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
    gap: 30px;
  }

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

  .footer-row {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }

  .ranking {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  /* The logo needs a line of its own, otherwise the wordmark shrinks past
     reading size next to a nav this long. */
  .header-row {
    flex-wrap: wrap;
  }

  .brand-logo {
    width: min(232px, 64vw);
  }

  .nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .diploma-layout { grid-template-columns: 1fr; }
  .diploma-preview { width: min(88vw, 390px); box-shadow: 8px 8px 0 var(--ink); }
  .site-search-form { grid-template-columns: 1fr; }
  .site-search-form .btn { width: 100%; }
  .audience-map__rounds text {
    font-size: 12px;
  }

  .audience-map__rounds text + text {
    font-size: 10px;
  }

  .audience-season-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .audience-season-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audience-season-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audience-bike-categories,
  .audience-quick-filters {
    grid-column: 1 / -1;
  }

  .audience-filter-options {
    grid-template-columns: 1fr;
  }

  .audience-hall {
    grid-template-columns: 1fr;
  }

  .ranking .table th,
  .ranking .table td {
    padding: 8px 8px;
    font-size: 12px;
  }

  #ranking-table {
    min-width: 0;
  }

  #ranking-table .col-name {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .archive-section-header,
  .archive-table-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-source {
    white-space: normal;
  }

  .archive-controls {
    grid-template-columns: 1fr;
  }

  .results-hub-controls {
    grid-template-columns: 1fr;
  }

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

  .archive-protocol-links {
    justify-content: flex-start;
  }

  .archive-search-field {
    grid-column: 1;
  }

  .archive-table th,
  .archive-table td {
    padding: 8px 5px;
    font-size: 12px;
  }

  .archive-col-place {
    width: 40px;
  }

  .archive-col-bib {
    width: 48px;
  }

  .archive-col-gender {
    width: 36px;
  }

  .archive-col-time {
    width: 68px;
  }

  .archive-col-points {
    width: 58px;
  }

  .archive-col-category {
    width: 116px;
  }

  .archive-table.racer-table {
    min-width: 760px;
  }

  .racer-col-year {
    width: 54px;
  }

  .racer-col-event,
  .racer-col-race {
    width: 170px;
  }
}

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