/* Rondje – vormgeving. Eén bestand, geen bouwstap.
   Indeling: basis · kaart · balk bovenaan · knoppen op de kaart · paneel · kaartjes en onderdelen ·
   vensters · meldingen. Op een breed scherm (≥ 860 px) staat het paneel links naast de kaart. */

:root {
  --accent: #0E9E6E;
  --accent-light: #24C785;
  --accent-deep: #086B75;
  --accent-grad: linear-gradient(135deg, #24C785, #086B75);
  --ink: #141A1F;
  --orange: #FA731A;
  --good: #1AA86B;
  --warn: #F29912;
  --bad: #E04033;

  --text: #14181d;
  --text2: rgba(20, 24, 29, .62);
  --text3: rgba(20, 24, 29, .4);
  --line: rgba(20, 24, 29, .1);
  --soft: rgba(20, 24, 29, .07);
  --glass: rgba(249, 250, 251, .86);
  --glass-solid: #f6f7f8;
  --card: rgba(255, 255, 255, .78);
  --card-line: rgba(20, 24, 29, .06);
  --float: rgba(255, 255, 255, .92);
  --shadow: 0 6px 22px rgba(15, 25, 35, .16);
  --shadow-soft: 0 2px 10px rgba(15, 25, 35, .12);

  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --panel-width: 396px;
  --sheet-h: 220px;
  --map-bottom: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f2f4f6;
    --text2: rgba(242, 244, 246, .64);
    --text3: rgba(242, 244, 246, .4);
    --line: rgba(255, 255, 255, .13);
    --soft: rgba(255, 255, 255, .1);
    --glass: rgba(24, 26, 30, .84);
    --glass-solid: #17191c;
    --card: rgba(255, 255, 255, .075);
    --card-line: rgba(255, 255, 255, .06);
    --float: rgba(38, 41, 46, .94);
    --shadow: 0 6px 22px rgba(0, 0, 0, .45);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, .35);
  }
}

/* ---------- Basis ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--glass-solid);
  color: var(--text);
  font: 15px/1.35 var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body { touch-action: manipulation; }

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
.icon { flex: none; display: block; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

#app {
  position: fixed;
  inset: 0;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, .selectable { user-select: text; -webkit-user-select: text; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--glass-solid); z-index: 99; }

.boot {
  position: absolute; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--glass-solid); color: var(--text2); font: 600 15px var(--round); text-align: center; padding: 24px;
  transition: opacity .35s ease;
}
.boot img { border-radius: 18px; box-shadow: var(--shadow); }
.boot.gone { opacity: 0; pointer-events: none; }

/* ---------- Kaart ---------- */

#map { position: absolute; inset: 0; z-index: 0; isolation: isolate; background: #dfe6e2; }
.leaflet-container { font: inherit; background: #dfe6e2; }
.leaflet-container a { color: inherit; }
/* De tegels overlappen een beeldpunt (zie map.js); dan moeten ze elkaar gewoon afdekken. */
.leaflet-container img.leaflet-tile { mix-blend-mode: normal; }
.leaflet-bottom { bottom: var(--map-bottom); transition: bottom .32s cubic-bezier(.2, .9, .25, 1); }
.leaflet-control-attribution {
  font-size: 10px; line-height: 1.5; padding: 1px 6px; border-radius: 6px 0 0 0;
  background: rgba(255, 255, 255, .78) !important; color: rgba(0, 0, 0, .72);
}
.leaflet-control-attribution a { color: inherit; text-decoration: none; }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow-soft) !important; border-radius: 14px !important; overflow: hidden; margin: 0 12px 26px 0 !important; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; background: var(--float) !important; color: var(--text) !important; border-color: var(--line) !important; font-weight: 500; }
.leaflet-interactive { cursor: pointer; }
.leaflet-grab { cursor: grab; }
.leaflet-dragging .leaflet-grab { cursor: grabbing; }
.map-mouse .leaflet-grab { cursor: crosshair; }
.map-mouse.leaflet-dragging .leaflet-grab { cursor: grabbing; }
.map-locked .leaflet-grab { cursor: grab; }

/* Routepunten op de kaart */
.wp-icon { background: none; border: 0; }
.wp {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  display: grid; place-items: center; border-radius: 50%;
  background: #fff; color: var(--ink); border: 3px solid var(--ink);
  font: 800 13px/1 var(--round); box-shadow: 0 2px 7px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.wp-start { background: var(--accent); border-color: #fff; color: #fff; }
.wp-end { background: var(--ink); border-color: #fff; color: #fff; }
.wp-stop { background: var(--orange); border-color: #fff; color: #fff; }
.wp-fixed { opacity: .95; }
.leaflet-marker-draggable .wp { cursor: grab; }
.leaflet-drag-target .wp, .wp-icon:active .wp { transform: scale(1.22); cursor: grabbing; }
.wp-label {
  position: absolute; left: 50%; top: calc(50% + 19px); transform: translateX(-50%);
  max-width: 150px; padding: 2px 7px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .94); color: #14181d; font: 700 11.5px/1.3 var(--round); box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  pointer-events: none;
}
.wp-ghost { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-width: 3px; border-color: var(--accent); opacity: .95; }

.km-icon, .arrow-icon { background: none; border: 0; pointer-events: none; }
.km {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  min-width: 22px; padding: 1px 5px; border-radius: 9px; text-align: center;
  background: rgba(255, 255, 255, .95); color: #14181d; border: 1.5px solid rgba(20, 26, 31, .55);
  font: 800 10.5px/1.25 var(--round);
}
.arrow { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; color: #fff; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .9)); }

.stop-icon { background: none; border: 0; }
.stop-pin {
  position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--orange);
  border: 2.5px solid var(--orange); box-shadow: 0 2px 7px rgba(0, 0, 0, .3); cursor: pointer;
}
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow); background: var(--float); color: var(--text); }
.leaflet-popup-tip { background: var(--float); }
.leaflet-popup-content { margin: 12px 14px; font: inherit; min-width: 170px; }
.leaflet-popup-content b { display: block; font: 700 15px var(--round); }
.leaflet-popup-content small { display: block; color: var(--text2); font-size: 12.5px; margin: 2px 0 9px; }
.leaflet-popup-content button { width: 100%; height: 38px; border-radius: 12px; background: var(--accent-grad); color: #fff; font: 700 14px var(--round); text-align: center; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text2); top: 4px; right: 4px; }

/* ---------- Laag over de kaart ---------- */

/* De laag zelf laat aanrakingen door naar de kaart; alleen de onderdelen erop vangen ze op. */
#ui { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.panel, .modal-layer, .menu-layer { pointer-events: auto; }

.overlay {
  position: absolute; left: 0; right: 0; top: 0; pointer-events: none;
  padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 12px) 0 calc(var(--safe-left) + 12px);
  display: flex; flex-direction: column; gap: 8px;
}
.overlay > * { pointer-events: auto; }
.wide .overlay { left: calc(var(--panel-width) + 12px); padding-top: 12px; }

.glass { background: var(--float); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); box-shadow: var(--shadow-soft); }

/* Balk bovenaan: zoeken, routes, instellingen en het fietstype */
.topbar { display: flex; flex-direction: column; gap: 8px; }
.toprow { display: flex; gap: 8px; }
.searchpill {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 24px;
  display: flex; align-items: center; gap: 9px; color: var(--text2); font-size: 16px; font-weight: 500;
}
.searchpill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roundbtn {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
  transition: transform .15s ease, background .15s ease;
}
.roundbtn:active { transform: scale(.92); }
.roundbtn.big { width: 48px; height: 48px; }
.roundbtn.on { background: var(--accent-grad); color: #fff; }
.roundbtn:disabled { opacity: .45; }

.bikepicker { display: flex; padding: 3px; border-radius: 15px; gap: 2px; }
.bikepicker button {
  flex: 1; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 14px var(--round); color: var(--text2); transition: background .2s ease, color .2s ease;
}
.bikepicker button.on { background: var(--accent-grad); color: #fff; box-shadow: 0 2px 8px rgba(14, 158, 110, .35); }

.wide .panel .topbar { padding: 12px 12px 4px; }
.wide .panel .searchpill, .wide .panel .roundbtn, .wide .panel .bikepicker { background: var(--soft); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Knoppen rechts op de kaart */
.side { align-self: flex-end; display: flex; flex-direction: column; gap: 9px; }

/* Uitklapmenu */
.menu-layer { position: absolute; inset: 0; z-index: 30; }
.menu {
  position: absolute; min-width: 230px; max-width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow-y: auto;
  padding: 6px; border-radius: 16px; background: var(--float); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  animation: pop .14s ease-out;
}
.menu button, .menu label {
  width: 100%; min-height: 42px; padding: 8px 11px; border-radius: 11px; display: flex; align-items: center; gap: 11px;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.menu button:hover, .menu label:hover { background: var(--soft); }
.menu button .icon { color: var(--text2); }
.menu button.danger, .menu button.danger .icon { color: var(--bad); }
.menu button .tick { margin-left: auto; color: var(--accent); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 8px; }
.menu h4 { margin: 6px 11px 3px; font: 700 11.5px var(--round); color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- Paneel ---------- */

.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  height: calc(var(--sheet-h) + var(--safe-bottom));
  display: flex; flex-direction: column;
  border-radius: 24px 24px 0 0;
  background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  box-shadow: 0 -4px 26px rgba(15, 25, 35, .18);
  transition: height .34s cubic-bezier(.2, .9, .25, 1);
  will-change: height;
}
.panel.dragging { transition: none; }
.wide .panel {
  left: 12px; top: 12px; bottom: 12px; right: auto; width: calc(var(--panel-width) - 12px); height: auto;
  border-radius: 24px; box-shadow: var(--shadow); transition: none;
}

.grab { flex: none; touch-action: none; cursor: grab; }
.wide .grab { cursor: default; touch-action: auto; }
.handle { height: 22px; display: grid; place-items: center; }
.handle i { width: 38px; height: 5px; border-radius: 3px; background: var(--text3); opacity: .7; }
.wide .handle { display: none; }

.head { padding: 0 16px 10px; display: flex; flex-direction: column; gap: 9px; }
.wide .head { padding-top: 10px; }
.body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 14px calc(44px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }
.body > * { flex: none; }

.title { font: 800 22px/1.15 var(--round); letter-spacing: -.01em; }
.title.small { font-size: 21px; }
.sub { color: var(--text2); font-size: 13px; font-weight: 500; }
.muted { color: var(--text2); font-size: 13.5px; }
.tiny { color: var(--text2); font-size: 12.5px; }
.tagline { display: flex; align-items: center; gap: 6px; color: var(--accent); font: 700 13px var(--round); white-space: nowrap; overflow: hidden; }
.tagline span { overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 8px; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }

/* Knoppen */
.btn {
  flex: none; min-width: 0; height: 48px; padding: 0 14px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 16px var(--round); white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease, filter .15s ease;
}
.row > .btn { flex: 1; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent-grad); color: #fff; box-shadow: 0 5px 14px rgba(14, 158, 110, .32); }
.btn.primary:disabled { filter: saturate(.2); opacity: .5; box-shadow: none; }
.btn.soft { background: var(--card); border: 1px solid var(--card-line); font-size: 15px; font-weight: 650; }
.btn.soft:disabled { opacity: .45; }
.btn.accent { color: var(--accent); }
.btn.good { color: var(--good); }
.btn.tall { height: 52px; font-size: 17px; }
.btn.low { height: 44px; }
.row > .btn.square, .btn.square { flex: none; width: 54px; padding: 0; }
.row > .btn.fixed, .btn.fixed { flex: none; width: 128px; }
.textbtn { color: var(--accent); font: 650 14px var(--round); padding: 6px 2px; }
.textbtn.center { display: block; width: 100%; text-align: center; }
.iconbtn { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--text); }
.iconbtn.plain { background: none; color: var(--text2); width: 34px; height: 32px; }
.iconbtn.add { width: 32px; height: 32px; background: var(--accent-grad); color: #fff; }

.spinner {
  flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; opacity: .8;
}
.spinner.small { width: 12px; height: 12px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Naam van de route */
.name { display: flex; align-items: center; gap: 6px; min-width: 0; font: 800 18px/1.2 var(--round); }
.name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name .icon { color: var(--text3); }
.name-input {
  width: 100%; height: 34px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--accent); background: var(--card);
  font: 700 17px var(--round); outline: none;
}
.verdict { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.verdict span { overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }

/* Kerncijfers */
.stats { display: flex; gap: 6px; transition: opacity .2s ease; }
.stats.busy, .bar.busy { opacity: .45; }
.stat { flex: 1; min-width: 0; padding: 7px 4px 6px; border-radius: 13px; background: var(--card); border: 1px solid var(--card-line); text-align: center; }
.stat b { display: block; font: 800 16px/1.2 var(--round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { display: block; margin-top: 1px; color: var(--text2); font-size: 11px; font-weight: 500; }

.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--soft); gap: 1.5px; transition: opacity .2s ease; }
.bar.thick { height: 12px; border-radius: 6px; }
.bar.mid { height: 10px; border-radius: 5px; }
.bar i { display: block; min-width: 2px; }

/* Kaartjes in het paneel */
.card { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); display: flex; flex-direction: column; gap: 10px; }
button.card { width: 100%; text-align: left; }
.card.selected { box-shadow: 0 0 0 2.5px var(--sel, var(--accent)); }
.cardtitle { display: flex; align-items: center; gap: 7px; font: 700 14.5px var(--round); }
.cardtitle .icon { color: var(--accent); }
.cardtitle em { margin-left: auto; font-style: normal; font: 600 12.5px var(--sans); color: var(--text2); white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 1px 0; }
.note { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; }
.note .icon { margin-top: 1px; }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.goodtext { color: var(--good); }

.tip { display: flex; align-items: flex-start; gap: 11px; }
.tip .icon { color: var(--accent); margin-top: 2px; width: 26px; }
.tip b { display: block; font: 700 14.5px var(--round); }
.tip span { color: var(--text2); font-size: 13.5px; }

/* Geschiktheid */
.fitbig { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.fittitle { font: 700 16px/1.25 var(--round); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px; font: 700 12px var(--round); white-space: nowrap; flex: none; }
.listrow { width: 100%; display: flex; align-items: center; gap: 9px; min-height: 30px; font-size: 14px; font-weight: 500; }
.listrow .km { all: unset; }
.listrow small { color: var(--text2); font-size: 13px; white-space: nowrap; }
.listrow .icon.chev { color: var(--text3); }
.climb b { width: 52px; font: 700 13.5px var(--round); }

/* Legenda */
.legend { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.legend i { flex: none; width: 12px; height: 12px; border-radius: 4px; }
.legend span { flex: 1; min-width: 0; }
.legend small { color: var(--text2); font-size: 13px; white-space: nowrap; }
.legend b { width: 42px; text-align: right; font: 700 13.5px var(--round); }
.legendgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.legendgrid div { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.legendgrid i { flex: none; width: 12px; height: 12px; border-radius: 3px; }

/* Hoogteprofiel */
.chart { position: relative; height: 132px; margin: 2px 0 16px 34px; touch-action: pan-y; cursor: crosshair; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .ylab, .chart .xlab { position: absolute; color: var(--text2); font-size: 10px; white-space: nowrap; pointer-events: none; }
.chart .ylab { right: calc(100% + 5px); transform: translateY(-50%); }
.chart .xlab { top: calc(100% + 3px); transform: translateX(-50%); }
.chart .xlab.first { transform: none; }
.chart .xlab.last { transform: translateX(-100%); }
.chart .rule { position: absolute; top: 0; bottom: 0; width: 1.5px; margin-left: -.75px; background: var(--orange); pointer-events: none; }
.chart .ruledot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; pointer-events: none; }
.chart .bubble {
  position: absolute; top: -9px; transform: translate(-50%, -100%); padding: 3px 8px; border-radius: 11px; background: var(--orange); color: #fff;
  font: 700 11.5px var(--round); white-space: nowrap; pointer-events: none;
}

/* Wind en weer */
.windicon { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 158, 110, .13); color: var(--accent); }
.strong { font: 700 15.5px var(--round); }
.windlabels { display: flex; justify-content: space-between; font: 700 12.5px var(--round); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 500; }
.field input[type="datetime-local"] { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14px; max-width: 220px; }

/* Schakelaar */
.switch { display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; margin-left: auto; width: 50px; height: 30px; border-radius: 15px; background: var(--text3); position: relative; transition: background .2s ease; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.switch b { display: block; font-size: 14.5px; font-weight: 600; }
.switch small { display: block; color: var(--text2); font-size: 12.5px; }

/* Keuzebalk */
.segmented { display: flex; padding: 2px; border-radius: 11px; background: var(--soft); gap: 1px; }
.segmented button { flex: 1; min-width: 0; height: 32px; border-radius: 9px; font: 650 13px var(--round); text-align: center; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.segmented button.on { background: var(--float); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }

/* Routepunten in de lijst */
.wprow { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.wprow > button.grow { font-size: 14.5px; font-weight: 500; padding: 5px 0; }
.wpdot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 12px var(--round); color: #fff; }
.wpdot.via { background: none; color: var(--text); box-shadow: inset 0 0 0 2.5px var(--text2); }

/* Rondje maken */
.bigkm { margin-left: auto; font: 800 26px/1 var(--round); }
.range { width: 100%; height: 30px; accent-color: var(--accent); margin: 0; }
.chips { display: flex; gap: 6px; }
.chips button { flex: 1; height: 34px; border-radius: 17px; background: var(--soft); font: 700 14px var(--round); text-align: center; }
.chips button.on { background: var(--accent-grad); color: #fff; }
.compass { position: relative; height: 216px; }
.compass .ring { position: absolute; left: 50%; top: 50%; width: 172px; height: 172px; margin: -86px 0 0 -86px; border-radius: 50%; border: 1.5px solid var(--line); }
.compass button { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--soft); font: 700 13px var(--round); text-align: center; transition: background .2s ease, transform .2s ease; }
.compass button.on { background: var(--accent-grad); color: #fff; transform: scale(1.08); }
.compass button.mid { left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; }
.compass .windmark { position: absolute; margin: -8px 0 0 -8px; color: var(--text2); }
.cands { display: flex; gap: 7px; align-items: center; }
.cand { flex: 1; min-width: 0; height: 50px; padding: 0 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-line); display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.cand.on { box-shadow: 0 0 0 2.5px var(--sel); }
.cand b { display: flex; align-items: center; gap: 5px; font: 800 15px var(--round); white-space: nowrap; }
.cand small { color: var(--text2); font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bewaarde routes */
.routerow { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; }
.thumb { flex: none; width: 76px; height: 58px; border-radius: 12px; background: rgba(14, 158, 110, .12); overflow: hidden; }
.thumb svg { width: 100%; height: 100%; display: block; }
.routerow b { display: block; font: 700 15.5px var(--round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routerow small { display: block; color: var(--text2); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routerow .tags { display: flex; gap: 10px; margin-top: 3px; font: 700 11.5px var(--round); }
.routerow .tags span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Vensters ---------- */

.modal-layer { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 14, 18, .38); animation: fade .2s ease; }
.modal {
  width: 100%; max-height: calc(100dvh - var(--safe-top) - 26px); display: flex; flex-direction: column;
  border-radius: 24px 24px 0 0; background: var(--glass-solid); box-shadow: var(--shadow);
  animation: rise .28s cubic-bezier(.2, .9, .25, 1);
}
.modal.tall { height: calc(100dvh - var(--safe-top) - 26px); }
.wide .modal-layer { align-items: center; padding: 24px; }
.wide .modal { width: min(520px, 100%); max-height: min(760px, calc(100dvh - 48px)); border-radius: 24px; animation: pop .18s ease-out; }
.wide .modal.tall { height: min(760px, calc(100dvh - 48px)); }
.modal-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 6px 12px 4px 16px; }
.modal-head h2 { flex: 1; min-width: 0; font: 800 18px var(--round); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-head .textbtn { min-width: 76px; font-size: 16px; padding: 8px 4px; }
.modal-head .textbtn.right { text-align: right; font-weight: 700; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; }
.modal-body > * { flex: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

.textfield {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--card);
  font-size: 16px; outline: none;
}
.textfield:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 158, 110, .18); }
.textfield.mono { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.searchfield { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 13px; background: var(--soft); color: var(--text2); }
.searchfield input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 16px; color: var(--text); }
.result { width: 100%; padding: 9px 4px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.result .icon { color: var(--accent); }
.result b { display: block; font-size: 16px; font-weight: 550; }
.result small { display: block; color: var(--text2); font-size: 13px; }
.empty { text-align: center; padding: 34px 20px; color: var(--text2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty b { font: 800 19px var(--round); color: var(--text); }
.empty .icon { color: var(--text3); }

/* Instellingen */
.group { display: flex; flex-direction: column; gap: 6px; }
.group > h3 { display: flex; align-items: center; gap: 7px; margin: 4px 4px 0; font: 700 13px var(--round); color: var(--text2); text-transform: uppercase; letter-spacing: .03em; }
.group > p { margin: 0 4px; color: var(--text2); font-size: 12.5px; }
.rows { border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); overflow: hidden; }
.rows > * { min-height: 48px; padding: 6px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows > *:last-child { border-bottom: 0; }
.rows > button { width: 100%; color: var(--accent); font-weight: 600; }
.rows > button.danger { color: var(--bad); }
.rows select { margin-left: auto; max-width: 58%; height: 34px; padding: 0 26px 0 10px; border-radius: 9px; border: 0; background: var(--soft); font-size: 14.5px; text-align: right; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-size: 5px 5px, 5px 5px; background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px; background-repeat: no-repeat; }
.rows .value { margin-left: auto; color: var(--text2); }
.rows .column { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 14px; }
.stepper { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.stepper span { min-width: 64px; text-align: right; color: var(--text2); }
.stepper button { width: 34px; height: 32px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; }
details.help { padding: 0 !important; display: block !important; }
details.help summary { min-height: 48px; padding: 6px 14px; display: flex; align-items: center; cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
details.help summary::-webkit-details-marker { display: none; }
details.help ol { margin: 0; padding: 0 14px 14px 34px; color: var(--text2); font-size: 13.5px; display: flex; flex-direction: column; gap: 7px; }
.copybox { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 11px; background: var(--soft); font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.copybox span { flex: 1; }

/* Stappen en deelopties */
.steps { display: flex; flex-direction: column; gap: 10px; }
.steps div { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.steps i { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 800 13px var(--round); font-style: normal; }
.option { width: 100%; display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); text-align: left; }
.option:disabled { opacity: .5; }
.option .sym { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(14, 158, 110, .13); color: var(--accent); }
.option b { display: block; font: 700 16px var(--round); }
.option small { display: block; color: var(--text2); font-size: 13px; margin-top: 1px; }
.option > .icon { color: var(--text3); }
.sharecard { align-self: center; max-height: 330px; max-width: 100%; border-radius: 18px; box-shadow: var(--shadow); aspect-ratio: 540 / 690; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.sharecard img { display: block; height: 100%; width: 100%; object-fit: contain; }
.done { display: flex; align-items: center; gap: 12px; }
.done .icon { color: var(--good); }

/* ---------- Meldingen ---------- */

.toast-layer { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 118px); z-index: 40; display: flex; justify-content: center; padding: 0 24px; pointer-events: none; }
.wide .toast-layer { top: 22px; left: var(--panel-width); }
.toast { max-width: 460px; padding: 10px 17px; border-radius: 22px; background: rgba(20, 26, 31, .93); color: #fff; font: 650 14px/1.3 var(--round); text-align: center; box-shadow: 0 5px 18px rgba(0, 0, 0, .3); animation: drop .3s cubic-bezier(.2, 1.2, .3, 1); }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

.dropzone { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(14, 158, 110, .2); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); pointer-events: none; }
.dropzone div { padding: 22px 30px; border-radius: 22px; background: var(--float); box-shadow: var(--shadow); font: 800 18px var(--round); display: flex; align-items: center; gap: 12px; }

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