/* ============================== tokens ============================== */
:root {
  --bg: #070b14;
  --glass: rgb(13 20 36 / .72);
  --glass-strong: rgb(15 23 42 / .92);
  --line: rgb(148 163 184 / .16);
  --line-strong: rgb(148 163 184 / .28);
  --text: #e8eef8;
  --muted: #8b9ab3;
  --accent: #2dd4bf;
  --accent-2: #818cf8;
  --accent-ink: #032b28;
  --warn-bg: rgb(245 158 11 / .14);
  --warn-text: #fcd34d;
  --danger: #f43f5e;
  --ok: #22c55e;
  --card: rgb(255 255 255 / .04);
  --card-hover: rgb(255 255 255 / .08);
  --shadow: 0 10px 40px rgb(0 0 0 / .45);
  --radius: 18px;
  --tiles: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.7);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef2f7;
  --glass: rgb(255 255 255 / .78);
  --glass-strong: rgb(255 255 255 / .95);
  --line: rgb(15 23 42 / .09);
  --line-strong: rgb(15 23 42 / .16);
  --text: #0f172a;
  --muted: #5b6b82;
  --accent: #0d9488;
  --accent-2: #6366f1;
  --accent-ink: #ffffff;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --card: rgb(15 23 42 / .03);
  --card-hover: rgb(15 23 42 / .06);
  --shadow: 0 10px 40px rgb(15 23 42 / .14);
  --tiles: none;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef2f7; --glass: rgb(255 255 255 / .78); --glass-strong: rgb(255 255 255 / .95);
    --line: rgb(15 23 42 / .09); --line-strong: rgb(15 23 42 / .16); --text: #0f172a; --muted: #5b6b82;
    --accent: #0d9488; --accent-2: #6366f1; --accent-ink: #fff; --warn-bg: #fef3c7; --warn-text: #92400e;
    --card: rgb(15 23 42 / .03); --card-hover: rgb(15 23 42 / .06); --shadow: 0 10px 40px rgb(15 23 42 / .14);
    --tiles: none; color-scheme: light;
  }
}

/* ============================== basis ============================== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; }
b { font-weight: 650; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.brand.big { font-size: 26px; margin-bottom: 28px; }
.logo {
  width: 22px; height: 22px; border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent));
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px 7px, transparent 7.5px 10px, #000 10.5px);
          mask: radial-gradient(circle, transparent 5px, #000 5.5px 7px, transparent 7.5px 10px, #000 10.5px);
}
.logo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--accent) 0 4.5px, transparent 5px); -webkit-mask: none; }
.brand.big .logo { width: 34px; height: 34px; }

select, input[type="text"], input[type="date"] {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; min-width: 0;
  outline: none; transition: border-color .15s;
}
select:focus, input:focus { border-color: var(--accent); }
select option { background: var(--glass-strong); color: var(--text); }
.btn {
  font: inherit; font-weight: 600; color: var(--text); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: transform .12s, background .15s, border-color .15s;
}
.btn:hover { background: var(--card-hover); border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 9px 13px; }
.row { display: flex; gap: 8px; margin-bottom: 10px; }
.row > select, .row > input { flex: 1; }

/* ============================== koppelen ============================== */
.pair { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; }
.aurora { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
.aurora i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .35;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { background: var(--accent); top: -25vmax; left: -15vmax; }
.aurora i:nth-child(2) { background: var(--accent-2); bottom: -30vmax; right: -20vmax; animation-delay: -7s; }
.aurora i:nth-child(3) { background: #ec4899; top: 30%; left: 45%; width: 35vmax; height: 35vmax; opacity: .18; animation-delay: -14s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

.pair-card {
  width: min(980px, 100%); display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px;
  padding: 44px; border-radius: 28px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: var(--shadow); animation: rise .6s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.pair h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 22px; }
.steps { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.steps span {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 14px; color: var(--accent); border: 1.5px solid var(--accent);
}
.trust { display: grid; gap: 10px; margin-bottom: 18px; }
.trust div { padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.trust b { display: block; margin-bottom: 2px; }
.trust span { color: var(--muted); font-size: 13px; }
.alt summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; }

.pair-qr { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-frame {
  position: relative; width: 300px; max-width: 100%; aspect-ratio: 1; padding: 18px; border-radius: 24px;
  background: #fff; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgb(45 212 191 / .25);
}
.qr-frame::before {
  content: ""; position: absolute; inset: -3px; border-radius: 27px; z-index: -1;
  background: conic-gradient(from var(--a, 0deg), var(--accent), var(--accent-2), #ec4899, var(--accent));
  animation: spin 6s linear infinite;
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }
.qr svg { width: 100%; height: 100%; display: block; }
.qr { width: 100%; height: 100%; transition: filter .3s, opacity .3s; }
.qr.blur { filter: blur(6px); opacity: .5; }
.qr-logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 16px; background: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgb(0 0 0 / .15);
}
.qr-logo .logo { width: 36px; height: 36px; }
.qr-overlay, .qr-done {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 24px;
}
.qr-done { background: rgb(255 255 255 / .94); color: #0f172a; align-content: center; gap: 10px; justify-items: center; }
.qr-done svg { width: 84px; height: 84px; }
.qr-done circle { fill: none; stroke: #22c55e; stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .6s forwards; }
.qr-done path { fill: none; stroke: #22c55e; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .45s forwards; }
.qr-done b { font-size: 20px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.qr-caption { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.6s infinite; }
@keyframes pulse-dot { 50% { opacity: .3; } }

/* ============================== dashboard ============================== */
.app { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
.leaflet-container { font: inherit; background: var(--bg); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; }
.leaflet-control-zoom a { background: var(--glass-strong) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--muted) !important; border-radius: 8px 0 0 0; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-top.leaflet-right { top: 76px; }

.topbar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1000; height: 56px;
  display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; border-radius: 18px;
}
.spacer { flex: 1; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-right: 4px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn[data-state="online"] i { background: var(--ok); box-shadow: 0 0 0 0 rgb(34 197 94 / .6); animation: ping 2s infinite; }
.conn[data-state="connecting"] i { background: #f59e0b; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0); } 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); } }
.spin-icon { display: inline-block; }
.spinning .spin-icon { animation: rot .9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.menu {
  position: absolute; right: 8px; top: 62px; border-radius: 14px; padding: 6px; display: grid; min-width: 230px;
  background: var(--glass-strong); animation: rise .15s;
}
.menu button { font: inherit; text-align: left; color: var(--text); background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.menu button:hover { background: var(--card-hover); }
.menu .danger { color: var(--danger); }

.panel {
  position: absolute; z-index: 999; top: 80px; left: 12px; bottom: 12px; width: 380px;
  border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.tabs { position: relative; display: flex; padding: 8px 8px 0; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; font: inherit; font-weight: 650; background: none; border: 0; color: var(--muted);
  padding: 10px 12px 12px; cursor: pointer; transition: color .15s;
}
.tabs button[aria-selected="true"] { color: var(--text); }
.tab-ink {
  position: absolute; bottom: -1px; left: 8px; height: 2px; width: calc(50% - 9px);
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px; transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.tabs[data-tab="history"] .tab-ink { transform: translateX(calc(100% + 2px)); }
.tab { flex: 1; overflow: auto; padding: 14px; scrollbar-width: thin; }
.foot { padding: 10px 16px; border-top: 1px solid var(--line); text-align: center; }

/* leden */
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.member {
  position: relative; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  cursor: pointer; transition: background .15s, border-color .15s, transform .15s; animation: rise .35s backwards;
}
.member:hover { background: var(--card-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.member .head { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; }
.member .name { font-weight: 650; font-size: 15.5px; }
.member .meta { font-size: 13px; color: var(--muted); }
.member .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--card-hover); color: var(--text); display: inline-flex; gap: 5px; align-items: center; }
.chip.speed { color: #fff; }
.chip.live { color: var(--ok); }
.member .warn { margin-top: 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); }
.member.sos { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger), 0 0 30px rgb(244 63 94 / .3); }
.member.stale .avatar { filter: grayscale(.8); opacity: .65; }

.battery { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.battery .cell { width: 26px; height: 12px; border-radius: 3px; border: 1.5px solid currentColor; position: relative; padding: 1px; }
.battery .cell::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: currentColor; border-radius: 1px; }
.battery .fill { display: block; height: 100%; border-radius: 1px; background: var(--ok); }
.battery.mid .fill { background: #f59e0b; }
.battery.low .fill { background: var(--danger); }
.battery.low { color: var(--danger); }

.avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; position: relative;
  color: #fff; font-weight: 750; font-size: 16px; border: 3px solid var(--glass-strong);
  box-shadow: 0 4px 14px rgb(0 0 0 / .35);
}

/* kaartmarkers */
.pin { background: none; border: 0; }
.pin .wrap { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.pin .avatar { width: 44px; height: 44px; font-size: 15px; border-color: #fff; z-index: 2; }
.pin .pulse { position: absolute; inset: 4px; border-radius: 50%; background: var(--c); opacity: .55; animation: halo 2.2s ease-out infinite; }
@keyframes halo { to { transform: scale(2.2); opacity: 0; } }
.pin .heading { position: absolute; inset: -6px; z-index: 1; transform: rotate(var(--h)); }
.pin .heading::before {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  border: 7px solid transparent; border-bottom: 11px solid var(--c); border-top: 0;
}
.pin .badge {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); z-index: 3; white-space: nowrap;
  font-size: 11px; font-weight: 750; color: #fff; padding: 2px 7px; border-radius: 999px; box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.pin.stale .avatar { filter: grayscale(.85); opacity: .75; }
.pin.sos .avatar { box-shadow: 0 0 0 4px var(--danger), 0 0 24px var(--danger); }
.stay-pin { background: none; border: 0; }
.stay-pin div { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--c); box-shadow: 0 2px 8px rgb(0 0 0 / .4); }
.cursor-pin { background: none; border: 0; }
.cursor-pin div { width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 6px rgb(255 255 255 / .2), 0 2px 10px rgb(0 0 0 / .5); }

/* geschiedenis */
.datebar input { text-align: center; }
.datebar .btn:disabled { opacity: .35; cursor: default; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; animation: rise .35s backwards; }
.stat b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.hl b { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chart { height: 92px; margin-bottom: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); padding: 8px 8px 4px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis { position: absolute; left: 10px; top: 6px; font-size: 11px; color: var(--muted); }
.scrub { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.scrub input { flex: 1; accent-color: var(--accent); }
.play { width: 40px; justify-content: center; }
.pointcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-variant-numeric: tabular-nums; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pc-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.pc-head > b { font-size: 16px; letter-spacing: -.02em; }
.pc-head .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-idx { font-size: 11px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; min-width: 0; }
.pc-grid div { background: var(--card-hover); border-radius: 9px; padding: 6px 8px; display: grid; gap: 1px; min-width: 0; }
.pc-grid span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-grid b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-coords { display: flex; align-items: center; gap: 6px; }
.pc-coords code { flex: 1; font-size: 12px; background: var(--card-hover); padding: 4px 8px; border-radius: 8px; user-select: all; }
.btn.mini { padding: 3px 8px; font-size: 13px; line-height: 1.2; text-decoration: none; }
.pc-place { font-size: 12.5px; }
.readout-line { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.readout-line b { color: var(--text); }
/* infokaart aan de cursor op de kaart: compact, rustig, één accent */
.kcard .maplibregl-popup-content { box-sizing: border-box; width: 296px; max-width: 100%; background: var(--glass-strong); color: var(--text); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 14px 40px rgb(0 0 0 / .35); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; backdrop-filter: blur(16px); overflow: hidden; }
.kcard .maplibregl-popup-tip { display: none; }
.kc-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px 8px; border-left: 3px solid var(--m); }
.kc-time { line-height: 1; }
.kc-time b { font-size: 20px; letter-spacing: -.03em; }
.kc-time small { font-size: 12px; color: var(--muted); }
.kc-speed { display: flex; align-items: baseline; gap: 4px; margin-left: auto; line-height: 1; }
.kc-speed i { font-style: normal; font-size: 15px; align-self: center; }
.kc-speed b { font-size: 24px; letter-spacing: -.04em; color: var(--m); }
.kc-speed small { font-size: 11px; color: var(--muted); }
.kc-still { font-size: 14px; color: var(--muted); }
.kc-dir { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.kc-dir span { display: inline-block; font-size: 13px; color: var(--m); }
.kc-ctx { padding: 0 12px 8px; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.kc-stat { padding: 7px 6px; text-align: center; min-width: 0; }
.kc-stat + .kc-stat { border-left: 1px solid var(--line); }
.kc-stat b { display: block; font-size: 13.5px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-stat span { display: block; white-space: nowrap; font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }
.kc-foot { display: flex; align-items: center; gap: 6px; padding: 8px 12px 4px; }
.kc-foot code { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; padding: 0; }
.kc-btn { font: inherit; font-size: 13px; line-height: 1; padding: 4px 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; }
.kc-btn:hover { border-color: var(--accent); color: var(--accent); }
.kc-place { padding: 0 12px 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-pin { margin-right: 4px; }
.kc-idx { padding: 0 12px 9px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.timeline li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 8px 8px 8px 0; border-radius: 12px; cursor: pointer; animation: rise .35s backwards; }
.timeline li:hover { background: var(--card-hover); }
.timeline li.empty { display: block; cursor: default; }
.timeline li.empty:hover { background: none; }
.timeline li.skel-row { cursor: default; animation: rise .35s backwards; }
.timeline li.skel-row:hover { background: none; }
.skel { background: linear-gradient(90deg, var(--card-hover) 25%, var(--card) 50%, var(--card-hover) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; color: transparent !important; }
.skel.ico { width: 36px; height: 36px; border-radius: 50%; }
.skel.line { height: 12px; margin: 6px 0; }
.skel.line.w60 { width: 60%; } .skel.line.w40 { width: 40%; }
.stat.skel b, .stat.skel span { color: transparent; }
.timeline .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; z-index: 1; font-size: 16px; background: var(--glass-strong); border: 2px solid var(--line-strong); }
.timeline .move .ico { color: #fff; border: 0; }
.timeline .what { font-weight: 650; }
.timeline .when { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }

.legend { position: absolute; z-index: 998; right: 12px; bottom: 28px; border-radius: 12px; padding: 8px 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.legend i { width: 14px; height: 4px; border-radius: 2px; }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgb(0 0 0 / .55); backdrop-filter: blur(4px); padding: 16px; }
.modal .sheet { background: var(--glass-strong); border: 1px solid var(--line); border-radius: 24px; padding: 28px; text-align: center; max-width: 380px; width: 100%; box-shadow: var(--shadow); animation: rise .3s; }
.modal .qr-frame { margin: 18px auto; width: 260px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 4000;
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.sos { background: var(--danger); color: #fff; font-weight: 700; border: 0; }

/* ============================== mobiel ============================== */
@media (max-width: 820px) {
  .pair-card { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .pair-qr { order: -1; }
  .pair h1 { font-size: 23px; }
  .brand.big { margin-bottom: 16px; }
  .topbar { top: 8px; left: 8px; right: 8px; height: 50px; }
  .topbar .lbl, .conn span { display: none; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 46vh; }
  .leaflet-top.leaflet-right { top: 66px; }
  .legend { bottom: calc(46vh + 16px); right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* plaatsnamen */
.members { grid-template-columns: minmax(0, 1fr); }
.member { min-width: 0; }
.member .head > div { min-width: 0; }
.member .name, .member .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .place { margin-top: 10px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.place-ico {
  flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 15px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.place-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.place-txt b, .place-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-txt b { font-size: 14px; font-weight: 650; }
.place-txt small { font-size: 12.5px; color: var(--muted); }
.shimmer { background: linear-gradient(90deg, var(--muted) 0%, var(--text) 50%, var(--muted) 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.places { margin-bottom: 12px; }
.places-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px 2px; }
.place-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.place-chip {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 11px;
  display: inline-flex; gap: 6px; align-items: baseline; animation: rise .35s backwards; transition: border-color .15s, background .15s;
}
.place-chip:hover { border-color: var(--accent); background: var(--card-hover); }
.place-chip span { font-weight: 500; font-size: 12px; color: var(--muted); }
.timeline .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 270px; }
.timeline .dur { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }

/* MapLibre */
#map .maplibregl-canvas { outline: none; }
.maplibregl-popup-content { background: var(--glass-strong); color: var(--text); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 30px 12px 14px; font: inherit; border: 1px solid var(--line); }
.maplibregl-popup-tip { border-top-color: var(--glass-strong) !important; border-bottom-color: var(--glass-strong) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; right: 6px; top: 4px; }
.maplibregl-ctrl-group { background: var(--glass-strong) !important; border: 1px solid var(--line); box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: var(--icon-filter, none); }
:root:not([data-theme="light"]) { --icon-filter: invert(1) brightness(1.4); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --icon-filter: none; } }
:root[data-theme="light"] { --icon-filter: none; }
.maplibregl-ctrl-top-right { top: 76px; right: 4px; }
.maplibregl-ctrl-attrib { background: var(--glass) !important; color: var(--muted); border-radius: 10px 0 0 0; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-marker { cursor: pointer; }
@media (max-width: 820px) { .maplibregl-ctrl-top-right { top: 64px; } }

.sos-warn { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sos-warn .x { font: inherit; font-size: 18px; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; padding: 0 4px; opacity: .7; }
.sos-warn .x:hover { opacity: 1; }

/* versheid: eerlijk zeggen hoe oud en waarom */
.pin .badge.age { background: var(--glass-strong); color: var(--text); border: 1px solid var(--line-strong); top: auto; }
.pin .badge.age.silent { border-color: var(--danger); }
.member .age-line { color: var(--warn-text); font-weight: 600; }
.member .age-line.silent { color: var(--danger); }
.member .why { margin-top: 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }

/* dagrecap: de kaart is even helemaal van de film */
body.recapping .panel, body.recapping .legend, body.recapping .topbar { display: none !important; }
.recap {
  position: absolute; z-index: 1000; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: min(600px, calc(100vw - 24px)); border-radius: 26px; padding: 16px 18px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--glass-strong) 96%, #fff 4%), var(--glass));
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgb(255 255 255 / .35);
  box-shadow: 0 1px 0 rgb(255 255 255 / .5) inset, 0 24px 60px rgb(10 20 40 / .28), 0 6px 16px rgb(10 20 40 / .14);
  animation: rc-in .4s cubic-bezier(.2, .9, .25, 1.1);
}
@keyframes rc-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.rc-title {
  position: absolute; z-index: 1000; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; max-width: calc(100vw - 110px); overflow: hidden; text-overflow: ellipsis;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 8px 24px rgb(10 20 40 / .16);
}
.rc-top { display: flex; align-items: center; gap: 12px; min-height: 50px; }
.rc-clock { font-size: 42px; font-weight: 750; letter-spacing: -2px; line-height: 1; font-variant-numeric: tabular-nums; }
.rc-chip-slot { flex: none; }
.rc-chip {
  width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000));
  box-shadow: 0 1px 0 rgb(255 255 255 / .45) inset, 0 -2px 3px rgb(0 0 0 / .14) inset, 0 5px 12px color-mix(in srgb, var(--c) 42%, transparent);
}
.rc-chip svg { filter: drop-shadow(0 1px 1px rgb(0 0 0 / .25)); }
.rc-chip.stop { background: linear-gradient(160deg, #fff, #e8edf4); box-shadow: 0 1px 0 #fff inset, 0 -2px 3px rgb(0 0 0 / .06) inset, 0 4px 10px rgb(10 20 40 / .14); font-size: 19px; }
.rc-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-what b { font-size: 15.5px; font-weight: 650; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-what span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-speed { display: flex; flex-direction: column; align-items: center; line-height: 1; padding: 6px 11px; border-radius: 14px; background: rgb(127 127 127 / .12); box-shadow: 0 1px 2px rgb(0 0 0 / .08) inset; font-variant-numeric: tabular-nums; }
.rc-speed b { font-size: 18px; font-weight: 750; letter-spacing: -.5px; }
.rc-speed span { font-size: 9.5px; font-weight: 600; color: var(--muted); margin-top: 2px; letter-spacing: .3px; }
.rc-bar { display: flex; gap: 4px; margin: 13px 0 8px; height: 20px; align-items: center; cursor: pointer; touch-action: none; }
.rc-bar i { position: relative; height: 7px; border-radius: 4px; background: rgb(127 127 127 / .22); box-shadow: 0 1px 1px rgb(0 0 0 / .1) inset; display: block; }
.rc-bar i.stop { flex: 0 0 7px; width: 7px; border-radius: 50%; }
.rc-bar u { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c)); border-radius: inherit; text-decoration: none; display: block; }
.rc-bar i.now u::after {
  content: ''; position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%;
  background: linear-gradient(180deg, #fff, #eef2f7); border: 2.5px solid var(--c); box-shadow: 0 2px 7px rgb(10 20 40 / .32);
}
.rc-buttons { display: flex; align-items: center; gap: 10px; }
.rc-total { flex: 1; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); border: 0; font: inherit;
  background: linear-gradient(180deg, rgb(255 255 255 / .92), rgb(236 240 246 / .9));
  box-shadow: 0 1px 0 #fff inset, 0 -1px 2px rgb(0 0 0 / .05) inset, 0 3px 9px rgb(10 20 40 / .14), 0 0 0 1px rgb(10 20 40 / .05);
  transition: transform .14s, box-shadow .14s;
}
.rc-btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 #fff inset, 0 6px 14px rgb(10 20 40 / .18), 0 0 0 1px rgb(10 20 40 / .06); }
.rc-btn:active { transform: translateY(1px) scale(.96); }
.rc-rate { width: 50px; border-radius: 21px; font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; }
.rc-play {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; border: 0; position: relative;
  background: radial-gradient(120% 90% at 50% 0%, #5eead4 0%, #14b8a6 42%, #0f766e 100%);
  box-shadow:
    0 2px 1px rgb(255 255 255 / .55) inset,
    0 -5px 9px rgb(4 60 56 / .45) inset,
    0 10px 22px rgb(13 148 136 / .42),
    0 3px 6px rgb(10 20 40 / .22),
    0 0 0 1px rgb(4 80 74 / .35);
  transition: transform .15s cubic-bezier(.3, 1.4, .5, 1), box-shadow .15s;
}
.rc-play::before { content: ''; position: absolute; inset: 4px 8px auto; height: 42%; border-radius: 50% 50% 46% 46%; background: linear-gradient(180deg, rgb(255 255 255 / .42), rgb(255 255 255 / 0)); pointer-events: none; }
.rc-play svg { position: relative; filter: drop-shadow(0 2px 2px rgb(4 50 46 / .55)); }
.rc-play:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 2px 1px rgb(255 255 255 / .6) inset, 0 -5px 9px rgb(4 60 56 / .45) inset, 0 14px 28px rgb(13 148 136 / .5), 0 4px 8px rgb(10 20 40 / .24), 0 0 0 1px rgb(4 80 74 / .35); }
.rc-play:active { transform: translateY(1px) scale(.95); box-shadow: 0 2px 6px rgb(4 50 46 / .55) inset, 0 3px 8px rgb(13 148 136 / .4), 0 0 0 1px rgb(4 80 74 / .35); }
[data-theme="dark"] .rc-btn { background: linear-gradient(180deg, rgb(51 65 85 / .95), rgb(30 41 59 / .95)); box-shadow: 0 1px 0 rgb(255 255 255 / .1) inset, 0 3px 9px rgb(0 0 0 / .4), 0 0 0 1px rgb(255 255 255 / .06); }

.rc-cursor-wrap, .rc-stop-wrap { background: none; border: 0; overflow: visible; }
.rc-heading { width: 46px; height: 46px; transition: none; }
.rc-walker { position: absolute; left: -32px; top: -71px; width: 110px; height: 124px; pointer-events: none; }
.rc-car { filter: drop-shadow(0 5px 6px rgb(10 20 40 / .45)) drop-shadow(0 1px 1px rgb(10 20 40 / .4)); }
.rc-disc {
  width: 42px; height: 42px; margin: 2px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--c) 62%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 75%, #000));
  border: 2.5px solid #fff;
  box-shadow: 0 7px 14px rgb(10 20 40 / .38), 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent);
}
.rc-disc svg { filter: drop-shadow(0 1px 1px rgb(0 0 0 / .3)); }
/* speld: de punt staat op de plek */
.rc-pin { position: relative; width: 44px; height: 56px; transform: translateY(-24px); filter: drop-shadow(0 7px 7px rgb(10 20 40 / .35)); animation: rc-drop .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes rc-drop { from { opacity: 0; transform: translateY(-58px) scale(.8); } to { opacity: 1; transform: translateY(-24px) scale(1); } }
.rc-pin svg { display: block; }
.rc-pin-emoji { position: absolute; left: 0; right: 0; top: 11px; text-align: center; font-size: 19px; line-height: 24px; }
.rc-pin em { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #0f172a; color: #fff; font: 700 10.5px/18px system-ui, sans-serif; text-align: center; font-style: normal; box-shadow: 0 0 0 2px #fff; }
.rc-pin b { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 6px 13px; border-radius: 999px; background: var(--glass-strong); color: var(--text); font-size: 13.5px; font-weight: 650; white-space: nowrap; box-shadow: 0 8px 20px rgb(10 20 40 / .22); opacity: 0; transition: opacity .25s; pointer-events: none; }
.rc-pin.on { --pin: var(--accent); }
.rc-pin.on b { opacity: 1; }
@media (max-width: 820px) {
  .recap { bottom: 10px; padding: 12px 13px 9px; border-radius: 22px; }
  .rc-clock { font-size: 32px; letter-spacing: -1.5px; }
  .rc-chip { width: 32px; height: 32px; border-radius: 11px; }
  .rc-play { width: 54px; height: 54px; }
  .rc-btn { width: 38px; height: 38px; }
}
.rc-total { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rc-mini { width: 20px; height: 20px; border-radius: 7px; display: inline-grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 1px 0 rgb(255 255 255 / .35) inset, 0 2px 4px rgb(10 20 40 / .18); }

/* privacy: één slotje in plaats van zinnetjes overal */
.foot .seal { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); font: 600 12.5px/1 inherit; cursor: pointer; padding: 6px 10px; border-radius: 999px; }
.foot .seal svg { width: 14px; height: 14px; fill: var(--accent); }
.foot .seal:hover, .foot .seal:focus-visible { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.modal .sheet.privacy { max-width: 520px; text-align: left; max-height: min(86vh, 860px); overflow: auto; display: grid; gap: 12px; }
.privacy h2 { margin: 0; text-align: center; text-wrap: balance; }
.privacy h3 { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.privacy > p.muted { margin: 0; text-align: center; line-height: 1.5; }
.pv-seal { justify-self: center; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 5px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.pv-seal svg { width: 28px; height: 28px; fill: var(--accent); }
.pv-how { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 6px; text-align: center; }
.pv-how div { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pv-how div.dim { background: color-mix(in srgb, var(--muted) 12%, transparent); }
.pv-how span { font-size: 12px; color: var(--muted); }
.pv-how i { font-style: normal; color: var(--muted); }
.pv-log, .pv-knows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pv-log > li { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.pv-log summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pv-log summary span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pv-log ul { margin: 2px 0 6px; padding-left: 18px; font-size: 13px; }
.pv-k { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.pv-k.lock { color: var(--accent); }
.pv-knows li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); }
.pv-knows span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 480px) { .pv-how { grid-template-columns: 1fr; } .pv-how i { transform: rotate(90deg); } }

/* rondgelopen op een plek (markt): het lopen blijft zichtbaar */
.timeline .walked { margin-top: 4px; display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 999px; padding: 2px 9px; }

/* afspeelknop plat, zoals in de app */
.rc-play { background: var(--accent) !important; box-shadow: none !important; }
.rc-play::before { display: none !important; }
.rc-play svg { filter: none !important; }
.rc-play:hover { transform: none !important; box-shadow: none !important; filter: brightness(1.08); }
.rc-play:active { transform: scale(.96) !important; box-shadow: none !important; }
.rc-btn { box-shadow: none !important; }
.rc-chip { box-shadow: none !important; background: color-mix(in srgb, var(--c) 14%, transparent) !important; color: var(--c) !important; }
.rc-mini { box-shadow: none !important; }
.rc-btn { background: color-mix(in srgb, var(--text) 7%, transparent) !important; }
.rc-chip.stop { background: color-mix(in srgb, var(--text) 7%, transparent) !important; }
.rc-chip svg, .rc-btn svg { filter: none !important; }

/* zachte gloed om elke pin, ook als de locatie niet live is; live pulseert hij erbovenop */
.pin .wrap::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; background: var(--c); opacity: .22; filter: blur(6px); pointer-events: none; }
.pin.stale .wrap::before { opacity: .1; }
