.challenge-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem clamp(1.5rem, 4vw, 4rem);
  margin-block: 1.25rem 2rem;
}

.challenge-intro .page-title {
  flex: 1 1 max-content;
  min-inline-size: 0;
  margin: 0;
}

.challenge-intro .page-title > span {
  display: block;
  text-wrap: balance;
}

.challenge-keep-together {
  white-space: nowrap;
}

.challenge-intro > p {
  flex: 1 1 17rem;
  max-inline-size: 36ch;
  margin: 0;
  color: var(--muted);
}

.challenge-target {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  border-top: 1px solid var(--line);
  padding-block-start: 1rem;
}

.challenge-target p {
  margin: 0;
}

.challenge-target p:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
}

.challenge-target strong {
  font-size: 1.5rem;
}

.challenge-target p + p {
  font-size: .875rem;
  font-weight: 700;
}

#stage-map{margin-block:2rem 1.5rem;color:var(--ink)}
#course-map-title{margin:0 0 .75rem}
#stage-map{color-scheme:light;--paper:#f5f4ed;--ink:#1b342e;--green:#163e35;--muted:#5b6c62;--line:#d6dcd2;--lime:#ddec83;--water:#e4eeea;--land:#f9f7ed;--run1:#b74a25;--swim:#126c9d;--run2:#83418e;--bike:#176c5c}
  #stage-map *{box-sizing:border-box}
  #stage-map .course-layout{display:grid;grid-template-columns:minmax(0,1fr) 245px;gap:16px;align-items:start}
  #stage-map .course-layout[hidden]{display:none}
  #stage-map .map-card,#stage-map .stage-list{border:1px solid var(--line);border-radius:18px;overflow:hidden;background:#fffdf7}
  #stage-map .map-toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:48px;padding:6px 12px 6px 16px;background:var(--green);color:#fff}
  #stage-map .map-toolbar strong{font-size:13px;letter-spacing:.005em}
  #stage-map button{font:inherit;cursor:pointer;color:inherit}
  #stage-map button:focus-visible,#stage-map #map:focus-visible,#stage-map .pin:focus-visible{outline:3px solid #af6e08;outline-offset:-3px}
  #stage-map #reset{border:1px solid #749387;background:transparent;color:white;border-radius:999px;padding:5px 11px;font-size:.875rem;white-space:nowrap}
  #stage-map #reset:hover{background:#30574d}
  #stage-map .viewport{height:clamp(320px,48vw,520px);position:relative;background:var(--water)}
  #stage-map #map{display:block;width:100%;height:100%;cursor:grab;touch-action:pan-y pinch-zoom;user-select:none}
  #stage-map #map.dragging{cursor:grabbing}
  #stage-map .island{fill:var(--land);stroke:#a6b7a9;stroke-width:1.3;vector-effect:non-scaling-stroke;stroke-linejoin:round}
  #stage-map .casing,#stage-map .route{fill:none;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round;pointer-events:none}
  #stage-map .casing{stroke:#fffcf3;stroke-width:6.5}
  #stage-map .route{stroke-width:3.7}
  #stage-map .swim .route,#stage-map .swim .casing{stroke-dasharray:6 6}
  #stage-map .stage-layer{display:none}
  #stage-map .stage-layer.visible{display:block}
  #stage-map .town{fill:#485e55;font-size:11px;paint-order:stroke;stroke:#f9f7ed;stroke-width:2.7px;stroke-linejoin:round;pointer-events:none}
  #stage-map .water-name{fill:#5a7e75;font:bold 10px Arial,sans-serif;letter-spacing:.18em;pointer-events:none}
  #stage-map .pin{cursor:pointer}
  #stage-map .pin text{font-weight:700;font-size:13px;fill:#213d33;paint-order:stroke;stroke:#fffdf6;stroke-width:4px;stroke-linejoin:round}
  #stage-map .pin circle{fill:#163e35;stroke:#fffdf6;stroke-width:2.5}
  #stage-map .pin:focus-visible circle{stroke:#af6e08;stroke-width:3}
  #stage-map .zoom{position:absolute;right:9px;top:9px;display:grid;background:#fffdf6;border:1px solid #b9c7bc;border-radius:10px;overflow:hidden}
  #stage-map .zoom button{display:block;width:40px;height:39px;border:0;background:none;font-size:22px;line-height:1}
  #stage-map .zoom button + button{border-top:1px solid #cad6cc}
  #stage-map .zoom button:hover{background:#eff2dc}
  #stage-map .scale{position:absolute;left:11px;bottom:9px;color:#36574c;font-size:10px;font-weight:700;line-height:1.1;min-width:25px;border-bottom:2px solid currentColor;border-right:1px solid currentColor;border-left:1px solid currentColor;text-align:center;padding:2px 3px;background:#e4eeea;white-space:nowrap}
  #stage-map .north{position:absolute;left:13px;top:10px;color:#36574c;font-size:10px;letter-spacing:.05em;text-align:center}
  #stage-map .north span{display:block;font-size:18px;line-height:1}
  #stage-map .map-note{margin:0;padding:9px 13px;border-top:1px solid var(--line);font-size:.875rem;color:var(--muted);min-height:38px}
  #stage-map .stage-list{padding:10px}
  #stage-map .stage-list h3{color:var(--ink);margin:2px 5px 8px;font-size:14px}
  #stage-map .stage-actions{display:grid;gap:6px}
  #stage-map .course-stage{min-width:0;text-align:left;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:6px;align-items:baseline;margin:0;width:100%;border:1px solid #dddcd1;border-left:4px solid var(--stage);background:#fffdf7;border-radius:10px;padding:8px 9px 8px 10px;line-height:1.2}
  #stage-map .course-stage:hover{background:#f7f6ed}
  #stage-map .course-stage[aria-pressed=true]{background:#eff1d9;border-color:#aab485;border-left-color:var(--stage)}
  #stage-map .stage-label,#stage-map .course-distance{font-size:14px;font-weight:700}
  #stage-map .course-distance{font-variant-numeric:tabular-nums;white-space:nowrap}
  #stage-map .stage-place{grid-column:1/-1;font-size:.8125rem;color:var(--muted);padding-top:4px;line-height:1.25}
  #stage-map .footnote{margin:10px 1px 0;font-size:.875rem;color:var(--muted)}
  #stage-map .footnote a{color:inherit;text-underline-offset:2px}
  @media(max-width:740px){
    #stage-map .course-layout{grid-template-columns:1fr;gap:9px}
    #stage-map .stage-list{padding:8px}
    #stage-map .stage-list h3{margin:0 3px 6px;font-size:12px}
    #stage-map .stage-actions{grid-template-columns:1fr 1fr}
    #stage-map .viewport{height:clamp(300px,70vw,425px)}
  }
  @media(max-width:360px){#stage-map .course-stage{padding-inline:6px}#stage-map .course-distance{font-size:12px}}
  #stage-map .base{fill:none;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke;pointer-events:none}
  #stage-map .base-primary{stroke:#c1a477;stroke-width:1.7}
  #stage-map .base-secondary{stroke:#cdbd9c;stroke-width:1.3}
  #stage-map .base-local{stroke:#d5d0bd;stroke-width:1.15}
  #stage-map .base-rail{stroke:#7f7774;stroke-width:1.15;stroke-dasharray:3 3}
  #stage-map .base-rivers{stroke:#7eaeb6;stroke-width:1.45}
  #stage-map .town{fill:#4c6258;font-size:11px;font-weight:600}
  #stage-map .town-major{fill:#354e43;font-size:12px}
  #stage-map .road-shield{fill:#7c6746;font:bold 9px Arial,sans-serif;paint-order:stroke;stroke:#fffdf1;stroke-width:4px;stroke-linejoin:round}
  #stage-map .direction-arrow{fill:#f0f6ad;stroke:#175949;stroke-width:1.2;stroke-linejoin:round}
  @keyframes course-flow{to{stroke-dashoffset:-18}}
  #stage-map .rider-halo{fill:#f4f8d5;stroke:#154638;stroke-width:2}
  #stage-map .ride-controls{display:grid;grid-template-columns:auto minmax(90px,1fr) auto;gap:5px 12px;align-items:center;padding:9px 13px;border-top:1px solid var(--line);background:#f0f2e1}
  #stage-map #ride-play{background:#163e35;border:1px solid #163e35;color:#fffdf7;border-radius:9px;padding:6px 10px;font-size:12px;font-weight:700;white-space:nowrap}
  #stage-map #ride-play:hover{background:#2c574c}
  #stage-map #ride-position{width:100%;margin:0;accent-color:#216553}
  #stage-map #ride-distance{white-space:nowrap;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums}
  #stage-map #ride-place{grid-column:1/3;color:var(--muted);font-size:12px}
  #stage-map .ride-follow{grid-column:3;color:var(--muted);display:flex;align-items:center;gap:4px;font-size:11px;white-space:nowrap}
  #stage-map .ride-follow input{accent-color:#216553;margin:0}
  #stage-map .map-key{margin:0;border-top:1px solid var(--line);padding:8px 12px;color:var(--muted);display:flex;gap:5px 13px;flex-wrap:wrap;font-size:11px}
  #stage-map .map-key span{display:flex;align-items:center;gap:5px}
  #stage-map .map-key i{display:inline-block;width:13px;border-top:2px solid #c1a477}
  #stage-map .map-key .key-local{border-color:#c6c1ac}
  #stage-map .map-key .key-rail{border-top-style:dashed;border-color:#7f7774}
  #stage-map .map-key .key-river{border-color:#7eaeb6}
  @media(max-width:420px){#stage-map .ride-controls{gap:7px 8px;padding-inline:8px}#stage-map #ride-distance{font-size:10px}#stage-map #ride-play{padding-inline:6px}#stage-map .ride-follow{font-size:10px}}
  #stage-map #course-status{grid-column:1/3;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 7px;min-width:0}
  #stage-map #active-stage{font-size:12px}
  #stage-map #ride-place{grid-column:auto}
  #stage-map .course-stage[aria-current=step] .stage-label::after{content:"";display:inline-block;width:6px;height:6px;margin-left:6px;border-radius:50%;background:var(--stage);vertical-align:2px}
  #stage-map .stage-flow{fill:none;stroke:#fff3b1;stroke-width:2.1;stroke-linecap:round;stroke-dasharray:2 16;vector-effect:non-scaling-stroke;display:none;pointer-events:none}
  #stage-map #map.is-playing .stage-layer.active .stage-flow{display:block;animation:course-flow .9s linear infinite}
  #stage-map #map.is-playing .stage-layer.swim.active .stage-flow{stroke:#e4f8ff;stroke-dasharray:2 16}
  #stage-map .stage-layer.visible.context,#stage-map .arrow-group.context,#stage-map #map.is-playing .stage-layer.visible:not(.active){opacity:.35}
  #stage-map .course-glyph{fill:none;stroke:#fffbea;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
  #stage-map .course-core{fill:var(--marker-colour,#163e35)}
  #stage-map .direction-arrow{stroke:var(--arrow-colour,#175949);fill:#fff8bd}
  #stage-map .arrow-group.swim .direction-arrow{fill:#e1f6ff}
  @media(prefers-reduced-motion:reduce){#stage-map #map.is-playing .stage-layer.active .stage-flow{animation:none}}
