/* Bochtenjager — wegenatlas: rode route, groen voor bochtig, leisteen voor de bediening */
:root {
  --ink: #1b2530;          /* leisteen: tekst en panelen */
  --ink-2: #4a5866;
  --paper: #f5f7f4;        /* koel papier, geen crème */
  --fog: #dce3e1;
  --line: #c6d0cd;
  --route: #d7263d;        /* atlasrood */
  --scenic: #2f8f5b;       /* atlasgroen: bochtige weg */
  --signal: #f2c14e;       /* waarschuwingsgeel voor ritsignalen */
  --white: #ffffff;
  --danger: #b3122a;

  --font: 'Barlow', system-ui, sans-serif;
  --font-num: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sheet: 18px;
  --r-ctl: 10px;
  --tap: 48px;
  --sheet-w: 400px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--fog);
  -webkit-tap-highlight-color: transparent;
}
#map { position: fixed; inset: 0; }

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 6px; }

/* ---------- bovenbalk ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: calc(env(safe-area-inset-top, 0px) + var(--s2)) var(--s3) var(--s2);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--ink); color: var(--white); text-decoration: none;
  font-weight: 700; font-size: 1.05rem;
}
.brand svg { color: var(--scenic); }
.topnav { display: flex; gap: var(--s2); }
@media (max-width: 480px) {
  .brand span { display: none; }
  .brand { padding: 6px; }
  .topnav a, .topnav button { padding: 0 12px; }
}
.topnav a, .topnav button {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 0; background: var(--white); color: var(--ink);
  font: 600 0.95rem var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(27, 37, 48, 0.25);
}
.topnav a[aria-current="page"] { background: var(--ink); color: var(--white); }

/* ---------- paneel (bottom sheet op mobiel, zijpaneel op desktop) ---------- */
.sheet {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 -2px 16px rgba(27, 37, 48, 0.18);
  display: flex; flex-direction: column;
  max-height: 88dvh;
  transition: height 0.22s ease;
}
.sheet[data-state="peek"] { height: calc(132px + var(--safe-b)); }
.sheet[data-state="half"] { height: 48dvh; }
.sheet[data-state="full"] { height: 88dvh; }
.sheet-grip {
  flex: none; height: 28px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.sheet-grip span { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--s4) calc(var(--s5) + var(--safe-b));
}

@media (min-width: 900px) {
  .sheet, .sheet[data-state] {
    top: 68px; bottom: 16px; left: 16px; right: auto; width: var(--sheet-w);
    height: auto; max-height: none; border-radius: var(--r-sheet);
    box-shadow: 0 4px 24px rgba(27, 37, 48, 0.22);
  }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: var(--s4); }
  .maplibregl-ctrl-top-right { top: 56px; }
}

.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.row { display: flex; align-items: center; gap: var(--s2); }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section { padding-top: var(--s4); border-top: 1px solid var(--fog); }

/* ---------- bediening ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 18px; border-radius: var(--r-ctl);
  border: 1.5px solid var(--ink); background: var(--white); color: var(--ink);
  font: 600 1rem var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--ink); color: var(--white); }
.btn.go { background: var(--route); border-color: var(--route); color: var(--white); }
.btn.quiet { border-color: transparent; background: transparent; padding: 0 10px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: var(--fog); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

label.field { display: block; }
label.field > span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: var(--s1); }
input[type="text"], input[type="password"], input[type="search"], textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-ctl); background: var(--white);
  font: 1rem var(--font); color: var(--ink);
}
input:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { min-height: 84px; resize: vertical; }

/* segmentkeuze voor rijstijl en modus */
.segmented { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--fog); }
.segmented button {
  flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent;
  font: 600 0.95rem var(--font); color: var(--ink-2); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(27,37,48,.2); }
.segmented button[data-profile="bochtig"][aria-pressed="true"],
.segmented button[data-profile="extra"][aria-pressed="true"] { color: var(--scenic); }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); }
.toggle { display: flex; align-items: center; gap: var(--s2); min-height: 40px; cursor: pointer; font-size: 0.95rem; }
.toggle input { width: 20px; height: 20px; accent-color: var(--ink); }

input[type="range"] { width: 100%; accent-color: var(--route); height: 32px; }

/* ---------- routepunten ---------- */
.points { list-style: none; margin: 0; padding: 0; }
.points li {
  display: flex; align-items: center; gap: var(--s2);
  min-height: 48px; border-bottom: 1px solid var(--fog);
}
.points li:last-child { border-bottom: 0; }
.pin {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 0.85rem var(--font-num); color: var(--white); background: var(--ink);
  border: 2px solid var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.pin.start { background: var(--scenic); }
.pin.end { background: var(--route); }
.points .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search { position: relative; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  list-style: none; margin: 0; padding: 4px; background: var(--white);
  border-radius: var(--r-ctl); box-shadow: 0 6px 20px rgba(27,37,48,.2);
  max-height: 260px; overflow-y: auto;
}
.search-results button {
  display: block; width: 100%; text-align: left; padding: 10px; border: 0; background: none;
  border-radius: 8px; font: 0.95rem var(--font); cursor: pointer; color: var(--ink);
}
.search-results button:hover, .search-results button:focus-visible { background: var(--fog); }
.search-results small { color: var(--ink-2); display: block; }

/* ---------- routegegevens met bochtigheidsmeter ---------- */
.stats { display: grid; grid-template-columns: auto auto 1fr; gap: var(--s5); align-items: end; }
.stat b { display: block; font: 600 2rem/1 var(--font-num); letter-spacing: -0.01em; }
.stat span { font-size: 0.85rem; color: var(--ink-2); }
.squiggle { justify-self: end; text-align: right; }
.squiggle svg { display: block; width: 120px; height: 34px; margin-left: auto; }
.squiggle path { fill: none; stroke: var(--scenic); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.squiggle span { font-size: 0.85rem; color: var(--ink-2); }
.calc-state { min-height: 1.4em; font-size: 0.9rem; color: var(--ink-2); }
.calc-state.error { color: var(--danger); font-weight: 600; }

/* ---------- lijsten ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list a {
  display: flex; align-items: center; gap: var(--s3); padding: 12px 0;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--fog);
}
.list .meta { font-size: 0.9rem; color: var(--ink-2); }
.list .km { font: 600 1.35rem/1 var(--font-num); text-align: right; flex: none; }
.list .km small { display: block; font: 500 0.8rem var(--font); color: var(--ink-2); }
.profile-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.profile-dot.bochtig, .profile-dot.extra { background: var(--scenic); }
.profile-dot.extra { box-shadow: 0 0 0 3px rgba(47,143,91,.25); }
.empty { padding: var(--s5) 0; }
.empty p { margin-bottom: var(--s3); color: var(--ink-2); }

.tabs { display: flex; gap: var(--s4); border-bottom: 1px solid var(--fog); }
.tabs button {
  border: 0; background: none; padding: 10px 0; font: 600 1rem var(--font);
  color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--route); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px;
  background: var(--fog); font-size: 0.9rem; font-weight: 500;
}
.chip .icon-btn { width: 28px; height: 28px; }
.linkbox { display: flex; gap: var(--s2); }
.linkbox input { font-size: 0.85rem; }

/* ---------- groepsrit ---------- */
.ride-code { font: 700 1.9rem/1 var(--font-num); letter-spacing: 0.08em; }
.riders { list-style: none; margin: 0; padding: 0; }
.riders li { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--fog); }
.riders .who { flex: 1; min-width: 0; }
.riders .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riders .where { text-align: right; flex: none; }
.riders .where b { font: 600 1.3rem/1 var(--font-num); display: block; }
.riders .offline { opacity: 0.5; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; background: var(--fog); color: var(--ink-2); vertical-align: 2px; }
.badge.warn { background: var(--signal); color: var(--ink); }

.signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.signals button {
  min-height: 64px; border-radius: 14px; border: 2px solid var(--ink); background: var(--white);
  font: 700 1rem var(--font); color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.signals button svg { width: 24px; height: 24px; }
.signals button.help { border-color: var(--danger); color: var(--danger); }
.signals button:active { background: var(--signal); }

.gps { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: 14px; background: var(--white); border: 1.5px solid var(--line); }
.gps .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; }
.gps.on .dot { background: var(--scenic); box-shadow: 0 0 0 4px rgba(47,143,91,.25); }
.gps.err .dot { background: var(--danger); }

/* kaartmarkers */
.wp-marker { cursor: grab; }
.rider-marker {
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.rider-marker .head {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--white);
  display: grid; place-items: center; color: var(--white);
  font: 700 0.9rem var(--font-num); box-shadow: 0 2px 5px rgba(0,0,0,.4);
  position: relative;
}
.rider-marker .head::after {
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(var(--hdg, 0deg));
  transform-origin: 50% 26px;
  border: 6px solid transparent; border-bottom: 8px solid var(--white); display: var(--arrow, none);
}
.rider-marker .tag {
  margin-top: 3px; padding: 1px 6px; border-radius: 5px; background: var(--white);
  font: 600 0.75rem var(--font); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.rider-marker.me .head { outline: 3px solid var(--ink); }
.rider-marker.stale { opacity: 0.55; }

/* ---------- meldingen en dialogen ---------- */
.toasts {
  position: fixed; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px);
  transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s2);
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--white);
  font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  animation: toast-in 0.18s ease-out;
}
.toast.signal { background: var(--signal); color: var(--ink); font-size: 1.15rem; }
.toast.help { background: var(--danger); color: var(--white); }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

dialog {
  border: 0; border-radius: var(--r-sheet); padding: var(--s5); width: min(92vw, 420px);
  background: var(--paper); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(27, 37, 48, 0.45); }

.auth-card { max-width: 380px; }
.auth-card .switch { background: none; border: 0; padding: 0; font: 600 1rem var(--font); text-decoration: underline; cursor: pointer; color: var(--ink); }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.4em; }

.instructions { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.instructions li { display: flex; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--fog); }
.instructions .d { flex: none; width: 56px; text-align: right; font-family: var(--font-num); color: var(--ink-2); }
details summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }

.maplibregl-ctrl-group { border-radius: var(--r-ctl) !important; }
.maplibregl-ctrl-attrib { font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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

/* ================= navigatie ================= */
.nav-start { min-height: 60px; font-size: 1.15rem; }
.nav-start svg { width: 22px; height: 22px; }

body.navigating .topbar,
body.navigating .sheet,
body.navigating .maplibregl-ctrl-top-right { display: none; }
body.navigating .rider-marker.me { display: none; }
body.navigating .toasts { top: calc(env(safe-area-inset-top, 0px) + 186px); }

.nav { position: fixed; inset: 0; z-index: 30; pointer-events: none; --nav-card: var(--ink); }
.nav[hidden] { display: none; }
.nav > * { pointer-events: auto; }

.nav-top {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 10px; right: 10px;
  filter: drop-shadow(0 8px 18px rgba(27, 37, 48, 0.35));
}
.nav-card {
  display: flex; align-items: center; gap: 14px; color: #ffffff;
  min-height: 112px; padding: 14px 18px 14px 12px;
  border-radius: 24px; background: var(--nav-card);
  transition: background-color 0.25s ease, color 0.25s ease;
}
.nav-card:has(+ .nav-then:not([hidden])) { border-radius: 24px 24px 24px 0; }
.nav-arrow { flex: none; width: 88px; height: 88px; }
.nav-arrow svg, .nav-arrow > div { width: 100%; height: 100%; display: block; }
.nav-arrow > div { transition: transform 0.4s ease; }
.nav-what { min-width: 0; flex: 1; }
.nav-dist { font: 700 3.4rem/0.95 var(--font-num); letter-spacing: -0.01em; white-space: nowrap; }
.nav-street {
  margin-top: 4px; font: 600 1.2rem/1.2 var(--font); color: #c7d1d6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* vlak voor de afslag: rood, zodat je het vanuit je ooghoek ziet */
.nav-card[data-mode="near"] { background: var(--route); }
.nav-card[data-mode="near"] .nav-street { color: #ffe3e6; }
.nav-card[data-mode="off"] { background: var(--signal); color: var(--ink); }
.nav-card[data-mode="off"] .nav-street { color: #5a4a12; }
.nav-card[data-mode="off"] .nav-dist { font-size: 2.3rem; }
.nav-card[data-mode="arrived"] { background: var(--scenic); }
.nav-card[data-mode="arrived"] .nav-dist { font-size: 2.6rem; }
.nav-card[data-mode="arrived"] .nav-street { color: #dff3e8; }

.nav-then {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: -1px; padding: 6px 14px 8px 14px;
  border-radius: 0 0 16px 16px; background: #2a3946; color: #e8eef1;
  font: 600 1rem var(--font);
}
.nav-then[hidden] { display: none; }
.nav-then svg { width: 30px; height: 30px; }
.nav-then span:first-child { color: #9fb0ba; font-weight: 500; }

.nav-tools {
  position: absolute; right: 12px; top: 46%;
  display: flex; flex-direction: column; gap: 10px;
}
.nav-round {
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--white); color: var(--ink);
  box-shadow: 0 3px 10px rgba(27, 37, 48, 0.3);
}
.nav-round[hidden] { display: none; }
.nav-round svg { width: 26px; height: 26px; }
.nav-round.off { color: var(--danger); }

.nav-bottom {
  position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  display: flex; align-items: stretch; gap: 6px; padding: 8px;
  border-radius: 24px; background: var(--paper);
  box-shadow: 0 8px 24px rgba(27, 37, 48, 0.3);
}
.nav-speed {
  flex: none; width: 64px; height: 64px; border-radius: 50%; align-self: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--white); border: 3px solid var(--ink);
}
.nav-speed b { font: 700 1.7rem/1 var(--font-num); }
.nav-speed span { font-size: 0.72rem; font-weight: 600; color: var(--ink-2); }
.nav-rest { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 4px 0 6px; }
.nav-rest + .nav-rest { border-left: 1px solid var(--fog); padding-left: 8px; }
.nav-rest b { font: 700 1.5rem/1 var(--font-num); white-space: nowrap; }
.nav-rest span { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; }
.nav-group, .nav-stop {
  flex: none; border: 0; cursor: pointer; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 700 0.85rem var(--font); color: var(--ink);
}
.nav-group { min-width: 64px; padding: 0 6px; background: var(--signal); }
.nav-stop { width: 46px; background: var(--fog); }
@media (min-width: 900px) {
  .nav-speed { width: 72px; height: 72px; }
  .nav-rest b { font-size: 1.75rem; }
  .nav-group { min-width: 76px; }
}
.nav-stop svg { width: 26px; height: 26px; }
.stack-av { display: flex; }
.stack-av span {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--signal);
  display: grid; place-items: center; margin-left: -9px;
  font: 700 0.8rem var(--font-num); color: var(--white); background: var(--ink);
}
.stack-av span:first-child { margin-left: 0; }
.stack-av .more { background: var(--white); color: var(--ink); }
.stack-av .none { background: transparent; border: 0; color: var(--ink); }
.stack-av .none svg { width: 22px; height: 22px; }

.nav-panel {
  position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
  max-height: 62dvh; overflow-y: auto; padding: 16px;
  border-radius: 24px; background: var(--paper); box-shadow: 0 10px 30px rgba(27, 37, 48, 0.35);
}
.nav-panel[hidden] { display: none; }
.nav-panel .signals { margin: 12px 0; }
.nav-panel .signals button { min-height: 76px; font-size: 1.05rem; }

.nav-puck { width: 48px; height: 48px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); }
.nav-puck svg { width: 100%; height: 100%; display: block; }

@media (min-width: 900px) {
  .nav-top { right: auto; width: 420px; left: 16px; top: 16px; }
  .nav-tools { top: 16px; right: 16px; }
  .nav-bottom { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 16px; }
  .nav-panel { left: auto; right: 16px; width: 400px; bottom: 120px; }
}
@media (max-width: 360px) {
  .nav-arrow { width: 72px; height: 72px; }
  .nav-dist { font-size: 2.8rem; }
  .nav-group { min-width: 70px; }
}

/* huidige weg, onderin boven de balk (zoals in Apple Kaarten) */
.nav-road {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
  max-width: calc(100% - 140px); padding: 7px 16px; border-radius: 999px;
  background: rgba(27, 37, 48, 0.88); color: #fff; font: 600 1.05rem var(--font);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.nav-road[hidden] { display: none; }

/* ---------- nacht: overlays mee laten gaan met de donkere kaart ---------- */
body[data-theme="dark"] .nav { --paper: #1f2124; --fog: #2d3034; --white: #2b2e32; --ink: #eceef1; --ink-2: #a6abb2; color: var(--ink); }
body[data-theme="dark"] .nav-card { background: #121417; color: #ffffff; }
body[data-theme="dark"] .nav-then { color: #e8eef1; }
body[data-theme="dark"] .nav-card[data-mode="near"] { background: #c81f35; }
body[data-theme="dark"] .nav-card[data-mode="off"] { background: #e5b43f; color: #1b2530; }
body[data-theme="dark"] .nav-card[data-mode="arrived"] { background: #23824f; }
body[data-theme="dark"] .nav-then { background: #23272b; }
body[data-theme="dark"] .nav-speed { border-color: #eceef1; }
body[data-theme="dark"] .nav-round { color: #eceef1; }
body[data-theme="dark"] .nav-group { color: #1b2530; }
body[data-theme="dark"] .nav-road { background: rgba(245, 246, 248, 0.92); color: #1b2530; }
body[data-theme="dark"] .nav-puck path { fill: #ffffff; stroke: #1b2530; }
body[data-theme="dark"] .nav-panel .signals button { background: #2b2e32; color: #eceef1; border-color: #eceef1; }
body[data-theme="dark"] .nav-panel .signals button.help { color: #ff6b78; border-color: #ff6b78; }
body[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(30, 32, 35, 0.7); color: #a6abb2; }
body[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #c8ccd1; }

/* nacht: knoppen bovenin blijven zichtbaar op de donkere kaart */
body[data-theme="dark"] .brand,
body[data-theme="dark"] .topnav a[aria-current="page"] { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.22), 0 1px 3px rgba(0, 0, 0, 0.4); }

.routing-note { padding: 12px 14px; border-radius: 12px; background: #fff4d6; color: #5a4a12; font-weight: 500; font-size: 0.95rem; }
.invite-code { flex: 1; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.06em; }

/* GPS zoeken: zachte puls op het pictogram */
.nav-locating { width: 100%; height: 100%; display: grid; place-items: center; }
.nav-locating svg { width: 60%; height: 60%; animation: locate-pulse 1.4s ease-in-out infinite; }
@keyframes locate-pulse { 50% { opacity: 0.35; transform: scale(0.9); } }

/* ---------- snel navigeren ---------- */
.me-dot {
  width: 20px; height: 20px; border-radius: 50%; background: #2f7bd6; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(47, 123, 214, 0.22), 0 1px 4px rgba(0, 0, 0, 0.35);
}
body.navigating .me-dot { display: none; }
.go-gps { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 0.95rem; }
.go-gps svg { width: 18px; height: 18px; flex: none; animation: locate-pulse 1.4s ease-in-out infinite; }
.go-gps.err { color: var(--danger); font-weight: 600; }
.go-gps.err svg { animation: none; }
.go-dest { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 12px; border-radius: 12px; background: var(--white); border: 1.5px solid var(--line); font-weight: 600; }
.go-dest .pin { width: 18px; height: 18px; border-width: 2px; }
.go-recent { list-style: none; margin: 0; padding: 0; }
.go-recent button { width: 100%; text-align: left; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--fog); background: none; font: 1rem var(--font); color: var(--ink); cursor: pointer; }
.wp-marker.in-nav .pin { transform: scale(1.1); }
@media (max-width: 400px) {
  .topnav { gap: 6px; }
  .topnav a, .topnav button { padding: 0 11px; font-size: 0.9rem; }
}
