  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    /* Licht thema (standaard) */
    --paper: #f4f5f7;
    --surface: #ffffff;
    --ink: #1a1d21;
    --ink-soft: #555b62;
    --ink-faint: #8b929a;
    --line: #e4e7ea;
    --line-soft: #eff1f4;
    --signal: #0e5a35;
    --signal-2: #69c241;
    --signal-wash: #e7f2ea;
    --warn: #b25a14; --warn-wash: #f7ebe0;
    /* Pas-merkkleuren (voor de data) */
    --anwb: #f5a623; --shell: #e8001c; --tap: #5b4fcf; --audi: #bb0a30; --vattenfall: #e6b800;
    /* Header + sessiebalk (thema-afhankelijk) */
    --header-bg: #ffffff; --header-fg: #1a1d21; --header-muted: #8b929a; --header-line: #e4e7ea;
    --input-bg: #f4f5f7; --input-fg: #1a1d21; --input-ph: #9aa0a8;
    --bar-bg: #f7f8fa; --bar-fg: #3a4046; --bar-muted: #8b929a; --bar-line: #e4e7ea;
    /* Vaste kleuren voor "solide" knoppen (bv. Toevoegen/Versturen): bewust NIET --ink,
       want die kleurt om per thema en zou de knop onleesbaar maken in donker thema. */
    --btn-solid-bg: #1a1d21; --btn-solid-fg: #fbfbf9;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --r: 6px;
  }
  [data-theme="dark"] {
    --paper: #16181a;
    --surface: #1e2124;
    --ink: #e9ebee;
    --ink-soft: #a7adb4;
    --ink-faint: #7c828a;
    --line: #313539;
    --line-soft: #282c30;
    --signal: #6cc247;
    --signal-2: #78cf50;
    --signal-wash: #17281d;
    --warn: #d98a4a; --warn-wash: #2a201a;
    --header-bg: #1b1d20; --header-fg: #f2f4f6; --header-muted: #8b9098; --header-line: #313539;
    --input-bg: #26292d; --input-fg: #f2f4f6; --input-ph: #7c828a;
    --bar-bg: #26292d; --bar-fg: #dfe2e6; --bar-muted: #90969e; --bar-line: #313539;
    --btn-solid-bg: #2a2e33; --btn-solid-fg: #f2f4f6;
  }
  body { font-family: var(--font); background: var(--paper); color: var(--ink); height: 100vh; height: 100dvh; overflow: hidden; -webkit-font-smoothing: antialiased; }
  .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
  .eyebrow { text-transform: uppercase; letter-spacing: .08em; }
  .app { display: grid; grid-template-columns: 400px 1fr; grid-template-rows: auto auto 1fr auto; height: 100vh; height: 100dvh; }

  /* ── Header ── */
  header { grid-column: 1 / -1; background: var(--header-bg); border-bottom: 1px solid var(--header-line); display: flex; align-items: flex-end; gap: 14px; padding: 0 18px 10px; min-height: 88px; }
  .brand { display: flex; align-items: center; gap: 9px; }
  .brand .logo { height: 68px; width: auto; display: block; }
  .head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
  .search { width: 260px; position: relative; margin-left: 6px; }
  .search input { width: 100%; padding: 8px 38px 8px 12px; border: 1px solid var(--header-line); border-radius: var(--r); font-size: 13px; background: var(--input-bg); color: var(--input-fg); outline: none; transition: border-color .15s; }
  .search input::placeholder { color: var(--input-ph); }
  .search input:focus { border-color: var(--signal); }
  .search-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: calc(var(--r) - 2px); color: var(--ink-faint); cursor: pointer; transition: color .12s; }
  .search-btn:hover { color: var(--signal); }
  .icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--header-line); border-radius: var(--r); background: transparent; color: var(--header-fg); cursor: pointer; transition: border-color .12s, color .12s; padding: 0; }
  .icon-btn:hover { border-color: var(--signal); color: var(--signal); }
  .ghost-btn { padding: 8px 14px; border: 1px solid var(--header-line); border-radius: var(--r); background: transparent; font-size: 12.5px; font-weight: 500; color: var(--header-fg); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
  .ghost-btn:hover { border-color: var(--signal); color: var(--signal); }


  .session-bar { grid-column: 1 / -1; background: var(--bar-bg); color: var(--bar-fg); display: flex; align-items: center; gap: 20px; padding: 8px 18px; font-size: 12px; border-bottom: 1px solid var(--bar-line); }
  .car-select { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 11px; border-radius: var(--r); border: 1px solid var(--bar-line); background: var(--surface); transition: border-color .12s; }
  .car-select:hover { border-color: var(--signal); }
  .car-select .tag { font-size: 10px; font-weight: 600; letter-spacing: .02em; color: #fff; background: #0e5a35; padding: 2px 6px; border-radius: 3px; }
  .car-select .caret { color: var(--bar-muted); font-size: 9px; }
  .soc { display: flex; align-items: center; gap: 20px; }
  .soc.hidden { display: none; }
  .soc-inner { display: flex; align-items: center; gap: 9px; }
  .soc-inner label { font-size: 11px; color: var(--bar-muted); }
  .soc-inner input[type=range] { width: 84px; accent-color: var(--signal-2); cursor: pointer; }
  .soc-inner .val { font-weight: 600; min-width: 32px; }
  .fast-toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--bar-fg); cursor: pointer; user-select: none; }
  .fast-toggle input { accent-color: var(--signal-2); cursor: pointer; }
  .session-bar .out { margin-left: auto; color: var(--bar-muted); font-size: 11.5px; }
  .session-bar .out b { color: var(--bar-fg); font-weight: 600; }

  .footer-bar { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 18px; background: var(--bar-bg); color: var(--bar-muted); border-top: 1px solid var(--bar-line); font-size: 11px; }
  .footer-bar .fb-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
  .footer-bar a, .footer-bar .flink { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
  .footer-bar a:hover, .footer-bar .flink:hover { color: var(--signal); text-decoration: underline; }
  .footer-bar .fb-sep { color: var(--bar-line); }

  .car-modal { display: none; position: fixed; inset: 0; background: rgba(20,22,20,.45); z-index: 1000; align-items: center; justify-content: center; }
  .car-modal.open { display: flex; }
  .car-box { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); width: 92%; max-width: 440px; max-height: 80vh; box-shadow: 0 24px 70px rgba(20,22,20,.35); border-top: 3px solid var(--signal); }
  .car-box-head { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; padding: 22px 22px 6px; background: var(--surface); border-radius: var(--r) var(--r) 0 0; }
  .car-box-head h3 { font-size: 14px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
  .car-box-head .x { background: none; border: none; font-size: 16px; color: var(--ink-faint); cursor: pointer; }
  .car-box-body { overflow-y: auto; padding: 0 22px 22px; min-height: 0; }
  .car-hint { font-size: 12px; color: var(--ink-faint); line-height: 1.5; margin-bottom: 14px; }
  .car-section-label { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin: 14px 0 7px; }
  .car-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 6px; cursor: pointer; transition: border-color .12s, background .12s; }
  .car-item:hover { border-color: var(--signal); }
  .car-item.active { border-color: var(--signal); background: var(--signal-wash); }
  .car-item .ci-main { font-size: 13.5px; font-weight: 600; }
  .car-item .ci-spec { font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; letter-spacing: .01em; }
  .car-item .ci-del { background: none; border: none; color: var(--ink-faint); cursor: pointer; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; }
  .car-item .ci-del:hover { color: var(--shell); }
  .car-add { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
  .car-add-title { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
  .car-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 8px; }
  .car-add-grid input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; outline: none; background: var(--surface); }
  .car-add-grid input:focus { border-color: var(--signal); }
  .car-add-btn { width: 100%; padding: 9px; background: var(--btn-solid-bg); color: var(--btn-solid-fg); border: none; border-radius: var(--r); font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; transition: background .12s; }
  .car-add-btn:hover { background: var(--signal); }
  .car-add-btn:disabled { background: var(--line); color: var(--ink-faint); cursor: not-allowed; }

  .contact-field { margin-bottom: 10px; }
  .contact-field label { display: block; font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
  .contact-field input, .contact-field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; font-family: inherit; outline: none; background: var(--surface); color: var(--ink); resize: vertical; }
  .contact-field input:focus, .contact-field textarea:focus { border-color: var(--signal); }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .contact-status { margin-top: 10px; font-size: 12px; text-align: center; min-height: 16px; }
  .contact-status.ok { color: var(--signal); }
  .contact-status.err { color: var(--warn); }
  .car-pick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-bottom: 8px; }
  .car-pick select { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; background: var(--surface); color: var(--ink); cursor: pointer; outline: none; }
  .car-pick select:focus { border-color: var(--signal); }
  .car-pick select:disabled { color: var(--ink-faint); background: var(--paper); cursor: not-allowed; }

  .info-box { max-width: 480px; }
  .over-body p { font-size: 13px; line-height: 1.65; color: var(--ink-soft); margin-bottom: 12px; }
  .over-body p b { color: var(--ink); font-weight: 650; }
  .over-tagline { font-size: 15px; font-weight: 700; color: var(--signal); letter-spacing: .01em; margin-top: 4px; }
  .over-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
  .over-section-first { margin-top: 0; padding-top: 0; border-top: none; }
  .over-h { font-size: 14px; font-weight: 650; color: var(--ink); margin-bottom: 9px; }
  .over-lead { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 11px; }
  .over-criteria { list-style: none; margin: 0 0 11px; padding: 0; }
  .over-criteria li { position: relative; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); padding: 0 0 9px 20px; }
  .over-criteria li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px; border-radius: 2px; background: var(--signal-2); }
  .over-criteria li b { color: var(--ink); font-weight: 650; }
  .info-item { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
  .info-item .ii-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
  .info-item .ii-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
  .info-item .ii-naam { font-size: 13.5px; font-weight: 650; }
  .info-item .ii-tarief { font-size: 11.5px; color: var(--ink); background: var(--paper); border-radius: var(--r); padding: 7px 9px; margin-bottom: 7px; line-height: 1.55; }
  .info-item .ii-waarom { font-size: 12px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 7px; }
  .info-item .ii-letop { font-size: 11px; color: var(--warn); line-height: 1.5; margin-bottom: 7px; }
  .ii-link { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; letter-spacing: .03em; color: var(--signal); text-decoration: none; }
  .ii-link:hover { text-decoration: underline; }
  .info-foot { font-size: 11px; color: var(--ink-faint); line-height: 1.55; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .info-bronnen-wrap { margin-top: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
  .ibw-title { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 7px; }
  .info-bronnen { display: flex; flex-wrap: wrap; gap: 6px; }
  .info-bronnen a { font-size: 11px; font-weight: 500; color: var(--ink-soft); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 9px; }
  .info-bronnen a:hover { border-color: var(--signal); color: var(--signal); }

  .sidebar { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
  .pad { padding: 14px 16px; }
  .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
  .passes { display: flex; gap: 5px; flex-wrap: wrap; }
  .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--r); border: 1px solid var(--line); font-size: 10.5px; font-weight: 500; letter-spacing: .03em; cursor: pointer; color: var(--ink-faint); user-select: none; transition: all .12s; background: var(--surface); }
  .chip .d { width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: .3; }
  .chip.on { color: var(--ink); } .chip.on .d { opacity: 1; }
  .chip.on.anwb { border-color: var(--anwb); } .chip.on.anwb .d { background: var(--anwb); }
  .chip.on.shell { border-color: var(--shell); } .chip.on.shell .d { background: var(--shell); }
  .chip.on.tap { border-color: var(--tap); } .chip.on.tap .d { background: var(--tap); }
  .chip.on.audi { border-color: var(--audi); } .chip.on.audi .d { background: var(--audi); }
  .chip.on.fastnedapp { border-color: #1b9e8f; } .chip.on.fastnedapp .d { background: #1b9e8f; }
  .chip.on.vattenfall { border-color: var(--vattenfall); } .chip.on.vattenfall .d { background: var(--vattenfall); }
  .sortsel { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
  .sortsel select { border: 1px solid var(--line); border-radius: var(--r); padding: 4px 6px; font-size: 11px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .count { font-size: 10px; color: var(--ink-faint); letter-spacing: .06em; text-transform: uppercase; }

  .card { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; overflow: hidden; transition: border-color .12s, box-shadow .12s; background: var(--surface); }
  .card:hover { border-color: var(--ink-faint); }
  .card.sel { border-color: var(--signal); box-shadow: inset 3px 0 0 var(--signal); }
  .card.unknown { opacity: .85; }
  .card-top { padding: 11px 13px 9px; }
  .card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .card-name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
  .card-dist { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
  .card-sub { font-size: 10.5px; color: var(--ink-faint); margin-top: 3px; letter-spacing: .01em; }
  .card-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
  .t { font-size: 9.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; background: var(--line-soft); color: var(--ink-soft); }
  .t.dc { background: var(--signal-wash); color: var(--signal); }
  .t.op { background: var(--paper); color: var(--ink-soft); }
  .t.busy { background: #f6e3e3; color: #b23636; }
  .t.free { background: #e6efe6; color: #3c7a3c; }
  .t.warn { background: var(--warn-wash); color: var(--warn); }

  /* Winner = meterweergave: neutraal paneel met dunne accentstreep in pas-kleur */
  .winner { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--paper); border-top: 1px solid var(--line); position: relative; }
  .winner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--ink)); }
  .winner.none { background: var(--line-soft); }
  .winner.none::before { background: var(--ink-faint); }
  .winner .who .na-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink-faint); background: transparent; }
  .winner .price .na { font-size: 15px; font-weight: 600; color: var(--ink-faint); letter-spacing: .02em; }
  .list-section-label { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin: 16px 2px 9px; padding-top: 4px; }
  .winner .who { display: flex; align-items: center; gap: 8px; }
  .winner .who .d { width: 9px; height: 9px; border-radius: 2px; }
  .winner .who .nm { font-size: 12.5px; font-weight: 650; }
  .winner .who .lab { font-size: 9px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .12em; margin-top: 1px; }
  .winner .price { text-align: right; }
  .winner .price .big { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
  .winner .price .per { font-size: 9.5px; color: var(--ink-soft); }
  .winner .nomsg { font-size: 11.5px; color: var(--ink-soft); }

  .others { border-top: 1px solid var(--line); display: none; }
  .card.sel .others { display: block; }
  .row { display: flex; align-items: center; justify-content: space-between; padding: 7px 13px; font-size: 12px; border-top: 1px solid var(--line-soft); }
  .row:first-child { border-top: none; }
  .row .who { display: flex; align-items: center; gap: 8px; }
  .row .who .d { width: 7px; height: 7px; border-radius: 2px; }
  .row .who .nm { font-weight: 500; color: var(--ink-soft); }
  .row .amt { font-weight: 600; font-size: 12px; }
  .row .amt .per { font-size: 9.5px; color: var(--ink-faint); font-weight: 400; margin-left: 5px; }
  .row .delta { font-size: 9.5px; color: var(--ink-faint); margin-left: 6px; }
  .expand-hint { text-align: center; font-size: 9px; color: var(--ink-faint); padding: 6px; border-top: 1px solid var(--line-soft); letter-spacing: .08em; text-transform: uppercase; }
  .card.sel .expand-hint { display: none; }

  #map { grid-column: 2; grid-row: 3; z-index: 0; }
  .state { text-align: center; padding: 44px 18px; color: var(--ink-faint); }
  .state .ic { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; color: var(--ink-faint); }
  .state p { font-size: 12.5px; line-height: 1.6; }
  .spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--signal); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -3px; margin-right: 7px; }
  @keyframes sp { to { transform: rotate(360deg); } }
  .legend { padding: 10px 16px; font-size: 10.5px; color: var(--ink-faint); line-height: 1.55; border-top: 1px solid var(--line); background: var(--paper); }
  .legend b { color: var(--ink-soft); font-weight: 600; }

  .leaflet-popup-content-wrapper { border-radius: var(--r); }
  .loc-ctl { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; box-shadow: 0 1px 5px rgba(20,22,20,.18); transition: color .12s, border-color .12s; padding: 0; }
  .loc-ctl:hover { color: var(--signal); border-color: var(--signal); }
  .loc-ctl.busy { color: var(--signal); animation: locspin 1s linear infinite; }
  @keyframes locspin { to { transform: rotate(360deg); } }
  .leaflet-bottom.leaflet-right { margin-bottom: 8px; margin-right: 8px; }
  .pop { font-family: inherit; min-width: 180px; }
  .pop h4 { font-size: 13px; font-weight: 650; margin-bottom: 3px; }
  .pop .pa { font-size: 10px; color: #777; margin-bottom: 7px; }
  .pop .pw { display: flex; align-items: center; justify-content: space-between; padding-top: 7px; border-top: 1px solid #eee; }
  .pop .pw .nm { font-size: 12px; font-weight: 600; }
  .pop .pw .pr { font-size: 14px; font-weight: 700; }

  /* Alleen op mobiel (zie JS): knop om terug naar boven te scrollen zodra de kaart uit beeld is. */
  .scroll-top-btn { display: none; position: fixed; right: 14px; bottom: 14px; z-index: 500; width: 42px; height: 42px; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 10px rgba(20,22,20,.22); padding: 0; }
  .scroll-top-btn.show { display: flex; }

  @media (max-width: 720px) {
    body { height: auto; overflow: visible; }
    .app { grid-template-columns: 1fr; grid-template-rows: auto auto 28vh auto auto; height: auto; }
    .app { grid-template-rows: auto auto 28dvh auto auto; }
    #map { grid-column: 1; grid-row: 3; } .sidebar { grid-row: 4; border-right: none; overflow-y: visible; }
    header { flex-wrap: wrap; align-items: center; min-height: auto; padding: 8px 10px; gap: 6px; }
    .brand .logo { height: 30px; }
    .head-right { order: 2; gap: 6px; }
    .search { order: 3; width: 100%; margin-left: 0; }
    .ghost-btn { padding: 6px 8px; font-size: 11px; }
    .icon-btn { width: 34px; height: 34px; }
    .session-bar { flex-wrap: wrap; gap: 12px; padding: 8px 12px; } .session-bar .out { margin-left: 0; width: 100%; }
    .soc-inner input[type=range] { width: 64px; }
    .car-pick, .car-add-grid { grid-template-columns: 1fr; }
    .car-box { max-height: 85vh; }
    .chip { padding: 6px 10px; }
    .legend { display: none; }
  }
