/* Running.Route: een rustige kaart met een vaste zijbalk. De route is het enige felle op de kaart. Barlow komt van snelwegborden, smal voor de cijfers. */
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root {
  --band: #12343b; --band-2: #1f4750; --on-band: #f2f7f6; --on-band-2: #adc4c6;
  --ink: #11272c; --muted: #566c71; --line: #dfe6e3; --wash: #f0f3f1; --paper: #fff;
  --go: #d23a09; --go-2: #b53106; --route: #e8440f; --road: #3a78bd; --trail: #2f9160; --err: #a92c05;
  --side: 372px; --fig: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;
  --shadow: 0 1px 2px rgba(17, 39, 44, 0.12), 0 8px 24px rgba(17, 39, 44, 0.16);
  --l: env(safe-area-inset-left, 0px); --r: env(safe-area-inset-right, 0px); --b: env(safe-area-inset-bottom, 0px); --t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--wash); color: var(--ink); font: 15px/1.4 "Barlow", "Helvetica Neue", Arial, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--go); outline-offset: 2px; }
.ico { display: block; flex: none; }
.maplibregl-map { font: inherit; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-scale { border-color: var(--muted); color: var(--ink); background: rgba(255, 255, 255, 0.8); font-size: 11px; }

#app { position: absolute; inset: 0; }
#map { position: absolute; top: 0; right: 0; bottom: 0; left: calc(var(--side) + var(--l)); }

/* Zijbalk */
.side { position: absolute; z-index: 10; left: 0; top: 0; bottom: 0; width: calc(var(--side) + var(--l)); padding-left: var(--l); background: var(--paper); display: flex; flex-direction: column; box-shadow: 1px 0 0 var(--line), 4px 0 18px rgba(17, 39, 44, 0.1); }
.bar { flex: none; position: relative; z-index: 3; }
.band { background: var(--band); color: var(--on-band); padding: calc(10px + var(--t)) 12px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.band-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wrap { position: relative; }
.brand { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; font-weight: 700; font-size: 18px; letter-spacing: -0.005em; background: none; border: 0; border-radius: 8px; white-space: nowrap; }
.brand img { display: block; }
.brand:hover, .brand[aria-expanded="true"], .band-btn:hover, .band-btn[aria-expanded="true"] { background: var(--band-2); }
.brand .chev { color: var(--on-band-2); }
.band-btn { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; }
#search-form { position: relative; }
.search-ico { position: absolute; left: 11px; top: 11px; color: var(--on-band-2); pointer-events: none; }
#search { display: block; width: 100%; height: 40px; background: var(--band-2); color: var(--on-band); border: 1px solid transparent; border-radius: 8px; padding: 0 44px 0 36px; font-size: 15px; }
#search::placeholder { color: var(--on-band-2); opacity: 1; }
#search::-webkit-search-cancel-button { display: none; }
#search:focus { outline: 0; border-color: var(--on-band-2); background: #173d45; }
.filter-btn { position: absolute; right: 4px; top: 4px; width: 36px; height: 32px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--on-band-2); }
.filter-btn:hover, .filter-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.14); color: var(--on-band); }
.filter-btn i { position: absolute; right: 6px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #ff7a4d; box-shadow: 0 0 0 2px var(--band-2); }

/* Keuzemenu's */
.menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 14.5rem; display: flex; flex-direction: column; padding: 6px; background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: var(--shadow); }
.menu.right { left: auto; right: 0; }
.menu > a, .menu > button, .menu form > button, .menu .current { display: block; width: 100%; padding: 9px 11px; text-align: left; color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 6px; font-size: 15px; font-weight: 500; }
.menu .current { color: var(--muted); }
.menu > a:hover, .menu > button:hover, .menu form > button:hover, .menu > a:focus-visible, .menu > button:focus-visible { background: var(--wash); }
.menu .who { display: block; padding: 7px 11px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .who b { font-weight: 600; color: var(--ink); }
.results { right: 0; }
.results button { font-size: 14px; line-height: 1.3; font-weight: 400; }
.results button:disabled { color: var(--muted); cursor: default; background: none; }

/* Filters */
.filters { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 14px; background: var(--wash); border-bottom: 1px solid var(--line); }
.filter-end { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.range-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.range-head output { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.range-track { position: relative; height: 26px; margin-top: 2px; }
.range-track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: #cfd8d5; }
.range-fill { position: absolute; top: 11px; height: 4px; background: var(--band); border-radius: 2px; }
.range-track input { position: absolute; left: 0; top: 0; width: 100%; height: 26px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range-track input::-webkit-slider-runnable-track { background: none; height: 26px; }
.range-track input::-moz-range-track { background: none; }
.range-track input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: var(--paper); border: 2px solid var(--band); box-shadow: 0 1px 3px rgba(17, 39, 44, 0.3); cursor: grab; }
.range-track input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2px solid var(--band); cursor: grab; }

/* Paneel */
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.sheet { display: none; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.foot { flex: none; padding: 12px 16px calc(12px + var(--b)); border-top: 1px solid var(--line); background: var(--paper); }
.panel h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -0.005em; }
.panel h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.panel p { margin: 0; }
.panel a { color: var(--ink); }
.lead { color: var(--ink); }
.none { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 14px; }
.credit { color: var(--muted); font-size: 12px; margin-top: 6px !important; }
.err { color: var(--err); font-size: 14px; font-weight: 500; }
.sect { border-top: 1px solid var(--line); padding-top: 14px; }
.head { display: flex; gap: 8px; align-items: flex-start; margin-left: -6px; }
.head h2 { padding-top: 5px; }
.head-main { min-width: 0; flex: 1; }
.back { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--ink); }
.back:hover { background: var(--wash); }
.meta { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; margin-top: 5px !important; font-size: 14px; color: var(--muted); }
.meta .private { font-weight: 500; color: var(--ink); }
.kind { display: inline-block; font-size: 12px; font-weight: 600; line-height: 18px; border-radius: 4px; padding: 0 6px; color: #fff; }
.kind.road { background: var(--road); }
.kind.trail { background: var(--trail); }

/* Cijfers */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.stats div { min-width: 0; }
.stats dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.stats dd { margin: 0; font-family: var(--fig); font-size: 32px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats dd.pace { display: flex; gap: 5px; align-items: center; margin-top: 4px; font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.2; color: var(--muted); }
.pace input { width: 3.4rem; height: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.mix-bar { display: flex; height: 6px; gap: 2px; margin-bottom: 5px; }
.mix-bar i { display: block; height: 100%; min-width: 2px; border-radius: 3px; }
.mix-bar .r { background: var(--road); }
.mix-bar .t { background: var(--trail); }
.mix { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.mix b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; background: var(--band); color: var(--on-band); border: 1px solid transparent; border-radius: 8px; padding: 0 14px; font-weight: 600; font-size: 14px; text-decoration: none; }
.panel a.btn { color: var(--on-band); }
.btn:hover { background: #0d2a30; }
.btn.go { background: var(--go); color: #fff; }
.btn.go:hover { background: var(--go-2); }
.btn.wide { display: flex; width: 100%; min-height: 44px; font-size: 16px; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.quiet { background: var(--paper); color: var(--ink); border-color: #c9d3d0; font-weight: 500; }
.panel a.btn.quiet { color: var(--ink); }
.btn.quiet:hover { background: var(--wash); }
.btn.danger { color: var(--err); }
.btn:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; font-weight: 500; }
.tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0 -6px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; background: none; border: 0; border-radius: 8px; font-size: 12px; font-weight: 500; line-height: 1.15; color: var(--ink); text-align: center; text-decoration: none; }
.panel a.tool { color: var(--ink); }
button.tool:hover, a.tool:hover { background: var(--wash); }
.tool:disabled { color: #a9b6b4; cursor: default; background: none; }
.tool.static { color: var(--muted); }
.tool[aria-pressed="true"] { color: var(--go); font-weight: 700; }
.tool[aria-pressed="true"] .ico path { fill: rgba(232, 68, 15, 0.18); }
#p-likes { font-variant-numeric: tabular-nums; }
.stick { position: sticky; bottom: -16px; z-index: 2; margin: auto -16px -16px; padding: 12px 16px calc(12px + var(--b)); background: var(--paper); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.stick .btn { flex: 1 1 auto; }
.stick .err { flex: 1 1 100%; }

/* Velden */
.form { display: flex; flex-direction: column; gap: 10px; }
.form h3 { margin: 0; }
.form label, .label, .km-pair label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.form label.spaced { margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.form input[type=text], .form select, .field-copy input { display: block; width: 100%; height: 38px; margin-top: 3px; font-size: 15px; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid #c9d3d0; border-radius: 8px; padding: 0 10px; }
.form input[type=text]:focus, .form select:focus, .field-copy input:focus, .km-input input:focus { outline: 0; border-color: var(--band); box-shadow: 0 0 0 1px var(--band); }
.form input::placeholder { color: #8a9a9b; }
.switch { display: flex !important; align-items: center; gap: 10px; font-size: 14px !important; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; }
.switch input { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 36px; height: 21px; margin: 0; border-radius: 11px; background: #bcc8c5; cursor: pointer; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(17, 39, 44, 0.3); }
.switch input:checked { background: var(--band); }
.switch input:checked::after { left: 17px; }
.seg-choice { display: flex; padding: 3px; gap: 2px; background: #e6ebe8; border-radius: 9px; }
.seg-choice button { flex: 1; min-height: 32px; background: none; border: 0; border-radius: 6px; padding: 0 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg-choice button:hover { color: var(--ink); }
.seg-choice button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 39, 44, 0.18); }
.tips { margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 2px; }
.swatch-btn { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(17, 39, 44, 0.15); }
.swatch-btn[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
#a-color { width: 34px; height: 28px; padding: 2px; background: var(--paper); border: 1px solid #c9d3d0; border-radius: 8px; }

/* Lijst */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.list-head h2 { font-size: 17px; }
.sort { flex: none; display: flex; align-items: center; font-size: 13px; color: var(--muted); }
.sort span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sort select { width: 8.2rem; height: 30px; border: 0; background: none; border-radius: 6px; padding: 0 2px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: right; text-align-last: right; }
.sort select:hover { background: var(--wash); }
.active-line { margin: -10px 0 -4px !important; font-size: 13px; }
.list { display: flex; flex-direction: column; margin: -4px -16px 0; padding: 0; list-style: none; }
.list li + li { border-top: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 9px 16px; }
.row:hover, .row.hot { background: var(--wash); }
.row:focus-visible { outline-offset: -2px; }
.shape { display: block; background: var(--wash); border-radius: 8px; }
.row:hover .shape, .row.hot .shape { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.row-main, .row-side { display: block; min-width: 0; }
.row-main b, .row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main b { font-weight: 600; font-size: 15px; }
.row-main small, .row-side small { font-size: 13px; color: var(--muted); }
.row-side { text-align: right; }
.row-side b { display: block; font-family: var(--fig); font-size: 17px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-side small { display: block; white-space: nowrap; }
.likes { font-style: normal; margin-right: 3px; font-variant-numeric: tabular-nums; }
.likes .ico { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; }
#l-results + .note { margin: 0 -16px -16px !important; padding: 12px 16px; border-top: 1px solid var(--line); }
.empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 14px; text-wrap: balance; }

/* Kies een route voor mij */
.km-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.km-tot { padding-bottom: 12px; color: var(--muted); font-size: 14px; }
.km-input { position: relative; display: block; margin-top: 3px; }
.km-input input { display: block; width: 100%; height: 50px; padding: 0 34px 0 12px; font-family: var(--fig); font-size: 26px; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid #c9d3d0; border-radius: 8px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.km-input input::-webkit-outer-spin-button, .km-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.km-input i { position: absolute; right: 11px; top: 16px; font-style: normal; font-size: 14px; font-weight: 500; color: var(--muted); }
.lucky { margin: -14px -16px 0; padding: 10px 16px; background: #fdeee8; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.lucky-acts { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; }

/* Teken een route */
.art-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; touch-action: none; cursor: crosshair; }
.art-canvas.off { pointer-events: none; }
.art-canvas polyline { stroke-linecap: round; stroke-linejoin: round; }
.art-canvas .under { stroke: #fff; stroke-width: 8; }
.art-canvas .over { stroke: var(--route); stroke-width: 4.5; }
.progress { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--wash); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--route); border-radius: 3px; transition: width 0.15s linear; }
.grade { display: inline-block; font-size: 13px; font-weight: 600; line-height: 22px; padding: 0 9px; border-radius: 11px; }
.grade.goed { background: #e0f2e7; color: #135c3a; }
.grade.redelijk { background: #fbf0d4; color: #6e4d00; }
.grade.zwak { background: #fdeee8; color: var(--err); }
.range input.one { display: block; width: 100%; height: 26px; margin: 4px 0 0; padding: 0; background: none; -webkit-appearance: none; appearance: none; }
.range input.one::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--band); }
.range input.one::-moz-range-track { height: 4px; border-radius: 2px; background: var(--band); }
.range input.one::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--band); box-shadow: 0 1px 3px rgba(17, 39, 44, 0.3); cursor: grab; }
.range input.one::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 2px solid var(--band); cursor: grab; }
.range-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.range .none { margin-top: 6px !important; }

/* Bouwen: keuzes voor een lang stuk */
.options { display: flex; flex-direction: column; gap: 4px; }
.options h3 { margin-bottom: 4px; }
.opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.opt:hover { background: var(--wash); }
.opt[aria-pressed="true"] { border-color: var(--route); box-shadow: inset 0 0 0 1px var(--route); }
.opt i { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; }
.opt[aria-pressed="true"] i { background: var(--route) !important; }
.opt-main { flex: 1; min-width: 0; }
.opt-main b { font-weight: 600; }
.opt-main small { display: block; color: var(--muted); font-size: 13px; line-height: 1.25; }
.opt-km { flex: none; font-family: var(--fig); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.options .actions { margin-top: 6px; }

/* Delen en tijden */
.card { display: block; width: 100%; height: auto; border-radius: 8px; margin-bottom: 10px; }
.field-copy { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 10px; }
.field-copy input { font-size: 13px; }
#p-share .none { margin-top: 10px; }
.fold summary { cursor: pointer; font-size: 15px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 1px 0; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.fold[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.fold .form { margin-top: 12px; }
.effort { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 5px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.effort.best { font-weight: 600; }
.act { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.act div { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.act small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.act button { flex: none; }

/* Boven de kaart */
.toast { position: absolute; z-index: 30; left: calc(var(--side) + var(--l) + (100% - var(--side) - var(--l)) / 2); transform: translateX(-50%); bottom: calc(26px + var(--b)); max-width: min(30rem, 60%); margin: 0; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); }
.hint { position: absolute; z-index: 5; pointer-events: none; left: calc(var(--side) + var(--l) + (100% - var(--side) - var(--l)) / 2); transform: translateX(-50%); top: calc(16px + var(--t)); margin: 0; padding: 7px 14px; background: var(--paper); color: var(--ink); border-radius: 18px; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); }

/* Op de kaart */
.wp { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--ink); border: 3px solid var(--route); display: grid; place-items: center; font-size: 11px; font-weight: 700; cursor: grab; padding: 0; }
.wp.start { background: var(--route); color: #fff; }
.wp:active { cursor: grabbing; }
.ghost { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--route); pointer-events: none; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #000; pointer-events: none; }
.tag { --tag: #5f8296; --tag-ink: #fff; display: flex; align-items: baseline; gap: 4px; height: 22px; padding: 0 7px; font-size: 13px; line-height: 22px; color: var(--tag-ink); background: var(--tag); border: 0; border-radius: 6px; white-space: nowrap; box-shadow: 0 0 0 1.5px #fff, 0 1px 4px rgba(17, 39, 44, 0.35); font-variant-numeric: tabular-nums; }
.tag b { font-family: var(--fig); font-weight: 600; font-size: 14px; }
.tag em { font-style: normal; font-weight: 500; font-size: 12px; opacity: 0.85; }
.tag::after { content: ""; position: absolute; left: 8px; bottom: -5px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--tag); }
.tag:hover, .tag.hot { box-shadow: 0 0 0 2.5px #fff, 0 2px 8px rgba(17, 39, 44, 0.5); }
.tag.bundle { --tag: var(--band); --tag-ink: #fff; }
.tip { pointer-events: none; z-index: 6; max-width: 15rem; padding: 5px 9px; background: var(--ink); color: #fff; border-radius: 6px; font-size: 13px; line-height: 1.25; box-shadow: var(--shadow); }
.tip b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip span { display: block; color: #c4d3d4; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-list { display: flex; flex-direction: column; gap: 2px; max-height: 14rem; overflow-y: auto; color: var(--ink); font-size: 14px; }
.popup-list button { display: flex; justify-content: space-between; gap: 14px; text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 6px; color: var(--ink); }
.popup-list b { font-weight: 600; }
.popup-list button:hover, .popup-list button:focus-visible { background: var(--wash); outline: 0; }
.popup-list span { white-space: nowrap; color: var(--muted); }
.wp.fixed { pointer-events: none; cursor: default; }
.building .maplibregl-canvas { cursor: crosshair; }
.popup-del { font-size: 14px; font-weight: 500; background: none; color: var(--err); border: 0; border-radius: 6px; padding: 6px 10px; }
.popup-del:hover { background: var(--wash); }
.maplibregl-popup-content { padding: 6px; border-radius: 10px; box-shadow: var(--shadow); }
.maplibregl-popup-close-button { display: none; }

/* Inlog- en beheerpagina's */
body.plain { overflow: auto; background: var(--wash); color: var(--ink); font-size: 16px; line-height: 1.5; }
.plain-top { background: var(--band); padding: 14px max(16px, var(--l)); }
.plain-top a { display: inline-flex; align-items: center; gap: 9px; color: var(--on-band); font-weight: 700; text-decoration: none; font-size: 18px; }
.plain-main { max-width: 32rem; margin: 28px auto 40px; padding: 26px 26px 22px; background: var(--paper); border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 39, 44, 0.08); }
.plain-main h1 { margin: 0 0 10px; font-size: 26px; font-weight: 600; line-height: 1.2; }
.plain-main h2 { margin: 24px 0 8px; font-size: 18px; font-weight: 600; }
.plain-main a { color: var(--ink); }
.plain-main code { background: var(--wash); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.plain-main .err { color: var(--err); background: #fdeee8; padding: 9px 12px; border-radius: 8px; }
.plain-main .ok { color: #125a38; background: #e3f4ea; padding: 9px 12px; border-radius: 8px; }
.plain-form { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.plain-form label { display: block; font-weight: 500; font-size: 14px; }
.plain-form input { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 12px; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid #c9d3d0; border-radius: 8px; }
.plain-form input:focus { outline: 0; border-color: var(--band); box-shadow: 0 0 0 1px var(--band); }
.plain-form button { align-self: flex-start; min-height: 44px; background: var(--go); color: #fff; border: 0; border-radius: 8px; padding: 0 18px; font-weight: 600; }
.plain-form button:hover { background: var(--go-2); }

/* Venster en plusknop */
.dialog { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(17, 39, 44, 0.45); }
.dialog-card { width: min(24rem, 100%); padding: 20px; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.dialog-card h2 { margin: 0; font-size: 20px; font-weight: 600; }
.dialog-card p { margin: 0; }
.dialog-acts { display: flex; gap: 8px; margin-top: 4px; }
.dialog-acts .btn { flex: 1 1 0; min-height: 46px; font-size: 16px; }
.tips.big { color: var(--ink); font-size: 15px; gap: 7px; }
.fab { display: none; }
.rr-tools { display: none; }
.pbar { display: flex; align-items: center; gap: 10px; }
.pbar-km { flex: 1; min-width: 0; }
.pbar-km b { display: block; font-family: var(--fig); font-size: 30px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pbar-km small { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .btn { min-height: 48px; padding: 0 24px; font-size: 17px; }

/* Telefoon: de kaart vult het scherm, zoekbalk boven, lade onder */
@media (max-width: 700px) {
  #map { left: 0; }
  .side { display: contents; }
  .bar { position: absolute; z-index: 12; top: calc(8px + var(--t)); left: calc(8px + var(--l)); right: calc(8px + var(--r)); border-radius: 12px; box-shadow: var(--shadow); }
  .band { padding: 6px 8px 8px; border-radius: 12px; gap: 6px; }
  .filters { border-radius: 0 0 12px 12px; max-height: 58vh; overflow-y: auto; border-bottom: 0; }
  .bar:has(.filters:not([hidden])) .band { border-radius: 12px 12px 0 0; }
  .panel { position: absolute; z-index: 11; left: var(--l); right: var(--r); bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -2px 18px rgba(17, 39, 44, 0.22); overscroll-behavior: contain; }
  .panel.half { max-height: 54%; }
  .panel.full { max-height: calc(100% - 116px); }
  .panel.dragging { user-select: none; }
  .panel.dragging .scroll { overflow: hidden; }
  .foot { display: none; }
  .fab { position: absolute; right: 12px; top: -70px; width: 58px; height: 58px; display: grid; place-items: center; padding: 0; color: #fff; background: var(--go); border: 0; border-radius: 50%; box-shadow: 0 3px 12px rgba(17, 39, 44, 0.4); touch-action: manipulation; }
  .fab[hidden] { display: none; }
  .fab:active { background: var(--go-2); }
  .panel.full .fab { display: none; }
  .sheet, .head, .list-head, .lucky { touch-action: none; }
  /* Bouwen: alleen de kaart, de lengte en de knoppen die je nodig hebt */
  .build-phone .bar { display: none; }
  .build-phone .hint { top: calc(12px + var(--t)); max-width: calc(100% - 90px); left: calc(50% - 30px); }
  .build-phone .toast { top: calc(56px + var(--t)); }
  .panel.barmode { border-radius: 16px 16px 0 0; }
  .panel.barmode .sheet { display: none; }
  .panel.barmode .scroll { flex: none; padding: 10px 14px calc(10px + var(--b)) 8px; overflow: visible; }
  .panel.barmode .fab { display: none; }
  .build-phone .maplibregl-ctrl-top-right { top: auto; bottom: calc(86px + var(--b)); }
  .build-phone .maplibregl-ctrl-attrib { position: fixed; top: calc(8px + var(--t)); right: 8px; margin: 0; }
  .build-phone .rr-tools { display: block; }
  .rr-tools .ico { margin: auto; }
  .rr-tools button:disabled { color: #b5c0be; }
  .rr-tools button:not(:disabled) { color: var(--ink); }
  .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .c-start { display: grid; place-items: center; width: 26px; height: 26px; margin: auto; border-radius: 50%; background: var(--route); color: #fff; font-size: 14px; font-weight: 700; }
  .rr-tools button:disabled .c-start { background: #c9d3d0; }
  /* Klaar-scherm: wat al op de kaart staat hoeft hier niet nog een keer */
  #p-undo, #p-loop, #p-cancel { display: none; }
  .nostick { display: none; }
    .panel.compact .scroll > *:not(.stats):not(.keep) { display: none; }
  .panel.compact .scroll { padding-bottom: 10px; flex: none; }
  .panel.compact .stats dd.pace, .panel.compact .sort { display: none; }
  .panel.compact .stats dd { font-size: 24px; }
  .sheet { display: block; flex: none; height: 24px; background: none; border: 0; position: relative; }
  .sheet::after { content: ""; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #c3cdca; }
  .scroll { padding-top: 0; }
  .lucky { margin-top: 0; }
  .stats dd { font-size: 28px; }
  .maplibregl-ctrl-top-right { top: 104px; }
  .maplibregl-ctrl-bottom-left { display: none; }
  .toast { left: 50%; bottom: auto; top: calc(112px + var(--t)); max-width: 90%; }
  .hint { left: 50%; top: calc(112px + var(--t)); }
  .plain-main { margin: 0; border-radius: 0; box-shadow: none; padding: 22px max(16px, var(--r)) 30px max(16px, var(--l)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
