@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@200;400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f5f6;
  --ink: #34363a;
  --muted: #707377;
  --line: #dce0e3;
  --paper: #ffffff;
  --pink: #d9006c;
  --rose: #ffedf5;
  --blue: #116b8f;
  --green: #28784a;
  --yellow: #d29b12;
  --control: #e7ebee;
  --control-active: #d3d9dd;
  --shadow: 0 16px 40px rgba(52, 54, 58, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "IBM Plex Sans Var", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 0;
  background: rgba(244, 245, 246, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: calc(100% - 32px);
  max-width: 1220px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, var(--pink), #fff 28%, var(--blue) 50%, var(--green) 72%, var(--pink));
  border: 1px solid rgba(25, 24, 20, 0.14);
}

.brand-logo {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.stage-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.stage-nav a,
.stage-select,
.tab-button,
.source-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 4px;
  background: var(--control);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.stage-nav a.active,
.stage-select:focus,
.tab-button.active {
  background: var(--control-active);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--pink);
  font-weight: 700;
}

.stage-nav a:not(.active):hover,
.stage-select:hover,
.tab-button:not(.active):hover,
.source-link:hover,
.back-link:hover {
  background: var(--control-active);
}

.stage-select-wrap {
  display: block;
  min-width: 210px;
  width: min(38vw, 360px);
}

.stage-select {
  width: 100%;
  min-height: 34px;
  appearance: auto;
  text-align: left;
  cursor: pointer;
}

.stage-step {
  min-width: 54px;
  text-transform: uppercase;
}

.stage-step.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.overview-link {
  min-width: 78px;
}

.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;
}

main {
  width: calc(100% - 32px);
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 26px;
  align-items: end;
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--line);
}

.hero > *,
.stage-header > *,
.section-head > *,
.leader-card,
.stage-card {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  max-width: 780px;
  font-size: clamp(24px, 3.5vw, 39px);
  font-weight: 600;
}

h2 {
  font-size: 28px;
  font-weight: 600;
}

h3 {
  font-size: 18px;
  font-weight: 600;
}

.lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.snapshot {
  padding: 18px;
  border: 0;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.snapshot dl {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 7px 14px;
  margin: 0;
  font-size: 14px;
}

.snapshot dt {
  color: var(--muted);
}

.snapshot dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head p {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.race-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.race-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 178px;
  padding: 16px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.race-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: var(--pink);
}

.race-card-live::after {
  background: var(--green);
}

.race-card-complete::after {
  background: var(--blue);
}

.race-status {
  width: max-content;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--control);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.race-card strong {
  font-size: 22px;
  line-height: 1.08;
}

.race-card span,
.race-card small {
  color: var(--muted);
}

.race-card-meta {
  align-self: end;
  font-size: 13px;
  font-weight: 700;
}

.stage-card,
.leader-card,
.media-panel {
  border: 0;
  border-radius: 4px;
  background: var(--paper);
  overflow: hidden;
}

.stage-card {
  display: grid;
  min-height: 170px;
  padding: 14px;
  text-decoration: none;
}

.stage-number {
  color: var(--pink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.stage-card strong {
  align-self: center;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.16;
}

.stage-card span:last-child {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
}

.leader-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.leader-card {
  position: relative;
  min-height: 150px;
  padding: 50px 16px 16px 16px;
  background: var(--pink);
  color: #fff;
  overflow: visible;
  text-decoration: none;
  display: block;
}

.leader-card:hover {
  filter: brightness(1.05);
}

.leader-card::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 38px;
  height: 38px;
  background: var(--bg);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.leader-card-gc {
  background: var(--jersey-bg-gc, var(--pink));
  color: var(--jersey-text-gc, #fff);
}

.leader-card-points {
  background: var(--jersey-bg-points, #a83bb2);
  color: var(--jersey-text-points, #fff);
}

.leader-card-kom {
  background: var(--jersey-bg-kom, var(--blue));
  color: var(--jersey-text-kom, #fff);
}

:root[data-jersey-pattern-kom="polka"] .leader-card-kom::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-image: 
    radial-gradient(circle, rgba(255,255,255,0.3) 30%, transparent 30%), 
    radial-gradient(circle, rgba(255,255,255,0.3) 30%, transparent 30%);
  background-color: var(--jersey-bg-kom);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
  border-radius: 4px 4px 0 0;
  z-index: 0;
}

.leader-card-kom > * {
  position: relative;
  z-index: 1;
}

.leader-card-youth {
  background: var(--jersey-bg-youth, #e9e4d8);
  color: var(--jersey-text-youth, var(--ink));
}

.leader-card-teams {
  background: var(--jersey-bg-teams, #34363a);
  color: var(--jersey-text-teams, #fff);
}

.leader-section.has-dark-bg {
  --bg: #e0e5e9;
  background: var(--bg);
  padding: 24px;
  border-radius: 8px;
  margin-left: -24px;
  margin-right: -24px;
}

.leader-label {
  display: inline-block;
  margin: -4px 0 8px -4px;
  background-color: inherit;
  padding: 4px 4px 0 4px;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 2px;
  z-index: 1;
  position: relative;
}

.leader-label-text {
  opacity: 0.35;
}

.leader-name-band {
  margin-bottom: 2px;
  z-index: 1;
  position: relative;
}

.leader-card .flag {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
  line-height: 1;
}

.leader-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  margin-bottom: 2px;
}

.leader-card-detail {
  display: block;
  text-transform: uppercase;
  font-size: 11px;
  opacity: 0.9;
  line-height: 1.1;
  z-index: 1;
  position: relative;
}

.leader-name-band strong {
  display: block;
  font-size: 18px;
  line-height: 1.18;
}

.leader-card small {
  display: block;
  margin-top: 8px;
  color: currentColor;
  opacity: 0.78;
}

.race-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.5fr);
  gap: 14px;
}

.race-map-placeholder {
  min-height: 270px;
  padding: 16px;
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
}

.race-map-placeholder p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.race-stage-list {
  display: grid;
  gap: 5px;
}

.podium-trend-card {
  min-height: 170px;
  padding: 14px 16px 12px;
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
}

.podium-trend-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.podium-trend-head strong {
  font-size: 16px;
}

.podium-trend-head span {
  color: var(--muted);
  font-size: 12px;
}

.podium-trend {
  display: block;
  width: 100%;
  height: auto;
}

.trend-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.trend-axis,
.trend-stage-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trend-stage-label {
  text-anchor: middle;
}

.trend-line {
  fill: none;
  stroke: var(--line-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.trend-dot {
  fill: var(--paper);
  stroke: var(--line-color);
  stroke-width: 4;
}

.trend-rider-label {
  fill: var(--line-color);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.race-stage-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  background: var(--paper);
  border-radius: 4px;
  text-decoration: none;
}

.race-stage-row.current {
  box-shadow: inset 0 -3px 0 var(--pink);
}

.stage-type-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--control);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.stage-type-icon.mountain {
  background: #e7f0f6;
  color: var(--blue);
}

.stage-type-icon.hilly {
  background: #eef3e8;
  color: var(--green);
}

.stage-type-icon.tt {
  background: #f0edf5;
  color: #6e4ca2;
}

.race-stage-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.race-stage-main strong {
  color: var(--pink);
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
}

.race-stage-main span {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.race-stage-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.tab-button {
  cursor: pointer;
}

.table-wrap {
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: var(--paper);
}

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

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.rank {
  width: 58px;
  color: var(--pink);
  font-weight: 900;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

.rider-cell strong {
  display: inline;
  font-weight: 600;
}

.team-cell strong {
  display: inline;
  font-weight: 400;
}

.table-team {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

.team-flag {
  width: 1.55em;
}

.rider-cell > span:not(.flag),
.team-cell > span:not(.flag) {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.flag {
  display: inline-block;
  width: 1.55em;
  margin-right: 7px;
  font-size: 15px;
  line-height: 1;
  vertical-align: -1px;
}

.stage-header {
  display: block;
  padding-bottom: 4px;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.podium {
  display: grid;
  gap: 8px;
}

.podium-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.podium-row .place {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rose);
  color: var(--pink);
  font-weight: 900;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.media-panel.full {
  grid-column: 1 / -1;
}

.media-panel h3 {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.media-panel img {
  display: block;
  width: 100%;
  height: auto;
  background: #f0eee8;
}

.stage-map-stack {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.stage-map-stack .media-panel {
  width: 100%;
}

.profile-strip img {
  height: 170px;
  object-fit: fill;
  object-position: center;
}

.route-map-panel img {
  width: 100%;
}

.interactive-map-panel {
  overflow: hidden;
}

.stage-interactive-map {
  width: 100%;
  height: 620px;
  background: #dde3df;
  z-index: 0;
}

.route-map-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.route-map-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-key-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.map-key-start {
  background: #24a85a;
}

.map-key-passage {
  background: var(--pink);
}

.map-key-finish {
  background:
    linear-gradient(45deg, #111 25%, transparent 25% 75%, #111 75%),
    linear-gradient(45deg, #111 25%, #fff 25% 75%, #111 75%);
  background-position:
    0 0,
    3px 3px;
  background-size: 6px 6px;
}

.map-key-kom {
  background: #e73339;
}

.map-key-sprint {
  background: #24a85a;
}

.map-note,
.map-unavailable {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.route-marker {
  border-radius: 999px;
  color: #fff;
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 1px 5px rgba(20, 22, 24, 0.32);
}

.route-marker span {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-sizing: border-box;
}

.route-marker-passage span {
  background: var(--pink);
}

.route-marker-kom span {
  background: #e73339;
}

.route-marker-sprint span {
  background: #24a85a;
}

.route-marker-start span {
  background: #24a85a;
}

.route-marker-finish span {
  background:
    linear-gradient(45deg, #111 25%, transparent 25% 75%, #111 75%),
    linear-gradient(45deg, #111 25%, #fff 25% 75%, #111 75%);
  background-position:
    0 0,
    6px 6px;
  background-size: 12px 12px;
}

.route-point-label {
  border: 0;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(20, 22, 24, 0.18);
  color: #fff;
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
}

.route-point-label::before {
  display: none;
}

.route-point-label-kom {
  background: #e73339;
}

.route-point-label-sprint {
  background: #24a85a;
}

.route-overview-section {
  margin-top: 14px;
}

.route-overview-panel img {
  width: 100%;
}

.technical {
  max-width: 900px;
  color: var(--muted);
  white-space: pre-line;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.source-link {
  color: var(--ink);
}

.site-footer {
  width: calc(100% - 32px);
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.stage-compact {
  margin-top: -4px;
  padding-bottom: 2px;
}

.stage-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.compact-back {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.stage-title {
  max-width: none;
  font-size: 29px;
  line-height: 1.14;
  padding-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-title .stage-title-number {
  color: var(--pink);
  font-weight: 700;
}

.stage-title .stage-title-route {
  margin-left: 10px;
  font-weight: 200;
}

.stage-compact .stage-meta {
  margin-top: 1px;
}

.stage-compact .pill {
  font-size: 12px;
}

.stage-podium .podium {
  gap: 6px;
}

.stage-podium .podium-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 10px;
}

.stage-podium .podium-row .place {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

.stage-podium .podium-row strong {
  font-size: 13px;
}

.stage-podium .leader-label {
  margin: 2px 0 0;
  font-size: 10px;
}

.stage-results-area {
  margin-top: 3px;
}

.stage-tabs {
  position: sticky;
  top: 63px;
  z-index: 7;
  margin-bottom: 4px;
  padding: 3px 0;
  background: rgba(244, 245, 246, 0.95);
  backdrop-filter: blur(10px);
}

.stage-results-area th,
.stage-results-area td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.stage-map-grid {
  margin-top: 4px;
}

.stage-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.stage-detail-row .stage-meta,
.stage-detail-row .source-row {
  margin-top: 0;
}

.compact-technical {
  max-width: 980px;
  margin: 14px 0 0;
}

.visualiser-shell {
  border: 0;
  border-radius: 0;
  background: var(--paper);
  overflow: visible;
}

.visualiser-tabs {
  align-items: center;
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.visual-filter {
  min-height: 34px;
  max-width: 220px;
  padding: 6px 30px 6px 10px;
  border: 0;
  border-radius: 4px;
  background: var(--control);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.subtle-button {
  color: var(--muted);
}

.visualiser-meta {
  padding: 10px 14px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.visualiser-scroll {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 0 0;
}

.rank-visualiser {
  display: block;
  min-width: 820px;
}

.viz-bg {
  fill: #fff;
}

.viz-grid-line,
.viz-stage-line,
.viz-name-rule {
  stroke: var(--line);
  stroke-width: 1;
}

.viz-stage-line {
  stroke-width: 1.2;
}

.viz-path {
  fill: none;
  stroke: var(--line-color);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
  transition: opacity 120ms ease, stroke 120ms ease, stroke-width 120ms ease;
}

.viz-point,
.viz-name-dot {
  fill: var(--line-color);
  stroke: #fff;
  stroke-width: 1.5;
  transition: opacity 120ms ease, fill 120ms ease, r 120ms ease;
}

.viz-check {
  fill: #fff;
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.viz-rank,
.viz-stage-label,
.viz-name,
.viz-name-detail {
  fill: var(--ink);
  font-size: 13px;
}

.viz-rank,
.viz-stage-label {
  text-anchor: middle;
}

.viz-stage-label {
  font-weight: 700;
}

.viz-name {
  font-weight: 700;
}

.viz-name-detail {
  fill: var(--muted);
  font-size: 11px;
}

.viz-name-row {
  cursor: pointer;
}

.viz-name-row text {
  transition: opacity 120ms ease, font-weight 120ms ease;
}

.rank-visualiser.is-focusing .viz-path,
.rank-visualiser.is-focusing .viz-point,
.rank-visualiser.is-focusing .viz-name-dot {
  opacity: 0.4;
}

.rank-visualiser.is-focusing .viz-path:not(.is-focused) {
  stroke: #6f6f6f;
}

.rank-visualiser.is-focusing .viz-name-row:not(.is-focused) text {
  opacity: 0.55;
}

.rank-visualiser.is-focusing .viz-path.is-focused {
  opacity: 1;
  stroke-width: 5;
}

.rank-visualiser.is-focusing .viz-point.is-focused,
.rank-visualiser.is-focusing .viz-name-row.is-focused .viz-name-dot {
  opacity: 1;
}

.rank-visualiser.is-focusing .viz-name-row.is-focused .viz-name {
  font-weight: 900;
}

.rank-visualiser.has-selections .viz-path,
.rank-visualiser.has-selections .viz-point,
.rank-visualiser.has-selections .viz-name-dot {
  opacity: 0.36;
}

.rank-visualiser.has-selections .viz-path:not(.is-selected) {
  stroke: #6f6f6f;
}

.rank-visualiser.has-selections .viz-name-row:not(.is-selected) text {
  opacity: 0.55;
}

.rank-visualiser.has-selections .viz-path.is-selected {
  opacity: 1;
  stroke-width: 5;
}

.rank-visualiser.has-selections .viz-point.is-selected,
.rank-visualiser.has-selections .viz-name-row.is-selected .viz-name-dot {
  opacity: 1;
}

.rank-visualiser.has-selections .viz-name-row.is-selected .viz-name {
  font-weight: 900;
}

.story-panel {
  border: 0;
  border-radius: 0;
  background: var(--paper);
  overflow: visible;
}

.story-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.story-head h2 {
  flex: 0 0 auto;
  font-size: 18px;
}

.story-head p {
  flex: 1 1 auto;
  max-width: 740px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.compact-story-head {
  border-bottom: 0;
  padding-bottom: 4px;
}

.jersey-timeline,
.jersey-ribbon {
  display: grid;
  grid-template-columns: minmax(170px, 240px) repeat(var(--stage-columns), minmax(160px, 1fr));
  overflow-x: auto;
}

.jersey-ribbon {
  grid-template-columns: minmax(112px, 150px) repeat(var(--stage-columns), minmax(170px, 1fr));
  overflow-x: auto;
}

.jersey-stage-header,
.jersey-label,
.jersey-cell,
.jersey-dot-cell {
  min-height: 64px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.jersey-stage-header {
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.jersey-ribbon .jersey-stage-header {
  min-height: 28px;
  padding: 8px 4px;
  text-align: center;
}

.jersey-ribbon .jersey-label,
.jersey-ribbon .jersey-dot-cell {
  min-height: 58px;
  padding: 7px 8px;
}

.jersey-label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.jersey-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(25, 24, 20, 0.18);
  border-radius: 50%;
  background: var(--jersey);
}

.jersey-dot-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.jersey-dot,
.jersey-marker {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 1px solid rgba(25, 24, 20, 0.18);
  border-radius: 50%;
  background: var(--jersey);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.jersey-full-name {
  min-width: 0;
}

.jersey-full-name strong {
  display: block;
  font-size: 12px;
  line-height: 1.15;
}

.jersey-full-name small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.jersey-label strong,
.jersey-cell strong {
  display: block;
  font-size: 14px;
}

.haul-name strong {
  display: inline;
  font-size: 14px;
}

.jersey-label small,
.jersey-cell small,
.haul-name small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 0;
}

.haul-name {
  min-width: 0;
  line-height: 1.15;
}

.haul-name .flag,
.haul-heat-name .flag {
  margin-right: 5px;
}

.haul-list {
  display: grid;
  gap: 2px;
  padding: 6px 14px 10px;
}

.haul-row {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(220px, 1fr) 46px;
  gap: 10px;
  align-items: center;
  min-height: 31px;
  border-bottom: 1px solid var(--line);
}

.haul-row:last-child {
  border-bottom: 0;
}

.haul-track {
  position: relative;
  height: 15px;
  border-radius: 5px;
  background: #f0eee8;
  overflow: hidden;
}

.haul-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--left);
  width: var(--width);
  background: var(--haul);
}

.haul-total {
  text-align: right;
  font-weight: 900;
}

.haul-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.haul-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.haul-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--haul);
}

.haul-heatmap {
  display: grid;
  grid-template-columns: minmax(150px, 230px) repeat(var(--stage-columns), minmax(0, 1fr));
  padding: 0 14px 10px;
}

.haul-heat-header,
.haul-heat-name,
.haul-heat-cell {
  min-height: 30px;
  padding: 4px 5px;
  border-bottom: 1px solid var(--line);
}

.haul-heat-header {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.haul-heat-header:first-child,
.haul-heat-name {
  text-align: left;
}

.haul-heat-name {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.haul-heat-cell {
  display: grid;
  place-items: center;
}

.haul-heat-cell span {
  display: grid;
  place-items: center;
  width: clamp(21px, 2.6vw, 30px);
  height: clamp(21px, 2.6vw, 30px);
  border-radius: 4px;
  background: rgba(230, 0, 126, var(--heat));
  font-size: 11px;
  font-weight: 900;
}

.gap-matrix {
  display: grid;
  grid-template-columns: minmax(180px, 260px) repeat(var(--stage-columns), minmax(120px, 1fr));
  overflow-x: auto;
}

.gap-header,
.gap-rider,
.gap-cell {
  min-height: 42px;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.gap-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.gap-rider strong,
.gap-rider small {
  display: block;
}

.gap-rider small {
  color: var(--muted);
  font-size: 11px;
}

.gap-cell {
  position: relative;
  overflow: hidden;
}

.gap-cell strong {
  position: relative;
  z-index: 1;
  font-size: 13px;
}

.gap-bar {
  position: absolute;
  inset: 8px auto 8px 8px;
  width: var(--width);
  border-radius: 4px;
  background: rgba(230, 0, 126, 0.16);
}

.gap-line {
  stroke-width: 2.5;
}

.gap-label-rule {
  stroke: var(--line);
  stroke-opacity: 0.65;
  stroke-width: 1;
}

.gap-connector-layer {
  pointer-events: none;
}

.gap-zoom-axis {
  stroke: var(--ink);
  stroke-dasharray: 3 4;
  stroke-opacity: 0.32;
  stroke-width: 1;
}

.gap-zoom-dot {
  stroke-width: 2;
}

.gap-zoom-tick {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: end;
}

.swarm-chart {
  display: block;
  min-width: 900px;
}

.swarm-team {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.swarm-flag {
  font-size: 11px;
  pointer-events: none;
}

.swarm-rider {
  cursor: default;
}

.swarm-hit {
  fill: transparent;
}

.swarm-dot {
  fill: var(--line-color);
  stroke: #fff;
  stroke-width: 1.5;
  opacity: 0.82;
}

.swarm-tooltip {
  opacity: 0;
  pointer-events: none;
}

.swarm-tooltip rect {
  fill: var(--ink);
}

.swarm-tooltip text {
  fill: #fff;
  font-size: 11px;
  font-weight: 800;
}

.swarm-rider:hover .swarm-tooltip,
.swarm-rider:focus .swarm-tooltip {
  opacity: 1;
}

.swarm-rider:hover .swarm-dot,
.swarm-rider:focus .swarm-dot {
  opacity: 1;
  stroke: var(--ink);
  stroke-width: 2;
}

@media (max-width: 940px) {
  .hero,
  .stage-header,
  .stage-grid,
  .race-overview,
  .leader-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }
  .site-header {
    overflow: hidden;
    width: 100%;
  }

  .stage-nav {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .stage-nav a,
  .stage-select,
  .stage-select-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .stage-step {
    min-width: 0;
  }

  .overview-link {
    min-width: 0;
  }

  main {
    width: calc(100% - 22px);
    padding-top: 5px;
  }

  h1 {
    max-width: min(100%, 340px);
    font-size: 24px;
    overflow-wrap: break-word;
  }

  .stage-title {
    max-width: 100%;
    font-size: 23px;
  }

  .stage-tabs {
    top: 107px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .stage-header {
    padding-bottom: 2px;
  }

  .stage-compact {
    margin-top: -2px;
  }

  .stage-compact .stage-meta {
    margin-top: 2px;
  }

  .stage-compact .pill,
  .source-link {
    min-height: 24px;
    font-size: 12px;
  }

  .source-row {
    margin-top: 5px;
  }

  .stage-results-area {
    margin-top: 2px;
  }

  .stage-tabs {
    margin-bottom: 3px;
    padding: 2px 0;
  }

  .stage-results-area .story-head {
    padding: 6px 8px;
  }

  .stage-results-area .story-head p {
    display: block;
    font-size: 11px;
  }

  .stage-detail-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
    padding-top: 5px;
  }

  .visualiser-scroll {
    max-height: none;
  }

  .haul-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 9px 0;
  }

  .haul-total {
    text-align: left;
  }

  .lede,
  .section-head p {
    max-width: min(100%, 340px);
  }

  .snapshot,
  .leader-card,
  .stage-card {
    max-width: calc(100vw - 22px);
  }

  .snapshot dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .snapshot dd {
    text-align: left;
    margin-bottom: 8px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
