/*
 * Reisadvies-pagina. Kleuren gelijk aan de app (Theme.kt): donker uit site.css, licht hieronder.
 * Selecties in de planner zoals in de app: oranje tint met oranje rand.
 */

:root {
  --chrome: var(--bg);
  --choice: #2a3548;
  --accent-label: #ff6a00;
  /* Krappe minuten / te laat: zelfde paar als de app op donker en Wear. */
  --urgent: #ff6a00;
  --urgent-late: #ff2a40;
  --accent-soft: rgba(255, 106, 0, 0.16);
  --hover: rgba(255, 255, 255, 0.04);
  --badge-edge: rgba(255, 255, 255, 0.22);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --soft-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --ns-blue: #303289;
  /* Gekozen keuzeknop (app: Interactive): donker #1a4b8c, licht #0b1f3a. */
  --sel-bg: #1a4b8c;
  --ok: #1fa35b;
  --warn: #ff8a00;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --planner-glow: rgba(255, 106, 0, 0.22);
  --wear-glow: rgba(255, 106, 0, 0.16);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eceef2;
    --chrome: #ffffff;
    --surface: #ffffff;
    --surface-muted: #e4e6eb;
    --line: #d0d4dc;
    --choice: #c4c9d4;
    --cream: #0b1f3a;
    --muted: #5c6678;
    --caption: #3d4659;
    --link: #0b1f3a;
    --delay: #e5383b;
    --accent-label: #c65300;
    --urgent: #c65300;
    --urgent-late: #c01028;
    --ok: #15803d;
    --warn: #b35f00;
    --sel-bg: #0b1f3a;
    --hover: rgba(11, 31, 58, 0.03);
    --badge-edge: rgba(0, 0, 0, 0.18);
    --shadow: 0 18px 40px rgba(11, 31, 58, 0.14);
    --soft-shadow: 0 1px 2px rgba(11, 31, 58, 0.06);
    --hairline: #d0d4dc;
    --planner-glow: rgba(255, 106, 0, 0.1);
    --wear-glow: rgba(255, 106, 0, 0.08);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eceef2;
  --chrome: #ffffff;
  --surface: #ffffff;
  --surface-muted: #e4e6eb;
  --line: #d0d4dc;
  --choice: #c4c9d4;
  --cream: #0b1f3a;
  --muted: #5c6678;
  --caption: #3d4659;
  --link: #0b1f3a;
  --delay: #e5383b;
  --accent-label: #c65300;
  --urgent: #c65300;
  --urgent-late: #c01028;
  --ok: #15803d;
  --warn: #b35f00;
  --sel-bg: #0b1f3a;
  --hover: rgba(11, 31, 58, 0.03);
  --badge-edge: rgba(0, 0, 0, 0.18);
  --shadow: 0 18px 40px rgba(11, 31, 58, 0.14);
  --soft-shadow: 0 1px 2px rgba(11, 31, 58, 0.06);
  --hairline: #d0d4dc;
  --planner-glow: rgba(255, 106, 0, 0.1);
  --wear-glow: rgba(255, 106, 0, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

.plan-page {
  transition: background-color 0.25s ease, color 0.25s ease;
}

.plan-page .site-header {
  background: color-mix(in srgb, var(--chrome) 90%, transparent);
}

.plan-page .site-header.is-compact {
  background: color-mix(in srgb, var(--chrome) 74%, transparent);
}

@supports not (backdrop-filter: blur(1px)) {
  .plan-page .site-header,
  .plan-page .site-header.is-compact {
    background: var(--chrome);
  }
}

.sr {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Kop: thema-knop ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.theme-toggle .i-moon {
  display: none;
}

.is-light .theme-toggle .i-sun {
  display: none;
}

.is-light .theme-toggle .i-moon {
  display: block;
}

.plan-page .menu-toggle {
  order: 3;
}

.plan-page .nav {
  order: 4;
}

@media (min-width: 768px) {
  .plan-page .nav {
    order: 1;
  }
}

/* ---------- Opbouw ---------- */

.plan {
  max-width: var(--wide);
}

.plan-intro {
  margin: 0.25rem 0 1rem;
}

/* Zelfde label als bij de app. De intro-alinea zou de kleur en marge anders overschrijven. */
.plan-intro .promo-kicker {
  margin: 0 0 0.5rem;
  max-width: none;
  color: var(--accent-label);
}

.plan-intro h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.plan-intro p {
  margin: 0.45rem 0 0;
  max-width: 36rem;
  color: var(--muted);
}

.planner-layout {
  display: grid;
  gap: 1.25rem;
  margin-top: 0;
  align-items: start;
}

.planner-layout > * {
  min-width: 0;
}

.plan-side {
  position: relative;
  min-width: 0;
}

.plan-form {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 18px 42px -16px var(--planner-glow), var(--soft-shadow);
}

/* Samengevouwen formulier (telefoon, na zoeken). */
.plan-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.plan-summary[hidden] {
  display: none;
}

.sum-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.sum-route {
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sum-when {
  color: var(--muted);
  font-size: 0.9rem;
}

.sum-edit {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.plan-side.is-collapsed .plan-form {
  display: none;
}

/* ---------- Van / naar ---------- */

.places {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.places::before {
  /* Ronde puntjes van Van naar Naar, zoals in de app. */
  content: "";
  position: absolute;
  z-index: 0;
  /* Precies onder het midden van de stip en de vlag (kolom van 2.6rem breed). */
  left: calc(1.3rem - 3px);
  /* Van bolletje tot bolletje (Van → Naar), met wat ruimte bij beide, zoals in de app. */
  top: calc(1.7rem + 13px);
  height: calc(3.4rem - 26px);
  width: 6px;
  /* Puntjes gelijk verdeeld over de hoogte, nooit half afgesneden. */
  background-image: radial-gradient(circle, var(--muted) 1.8px, transparent 2.2px);
  background-size: 6px 6px;
  background-repeat: no-repeat space;
  background-position: center;
  opacity: 0.42;
}

.place {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: center;
  min-height: 3.4rem;
  padding-right: 3rem;
}

/* Scheidingslijn alleen onder de tekst, niet door de puntjes (zoals in de app). */
.place + .place::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2.6rem;
  right: 0;
  height: 1px;
  background: var(--line);
}

.mark {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  box-sizing: border-box;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
}

/* Van: altijd de blauwe stip (vertrekpunt), met witte rand en zachte ring. */
.mark-from,
.mark-from.is-me {
  width: 12px;
  height: 12px;
  background: #2f7de1;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 4px rgba(47, 125, 225, 0.22);
}

/* Naar: oranje rondje met de witte vlag, zoals in de app. */
.mark-to {
  width: 20px;
  height: 20px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(12 12) scale(.6) translate(-12 -12.5)'%3E%3Cpath d='M6 21V4' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath fill='%23fff' d='M6.5 4.2C9.1 2.8 11.1 5.4 13.7 4.3C15.3 3.6 16.5 3.4 18 3.9V12.1C16.5 11.6 15.3 11.8 13.7 12.5C11.1 13.6 9.1 11 6.5 12.4Z'/%3E%3C/g%3E%3C/svg%3E") center / 100% no-repeat;
}

.place input {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  min-height: 3.3rem;
  padding: 0.45rem 2.15rem 0.45rem 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 1.05rem;
  text-overflow: ellipsis;
}

.place input::placeholder {
  color: var(--muted);
}

.place input:focus-visible {
  outline: none;
}

.place:focus-within .mark {
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(255, 106, 0, 0.35);
}

.place:focus-within .mark-from {
  box-shadow: 0 0 0 4px rgba(47, 125, 225, 0.22), 0 0 0 6px rgba(255, 106, 0, 0.35);
}

.clear {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}

.clear[hidden] {
  display: none;
}

.clear:hover {
  color: var(--cream);
}

.swap {
  position: absolute;
  z-index: 2;
  right: 0.55rem;
  top: 3.4rem; /* op de lijn tussen Van en Naar */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--cream);
  transform: translateY(-50%);
  cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.2s, background-color 0.2s, color 0.2s;
}

.swap:hover {
  border-color: var(--muted);
}

.swap.is-turned {
  transform: translateY(-50%) rotate(180deg);
}

.loc {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: -0.35rem;
  padding: 0.15rem 0.1rem;
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.loc:hover {
  color: var(--cream);
}

/* Suggesties */
.suggest {
  position: absolute;
  z-index: 8;
  left: 0.45rem;
  right: 0.45rem;
  top: calc(100% - 0.15rem);
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  max-height: 19rem;
  overflow: auto;
  overscroll-behavior: contain;
  animation: pop-in 0.16s var(--ease);
}

.suggest[hidden] {
  display: none !important;
}

.suggest li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.6rem;
  color: var(--cream);
  cursor: default;
  user-select: none;
}

.suggest li:hover,
.suggest li.is-active {
  background: var(--surface-muted);
}

.suggest .s-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
}

.suggest .s-name,
.suggest .s-icon {
  cursor: inherit;
  user-select: none;
}

.suggest .s-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest .s-head {
  min-height: 0;
  padding: 0.35rem 0.65rem 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: default;
}

.suggest .s-head:hover {
  background: transparent;
}

.suggest .s-sub {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest .s-credit {
  min-height: 0;
  padding: 0.35rem 0.65rem 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.suggest .s-credit:hover {
  background: transparent;
}

.suggest .s-empty {
  min-height: 0;
  padding: 0.55rem 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: default;
}

.suggest .s-empty:hover {
  background: transparent;
}

.suggest .s-wipe {
  justify-content: center;
  min-height: 2.4rem;
  color: var(--link);
  font-size: 0.88rem;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Wanneer ---------- */

.block {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.block legend {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chips label {
  position: relative;
}

.chips input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chips span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.85rem;
  font-size: 0.93rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.chips .mode-ico {
  flex: none;
}

.chips input:focus-visible + span {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

/* ---------- Wanneer: derde regel van de routekaart ---------- */

.when-line {
  border-top: 1px solid var(--line);
}

.when-sum {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 3.2rem;
  padding: 0 0.55rem 0 0;
  border: 0;
  border-radius: 0 0 1rem 1rem;
  background: transparent;
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.when-sum:hover {
  background: var(--hover);
}

.when-sum:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: -2px;
}

.when-ico {
  justify-self: center;
  color: var(--muted);
}

.when-sum.is-set .when-ico {
  color: var(--accent-label);
}

.when-label {
  min-width: 0;
  overflow: hidden;
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.when-sum.is-set .when-label {
  font-weight: 700;
}

.when-sum .chev {
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}

.when-sum[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.when-edit {
  display: grid;
  gap: 0.55rem;
  padding: 0 0.75rem 0.8rem 2.6rem;
  animation: pop-in 0.18s var(--ease);
}

.when-edit[hidden] {
  display: none;
}

.when-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  justify-self: start;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.when-switch button {
  min-height: 2.3rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.when-switch button.is-on {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--cream);
  font-weight: 700;
}

.when-switch button:focus-visible,
.when-day select:focus-visible,
.when-time input:focus-visible,
.when-now:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.when-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.when-day {
  position: relative;
  display: flex;
  flex: 1 1 8rem;
  align-items: center;
  min-width: 0;
}

.when-day select,
.when-time input {
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--cream);
  font: inherit;
}

.when-day select {
  width: 100%;
  padding: 0 2rem 0 0.8rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.when-day select option {
  background: var(--surface);
  color: var(--cream);
}

.when-day svg {
  position: absolute;
  right: 0.7rem;
  color: var(--muted);
  pointer-events: none;
}

.when-time input {
  width: 7.2rem;
  padding: 0 0.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color-scheme: inherit;
}

.when-now {
  padding: 0.3rem 0.4rem;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.when-now[hidden] {
  display: none;
}

/* ---------- Reisopties (ingeklapt) ---------- */

.opts {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--cream);
}

.opts:has([aria-expanded="true"]) {
  border-radius: 1.15rem;
}

.opts-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.35rem 0.35rem 0.35rem 0.95rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  color: var(--cream);
  font: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.opts-toggle:hover {
  background: var(--hover);
}

.opts-toggle:focus {
  outline: none;
}

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

.opts-title {
  font-weight: 700;
}

.opts-sum {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opts-sum.is-set {
  color: var(--accent-label);
  font-weight: 650;
}

.chev {
  flex: none;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0.48rem;
  border-radius: 50%;
  background: var(--surface);
  color: var(--cream);
  box-sizing: border-box;
  transition: transform 0.25s var(--ease);
}

.opts-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.opts-body {
  display: grid;
  gap: 1.35rem;
  padding: 0.9rem 0.85rem 1.05rem;
  border-top: 1px solid var(--line);
  animation: pop-in 0.2s var(--ease);
}

.opts .block {
  gap: 1rem;
}

.opts-body[hidden] {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

/* Keuzes zoals in de app: gekozen = nachtblauw met witte tekst, uit = rustig grijs. Geen vinkjes. */
.chips span {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.chips span:hover {
  border-color: var(--muted);
  color: var(--cream);
}

.chips input:checked + span {
  border-color: var(--sel-bg, #1a4b8c);
  background: var(--sel-bg, #1a4b8c);
  color: #ffffff;
  font-weight: 700;
}

.chips input[type="checkbox"]:not(:checked) + span .mode-ico {
  opacity: 0.55;
}

/* ---------- Knop, status ---------- */

.plan-go {
  position: relative;
  overflow: hidden;
  width: 100%;
  gap: 0.5rem;
  color: #070d18;
  font-weight: 800;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .plan-go::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
    transform: translateX(-180%);
    pointer-events: none;
  }

  .plan-go:hover::after {
    transform: translateX(420%);
    transition: transform 0.7s var(--ease);
  }

  .plan-go:active {
    transform: translateY(1px) scale(0.985);
  }

  .plan-go:disabled::after {
    transform: translateX(-180%);
  }

  .plan-go:disabled:active {
    transform: none;
  }
}

.plan-go:disabled {
  opacity: 0.75;
  cursor: progress;
}

.plan-go .spin {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.8rem;
  background: var(--bg);
}

.status:empty {
  display: none;
}

.status.is-alert {
  color: var(--delay);
  background: rgba(229, 56, 59, 0.1);
}

.status.is-ok {
  color: var(--ok);
}

.fine {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

/* ---------- Resultaten ---------- */

.advice,
.results {
  min-width: 0;
}

.results {
  display: grid;
  gap: 0.75rem;
}

/* Nog geen reizen: de resultatenlijst neemt geen ruimte. Op een groot scherm blijft één rustige regel naast het formulier. */
.advice:has(> .results:empty) .results {
  display: none;
}

.plan-welcome {
  display: none;
  margin: 0;
  max-width: 16rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

@media (min-width: 960px) {
  .advice:has(> .results:empty) .plan-welcome {
    display: block;
    align-self: center;
    padding-left: 1.25rem;
  }
}

.advice-empty {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 2.2rem 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 1.1rem;
  color: var(--muted);
  text-align: center;
}

.advice-empty p {
  margin: 0;
  max-width: 24rem;
}

.advice-empty svg {
  color: var(--accent);
  opacity: 0.8;
}

.route-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.route-head h2 {
  min-width: 0;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.route-head p {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ok);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 163, 91, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(31, 163, 91, 0); }
}

.hint {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
  color: var(--muted);
}

/* Reiskaart */
.journey {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease);
  animation: card-in 0.35s var(--ease) both;
}

.journey:nth-child(3) { animation-delay: 0.04s; }
.journey:nth-child(4) { animation-delay: 0.08s; }
.journey:nth-child(5) { animation-delay: 0.12s; }
.journey:nth-child(6) { animation-delay: 0.16s; }
.journey:nth-child(7) { animation-delay: 0.2s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.journey:hover {
  border-color: var(--muted);
}

.journey.is-open {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.journey.is-gone {
  opacity: 0.6;
}

.journey-hit {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  padding: 0.95rem 1rem 0.9rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.journey-hit:hover {
  background: var(--hover);
}

.j-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.journey-times {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.t-day,
.t-dash {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0;
}

.t-was {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: line-through;
}

/* Zelfde badge als op de halte en in de app: klein, met de bovenkant gelijk aan de bovenkant van de
   cijfers van de kloktijd (zoals in de app). Op de letterlijn gezet en dan omhoog geschoven met de
   hoogte van de cijfers (Inter: 0,73 × 1,4rem) min de letterlijn in de badge (10 px). */
.delay-badge {
  align-self: baseline;
  position: relative;
  top: calc(10px - 1.02rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 13px;
  height: 13px;
  margin: 0 0 0 -0.25rem;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--delay);
  color: #fff;
  font: 700 10px/1 var(--font);
  font-variant-numeric: tabular-nums;
  /* Het cijfer precies in het midden: alleen de hoogte van de cijfers telt, niet de ruimte die het
     lettertype boven en onder reserveert (daardoor stond het een tikje uit het midden). */
  text-box: trim-both cap alphabetic;
}

.delay-badge.is-early {
  background: #1fa35b;
}

.j-dur {
  flex: none;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Doorlopende balk: ritten in lijnkleur, lopen gestippeld, naar verhouding van de tijd. */
/* Zoals LegTimeline in de app: één balk van 8 px, lopen grijs, wachten lichter, haarlijn tussen ritten. */
.legbar {
  /* Eén doorlopende balk op een bleke band, zoals in de app: lopen = stippen,
     wachten = schuine streepjes, rit = lijnkleur, met een dun naadje ertussen. */
  display: flex;
  height: 0.5rem;
  border-radius: 0.25rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
}

.legbar span {
  min-width: 0.3rem;
  background: var(--seg, var(--muted));
}

.legbar span + span {
  box-shadow: inset 2px 0 0 var(--surface);
}

.legbar .seg-walk {
  background: radial-gradient(circle, var(--muted) 1.6px, transparent 2px) left center / 6px 100% repeat-x;
}

.legbar span + .seg-walk {
  background-position: 3px center;
}

.legbar .seg-wait {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 65%, transparent) 0 1.6px, transparent 1.6px 5px);
}

.j-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.2rem;
}

.j-sep {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: var(--muted);
}

.walk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/*
 * Feiten met puntjes ertussen. Loopt de regel door, dan valt het puntje vooraan de nieuwe
 * regel buiten beeld (negatieve marge + overflow), zodat er nooit een los "·" begint.
 */
.journey-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0;
  margin: 0 0 0 -1rem;
  clip-path: inset(-0.5rem -0.5rem -0.5rem 1rem);
  color: var(--muted);
  font-size: 0.92rem;
}

.journey-facts > * {
  position: relative;
  padding-left: 1rem;
  white-space: nowrap;
}

/* Icoon + getal (overstappen, lopen), zelfde grijs als de tekst. */
.journey-facts .fact {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.journey-facts .fact svg {
  flex: none;
  width: 14px;
  height: 14px;
}

/* Tussen icoon-feiten geen puntje: alleen ruimte. */
.journey-facts > .fact::before {
  content: none;
}

.journey-facts > *::before {
  content: "·";
  position: absolute;
  left: 0.38rem;
  color: var(--muted);
  opacity: 0.6;
}

/* Onderste regel van een reisoptie: feiten links, labels rechts. */
/* Overstappen en lopen rechts; labels (melding, reserveren) links ervan. */
.journey-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.75rem;
}

.journey-foot > .tags {
  order: -1;
  margin-right: auto;
}

.journey-foot > .journey-facts {
  justify-content: flex-end;
  /* Iets kleiner en dikker: hoort bij de reislijn erboven (ballonnen zijn klein en vet). */
  font-size: 0.8rem;
  font-weight: 650;
}

/* Dicht onder de reislijn, niet als losse regel. */
.journey-hit > .journey-foot {
  margin-top: -0.35rem;
}

.leave-row {
  display: flex;
}

.leave-row[hidden] {
  display: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Labels zoals LabelPill in de app; status als gekleurde tekst (StatusText). */
.tag {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.14);
  color: var(--accent-label);
  font-size: 0.78rem;
  font-weight: 650;
}

.tag-late,
.tag-ok {
  padding-left: 0.1rem;
  padding-right: 0.1rem;
  background: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.tag-late {
  color: var(--delay);
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.9rem 0.2rem 0.35rem;
  color: var(--accent-label);
  font-size: 0.8rem;
  font-weight: 700;
}

.day-divider::before,
.day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tag-tight {
  color: var(--warn);
  white-space: nowrap;
}

.tag-ok {
  color: var(--ok);
}

/* Lijnbadge zoals in de app: verloop licht → donker, dun randje. */
.lb {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.4rem;
  min-height: 1.9rem;
  padding: 0.36rem 0.72rem;
  border: 1.25px solid var(--badge-edge);
  border-radius: 0.42rem;
  background: var(--surface-muted);
  color: var(--cream);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

/* Tijdlijn: blokje zo hoog als de richting ernaast. Het voertuig staat rechts in het ritvak. */
.step-head .lb {
  min-width: 0;
  min-height: 0;
  padding: 0.1rem 0.42rem;
}

/* Uitklappen: vloeiend via grid-rijen. */
.journey-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--ease);
}

.journey.is-open .journey-more {
  grid-template-rows: 1fr;
}

.journey-more > .inner {
  min-height: 0;
  overflow: hidden;
}

.journey-map {
  position: relative;
  height: 14rem;
  margin: 0 0.75rem;
  border-radius: 0.85rem;
  background: var(--bg);
  overflow: hidden;
}

.journey-map .map-canvas {
  position: absolute;
  inset: 0;
}

.journey-map .map-wait {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg) 25%, var(--surface-muted) 45%, var(--bg) 65%);
  background-size: 220% 100%;
  animation: plan-shimmer 1.15s linear infinite;
}

.journey-map .maplibregl-ctrl-attrib,
.journey-map .maplibregl-ctrl-logo {
  display: none;
}

.journey-map .osm-credit {
  position: absolute;
  z-index: 3;
  left: 0.4rem;
  bottom: 0.35rem;
  margin: 0;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(18, 26, 43, 0.94);
  color: #f2f5fa;
  cursor: pointer;
  font: 600 11px/1.2 "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
}

.journey-map .osm-credit.is-light-map {
  border-color: rgba(11, 31, 58, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: #0b1f3a;
}

.journey-map .osm-credit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.journey-map .osm-pop {
  position: absolute;
  z-index: 4;
  left: 0.35rem;
  bottom: 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 11rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.journey-map .osm-pop[hidden] {
  display: none;
}

.journey-map .osm-pop a {
  color: var(--cream);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.journey-map .osm-pop a:hover {
  text-decoration: underline;
}

/* Tijdlijn. --rail-track en --rail-gap bepalen ook waar de tussenhaltestippen op de lijn vallen. */
.timeline {
  --rail-track: 1.35rem;
  --rail-gap: 0.4rem;
  margin: 0;
  padding: 1rem 1rem 0.4rem;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: 3.3rem var(--rail-track) minmax(0, 1fr);
  column-gap: var(--rail-gap);
}

.step-time {
  position: relative;
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

/* Doorgestreepte geplande tijd onder de echte tijd, zonder de regel hoger te maken:
   anders zakt alles eronder (zoals het overstapvak) een stuk omlaag. */
.step-time s {
  position: absolute;
  top: 100%;
  right: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.step-time .late {
  color: var(--delay);
}

/* Overstap op dezelfde halte: de vertrektijd klein onder de aankomsttijd (zoals de geplande tijd),
   zonder de regel hoger te maken. */
.step-time .dep {
  position: absolute;
  top: 100%;
  right: 0;
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.step-time .dep.below-s {
  top: calc(100% + 0.95rem);
}

/* "Overstap 2 min" onder de haltenaam, alleen gekleurde tekst in de kleur van de speling. */
.step-xfer {
  margin: 0.1rem 0 0;
  color: var(--ok);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.step-xfer.is-tight {
  color: var(--urgent);
}

.step-xfer.is-miss {
  color: var(--urgent-late);
}

.rail {
  position: relative;
  --dot: 0.68rem; /* midden van het bolletje */
}

/*
 * Rails zonder afgeronde uiteinden, zodat stukken naadloos op elkaar aansluiten. Lopen = ronde
 * puntjes op vaste afstand; --y (afstand tot de bovenkant van de tijdlijn, door JS gezet) laat
 * het patroon over alle regels heen doorlopen, zodat de puntjes overal gelijk staan.
 */
.rail::before,
.step.stop .rail::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 5px; /* zoals in de app */
  transform: translateX(-50%);
}

.rail::before {
  top: 0;
  bottom: 0;
  background: var(--rail, var(--line));
}

/* Halte: boven het bolletje het aankomende stuk, eronder het vertrekkende. Niets = geen lijn. */
.step.stop .rail::before {
  bottom: auto;
  height: var(--dot);
  background: var(--in, var(--line));
}

.step.stop .rail::after {
  top: var(--dot);
  bottom: 0;
  background: var(--out, var(--line));
}

.step.stop .rail.in-none::before,
.step.stop .rail.out-none::after {
  display: none;
}

.step.walk .rail::before,
.step.stop .rail.in-walk::before,
.step.stop .rail.out-walk::after {
  width: 6px;
  /* Lopen: ronde puntjes van 4px om de 7px, gedempt grijs (zoals in de app). */
  background: radial-gradient(circle, color-mix(in srgb, var(--muted) 60%, transparent) 2px, transparent 2.4px) center 0 / 6px 7px repeat-y;
  background-position-y: calc(0px - var(--y, 0px));
}

.step.stop .rail.out-walk::after {
  background-position-y: calc(0px - var(--y, 0px) - var(--dot));
}

.rail i {
  /* Halte: open ring van 12px met een rand van 3px in de lijnkleur, zoals in de app. */
  position: absolute;
  z-index: 1;
  top: calc(var(--dot) - 6px);
  left: 50%;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--rail, var(--muted));
  transform: translateX(-50%);
}

.step.is-end .rail i {
  /* Eindpunt: oranje rondje met een witte vlag, zoals in de app en op de deelpagina. */
  top: calc(var(--dot) - 11px);
  width: 22px;
  height: 22px;
  border: 0;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(12 12) scale(.6) translate(-12 -12.5)'%3E%3Cpath d='M6 21V4' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath fill='%23fff' d='M6.5 4.2C9.1 2.8 11.1 5.4 13.7 4.3C15.3 3.6 16.5 3.4 18 3.9V12.1C16.5 11.6 15.3 11.8 13.7 12.5C11.1 13.6 9.1 11 6.5 12.4Z'/%3E%3C/g%3E%3C/svg%3E") center / 100% no-repeat;
  box-shadow: 0 0 0 3px var(--surface);
}

/* Vertrek vanaf je eigen locatie: blauwe stip. */
.step.is-me .rail i {
  /* Blauwe stip met witte rand en zachte ring, zoals in de app. */
  background: #2f7de1;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 4px rgba(47, 125, 225, 0.22);
}

.xchip {
  /* Altijd op een eigen regel onder "2 min lopen", nooit ernaast. */
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 13%, transparent);
}

.xchip strong,
.xchip span {
  display: block;
}

/* Lopen in het overstapblok: poppetje en tekst neutraal, alleen het wachten heeft de kleur. */
.xchip .xchip-walk {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--cream);
  font-weight: 500;
}

.xchip .xchip-walk svg {
  flex: none;
  color: var(--muted);
}

/* Het wachten onder de looptekst, niet onder het poppetje (15 px icoon + tussenruimte). */
.xchip.has-walk strong {
  padding-left: calc(15px + 0.35rem);
}

.xchip strong {
  font-weight: 700;
}

.xchip.is-tight {
  color: var(--urgent);
  background: color-mix(in srgb, var(--urgent) 14%, transparent);
}

.xchip.is-miss {
  color: var(--urgent-late);
  background: color-mix(in srgb, var(--urgent-late) 13%, transparent);
}

.step-body {
  min-width: 0;
  padding: 0 0 0.2rem;
}

.step.link .step-body {
  padding: 0.25rem 0 0.95rem;
}

.link-text {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Begin- en eindstuk lopen: zelfde vakje als een overstap, zonder wachtkleur. */
.walk-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.3rem 0.6rem;
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.walk-box svg {
  flex: none;
  color: var(--muted);
}

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

.step-town {
  margin: 0.05rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

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

.step-town-in {
  color: var(--muted);
  font-weight: 400;
}

.step-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

.step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

/* Rit: badge, richting en tussenhaltes in een lichte tint van de lijn, tegen de verticale lijn. */
.ride-card {
  --ride-wash: color-mix(in srgb, var(--ride, var(--ns-blue)) 22%, var(--surface));
  --ride-ink: color-mix(in srgb, var(--ride, var(--ns-blue)) 48%, #fff);
  --card-pull: -0.9rem;
  --card-pad: 0.85rem;
  position: relative;
  z-index: 0;
  margin: 0.05rem 0 0 var(--card-pull);
  padding: 0.42rem 0.7rem 0.42rem var(--card-pad);
  border-radius: 0.2rem 0.7rem 0.7rem 0.2rem;
  background: var(--ride-wash);
}

.ride-card > :not(.ride-mark) {
  position: relative;
  z-index: 1;
}

.ride-mark {
  position: absolute;
  z-index: 0;
  top: 0.2rem;
  right: 0.15rem;
  width: 42px;
  height: 42px;
  color: var(--ride-ink);
  opacity: 0.42;
  pointer-events: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .ride-card {
    --ride-wash: color-mix(in srgb, var(--ride, var(--ns-blue)) 12%, var(--surface));
    --ride-ink: var(--ride, var(--ns-blue));
  }

  :root:not([data-theme="dark"]) .ride-mark {
    opacity: 0.22;
  }
}

:root[data-theme="light"] .ride-card {
  --ride-wash: color-mix(in srgb, var(--ride, var(--ns-blue)) 12%, var(--surface));
  --ride-ink: var(--ride, var(--ns-blue));
}

:root[data-theme="light"] .ride-mark {
  opacity: 0.22;
}

.step-dest {
  font-weight: 500;
}

/* Ritvak: lijnblokje op de eerste regel van de richting (zelfde bovenlijn bij één of twee regels),
   richting strakker en hooguit twee regels, daarna … */
.ride-card .step-head {
  flex-wrap: nowrap;
  align-items: baseline;
}

.ride-card .step-head .lb {
  flex: none;
}

.ride-card .step-dest {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ride-card .step-head .tag {
  flex: none;
}

.step-dir {
  color: var(--muted);
}

.was {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: line-through;
}

/* Perron: rondje. Spoor: vierkantje in NS-blauw, zoals in de app. */
.pf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border: 1px solid var(--cream);
  border-radius: 999px;
  background: var(--bg);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.25rem;
  border: 1.5px solid var(--ns-blue);
  border-radius: 0.25rem;
  background: #ffffff;
  color: var(--ns-blue);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* Belgisch klein spoorkader (geen „Spoor”-tekst; zelfde als app TrackSquare). */
.track.is-be:not(.is-old) {
  border-color: #ffffff;
  border-radius: 6px;
  background: #003366;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .track.is-be:not(.is-old) {
    outline: 1px solid #3b6998;
    outline-offset: 0;
  }
}
:root[data-theme="dark"] .track.is-be:not(.is-old) {
  outline: 1px solid #3b6998;
  outline-offset: 0;
}

/* Oud spoor/perron bij een wijziging: rood, met een rode schuine streep erdoor. */
.track.is-old,
.pf.is-old {
  position: relative;
  overflow: hidden;
  border-color: var(--delay);
  background: transparent;
  color: var(--delay);
}

.track.is-old::after,
.pf.is-old::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 0.75px), var(--delay) calc(50% - 0.75px), var(--delay) calc(50% + 0.75px), transparent calc(50% + 0.75px));
}

.stops {
  margin-top: 0.45rem;
}

.step-head + .stops,
.step-head + .ride-min {
  margin-top: 0.12rem;
}

.stops summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  padding: 0.15rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
  cursor: pointer;
}

.stops summary::-webkit-details-marker {
  display: none;
}

.stops summary:hover {
  color: var(--cream);
}

.stops-chev {
  transition: transform 0.2s var(--ease);
}

.stops[open] .stops-chev {
  transform: rotate(180deg);
}

.ride-min {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.via {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.via li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #a8b0c0;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.25;
}

/* Tussenhalte: gevulde stip op de lijn. Iets breder dan de 5px-lijn, anders valt hij erin weg. */
.via li::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(-1 * (var(--rail-gap) + var(--rail-track) / 2) - var(--card-pull) - var(--card-pad));
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--dot, var(--muted));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.via li + li {
  margin-top: 12px;
}

/* Kloktijden in de reisplanner overal even breed (tabular cijfers), zoals in de app en op de deelpagina. */
main.plan,
.print-me {
  font-variant-numeric: tabular-nums;
}

.via-time {
  flex: none;
  color: color-mix(in srgb, var(--dot, var(--cream)) 50%, #fff);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.25;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .via li {
    color: #4a5568;
  }

  :root:not([data-theme="dark"]) .via-time {
    color: color-mix(in srgb, var(--dot, #0b1f3a) 80%, #142033);
  }
}

:root[data-theme="light"] .via li {
  color: #4a5568;
}

:root[data-theme="light"] .via-time {
  color: color-mix(in srgb, var(--dot, #0b1f3a) 80%, #142033);
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 1rem 1rem;
}

.timeline-actions .button {
  flex: 1 1 10rem;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
}

.button-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
}

.button-ghost:hover {
  background: var(--surface-muted);
  color: var(--cream);
  filter: none;
}

.button-ghost:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Eerder / later */
.more-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.more-times .button {
  min-height: 2.75rem;
  gap: 0.35rem;
}

/* Laden */
.skeleton {
  height: 7.4rem;
  border-radius: 1.1rem;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-muted) 45%, var(--surface) 65%);
  background-size: 220% 100%;
  animation: plan-shimmer 1.15s linear infinite;
}

.skeleton:nth-child(2) { animation-delay: 0.1s; }
.skeleton:nth-child(3) { animation-delay: 0.2s; }

@keyframes plan-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .journey-map .map-wait,
  .live-dot,
  .plan-go .spin {
    animation: none;
  }

  .journey,
  .suggest,
  .when-at,
  .opts-body {
    animation: none;
  }

  .journey-more,
  .swap,
  .chev {
    transition: none;
  }
}

/* ---------- Groot scherm ---------- */

@media (min-width: 960px) {
  .planner-layout {
    grid-template-columns: minmax(22rem, 26rem) minmax(0, 1fr);
  }

  .plan-side {
    position: sticky;
    top: 5.2rem;
  }

  .plan-summary {
    display: none !important;
  }

  .plan-side.is-collapsed .plan-form {
    display: grid;
  }

  .journey-map {
    height: 17rem;
  }
}

/* ---------- Telefoon ---------- */

@media (max-width: 959px) {
  .plan .wrap,
  .plan {
    padding-top: 1.5rem;
  }

  .plan-side.is-collapsed .plan-summary {
    position: sticky;
    z-index: 10;
    top: 4.2rem;
  }
}

@media (max-width: 420px) {
  .plan-form {
    padding: 0.75rem;
  }

  .journey-times {
    font-size: 1.25rem;
  }

  .timeline {
    --rail-track: 1.2rem;
    padding-left: 0.6rem;
    padding-right: 0.75rem;
  }

  .step {
    grid-template-columns: 3rem var(--rail-track) minmax(0, 1fr);
  }
}

/* ---------- Recente reizen (lege staat) ---------- */

.recent-trips {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  animation: card-in 0.3s var(--ease) both;
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.15rem 0.55rem;
}

.recent-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.recent-wipe {
  padding: 0.25rem 0.4rem;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.recent-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-trip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--bg);
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s;
}

.recent-trip:hover {
  border-color: var(--muted);
}

.recent-trip .s-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
}

.recent-trip > svg {
  flex: none;
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .recent-trip > svg {
    transition: transform 0.22s var(--ease);
  }

  .recent-trip:hover > svg {
    transform: translateX(4px);
  }
}

.recent-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.recent-from,
.recent-to {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-from {
  font-weight: 700;
}

.recent-to {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Telefoon: na het zoeken staat "Van → Naar" al in de samenvattingsbalk. */
@media (max-width: 959px) {
  .plan-side.is-collapsed ~ .advice .route-head {
    display: none;
  }
}

/*
 * Leesbaarheid. Segoe UI heeft 400, 600 en 700; zwaarder (750/800) en strak op elkaar
 * gezette letters zagen er op Windows scherp en afgekapt uit.
 */
.plan-page {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.plan-page h1,
.plan-page h2 {
  letter-spacing: -0.015em;
}

/* Vervoer op aanvraag: reserveren nodig (zoals 9292). */
.booking-note {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.6rem;
  background: rgba(255, 138, 0, 0.12);
  font-size: 0.85rem;
}

.booking-note strong {
  color: var(--warn, #ff8a00);
}

.booking-note span {
  color: var(--muted);
}

.tag.tag-book {
  background: rgba(255, 138, 0, 0.14);
  color: var(--warn, #ff8a00);
}

/* Label boven een reisoptie: "★ Beste keuze · geen overstap · 6 min minder lopen", of "Snelst". */
.j-pick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.4rem;
  margin: -0.1rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.j-pick strong {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.j-pick.is-best {
  color: var(--accent-label);
}

.j-pick.is-best svg {
  flex: none;
  fill: currentColor;
}

.j-pick .j-why {
  color: var(--muted);
  font-weight: 500;
}

.j-pick .j-why::before {
  content: "·";
  margin-right: 0.4rem;
}

/* Meldingen van vervoerders en NS bij een rit: label op de reisoptie, uitklapbaar in de stappen. */
.tag.tag-alert {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 138, 0, 0.14);
  color: var(--warn, #ff8a00);
}

.alert-note {
  margin-top: 0.45rem;
  border-radius: 0.6rem;
  background: rgba(255, 138, 0, 0.12);
  font-size: 0.85rem;
}

.alert-note summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  color: var(--warn, #ff8a00);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.alert-note summary::-webkit-details-marker {
  display: none;
}

.alert-note summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-note .alert-chev {
  flex: none;
  margin-left: auto;
  transition: transform 0.2s var(--ease);
}

.alert-note[open] .alert-chev {
  transform: rotate(180deg);
}

.alert-note .alert-text {
  margin: 0;
  padding: 0 0.65rem 0.3rem;
  color: var(--cream);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.alert-note .alert-meta {
  margin: 0;
  padding: 0 0.65rem 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Delen: bevestiging op de knop zelf. */
.timeline-actions .button.is-done {
  border-color: var(--ok);
  color: var(--ok);
}

.timeline-actions .button.is-fail {
  border-color: var(--delay);
  color: var(--delay);
}

/* ---------- Afdrukken: één reis op A4 ---------- */

.print-head,
.print-foot {
  display: none;
}

/* ---------- Voorpagina: de app onder de planner ---------- */

.promo {
  margin-top: clamp(1.35rem, 3vw, 2.15rem);
  padding-top: clamp(1.15rem, 2.6vw, 1.7rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 5rem;
}

.promo-head {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
}

.promo-kicker {
  margin: 0;
  color: var(--accent-label);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.promo-head h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.promo-lead {
  margin: 0.8rem auto 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.promo-badge {
  margin: 1.4rem 0 0;
}

.promo-badge .badge img {
  height: 3.6rem;
  margin: 0 auto;
}

.promo .actions {
  text-align: center;
}

.promo-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.9rem;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}

.promo-points li {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: 1.2rem 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.promo-points svg {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0.48rem;
  box-sizing: content-box;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 0.7rem;
  background: var(--accent-soft);
  color: var(--accent-label);
}

@media (hover: hover) and (pointer: fine) {
  .promo-points li {
    transition: border-color 0.2s ease, background-color 0.2s ease;
  }

  .promo-points li:hover {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
    background: color-mix(in srgb, var(--surface) 94%, var(--accent));
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.js .promo-points.reveal.is-in li {
    animation: card-in 0.5s var(--ease) both;
  }

  html.js .promo-points.reveal.is-in li:nth-child(2) { animation-delay: 0.06s; }
  html.js .promo-points.reveal.is-in li:nth-child(3) { animation-delay: 0.12s; }
  html.js .promo-points.reveal.is-in li:nth-child(4) { animation-delay: 0.18s; }
}

.promo-points strong {
  margin-top: 0.25rem;
  font-size: 1.02rem;
}

.promo-points span {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.promo .wear {
  position: relative;
  isolation: isolate;
  margin-top: clamp(2rem, 5vw, 3.2rem);
}

.promo .wear::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 10%;
  right: 10%;
  top: 8%;
  bottom: 0;
  background: radial-gradient(ellipse at center, var(--wear-glow), transparent 70%);
  pointer-events: none;
}

@media print {
  @page {
    size: A4;
    margin: 14mm 14mm 16mm;
  }

  :root,
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-muted: #eef0f4;
    --line: #d0d4dc;
    --cream: #0b1f3a;
    --muted: #5c6678;
    --caption: #3d4659;
    --link: #0b1f3a;
    --accent-label: #c65300;
    --urgent: #c65300;
    --urgent-late: #c01028;
    --ok: #15803d;
    --warn: #b35f00;
    --badge-edge: rgba(0, 0, 0, 0.18);
    --hairline: #ffffff;
    --planner-glow: transparent;
    --wear-glow: transparent;
  }

  html,
  body {
    background: #ffffff !important;
    color: #0b1f3a;
    font-size: 10.5pt;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    animation: none !important;
    transition: none !important;
  }

  body.printing .skip,
  body.printing .plan-intro,
  body.printing .plan-welcome,
  body.printing .day-divider,
  body.printing .promo,
  body.printing .site-header,
  body.printing .site-footer,
  body.printing .plan-side,
  body.printing .route-head,
  body.printing .hint,
  body.printing .more-times,
  body.printing .journey:not(.print-me),
  body.printing .print-me .journey-hit,
  body.printing .print-me .journey-map,
  body.printing .print-me .timeline-actions,
  body.printing .stops-chev {
    display: none !important;
  }

  body.printing .wrap {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Alles op papier als gewone blokken: in een grid knipt Chrome regels bij een pagina-einde door. */
  body.printing .planner-layout,
  body.printing .advice,
  body.printing .results,
  body.printing .print-me .timeline,
  body.printing .print-me .step-body,
  body.printing .print-me .stops,
  body.printing .print-me .via {
    display: block;
  }

  body.printing .planner-layout {
    margin: 0;
  }

  body.printing .print-me .via li + li {
    margin-top: 0.2rem;
  }

  body.printing .journey {
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }

  body.printing .journey-more {
    display: block;
  }

  body.printing .journey-more > .inner {
    overflow: visible;
  }

  /* Kop: logo | route en lijnen | datum, tijden en feiten rechts. */
  .print-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 4.5mm;
    align-items: center;
    padding-bottom: 3.5mm;
    margin-bottom: 4mm;
    border-bottom: 2px solid #ff6a00;
  }

  .print-logo {
    width: 16mm;
    height: 16mm;
    border-radius: 22%;
  }

  .print-text {
    display: grid;
    gap: 1.6mm;
    min-width: 0;
  }

  .print-kicker {
    margin: 0;
    color: #c65300;
    font-size: 7.5pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-route {
    display: grid;
    gap: 1.4mm;
    margin: 0;
    font-size: 13pt;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .print-route span {
    position: relative;
    padding-left: 6mm;
  }

  /* Bolletje: vertrek open (zoals in de tijdlijn), bestemming oranje. */
  .print-route span::before {
    content: "";
    position: absolute;
    top: 0.28em;
    left: 0;
    width: 3.4mm;
    height: 3.4mm;
    box-sizing: border-box;
    border: 0.75mm solid #5c6678;
    border-radius: 50%;
    background: #ffffff;
  }

  .print-route .pr-to::before {
    border-color: #ff6a00;
    background: #ff6a00;
  }

  /* Streep van het ene bolletje naar het andere. */
  .print-route .pr-from::after {
    content: "";
    position: absolute;
    top: calc(0.28em + 3.4mm);
    bottom: calc(-1.4mm - 0.28em);
    left: 1.35mm;
    width: 0.7mm;
    background: #c3c8d2;
  }

  .print-lines .lb {
    min-height: 1.4rem;
    padding: 0.18rem 0.48rem;
    font-size: 0.78rem;
  }

  .print-when {
    display: grid;
    gap: 0.6mm;
    justify-items: end;
    padding-left: 4.5mm;
    border-left: 1px solid #d0d4dc;
    text-align: right;
  }

  .print-when p {
    margin: 0;
    white-space: nowrap;
  }

  .print-date {
    color: #5c6678;
    font-size: 8.5pt;
    font-weight: 600;
  }

  .print-date::first-letter {
    text-transform: uppercase;
  }

  .print-times {
    font-size: 17pt;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }

  .print-facts {
    color: #5c6678;
    font-size: 8.5pt;
  }

  .print-warn {
    grid-column: 1 / -1;
    margin: 3mm 0 0;
    padding: 2mm 3mm;
    border-radius: 2mm;
    background: #fff1e0;
    color: #b35f00;
    font-size: 10pt;
    font-weight: 600;
  }

  .print-me .timeline {
    padding: 0;
  }

  /* Geen pagina-einde tussen een halte en de rit of het lopen dat erna komt, en niet midden in een regel. */
  .print-me .step,
  .print-me .via li,
  .print-me .step-head {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-me .step.stop,
  .print-me .step-head,
  .print-me .stops summary {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Een rit (instappen t/m uitstappen en lopen erna) als geheel: een pagina eindigt bij een overstap. */
  .print-me .print-group {
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-me .step.link {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Tussenhaltes compact als doorlopende tekst: "16:29 Ruigoord Dorp · 16:30 Oceaangroep · …". */
  body.printing .print-me .via {
    margin-top: 0.15rem;
    font-size: 8.5pt;
    line-height: 1.45;
  }

  body.printing .print-me .via li {
    display: inline;
    font-size: inherit;
  }

  body.printing .print-me .via li + li {
    margin-top: 0;
  }

  body.printing .print-me .via li::before {
    content: none;
  }

  body.printing .print-me .via li + li::before {
    content: " · ";
    position: static;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    border: 0;
    background: none;
    transform: none;
    color: var(--muted);
  }

  body.printing .print-me .via-time {
    margin-right: 0.25em;
  }

  /*
   * Op papier geen grid per regel: Chrome knipt een grid-regel bij een pagina-einde gewoon door
   * (half lijnbadge). Als gewone blokken met tijd en lijn absoluut ernaast werken de regels
   * hierboven (niet afbreken in een halte, de kop of een tussenhalte) wel.
   */
  body.printing .print-me .step {
    display: block;
    position: relative;
    padding-left: 5.45rem;
  }

  body.printing .print-me .step-time {
    position: absolute;
    top: 0;
    left: 0;
    width: 3.3rem;
  }

  body.printing .print-me .rail {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3.7rem;
    width: 1.35rem;
  }

  body.printing .print-me .step.stop {
    min-height: 1.6rem;
  }

  /* Compacter: plaats achter de haltenaam in plaats van eronder, en minder ruimte na lopen. */
  body.printing .print-me .step-place {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.45rem;
  }

  body.printing .print-me .step-town {
    margin: 0;
    font-size: 9pt;
  }

  body.printing .print-me .step.link .step-body {
    padding: 0.15rem 0 0.6rem;
  }

  body.printing .print-me .stops {
    margin-top: 0.3rem;
  }

  body.printing .print-me .step-head + .stops,
  body.printing .print-me .step-head + .ride-min {
    margin-top: 0.25rem;
  }

  body.printing .print-me .ride-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-me .booking-note {
    background: #fff1e0;
  }

  /* Afdrukken: meldingen altijd open. */
  .alert-note {
    background: #fff1e0;
  }

  .alert-note .alert-text,
  .alert-note .alert-meta {
    display: block;
  }

  /* Voet: herkomst en "tijden kunnen wijzigen". */
  .print-foot {
    display: grid;
    gap: 1mm;
    margin-top: 6mm;
    padding-top: 3mm;
    border-top: 1px solid #d0d4dc;
    color: #5c6678;
    font-size: 8.5pt;
    break-inside: avoid;
  }

  .print-foot span:first-child {
    color: #0b1f3a;
    font-weight: 700;
  }
}

/* Reislijn als metrokaart: lijnnummers boven, ritten op de lijn, lopen/wachten eronder. */
.mbar { position: relative; display: block; width: 100%; height: 48px; margin: 2px 0 0; }
.mbar.has-bot { height: 70px; }
.mbar .mb-top, .mbar .mb-line, .mbar .mb-bot { position: absolute; left: 0; right: 0; }
.mbar .mb-top { top: 1px; height: 20px; } /* lijnnummer sluit aan op zijn pijltje (21-25 px), 3 px boven de balk */
.mbar .mb-line { top: 32px; height: 0; }
.mbar .mb-bot { top: 43px; height: 22px; } /* pijltje 3 px onder de balk, net als boven */
/* width: max-content: een ballon vlak bij de rechterrand mag niet krimpen tot de ruimte rechts van
   zijn left (absolute positie); anders viel de achtergrond van de laatste ballon te vroeg af. */
.mbar .mb-badge { position: absolute; top: 0; height: 20px; width: max-content; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px;
  padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 800; line-height: 1; white-space: nowrap; }
.mbar .mb-ico { width: 13px; height: 13px; flex: none; fill: currentColor; }
.mbar .mb-base { position: absolute; top: -1px; height: 2px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.mbar .mb-rail { position: absolute; top: -4px; height: 8px; border-radius: 4px; }
.mbar .mb-rail.is-x { opacity: 0.35; }
.mbar .mb-ring { position: absolute; top: -6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; box-sizing: border-box;
  background: var(--mb-ring-bg, var(--surface)); border: 2.5px solid var(--mb-ring, var(--cream)); z-index: 1; }
.mbar .mb-me { position: absolute; top: -7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; box-sizing: border-box;
  background: #2f7de1; border: 2.5px solid #fff; box-shadow: 0 0 0 3px rgba(47, 125, 225, 0.25); z-index: 2; }
.mbar .mb-flag { position: absolute; top: -9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #ff6a00;
  display: flex; align-items: center; justify-content: center; z-index: 2; }
.mbar .mb-flag { background: #ff6a00 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(12 12) scale(.6) translate(-12 -12.5)'%3E%3Cpath d='M6 21V4' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath fill='%23fff' d='M6.5 4.2C9.1 2.8 11.1 5.4 13.7 4.3C15.3 3.6 16.5 3.4 18 3.9V12.1C16.5 11.6 15.3 11.8 13.7 12.5C11.1 13.6 9.1 11 6.5 12.4Z'/%3E%3C/g%3E%3C/svg%3E") center / 100% no-repeat; }
.mbar .mb-flag svg { display: none; }
.mbar .mb-lab { position: absolute; top: 0; width: max-content; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 2px 6px; border-radius: 7px; font-size: 11px; font-weight: 800; line-height: 16px; font-variant-numeric: tabular-nums;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 15%, var(--mb-ring-bg, var(--surface))); }
/* Pijltjes: onder het lijnnummer omlaag, boven het kaartje omhoog, naar het midden van het eigen stuk. */
.mbar .mb-caret-u { position: absolute; top: -4px; width: 0; height: 0; margin-left: -4px; border: 4px solid transparent; border-top: 0;
  border-bottom-color: color-mix(in srgb, var(--muted) 15%, var(--mb-ring-bg, var(--surface))); }
.mbar .mb-lab.is-tight { color: var(--urgent); background: color-mix(in srgb, var(--urgent) 16%, var(--mb-ring-bg, var(--surface))); }
.mbar .mb-lab.is-miss { color: var(--urgent-late); background: color-mix(in srgb, var(--urgent-late) 16%, var(--mb-ring-bg, var(--surface))); }
.mbar .mb-caret-u.is-tight { border-bottom-color: color-mix(in srgb, var(--urgent) 16%, var(--mb-ring-bg, var(--surface))); }
.mbar .mb-caret-u.is-miss { border-bottom-color: color-mix(in srgb, var(--urgent-late) 16%, var(--mb-ring-bg, var(--surface))); }
.mbar .mb-caret-d { position: absolute; top: -11px; width: 0; height: 0; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; }
/* Lopen en wachten: één grijze pil, lopen iets donkerder. */
.mbar .mb-pill { position: absolute; top: -4px; height: 8px; border-radius: 4px; overflow: hidden;
  /* Wachten: fijne rechte streepjes, subtiel. */
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--muted) 30%, var(--mb-ring-bg, var(--surface))) 0 1px,
    color-mix(in srgb, var(--muted) 17%, var(--mb-ring-bg, var(--surface))) 1px 4px); }
/* Lopen: schuine streepjes, even dun en licht als die van wachten. */
.mbar .mb-pw { position: absolute; left: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 30%, var(--mb-ring-bg, var(--surface))) 0 1px,
    color-mix(in srgb, var(--muted) 17%, var(--mb-ring-bg, var(--surface))) 1px 4px); }
.mbar .mb-lab span { display: inline-flex; align-items: center; gap: 2px; }
.mbar .mb-lab .mb-ico { width: 12px; height: 12px; }

/* ---------- Haltes bij de planner (zolang er geen reizen zijn) ---------- */

.plan-haltes {
  display: none;
}

.advice:has(> .results:empty) .plan-haltes {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
}

.plan-haltes h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.plan-haltes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.plan-haltes .promo-kicker {
  color: var(--accent-label);
  line-height: 1.2;
}

/* Op een telefoon blijft het kort: kop, zoekveld en plaatsen. */
.plan-haltes > p:not(.promo-kicker) {
  display: none;
}

.plan-towns[hidden] { display: none; }
.plan-towns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.plan-towns a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.plan-towns a:hover,
.plan-towns a:focus-visible {
  border-color: var(--accent-label);
}

@media (min-width: 960px) {
  .advice:has(> .results:empty) .plan-welcome {
    display: none;
  }

  .advice:has(> .results:empty) .plan-haltes {
    gap: 0.75rem;
    padding: 1.5rem 1.6rem;
  }

  /* Zolang er geen reisadvies is en de tijdlade dicht is: planner en haltesblok even hoog (de hoogste bepaalt), inhoud bovenaan. */
  .planner-layout:has(> .advice > .results:empty):not(:has(#plan-drawer:not([hidden]))) {
    align-items: stretch;
  }

  .planner-layout:has(> .advice > .results:empty) > .plan-side {
    display: flex;
    flex-direction: column;
  }

  .planner-layout:has(> .advice > .results:empty) .plan-form {
    flex: 1 0 auto;
    align-content: start;
  }

  .advice:has(> .results:empty) .plan-haltes {
    height: 100%;
    align-content: start;
  }

  .plan-haltes h2 {
    font-size: 1.35rem;
  }

  .plan-haltes > p:not(.promo-kicker) {
    display: block;
  }
}

/* ---------- App-stijl (zoals "Plannen" in de app) ---------- */

.plan-form {
  gap: 0.8rem;
  padding: 0.7rem;
  border-radius: 1.5rem;
  container-type: inline-size;
}

.places {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.place {
  grid-template-rows: auto auto;
  align-content: center;
  min-height: 4.2rem;
  padding: 0.55rem 3rem 0.5rem 0;
}

.place + .place::before {
  left: 2.6rem;
}

.place .mark {
  grid-row: 1 / span 2;
  align-self: center;
}

.plab {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
}

.place input {
  grid-row: 2;
  min-height: 0;
  padding: 0.1rem 2.8rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.place input::placeholder {
  color: var(--muted);
  font-weight: 650;
  opacity: 0.85;
}

.places::before {
  top: calc(2.1rem + 14px);
  height: calc(4.2rem - 28px);
}

.swap {
  top: 4.2rem;
  right: 0.35rem;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--cream) 22%, var(--line));
  border-radius: 50%;
  background: var(--bg);
  color: var(--cream);
  box-shadow: 0 0 0 3px var(--surface);
}

.swap:hover {
  border-color: color-mix(in srgb, var(--cream) 42%, var(--line));
  background: color-mix(in srgb, var(--cream) 8%, var(--bg));
  color: var(--cream);
}

.swap:active {
  transform: translateY(-50%) scale(0.94);
}

.swap.is-turned:active {
  transform: translateY(-50%) rotate(180deg) scale(0.94);
}

.here {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 0.4rem 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.place .clear {
  position: relative;
  top: auto;
  right: auto;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  z-index: 3;
  margin: 0 0.4rem 0 0;
  transform: none;
}

.here:hover,
.here:active {
  background: rgba(47, 125, 225, 0.12);
  color: var(--cream);
}

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

.here[hidden] {
  display: none;
}

.loc {
  margin-top: -0.2rem;
  padding-left: 0.4rem;
}

.plan-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.45rem 0.5rem 0.45rem 0.45rem;
  border-radius: 1.4rem;
  background: #12294a;
  color: #fff;
}

.when-line {
  flex: 1 1 auto;
  min-width: min-content;
  border-top: 0;
}

.when-sum {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  color: #fff;
}

.when-sum:hover {
  background: transparent;
}

.when-sum .when-ico,
.when-sum.is-set .when-ico {
  flex: none;
  box-sizing: border-box;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0.62rem;
  border-radius: 50%;
  background: #07101f;
  color: #fff;
}

.when-label {
  display: grid;
  flex: 0 1 auto;
  min-width: min-content;
  overflow: visible;
  line-height: 1.1;
  text-align: left;
}

.when-label b,
.when-label small {
  white-space: nowrap;
}

.when-label b {
  font-size: clamp(1rem, 3.6vw, 1.25rem);
  font-weight: 800;
}

.when-label small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
}

.when-chev {
  flex: none;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s var(--ease);
}

.when-sum[aria-expanded="true"] .when-chev {
  transform: rotate(180deg);
}

.when-sum.is-set .when-label {
  font-weight: inherit;
}

.opts-toggle {
  flex: none;
  width: auto;
  min-height: 2.6rem;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 16, 31, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
  white-space: nowrap;
}

.opts-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.opts-toggle[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.1);
}

.opts-toggle .opts-title {
  font-weight: 700;
}

.opts-toggle .opts-sum {
  display: none;
}

@media (max-width: 420px) {
  .plan-bar {
    gap: 0.4rem;
    padding: 0.4rem;
  }

  .when-sum {
    gap: 0.4rem;
  }

  .when-sum .when-ico,
  .when-sum.is-set .when-ico {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
  }

  .opts-toggle {
    min-height: 2.4rem;
    padding: 0.4rem 0.7rem;
  }
}

@container (max-width: 300px) {
  .plan-bar {
    gap: 0.3rem;
    padding: 0.3rem;
  }

  .when-sum {
    gap: 0.3rem;
  }

  .when-sum .when-ico,
  .when-sum.is-set .when-ico {
    width: 2rem;
    height: 2rem;
    padding: 0.42rem;
  }

  .when-label b {
    font-size: 0.95rem;
  }

  .when-label small {
    font-size: 0.72rem;
  }

  .opts-toggle {
    gap: 0.28rem;
    min-height: 2.15rem;
    padding: 0.32rem 0.5rem;
  }

  .opts-ico {
    width: 15px;
    height: 15px;
  }
}

.opts {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.opts:has(.opts-body[hidden]) {
  display: none;
}

.opts-body {
  border-top: 0;
  padding: 0.2rem 0.3rem 0.4rem;
}

.when-wrap:has(.when-edit[hidden]) {
  display: none;
}

.when-edit {
  padding: 0.2rem 0.3rem 0.3rem;
}

/* ---------- Zoekveld in het haltesblok ---------- */
.plan-haltes { justify-items: stretch; }
.ph-search { position: relative; margin-top: 0.15rem; }
.ph-search input { width: 100%; height: 3rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg, var(--surface)); color: var(--cream); font: 500 1rem var(--font); padding: 0 1.1rem 0 2.7rem; outline: none; }
.ph-search input:focus { border-color: var(--accent); }
.ph-search > svg { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ph-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 0.4rem); background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; z-index: 5; box-shadow: var(--shadow); }
.ph-sugg a { display: block; padding: 0.6rem 1rem; color: var(--cream); text-decoration: none; border-top: 1px solid var(--line); }
.ph-sugg a:first-child { border-top: 0; }
.ph-sugg a:hover, .ph-sugg a.act { background: var(--hover); }
.ph-sugg b { font-weight: 600; }
.ph-sugg small { display: block; color: var(--muted); font-size: 0.8rem; }
.plan-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.plan-pop-l { color: var(--muted); font-size: 0.88rem; }
.plan-pop .plan-towns { margin: 0; gap: 0.4rem; }
.plan-pop .plan-towns a { padding: 0.25rem 0.7rem; font-size: 0.88rem; }

.plan-form,
.plan-summary,
.places,
.journey,
.recent-trips,
.recent-trip,
.promo-points li,
.hint,
.advice:has(> .results:empty) .plan-haltes {
  border-top-color: var(--hairline);
}

@media print {
  .promo .wear::before {
    display: none !important;
  }
}

/* ---------- Tijdpaneel als lade onder de tijdbalk (mockup v3, 30-11-2026) ----------
 * Eén lade met Nu / Vertrek / Aankomst, datum en tijd, Voorkeur en Vervoer. Alleen bestaande kleuren:
 * de lade in --bg met --line als rand (licht: paginagrijs; donker: nachtzwart), keuzes zoals voorheen.
 */
.plan-bar:has(#when-open[aria-expanded="true"]) {
  border-radius: 1.4rem 1.4rem 0 0;
}

.plan-drawer {
  display: grid;
  gap: 0;
  margin-top: -0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 1.15rem 1.15rem;
  background: var(--bg);
  animation: pop-in 0.18s var(--ease);
}

.plan-drawer[hidden] {
  display: none;
}

.plan-drawer .when-edit {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  animation: none;
}

/* Nu | Vertrek | Aankomst: één schakelbalk over de hele breedte, wit met rand. */
.plan-drawer .when-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-self: stretch;
  border-color: var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
}

.plan-drawer .when-switch button {
  border-radius: 0.65rem;
  padding: 0 0.4rem;
}

.plan-drawer .when-fields {
  flex-wrap: nowrap;
}

.plan-drawer .when-fields.is-now {
  opacity: 0.45;
}

.plan-drawer .opts-body {
  display: grid;
  gap: 0;
  padding: 0;
  border-top: 0;
  animation: none;
}

/* Voorkeur en Vervoer: elk met een dun lijntje erboven. */
.plan-drawer .block {
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.plan-drawer .chips-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.plan-drawer .chips span {
  min-height: 2.3rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.7rem;
  font-size: 0.85rem;
}

/* Voorkeur: 2 × 2, want "Minste overstappen" past niet in een kwart van het formulier;
   alleen bij een breed formulier vier naast elkaar. */
.plan-drawer .block:first-child .chips-grid {
  grid-template-columns: 1fr 1fr;
}

@container (min-width: 560px) {
  .plan-drawer .block:first-child .chips-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Vervoer op heel smalle schermen: 2 × 2. */
@container (max-width: 300px) {
  .plan-drawer .chips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* De losse Opties-knop is vervangen door de lade (hidden in de HTML; display:flex hierboven mag dat niet overrulen). */
.opts-toggle[hidden] {
  display: none;
}
