/* Koolskamp Koers Raceday */

/* ---------- Tokens ---------- */
:root {
  --brand-yellow: #FFD201;
  --brand-yellow-light: #FFE680;
  --brand-black: #000000;

  --app: #F6F6F7;          /* page background */
  --bg: #FFFFFF;           /* cards, inputs, sidebar */
  --panel: #F4F4F5;        /* subtle fills inside cards */
  --fg: #09090B;
  --muted: #71717A;
  --line: #E4E4E7;
  --line-strong: #D4D4D8;
  --shadow: 0 1px 2px rgba(9, 9, 11, 0.05);
  --focus: 0 0 0 3px rgba(9, 9, 11, 0.12);

  --org: #F4F4F5;
  --org-fg: #52525B;
  --org-border: #D4D4D8;
  --women-intro: #FFF7CC;
  --men-loop: #52525B;
  --men-turnoff: #3F3F46;
  --men-lap: #18181B;
  --men-border: rgba(255, 255, 255, 0);
  --men-outline: #18181B;
  --men-chip: #18181B;
  --women-line: #E0B400;
  --vip-aperitif: #E2E8F0;
  --vip-menu: #94A3B8;
  --vip-free: #F1F5F9;
  --ok: oklch(0.55 0.14 150);
  --warn: oklch(0.64 0.16 60);
  --bad: oklch(0.56 0.21 27);
  --broadcast-women: oklch(0.55 0.18 255);
  --broadcast-men: oklch(0.55 0.18 320);
  --approach: #7A7A7A;
  --status: var(--ok);
  --first-passage: #64748B; /* fixed: the colour of the margin (--status) belongs to the margin block */
  color-scheme: light;
}

[data-theme="dark"] {
  --app: #09090B;
  --bg: #111113;
  --panel: #1A1A1D;
  --fg: #FAFAFA;
  --muted: #A1A1AA;
  --line: #26262A;
  --line-strong: #3F3F46;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --focus: 0 0 0 3px rgba(250, 250, 250, 0.15);

  --org: #1F1F23;
  --org-fg: #D4D4D8;
  --org-border: #3F3F46;
  --women-intro: #3A3200;
  --men-loop: #5A5A62;
  --men-turnoff: #45454C;
  --men-lap: #2E2E33;
  --men-border: #5A5A62;
  --men-outline: #A1A1AA;
  --men-chip: #A1A1AA;
  --women-line: #FFD201;
  --vip-aperitif: #28313D;
  --vip-menu: #4B5A6E;
  --vip-free: #1B222B;
  --ok: oklch(0.74 0.15 150);
  --warn: oklch(0.78 0.15 65);
  --bad: oklch(0.68 0.2 27);
  --broadcast-women: oklch(0.72 0.15 255);
  --broadcast-men: oklch(0.72 0.15 320);
  --approach: #B5B5B2;
  --first-passage: #94A3B8;
  color-scheme: dark;
}

[data-status="ok"] { --status: var(--ok); }
[data-status="warn"] { --status: var(--warn); }
[data-status="bad"] { --status: var(--bad); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--app);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 60px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__logo {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: var(--brand-yellow); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
}
.brand__text { min-width: 0; }
.brand__title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand__subtitle { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { opacity: .88; }
.btn--secondary { background: var(--bg); color: var(--fg); border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn--secondary:hover { background: var(--panel); }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--panel); color: var(--fg); }
.btn--small { height: 30px; padding: 0 10px; font-size: 13px; }

.segmented { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.segmented__item {
  width: 30px; height: 28px; border: 0; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted);
}
.segmented__item svg { width: 16px; height: 16px; }
.segmented__item:hover { color: var(--fg); }
.segmented__item.is-active { background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.sidebar {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
  background: var(--bg); border-right: 1px solid var(--line);
}
.page { display: flex; flex-direction: column; gap: 16px; padding: 24px 28px 48px; min-width: 0; }

/* ---------- Chips ---------- */
.chip { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.chip--women { background: var(--brand-yellow); }
.chip--men { background: var(--men-chip); }
.chip--vip { background: var(--vip-menu); }
.chip--closure { background: var(--bad); }
.chip--broadcast { background: var(--broadcast-women); }
.chip--org { background: var(--org); box-shadow: inset 0 0 0 1px var(--org-border); }

/* ---------- Settings (sidebar) ---------- */
.sidebar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px 20px;
}
.sidebar__title { font-size: 13px; font-weight: 600; color: var(--muted); }
.settings__group { padding: 10px 20px 14px; }
.settings__group + .settings__group { border-top: 1px solid var(--line); padding-top: 16px; }
.settings__heading {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 600;
}
.field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px; font-size: 13.5px;
}
.field__label { color: var(--fg); }
.field .muted { white-space: nowrap; }
.field__controls { display: flex; align-items: center; gap: 10px; flex: none; }
.field.is-off .field__stack, .field.is-off input[type="time"] { opacity: 0.45; }
.field input:not([type="checkbox"]) {
  flex: none; width: 64px; height: 32px; padding: 0 10px;
  font-size: 13.5px; font-weight: 500; text-align: right;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--bg); color: var(--fg); box-shadow: var(--shadow);
}
.field input:focus { outline: none; border-color: var(--fg); box-shadow: var(--focus); }
.field input[type="time"] { width: 104px; }
.field__stack { display: flex; flex-direction: column; gap: 1px; }
.field__hint { font-size: 12px; color: var(--muted); }
.link-button {
  align-self: flex-start; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}

.stepper {
  display: flex; align-items: stretch; flex: none; height: 32px;
  border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden;
  background: var(--bg); box-shadow: var(--shadow);
}
.stepper:focus-within { border-color: var(--fg); box-shadow: var(--focus); }
.field .stepper input {
  width: 48px; height: 100%; border: 0; border-radius: 0; box-shadow: none; padding: 0 2px;
  text-align: center; -moz-appearance: textfield;
}
.field .stepper input:focus { box-shadow: none; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__button {
  width: 30px; border: 0; cursor: pointer; background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1;
}
.stepper__button:first-child { border-right: 1px solid var(--line); }
.stepper__button:last-child { border-left: 1px solid var(--line); }
.stepper__button:hover { background: var(--panel); color: var(--fg); }

.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #FFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch:checked { background: var(--fg); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible, .stepper__button:focus-visible { outline: none; box-shadow: var(--focus); }

/* Collapsed sidebar: a narrow strip with only the toggle (on a phone the heading stays, the settings fold away) */
.sidebar__head { gap: 6px; }
.sidebar__title { flex: 1; }
.sidebar__toggle { padding: 0 6px; }
.sidebar__toggle svg { width: 18px; height: 18px; }
.shell.is-collapsed .sidebar__chevron { transform: translateX(-26px) scaleX(-1); transform-origin: 14.5px 12px; }
.shell.is-collapsed .settings { display: none; }
@media (min-width: 1025px) {
  .shell.is-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
  .shell.is-collapsed .sidebar__title, .shell.is-collapsed #reset-button { display: none; }
  .shell.is-collapsed .sidebar__head { padding: 16px 0 8px; justify-content: center; }
}

/* Eye in a group heading: shows or hides that part of the timeline. A hidden group folds in. */
.settings__heading .eye {
  margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: transparent; color: var(--muted);
}
.eye:hover { background: var(--panel); color: var(--fg); }
.eye:focus-visible { outline: none; box-shadow: var(--focus); }
.eye svg { width: 17px; height: 17px; }
.eye .eye__shut, .eye[aria-pressed="false"] .eye__open { display: none; }
.eye[aria-pressed="false"] .eye__shut { display: block; }
.settings__group.is-hidden .settings__body { display: none; }
.settings__group.is-hidden .settings__heading { margin-bottom: 0; color: var(--muted); }
.settings__group.is-hidden .chip { opacity: .4; }
.settings__note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* Road closure: one small table, women and men side by side */
.closure { display: flex; flex-direction: column; gap: 6px; }
.closure__row { display: grid; grid-template-columns: minmax(0, 1fr) 82px 82px; gap: 8px; align-items: center; font-size: 13.5px; }
.closure__row--head { font-size: 12px; color: var(--muted); text-align: center; }
.closure__row--head span:first-child { text-align: left; }
.stepper--compact { width: 82px; }
.stepper--compact .stepper__button { width: 22px; }
.field .stepper--compact input, .closure .stepper--compact input { width: 36px; height: 100%; border: 0; border-radius: 0; box-shadow: none; padding: 0; text-align: center; -moz-appearance: textfield; font-size: 13.5px; background: var(--bg); color: var(--fg); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 3.2fr); gap: 12px; }
.stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.stat__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.stat__value { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.stat__detail { font-size: 12.5px; color: var(--muted); }
.stat__value--status { color: var(--status); }
.stat--margin { border-color: color-mix(in oklch, var(--status) 45%, var(--line)); flex-direction: row; gap: 18px; align-items: stretch; }
.stat__main { display: flex; flex-direction: column; gap: 4px; flex: 0 0 176px; }
/* The sum behind the margin: two columns (women clear, men come) and the result under them. */
.sum { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; align-content: start; border-left: 1px solid var(--line); padding-left: 18px; font-size: 12px; }
.sum__title { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.sum__row { display: flex; justify-content: space-between; gap: 8px; line-height: 1.55; white-space: nowrap; }
.sum__row b { font-weight: 500; white-space: nowrap; }
.sum__row--muted { color: var(--muted); }
.sum__row--sub { margin-top: 2px; padding-top: 2px; border-top: 1px solid var(--line); font-weight: 600; }
.sum__row--sub b { font-weight: 600; }
.sum__row--total { margin-top: 2px; padding-top: 2px; border-top: 1px solid var(--line); font-weight: 600; }
.sum__row--total b { font-weight: 700; }
.sum__result { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.sum__result b { color: var(--status); font-weight: 700; }
.badge {
  margin-left: auto; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--status);
  background: color-mix(in oklch, var(--status) 14%, var(--bg));
  border: 1px solid color-mix(in oklch, var(--status) 30%, transparent);
}

/* ---------- Cards ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  min-height: 52px; padding: 10px 18px; border-bottom: 1px solid var(--line);
}
.card__title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
.card__hint { font-size: 12.5px; color: var(--muted); }
.card__body { padding: 16px 18px 18px; }

/* ---------- Timeline ---------- */
.timeline .card__body { display: flex; flex-direction: column; gap: 12px; }
.timeline__scroll { overflow-x: auto; padding-bottom: 4px; }
.timeline__grid { min-width: 860px; display: grid; grid-template-columns: 112px minmax(0, 1fr) 24px; } /* last column: room for a flag past the last hour */
.timeline--no-vip { --cut: 80px; } /* a hidden VIP lane makes the lanes area this much shorter */
.timeline--no-vip .lane-label--vip { display: none; }
.timeline__labels { position: sticky; left: 0; z-index: 8; height: calc(400px - var(--cut, 0px)); background: var(--bg); }
.lane-label { position: absolute; height: 100px; left: 0; right: 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.lane-label--women { top: 64px; }
.lane-label--men { top: 178px; }
.lane-label--vip { top: 292px; height: 68px; }
.lane-label__name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.lane-label__bar { width: 4px; height: 18px; border-radius: 2px; display: inline-block; flex: none; }
.lane-label__detail { font-size: 12.5px; color: var(--muted); padding-left: 12px; }
.timeline__track { position: relative; height: calc(400px - var(--cut, 0px)); cursor: crosshair; }

.tick { position: absolute; top: 40px; height: 320px; border-left: 1px solid var(--line); }
.tick--quarter { top: 64px; height: 214px; border-left-style: dashed; }
.tick-label {
  position: absolute; top: 40px; transform: translateX(-50%);
  font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg); padding: 0 4px;
}
.lane-bg { position: absolute; left: 0; right: 0; height: 100px; background: var(--panel); border-radius: 10px; }
.lane-bg--vip { height: 68px; }
.broadcast-band { position: absolute; top: 0; height: calc(360px - var(--cut, 0px)); z-index: 1; pointer-events: none; }
.broadcast-band--women { background: color-mix(in oklch, var(--broadcast-women) 12%, transparent); }
.broadcast-band--men { background: color-mix(in oklch, var(--broadcast-men) 12%, transparent); }

.block {
  position: absolute; height: 84px; border-radius: 6px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; cursor: default; z-index: 2;
}
.block:hover { outline: 2px solid var(--fg); outline-offset: -2px; }
.block__title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.block__time { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; opacity: .8; }
.block--compact .block__time { font-size: 11px; }
/* Narrow blocks: the title is turned 90 degrees (read from bottom to top), the times stay next to it when there is room. */
.block--vtitle { flex-direction: row; align-items: center; justify-content: center; gap: 6px; }
.block__title--vertical { writing-mode: vertical-rl; transform: rotate(180deg); overflow: visible; font-size: 12.5px; line-height: 1.2; }
.block__times { display: flex; flex-direction: column; gap: 2px; }

.block--women-intro { background: var(--women-intro); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--brand-yellow); }
.block--women-approach { background: var(--brand-yellow-light); color: #000; }
.block--women-lap { background: var(--brand-yellow); color: #000; }
.block--women-podium { background: var(--women-intro); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--brand-yellow); }
.block--men-intro { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--men-outline); }
.block--men-loop { background: var(--men-loop); color: #FFF; }
.block--men-turnoff { background: var(--men-turnoff); color: #FFF; }
.block--men-lap { background: var(--men-lap); color: #FFF; box-shadow: inset 0 0 0 1px var(--men-border); }
.block--men-podium { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--men-outline); }
.block--org { background: color-mix(in oklch, var(--status) 16%, var(--bg)); color: var(--status); box-shadow: inset 0 0 0 1.5px var(--status); } /* the margin block takes the status colour */
.block--conflict { background: var(--bad); color: #FFF; z-index: 4; }

/* VIP tent: neutral blue-grey, clearly different from the race colours */
.block--vip-aperitif { background: var(--vip-aperitif); color: var(--fg); }
.block--vip-free { background: var(--vip-free); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* The menu has soft edges: not all tables eat at the same time. */
.block--vip-menu {
  background: var(--vip-menu); color: var(--fg); z-index: 3; padding-inline: 20px !important;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.block--vip-aperitif, .block--vip-free { z-index: 2; }

.vline { position: absolute; transform: translateX(-50%); z-index: 5; pointer-events: none; }
.vline--women-broadcast { top: 0; height: calc(360px - var(--cut, 0px)); border-left: 2px dotted var(--broadcast-women); }
.vline--men-broadcast { top: 0; height: calc(360px - var(--cut, 0px)); border-left: 2px dotted var(--broadcast-men); }
.vline--selected { top: 58px; height: calc(308px - var(--cut, 0px)); border-left: 1.5px solid var(--fg); }
.vline-label {
  position: absolute; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  padding: 1px 6px; border-radius: 6px; z-index: 6; pointer-events: none; background: var(--bg);
}
.vline-label--start { top: 0; transform: translateX(calc(-100% - 4px)); }
.vline-label--end { top: 0; transform: translateX(4px); }
.vline-label--women { color: var(--broadcast-women); }
.vline-label--men { color: var(--broadcast-men); }
.marker { position: absolute; top: 58px; width: 18px; z-index: 5; pointer-events: none; }
.marker--right { border-left: 2px solid var(--mk); border-bottom: 2px solid var(--mk); border-bottom-left-radius: 12px; transform: translateX(-1px); }
.marker--left { border-right: 2px solid var(--mk); border-bottom: 2px solid var(--mk); border-bottom-right-radius: 12px; transform: translateX(calc(-100% + 1px)); }
.marker::before { content: ''; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--mk); }
.marker--right::before { left: -3px; }
.marker--left::before { right: -3px; }
.marker__label {
  position: absolute; bottom: 0; transform: translateY(50%); white-space: nowrap;
  padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.4;
  color: var(--mk-fg); background: var(--mk-bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.marker--right .marker__label { left: 100%; }
.marker--left .marker__label { right: 100%; }
.marker--women { --mk: var(--women-line); --mk-bg: var(--brand-yellow); --mk-fg: #000; }
.marker--status { --mk: var(--first-passage); --mk-bg: var(--first-passage); --mk-fg: #FFF; }
.marker--men { --mk: var(--men-chip); --mk-bg: var(--men-chip); --mk-fg: var(--bg); }
.vline-label--flip { transform: translateX(calc(-100% - 4px)); }

/* Vertical timeline (phones): time runs down, women left, men right */
.timeline--vertical .timeline__scroll { overflow: visible; padding-bottom: 0; }
.timeline--vertical .timeline__grid { display: block; min-width: 0; }
.timeline--vertical .timeline__labels { display: none; }
.timeline__track--vertical { --axis: 48px; --lane: calc((100% - var(--axis) - 8px * (var(--lanes, 3) - 1)) / var(--lanes, 3)); cursor: pointer; }
.timeline__track--vertical :is(.block, .lane-bg, .uband).vlane--women { left: var(--axis); right: auto; width: var(--lane); }
.timeline__track--vertical :is(.block, .lane-bg, .uband).vlane--men { left: calc(var(--axis) + var(--lane) + 8px); right: auto; width: var(--lane); }
.timeline__track--vertical :is(.block, .lane-bg).vlane--vip { left: calc(var(--axis) + 2 * (var(--lane) + 8px)); right: auto; width: var(--lane); }
.timeline__track--vertical .block--vip-menu {
  padding-inline: 6px !important; padding-block: 16px !important;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.timeline__track--vertical .block { padding: 2px 6px; gap: 1px; }
.timeline__track--vertical .block__title { font-size: 12.5px; }
.timeline__track--vertical .block__time { font-size: 11px; }
.timeline__track--vertical .broadcast-band { left: calc(var(--axis) - 4px); right: 0; }
.vhead {
  position: sticky; top: 0; z-index: 9; height: 52px; padding-left: var(--axis);
  display: flex; gap: 8px; align-items: center; background: var(--bg); border-bottom: 1px solid var(--line);
}
.vhead__lane { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.vhead__lane b { display: block; font-size: 14px; font-weight: 600; color: var(--fg); }
.htick { position: absolute; left: calc(var(--axis) - 4px); right: 0; border-top: 1px solid var(--line); z-index: 1; pointer-events: none; }
.htick-label {
  position: absolute; left: 0; width: calc(var(--axis) - 8px); text-align: right; transform: translateY(-50%);
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.htick-label--women, .htick-label--men, .htick-label--status, .htick-label--women-finish, .htick-label--men-finish { font-size: 11px; font-weight: 600; padding: 1px 0; border-radius: 5px; text-align: center; left: 2px; width: calc(var(--axis) - 8px); }
.htick-label--women { color: var(--broadcast-women); background: color-mix(in oklch, var(--broadcast-women) 14%, var(--bg)); }
.htick-label--men { color: var(--broadcast-men); background: color-mix(in oklch, var(--broadcast-men) 14%, var(--bg)); }
.htick-label--status { color: #FFF; background: var(--first-passage); }
.htick-label--women-finish { color: #000; background: var(--brand-yellow); }
.htick-label--men-finish { color: var(--bg); background: var(--men-chip); }
.hline { position: absolute; left: calc(var(--axis) - 4px); right: 0; transform: translateY(-50%); z-index: 5; pointer-events: none; }
.hline--women-broadcast { border-top: 2px dotted var(--broadcast-women); }
.hline--men-broadcast { border-top: 2px dotted var(--broadcast-men); }
.hline--first-passage { border-top: 2px solid var(--first-passage); }
.hline--selected { border-top: 1.5px solid var(--fg); }
.hline--women-finish { border-top: 2px solid var(--women-line); }
.hline--men-finish { border-top: 2px solid var(--men-chip); }

.tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  background: var(--fg); color: var(--bg); border-radius: 8px; padding: 10px 12px; min-width: 230px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; gap: 2px;
}
.tooltip[hidden] { display: none; }
.tooltip__title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.tooltip__line { font-size: 12.5px; white-space: nowrap; opacity: .85; }


/* ---------- Route ---------- */
.playback { display: flex; align-items: center; gap: 12px; }
.playback__button { min-width: 84px; }
.range { width: 100%; height: 20px; margin: 0; accent-color: var(--fg); }
.playback__range { flex: 1; min-width: 0; }
.playback__time { font-size: 18px; font-weight: 600; min-width: 64px; text-align: right; letter-spacing: -0.01em; }
.route__body { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.route__main { flex: 3 1 min(100%, 560px); min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.route__map {
  flex: none; height: 540px; border-radius: 8px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); z-index: 0;
}
.route__map--unavailable { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.route__map--unavailable::after { content: 'De kaart kan op dit toestel niet getoond worden.'; }
.route__side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 12px; }
.rider { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 2px; }
.rider__head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.rider__dot { width: 12px; height: 12px; border-radius: 50%; }
.rider__dot--women { background: var(--brand-yellow); box-shadow: inset 0 0 0 2px #000; }
.rider__dot--men { background: #000; box-shadow: inset 0 0 0 2px var(--brand-yellow); }
.rider__status { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.rider__detail { font-size: 12.5px; color: var(--muted); }
.route-legend { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.route-legend__item { display: flex; align-items: center; gap: 10px; }
.route-legend__line { width: 26px; flex: none; }
.route-legend__line--lap { height: 6px; border-radius: 3px; background: var(--brand-yellow); box-shadow: 0 0 0 1.5px #000; }
.route-legend__line--approach { height: 5px; border-radius: 3px; background: var(--approach); box-shadow: 0 0 0 1.5px var(--bg); }
.route-legend__line--loop { height: 0; border-top: 3px dashed var(--fg); }
.route-legend__note { font-size: 12px; color: var(--muted); }

.map-pin-wrap { display: flex; align-items: center; gap: 6px; pointer-events: none; }
.map-pin { width: 12px; height: 12px; border-radius: 3px; background: #000; box-shadow: 0 0 0 2px var(--brand-yellow); flex: none; }
.map-pin__label {
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--fg);
  background: var(--bg); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.map-rider {
  width: 30px; height: 30px; border-radius: 50%; cursor: default;
  display: flex; align-items: center; justify-content: center;
  font: 700 13px 'Inter', system-ui, sans-serif; transition: opacity .2s;
}
.map-rider.is-idle { opacity: 0.5; }
.map-rider--women { background: var(--brand-yellow); color: #000; box-shadow: inset 0 0 0 2px #000, 0 2px 8px rgba(0, 0, 0, .3); z-index: 2; }
.map-rider--men { background: #000; color: var(--brand-yellow); box-shadow: inset 0 0 0 2px var(--brand-yellow), 0 2px 8px rgba(0, 0, 0, .3); z-index: 2; }
.route__map .maplibregl-ctrl-attrib { font-size: 11px; }
.map-flag { width: 22px; height: 27px; pointer-events: auto; }
.map-flag svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.map-flag .pole-outline { fill: none; stroke: #FFF; stroke-width: 4; stroke-linecap: round; }
.map-flag .pole { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.map-flag .cloth { fill: currentColor; stroke: #FFF; stroke-width: 1.4; stroke-linejoin: round; paint-order: stroke; }
.map-flag--red { color: #E5484D; }
.map-flag--green { color: #2F9E5B; }
html.is-printing .map-flag { display: none !important; }


/* ---------- Elevation profile ---------- */
.route__profile { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.profile__title { font-size: 14px; font-weight: 600; }
.profile__hint { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.profile__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.profile__head b { font-weight: 600; }
.profile svg { display: block; overflow: visible; max-width: 100%; height: auto; }
.profile text { font: 500 10.5px 'Inter', system-ui, sans-serif; fill: var(--muted); }
.profile .profile__label { font-weight: 600; }
.profile__grid { stroke: var(--line); stroke-width: 1; }
.profile__tick { stroke: var(--line-strong); stroke-width: 1; }
.profile__separator { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.profile__line { fill: none; stroke: var(--fg); stroke-opacity: .6; stroke-width: 1.25; stroke-linejoin: round; }
.profile__area--women-approach { fill: var(--brand-yellow-light); fill-opacity: .85; }
.profile__area--women-lap { fill: var(--brand-yellow); fill-opacity: .8; }
.profile__area--men-loop { fill: var(--men-loop); fill-opacity: .55; }
.profile__area--men-turnoff { fill: var(--men-turnoff); fill-opacity: .6; }
.profile__area--men-lap { fill: var(--men-lap); fill-opacity: .6; }
.profile__guide { stroke: var(--fg); stroke-opacity: .45; stroke-width: 1; stroke-dasharray: 3 3; }
.profile__rider circle { stroke-width: 2.5; }
.profile__rider text { font-weight: 700; font-size: 10px; }
.profile__rider--women circle { fill: var(--brand-yellow); stroke: #000; }
.profile__rider--women text { fill: #000; }
.profile__rider--men circle { fill: #000; stroke: var(--brand-yellow); }
.profile__rider--men text { fill: var(--brand-yellow); }
.profile__note { margin: 0; font-size: 12px; color: var(--muted); }
/* The closed stretch of road and the two flags on the profile */
.profile__closure-area { fill: var(--bad); fill-opacity: .8; }
.profile__closure-line { fill: none; stroke: var(--bad); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.profile__flag .pole-outline { fill: none; stroke: #FFF; stroke-width: 4; stroke-linecap: round; }
.profile__flag .pole { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.profile__flag .cloth { fill: currentColor; stroke: #FFF; stroke-width: 1.2; stroke-linejoin: round; paint-order: stroke; }
.profile__flag--red { color: #E5484D; }
.profile__flag--green { color: #2F9E5B; }

/* ---------- Passage tables ---------- */
.passages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.passages__table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.passages__table th {
  font-size: 12px; font-weight: 500; color: var(--muted); text-align: left;
  padding: 8px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.passages__table td { padding: 8px 18px; border-bottom: 1px solid var(--line); }
.passages__table tr:last-child td { border-bottom: 0; }
.passages__table th:nth-child(n+2), .passages__table td:nth-child(n+2) { text-align: right; width: 84px; }
.passages__table th:nth-child(2), .passages__table td:nth-child(2) { padding-right: 0; }
.passages__table tr.is-key td { font-weight: 600; }

/* ---------- Scenarios (sidebar) ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scenario { display: flex; flex-direction: column; gap: 8px; }
.scenario .settings__heading { margin-bottom: 0; }
.scenario__select, .field__select {
  width: 100%; height: 34px; padding: 0 30px 0 10px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); box-shadow: var(--shadow);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat;
}
.scenario__select:focus-visible, .field__select:focus-visible { outline: none; border-color: var(--fg); box-shadow: var(--focus); }
.scenario__actions { display: flex; gap: 6px; align-items: center; }
.scenario__actions > .btn { flex: 1; }
.scenario__actions .btn:disabled { cursor: default; }
.scenario__form { display: flex; gap: 6px; }
.scenario__form input {
  flex: 1; min-width: 0; height: 30px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg);
}
.scenario__form input:focus { outline: none; border-color: var(--fg); box-shadow: var(--focus); }
.scenario__form[hidden] { display: none; }
.scenario__status { margin: 0; font-size: 12px; color: var(--muted); }
.scenario__status[data-kind="warn"] { color: var(--warn); font-weight: 500; }
.scenario__status[data-kind="ok"] { color: var(--ok); font-weight: 500; }
.scenario__status[data-kind="info"] { color: var(--fg); }
.scenario__compare { width: 100%; }
.menu { position: relative; flex: none; }
.menu__button { list-style: none; width: 30px; padding: 0; }
.menu__button::-webkit-details-marker { display: none; }
.menu__button svg { width: 16px; height: 16px; }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; padding: 4px;
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.menu__list button {
  text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent;
  font: inherit; font-size: 13px; color: var(--fg); cursor: pointer;
}
.menu__list button:hover:not(:disabled) { background: var(--panel); }
.menu__list button:disabled { color: var(--muted); opacity: .6; cursor: default; }

/* ---------- "i" buttons with an explanation in a tooltip (js/info.js) ---------- */
.info {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; margin: 0 0 0 4px;
  padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); color: var(--muted);
  font: 700 10.5px/1 Georgia, 'Times New Roman', serif; font-style: italic; vertical-align: 1px; cursor: help;
}
.info:hover, .info[aria-expanded="true"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.info:focus-visible { outline: none; box-shadow: var(--focus); }
.info-tip {
  position: fixed; z-index: 2000; max-width: min(300px, calc(100vw - 16px)); padding: 9px 11px; border-radius: 8px;
  background: var(--fg); color: var(--bg); font-size: 12.5px; font-weight: 400; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22); pointer-events: none;
}
.info-tip[hidden] { display: none; }
.card__title .info, .cmp-head__title .info { vertical-align: 2px; }

/* ---------- Variants (tabs above the page) ---------- */
.variants { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.variants__tabs { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.vtab-wrap {
  display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  box-shadow: var(--shadow); min-width: 0;
}
.vtab-wrap.is-active { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.vtab {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 8px; min-width: 0;
  border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.vtab__letter {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; border-radius: 6px;
  background: var(--panel); color: var(--fg); font-size: 11.5px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line);
}
.vtab-wrap.is-active .vtab__letter, .cmp-card.is-active .vtab__letter { background: var(--fg); color: var(--bg); box-shadow: none; }
.vtab__name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtab__margin {
  flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--status);
  background: color-mix(in oklch, var(--status) 14%, var(--bg));
}
.vtab__input {
  width: 160px; height: 26px; padding: 0 6px; font: inherit; font-size: 13px; color: var(--fg);
  border: 1px solid var(--fg); border-radius: 6px; background: var(--bg);
}
.vtab__menu > summary { list-style: none; }
.vtab__menu > summary::-webkit-details-marker { display: none; }
.vtab__more {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 36px; color: var(--muted); cursor: pointer;
  border-left: 1px solid var(--line);
}
.vtab__more:hover { color: var(--fg); }
.vtab__more svg { width: 15px; height: 15px; }
.variants__add > summary { list-style: none; }
.variants__add > summary::-webkit-details-marker { display: none; }
.variants__add .menu__list { left: 0; right: auto; }
.menu__note { margin: 0; padding: 8px 10px; font-size: 12.5px; color: var(--muted); max-width: 220px; }
.menu__label { padding: 8px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.variants__view { margin-left: auto; }
.segmented__item--text { width: auto; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 500; }
.sidebar__variant {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px; border-radius: 5px;
  background: var(--fg); color: var(--bg); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.sidebar__variant[hidden] { display: none; }

/* The comparison view replaces the planning while it is open. */
.compare-view { display: none; }
.page.is-comparing > :not(.variants):not(.compare-view):not(.credits) { display: none; }
.page.is-comparing > .compare-view { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Speed range (sidebar) and margin range ---------- */
.range-inputs { gap: 6px; }
.field .range-inputs input { width: 56px; padding: 0 6px; text-align: center; }
.mrange { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.mrange__text { font-size: 12px; color: var(--muted); }
.mrange__text.is-warn { color: var(--warn); font-weight: 500; }
.mrange__text.is-bad { color: var(--bad); font-weight: 600; }
.rbar-wrap { display: flex; flex-direction: column; gap: 4px; }
.rbar__labels { position: relative; height: 30px; }
.rbar__labels--ends { height: auto; display: flex; justify-content: space-between; gap: 8px; }
.rbar__end { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.rbar__end b { font-size: 13px; font-weight: 600; color: var(--fg); }
.rbar__end small { font-size: 11px; color: var(--muted); }
.rbar__label { position: absolute; top: 0; display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.rbar__label--middle { align-items: center; }
.rbar__label--end { align-items: flex-end; }
.rbar__label b { font-size: 13px; font-weight: 600; color: var(--fg); }
.rbar__label small { font-size: 11px; color: var(--muted); }
.rbar { position: relative; height: 12px; border-radius: 6px; overflow: hidden; background: var(--panel); }
.rbar__zone { position: absolute; top: 0; bottom: 0; }
.rbar__zone--bad { background: color-mix(in oklch, var(--bad) 22%, var(--bg)); }
.rbar__zone--warn { background: color-mix(in oklch, var(--warn) 24%, var(--bg)); }
.rbar__zone--ok { background: color-mix(in oklch, var(--ok) 20%, var(--bg)); }
.rbar__span { position: absolute; top: 4px; height: 4px; border-radius: 2px; background: var(--fg); opacity: .55; }
.rbar__dot {
  position: absolute; top: 1px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--status); box-shadow: 0 0 0 2px var(--bg);
}

/* Hatched band in the timeline: the time the women can be clear, or the men's red flag can come. */
.uband {
  position: absolute; height: 84px; z-index: 4; pointer-events: none; border-radius: 6px;
  background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--fg) 30%, transparent) 0 1.5px, transparent 1.5px 6px);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--fg) 22%, transparent);
}
.timeline__track--vertical .uband { height: auto; }

/* ---------- Comparison view ---------- */
.cmp-head__title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.cmp-head__intro { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.cmp-empty { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cmp-empty p { margin: 0; font-size: 14px; }
.cmp-cards { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; }
.cmp-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; min-width: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  border-top: 3px solid color-mix(in oklch, var(--status) 70%, var(--line));
}
.cmp-card.is-active { box-shadow: 0 0 0 1px var(--fg), var(--shadow); }
.cmp-card__head {
  display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; min-width: 0;
}
.cmp-card__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-card__editing { margin-left: auto; flex: none; font-size: 11px; font-weight: 500; color: var(--muted); }
.cmp-card__margin { display: flex; align-items: center; gap: 10px; }
.cmp-card__margin b { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; color: var(--status); }
.cmp-card__margin .badge { margin-left: 0; }
.cmp-card__delta, .cmp-card__range { font-size: 12.5px; color: var(--muted); }
.cmp-card__range.is-warn { color: var(--warn); font-weight: 500; }
.cmp-card__range.is-bad { color: var(--bad); font-weight: 600; }
.cmp-card__ref { font-weight: 600; color: var(--fg); }
.is-better { color: var(--ok); font-weight: 600; }
.is-worse { color: var(--bad); font-weight: 600; }
.is-muted { color: var(--muted); }
.cmp-card__diffs { list-style: none; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.cmp-card__diffs li { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.cmp-card__diffs li b { font-weight: 600; }
.cmp-section .card__hint { text-align: right; }

/* The days of all variants on one time axis */
.mtl { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; overflow-x: auto; }
.mtl__row { display: grid; grid-template-columns: 170px minmax(560px, 1fr) 64px; gap: 10px; align-items: center; }
.mtl__name {
  display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; min-width: 0;
}
.mtl__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtl__axis { position: relative; height: 16px; }
.mtl__tick { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.mtl__track { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 5px 0; border-radius: 8px; background: var(--panel); }
.mtl__lane { position: relative; height: 16px; }
.mtl__b { position: absolute; top: 0; height: 100%; border-radius: 3px; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, .12); }
.mtl__b--women-intro, .mtl__b--women-podium { background: var(--women-intro); box-shadow: inset 0 0 0 1.5px var(--brand-yellow); }
.mtl__b--women-approach { background: var(--brand-yellow-light); }
.mtl__b--women-lap { background: var(--brand-yellow); }
.mtl__b--men-intro, .mtl__b--men-podium { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--men-outline); }
.mtl__b--men-loop { background: var(--men-loop); }
.mtl__b--men-turnoff { background: var(--men-turnoff); }
.mtl__b--men-lap { background: var(--men-lap); }
.mtl__b--org { background: color-mix(in oklch, var(--status) 22%, var(--bg)); box-shadow: inset 0 0 0 1.5px var(--status); }
.mtl__b--conflict { background: var(--bad); }
.mtl__unsure {
  position: absolute; top: -2px; bottom: -2px; z-index: 2; pointer-events: auto; border-radius: 3px;
  background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--fg) 45%, transparent) 0 1.5px, transparent 1.5px 5px);
}
.mtl__line { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1.5px dashed var(--muted); z-index: 3; pointer-events: none; }
.mtl__margin { font-size: 13px; font-weight: 600; color: var(--status); text-align: right; }

/* Tables in the comparison view */
.cmp-table-wrap { overflow-x: auto; padding: 0; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cmp-table th, .cmp-table td { padding: 8px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.cmp-table thead th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--panel); }
.cmp-table tbody th { font-weight: 500; color: var(--muted); }
.cmp-table tr:last-child th, .cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table td.is-ref { background: color-mix(in oklch, var(--panel) 60%, transparent); }
.cmp-delta { margin-left: 8px; font-size: 12px; color: var(--muted); }
.cmp-delta.is-better { color: var(--ok); }
.cmp-delta.is-worse { color: var(--bad); }

/* Zoek de grens */
.sweep .card__body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; }
.sweep__controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.sweep__field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sweep__field input {
  width: 92px; height: 32px; padding: 0 8px; font: inherit; font-size: 13.5px; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg);
}
.sweep__field input[type="number"] { width: 72px; }
.sweep__field .field__select { width: 190px; }
.sweep__answer { border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.sweep__answer td, .sweep__answer th { white-space: normal; }
.sweep__answer b { color: var(--fg); }
.sweep__dotkey { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--status); vertical-align: 1px; }
.sweep__chart { display: block; max-width: 100%; height: auto; }
.sweep__zone--bad { fill: color-mix(in oklch, var(--bad) 12%, var(--bg)); }
.sweep__zone--warn { fill: color-mix(in oklch, var(--warn) 14%, var(--bg)); }
.sweep__zone--ok { fill: color-mix(in oklch, var(--ok) 11%, var(--bg)); }
.sweep__grid { stroke: var(--line); stroke-width: 1; }
.sweep__axis { font-size: 11px; fill: var(--muted); }
.sweep__band { fill: color-mix(in oklch, var(--fg) 14%, transparent); }
.sweep__worst { fill: none; stroke: var(--fg); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .6; }
.sweep__expected { fill: none; stroke: var(--fg); stroke-width: 2.2; }
.sweep__current { stroke: var(--broadcast-women); stroke-width: 2; }
.sweep__selected { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 3 3; }
.sweep__dot { fill: var(--fg); stroke: var(--bg); stroke-width: 2; }
.sweep__hit { fill: transparent; cursor: pointer; }
.sweep__hit:hover { fill: color-mix(in oklch, var(--fg) 6%, transparent); }
.sweep__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); }
.sweep__legend span { display: inline-flex; align-items: center; gap: 6px; }
.sweep__key { display: inline-block; width: 18px; height: 0; }
.sweep__key--expected { border-top: 2.2px solid var(--fg); }
.sweep__key--band { height: 10px; background: color-mix(in oklch, var(--fg) 14%, transparent); }
.sweep__key--current { border-top: 2px solid var(--broadcast-women); }
.sweep__pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel); }
.sweep__pick p { margin: 0; font-size: 13.5px; }
.sweep__actions { display: flex; gap: 8px; }
.sweep__hint { margin: 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  .cmp-cards { grid-template-columns: 1fr; }
  .variants__view { margin-left: 0; }
}
@media (max-width: 640px) {
  .mtl__row { grid-template-columns: 1fr; gap: 4px; }
  .mtl__row--axis > span { display: none; }
  .mtl__margin { text-align: left; }
  .vtab__name { max-width: 110px; }
}

/* ---------- Credits (footer) ---------- */
.credits { margin-top: 8px; padding: 18px 0 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.credits b { color: var(--fg); font-weight: 600; }
.credits__main, .credits__more { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.credits__more { font-size: 12px; }
.credits__sep { opacity: .6; }
html.is-printing .credits { padding-top: 8px; font-size: 10.5px; }
html.is-printing .credits__more { font-size: 10px; }

/* ---------- Navigation between the modules ---------- */
.modnav { display: flex; gap: 2px; padding: 3px; margin-right: auto; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.modnav__item { padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.modnav__item:hover { color: var(--fg); }
.modnav__item.is-active { background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }

/* ---------- Parcourskaart: sidebar ---------- */
.pm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pm-actions .btn { cursor: pointer; }
.settings__note[data-kind="warn"] { color: var(--bad); }
.settings__note[data-kind="ok"] { color: var(--ok); }
.field--stacked { flex-direction: column; align-items: stretch; gap: 4px; min-height: 0; padding: 4px 0; }
.pm-text {
  width: 100%; min-width: 0; height: 30px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg);
}
.pm-text:focus, .pm-mini:focus { outline: none; border-color: var(--fg); box-shadow: var(--focus); }
.pm-mini {
  height: 28px; padding: 0 6px; font: inherit; font-size: 12.5px; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); cursor: pointer;
}
.pm-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 28px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.pm-icon:hover:not(:disabled) { background: var(--panel); color: var(--fg); }
.pm-icon:disabled { opacity: .3; cursor: default; }
.pm-icon svg { width: 16px; height: 16px; }
.pm-color { flex: none; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); cursor: pointer; }
.pm-color::-webkit-color-swatch-wrapper { padding: 3px; }
.pm-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
.pm-tracks, .pm-points { display: flex; flex-direction: column; gap: 8px; }
.pm-track { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.pm-track.is-hidden { opacity: .55; }
.pm-track__top, .pm-track__meta { display: flex; align-items: center; gap: 6px; }
.pm-track__name { flex: 1 1 auto; }
.pm-track__meta { font-size: 12px; color: var(--muted); }
.pm-track__meta .pm-mini { flex: 1 1 auto; min-width: 0; }
.pm-track__km { white-space: nowrap; font-size: 12px; color: var(--muted); }
.pm-icon[data-action="label"][aria-pressed="true"] { background: var(--panel); color: var(--fg); }
.pm-point-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 26px; gap: 4px 6px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pm-point-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pm-point-row [data-field="name"] { grid-column: 1 / 3; grid-row: 1; }
.pm-point-row [data-action="delete-point"] { grid-column: 3; grid-row: 1; }

/* ---------- Parcourskaart: the image ---------- */
.pm-page { gap: 18px; }
.pm-stage { position: relative; overflow-x: auto; display: flex; justify-content: center; padding: 2px 0 6px; }
.pm-artboard {
  --u: 8px; position: relative; flex: none; display: flex; flex-direction: column; overflow: hidden;
  background: #FFFFFF; color: #18181B; border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 30px rgba(0, 0, 0, .12);
  font-family: Inter, system-ui, sans-serif;
}
.pm-artboard[data-dark="true"] { background: #141518; color: #ECECEF; }
.pm-mapwrap { position: relative; flex: 1 1 auto; min-height: 0; }
.pm-map { position: absolute; inset: 0; }
.pm-artboard.is-adding .pm-map .maplibregl-canvas { cursor: crosshair; }
.pm-snapshot { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.pm-artboard.is-exporting .pm-snapshot { display: block; }
.pm-artboard.is-exporting .pm-map canvas, .pm-artboard.is-exporting .maplibregl-ctrl, .pm-artboard.is-exporting .info { display: none !important; }
.pm-artboard.is-exporting { border-radius: 0; box-shadow: none; }

/* Box top left: yellow head with the title, then the legend */
.pm-key {
  position: absolute; z-index: 3; top: calc(var(--u) * 2.6); left: calc(var(--u) * 2.6); min-width: calc(var(--u) * 22); max-width: 46%;
  background: #FFFFFF; color: #111111; border-radius: calc(var(--u) * .5); overflow: hidden;
  box-shadow: 0 calc(var(--u) * .2) calc(var(--u) * 1.2) rgba(0, 0, 0, .14);
}
.pm-key[hidden] { display: none; }
.pm-key__head {
  display: flex; align-items: center; gap: calc(var(--u) * 1); padding: calc(var(--u) * .9) calc(var(--u) * 1.4);
  background: #FFD201; color: #000000; font-size: calc(var(--u) * 2.1); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; text-transform: uppercase;
}
.pm-key__logo {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: calc(var(--u) * 3); height: calc(var(--u) * 3);
  border-radius: calc(var(--u) * .5); background: #000000; color: #FFD201; font-size: calc(var(--u) * 1.25); letter-spacing: -0.03em;
}
.pm-key__sub { padding: calc(var(--u) * .9) calc(var(--u) * 1.4) 0; font-size: calc(var(--u) * 1.45); font-weight: 600; opacity: .75; }
.pm-key__sub[hidden] { display: none; }
.pm-key__items { display: flex; flex-direction: column; gap: calc(var(--u) * .65); padding: calc(var(--u) * 1.1) calc(var(--u) * 1.4) calc(var(--u) * 1.3); font-size: calc(var(--u) * 1.4); font-weight: 600; }
.pm-key__items:empty, .pm-key__items[hidden] { display: none; }
.pm-key__item { display: flex; align-items: center; gap: calc(var(--u) * .9); white-space: nowrap; }
.pm-key__icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: calc(var(--u) * 2.3); height: calc(var(--u) * 2.3);
  border-radius: 50%; background: #111111; color: #FFFFFF;
}
.pm-key__icon svg { width: 70%; height: 70%; }
.pm-key__icon--finish, .pm-badge--finish .pm-badge__icon { background: repeating-conic-gradient(#111111 0 25%, #FFFFFF 0 50%) 50% 50% / 33.4% 33.4%; }
.pm-key__icon--finish svg, .pm-badge--finish .pm-badge__icon svg { display: none; }
.pm-key__icon--finish { box-shadow: inset 0 0 0 calc(var(--u) * .2) #111111; }
.pm-key__icon--voeding, .pm-key__icon--afval { background: #6FC0DC; }
.pm-key__icon .pm-zero { font-size: calc(var(--u) * 1.05); }
.pm-key__line { flex: none; width: calc(var(--u) * 4); height: calc(var(--u) * 1); }
.pm-key__km { margin-left: auto; padding-left: calc(var(--u) * 1); font-weight: 500; opacity: .55; }

/* Box bottom right: the numbered points */
.pm-list {
  position: absolute; z-index: 3; right: calc(var(--u) * 2.6); bottom: calc(var(--u) * 3.6); max-width: 44%;
  display: flex; flex-direction: column; gap: calc(var(--u) * .55); padding: calc(var(--u) * 1.2) calc(var(--u) * 1.4);
  background: #FFFFFF; color: #111111; border-radius: calc(var(--u) * .5); box-shadow: 0 calc(var(--u) * .2) calc(var(--u) * 1.2) rgba(0, 0, 0, .14);
  font-size: calc(var(--u) * 1.4); font-weight: 600;
}
.pm-list[hidden] { display: none; }
.pm-list__row { display: flex; align-items: center; gap: calc(var(--u) * .8); white-space: nowrap; }
.pm-list__name { overflow: hidden; text-overflow: ellipsis; }
.pm-list__km { margin-left: auto; padding-left: calc(var(--u) * 1); font-weight: 500; opacity: .6; }
.pm-list .pm-num--small { width: calc(var(--u) * 2.3); height: calc(var(--u) * 2.3); font-size: calc(var(--u) * 1.2); box-shadow: none; }
.pm-list .pm-key__icon { width: calc(var(--u) * 2); height: calc(var(--u) * 2); }
.pm-track__laps { height: 28px; font-size: 12.5px; }
.pm-track__beside { display: flex; white-space: nowrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.pm-track__beside .pm-mini { flex: 0 1 auto; min-width: 0; }

/* North arrow and scale bar bottom left */
.pm-scale { position: absolute; z-index: 3; left: calc(var(--u) * 2.6); bottom: calc(var(--u) * 2.4); display: flex; align-items: flex-end; gap: calc(var(--u) * 1.4); color: #111111; }
.pm-scale[hidden] { display: none; }
.pm-scale__north { width: calc(var(--u) * 1.8); height: calc(var(--u) * 2.7); }
.pm-scale__bar { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .3); }
.pm-scale__line { display: block; height: calc(var(--u) * .9); border: calc(var(--u) * .22) solid #111111; border-top: 0; }
.pm-scale__label { order: -1; font-size: calc(var(--u) * 1.3); font-weight: 600; }
.pm-artboard[data-dark="true"] .pm-scale { color: #E4E4E7; }
.pm-artboard[data-dark="true"] .pm-scale__line { border-color: #E4E4E7; }

.pm-attrib {
  position: absolute; z-index: 3; right: calc(var(--u) * 1); bottom: calc(var(--u) * .8); padding: calc(var(--u) * .25) calc(var(--u) * .7);
  font-size: max(9px, calc(var(--u) * 1.05)); border-radius: calc(var(--u) * .5); background: rgba(255, 255, 255, .8); color: #3F3F46;
}
.pm-artboard[data-dark="true"] .pm-attrib { background: rgba(20, 21, 24, .8); color: #A1A1AA; }

.pm-profile { flex: none; height: calc(var(--u) * 19); border-top: 1px solid rgba(0, 0, 0, .08); }
.pm-artboard[data-dark="true"] .pm-profile { border-top-color: rgba(255, 255, 255, .08); }
.pm-profile[hidden] { display: none; }
.pm-profile svg { display: block; font-family: Inter, system-ui, sans-serif; }
.pm-profile__title { font-size: calc(var(--fs) * 1.08); fill: currentColor; opacity: .7; }
.pm-profile__name { font-weight: 700; opacity: 1; }
.pm-profile__axis { font-size: var(--fs); fill: currentColor; opacity: .55; }
.pm-profile__grid { stroke: currentColor; stroke-opacity: .12; stroke-dasharray: 3 3; }
.pm-profile__band { fill: #111111; }
.pm-profile__bandkm { font-size: var(--fs); font-weight: 600; fill: #FFFFFF; fill-opacity: .7; }
.pm-profile__bandkm--mark { font-weight: 800; fill: #FFD201; fill-opacity: 1; }
.pm-profile__lead { stroke: currentColor; stroke-opacity: .5; stroke-width: 1; stroke-dasharray: 2 2; }
.pm-profile__num { fill: #FFFFFF; font-weight: 800; }
.pm-profile__zone { fill: #6FC0DC; fill-opacity: .35; }
.pm-profile__base { stroke: currentColor; stroke-opacity: .35; }
.pm-profile__empty { display: flex; height: 100%; align-items: center; justify-content: center; font-size: calc(var(--u) * 1.6); opacity: .6; }

.pm-drop {
  position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center;
  border: 2px dashed var(--fg); border-radius: 12px; background: color-mix(in oklch, var(--bg) 80%, transparent);
  font-size: 16px; font-weight: 600;
}
.pm-stage.is-dropping .pm-drop { display: flex; }

/* Points and kilometre markers on the map. MapLibre positions each marker (absolute); its parts are placed against it. */
.pm-badge { display: flex; flex-direction: column; align-items: center; cursor: grab; }
.pm-badge--below { flex-direction: column-reverse; }
.pm-badge__label {
  margin-bottom: 5px; padding: 5px 11px 6px 13px; border-radius: 3px; background: #111111; color: #FFFFFF; white-space: nowrap;
  font: 700 17px/1.1 Inter, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.pm-badge--below .pm-badge__label { margin: 5px 0 0; }
.pm-badge__icon {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: #111111; color: #FFFFFF; box-shadow: 0 0 0 2.5px #FFFFFF, 0 2px 6px rgba(0, 0, 0, .3);
}
.pm-badge__icon svg { width: 22px; height: 22px; }
.pm-badge__stem { width: 2px; height: 12px; background: #111111; }
.pm-badge__foot { width: 8px; height: 8px; background: #FFFFFF; border: 2px solid #111111; box-sizing: border-box; }
.pm-badge--finish .pm-badge__icon { box-shadow: inset 0 0 0 2.5px #111111, 0 0 0 2px #FFFFFF, 0 2px 6px rgba(0, 0, 0, .3); }
.pm-zero { display: flex; flex-direction: column; align-items: center; font: 800 17px/.85 Inter, system-ui, sans-serif; color: #FFFFFF; }
.pm-zero small { font-size: .52em; font-weight: 600; line-height: 1; }
.pm-num {
  display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; cursor: grab;
  background: #111111; color: #FFFFFF; font: 700 12px/1 Inter, system-ui, sans-serif; box-shadow: 0 0 0 2px #FFFFFF, 0 1px 4px rgba(0, 0, 0, .3);
}
.pm-town { width: 9px; height: 9px; background: #FFFFFF; border: 2px solid #111111; cursor: grab; }
.pm-town__label {
  position: absolute; top: 50%; white-space: nowrap; color: #111111; font: 700 13.5px/1.1 Inter, system-ui, sans-serif; letter-spacing: -0.01em;
  text-shadow: 0 0 2px #FFFFFF, 0 0 2px #FFFFFF, 0 0 3px #FFFFFF, 0 0 4px #FFFFFF;
}
.pm-town--right .pm-town__label { left: calc(100% + 6px); transform: translateY(-50%); }
.pm-town--left .pm-town__label { right: calc(100% + 6px); transform: translateY(-50%); }
.pm-town--top .pm-town__label { top: auto; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); }
.pm-town--bottom .pm-town__label { top: calc(100% + 4px); left: 50%; transform: translateX(-50%); }
.pm-artboard[data-dark="true"] .pm-town { background: #141518; border-color: #F4F4F5; }
.pm-artboard[data-dark="true"] .pm-town__label { color: #F4F4F5; text-shadow: 0 0 2px #141518, 0 0 2px #141518, 0 0 3px #141518, 0 0 4px #141518; }
.pm-zone { width: 8px; height: 8px; background: #FFFFFF; border: 2px solid #111111; box-sizing: content-box; cursor: grab; }
.pm-zone__lead { position: absolute; background: #111111; }
.pm-zone__body { position: absolute; display: flex; align-items: center; gap: 4px; }
.pm-zone__icon {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: #6FC0DC; color: #FFFFFF; box-shadow: 0 0 0 2px #FFFFFF, 0 1px 5px rgba(0, 0, 0, .3);
}
.pm-zone__icon svg { width: 20px; height: 20px; }
.pm-zone__km {
  padding: 2px 6px 2px 7px; border-radius: 3px; background: #6FC0DC; color: #FFFFFF; white-space: nowrap;
  font: 800 11.5px/1.2 Inter, system-ui, sans-serif; letter-spacing: .1em; box-shadow: 0 0 0 1.5px #FFFFFF;
}
.pm-zone--right .pm-zone__lead { left: 100%; top: 50%; width: 18px; height: 2px; margin-top: -1px; }
.pm-zone--right .pm-zone__body { left: calc(100% + 18px); top: 50%; transform: translateY(-50%); }
.pm-zone--left .pm-zone__lead { right: 100%; top: 50%; width: 18px; height: 2px; margin-top: -1px; }
.pm-zone--left .pm-zone__body { right: calc(100% + 18px); top: 50%; transform: translateY(-50%); flex-direction: row-reverse; }
.pm-zone--top .pm-zone__lead { bottom: 100%; left: 50%; width: 2px; height: 16px; margin-left: -1px; }
.pm-zone--top .pm-zone__body { bottom: calc(100% + 16px); left: 50%; transform: translateX(-16px); }
.pm-zone--bottom .pm-zone__lead { top: 100%; left: 50%; width: 2px; height: 16px; margin-left: -1px; }
.pm-zone--bottom .pm-zone__body { top: calc(100% + 16px); left: 50%; transform: translateX(-16px); }
/* Label of a loop or lap: the name in the route colour with the length, lines such as "Mannen 9 rondes" below */
.pm-lap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: grab; font-family: Inter, system-ui, sans-serif; text-transform: uppercase; white-space: nowrap; }
.pm-lap__head { display: flex; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pm-lap__name { padding: 5px 9px 5px 11px; font-weight: 700; font-size: 15px; letter-spacing: .16em; line-height: 1.15; }
.pm-lap__km { padding: 5px 10px; background: #FFFFFF; font-weight: 800; font-size: 15px; letter-spacing: .06em; line-height: 1.15; }
.pm-lap__row { padding: 3px 9px 3px 11px; background: #FFFFFF; color: #111111; font-weight: 700; font-size: 12.5px; letter-spacing: .16em; line-height: 1.2; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.pm-lap__row b { font-weight: 800; }
.pm-point { width: 12px; height: 12px; cursor: grab; }
.pm-point__icon { position: absolute; inset: 0; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 3px #111111, 0 1px 4px rgba(0, 0, 0, .3); }
.pm-point__label {
  position: absolute; top: 50%; padding: 3px 8px; white-space: nowrap; border-radius: 6px;
  background: #FFFFFF; color: #111111; font: 600 12.5px/1.25 Inter, system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.pm-point--right .pm-point__label { left: calc(100% + 7px); transform: translateY(-50%); }
.pm-point--left .pm-point__label { right: calc(100% + 7px); transform: translateY(-50%); }
.pm-point--top .pm-point__label { top: auto; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); }
.pm-point--bottom .pm-point__label { top: calc(100% + 7px); left: 50%; transform: translateX(-50%); }
.pm-artboard[data-dark="true"] .pm-point__label { background: #24262A; color: #F4F4F5; }
.pm-km {
  padding: 2px 6px; border-radius: 5px; background: #111111; color: #FFFFFF; white-space: nowrap;
  font: 700 10.5px/1.15 Inter, system-ui, sans-serif; box-shadow: 0 0 0 1.5px #FFFFFF;
}

@media (max-width: 1024px) {
  .modnav { order: 3; margin-right: 0; }
}

/* ---------- Export overlay ---------- */
.export-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--app); color: var(--fg); font-size: 15px; font-weight: 500;
}
.export-overlay[hidden] { display: none; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--fg); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Smaller screens ---------- */
@media (max-width: 1519px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat--margin { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .settings__group + .settings__group { border-top: 0; padding-top: 10px; }
}
@media (max-width: 720px) {
  .topbar { position: static; height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .brand__title, .brand__subtitle { white-space: normal; }
  .topbar { row-gap: 12px; }
  .topbar__actions { display: contents; }  /* theme toggle next to the title, the two buttons on their own row */
  .brand { flex: 1 1 calc(100% - 96px); }
  .topbar__actions .btn { flex: 1 1 40%; }
  .settings__group + .settings__group { border-top: 1px solid var(--line); padding-top: 16px; }
  .page { padding: 16px 12px 40px; gap: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat--margin { flex-direction: column; gap: 12px; }
  .stat__main { flex: 0 0 auto; }
  .sum { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .stat { padding: 12px; }
  .stat__label { font-size: 12px; }
  .stat__value { font-size: 22px; }
  .stat__detail { font-size: 11.5px; }
  .card__head { padding: 10px 14px; }
  .card__body { padding: 12px 14px 14px; }
  .route__map { height: 420px; }
  .passages__table th, .passages__table td { padding: 7px 12px; }
  .passages__table th:nth-child(n+2), .passages__table td:nth-child(n+2) { width: 60px; }
}

/* ---------- Print and PDF export ----------
   Two A4 landscape pages. Page 1 = summary and timeline, page 2 = map and passage tables.
   The layout hangs on html.is-printing, which the PDF button and the browser's own print (beforeprint) both set. */
.detail { display: flex; flex-direction: column; gap: 16px; }
.map-print-image { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
.print-only { display: none; }

html.is-printing body { background: var(--bg); }
html.is-printing .no-print { display: none !important; }
html.is-printing .print-only { display: flex !important; }
html.is-printing .shell { display: block; }
html.is-printing .page { width: calc(var(--print-w, 1230) * 1px); margin: 0; padding: 6px; gap: 14px; } /* --print-w is set by fitPrintWidth() in app.js */

html.is-printing .print-head { align-items: center; gap: 12px; }
html.is-printing .print-head .brand__logo { width: 36px; height: 36px; font-size: 14px; }
html.is-printing .print-head .brand__title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
html.is-printing .print-head .brand__subtitle { font-size: 13px; }
html.is-printing .print-head__meta { margin-left: auto; text-align: right; font-size: 12px; line-height: 1.4; color: var(--muted); }
/* The settings on page 1 of the PDF: compact blocks next to each other. */
html.is-printing .psum { display: flex !important; gap: 8px 14px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
html.is-printing .psum__block { flex: 1 1 0; padding-left: 9px; border-left: 2px solid var(--line-strong); min-width: 0; }
html.is-printing .psum__block--wide { flex-grow: 1.55; }
html.is-printing .psum__title { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg); margin-bottom: 1px; }
html.is-printing .psum b { color: var(--fg); font-weight: 600; }

html.is-printing .stats { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2.8fr); gap: 10px; }
html.is-printing .stat--margin { grid-column: auto; flex-direction: row; gap: 18px; }
html.is-printing .stat__main { flex: 0 0 176px; }
html.is-printing .sum { border-left: 1px solid var(--line); padding-left: 18px; border-top: 0; padding-top: 0; }
html.is-printing .stat, html.is-printing .card { box-shadow: none; break-inside: avoid; }
html.is-printing .stat__value { font-size: 26px; }

html.is-printing .timeline__scroll { overflow: visible; }
html.is-printing .timeline__grid { min-width: 0; }
html.is-printing .vline--selected { display: none; }
html.is-printing .print-link { font-size: 11.5px; color: var(--muted); gap: 6px; }
html.is-printing .print-link span { color: var(--fg); word-break: break-all; }

html.is-printing .detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
/* Under the map, in this order: the map, its legend, the elevation profile. */
html.is-printing .route__body { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 10px; }
html.is-printing .route__main { display: contents; }
html.is-printing .route__map { order: 1; flex: none; width: 600px; height: 420px; } /* same size on screen during export, so the map snapshot fits */
html.is-printing .route__side { order: 2; flex: none; margin-top: 0; } /* flex-basis 240px would be a height in this column */
html.is-printing .profile__note { display: none; }
html.is-printing .profile__flags, html.is-printing .profile__rider { display: none; } /* nothing moves on paper */
html.is-printing .route__profile { order: 3; border-top: 0; padding-top: 0; gap: 6px; width: 600px; } /* as wide as the map; otherwise the charts decide the width of the card */
html.is-printing .route-legend { border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; max-width: 600px; }
html.is-printing .maplibregl-canvas { visibility: hidden; }
html.is-printing .map-print-image { display: block; }
html.is-printing .maplibregl-ctrl-top-left, html.is-printing .maplibregl-ctrl-attrib-button, html.is-printing .map-rider { display: none !important; }

html.is-printing .passages { grid-template-columns: 1fr 1fr; gap: 10px; }
html.is-printing .passages .card__head { min-height: 0; padding: 10px 12px; }
html.is-printing .passages .card__title { font-size: 13.5px; }
html.is-printing .passages__table { font-size: 12px; }
html.is-printing .passages__table th { font-size: 11px; padding: 5px 12px; }
html.is-printing .passages__table td { padding: 5px 12px; }
html.is-printing .passages__table th:nth-child(n+2), html.is-printing .passages__table td:nth-child(n+2) { width: 48px; }
html.is-printing .passages__table th:nth-child(2), html.is-printing .passages__table td:nth-child(2) { padding-right: 0; }


@page { size: A4 landscape; margin: 9mm; }
@media print {
  html { zoom: 0.85; zoom: calc(1054 / var(--print-w, 1230)); } /* page width * zoom = the 1054 px (279 mm) printable width of A4 landscape */
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-break { break-before: page; }
}
