/* Kaartpagina's met een paneel links (parkeren.html en drukte.html). Gedeelde stijl staat in stijl.css. */

:root { --ok: #0b7a4b; --bad: #d82838; --hub: #07b26b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #5fd3a0; --bad: #ff8c96; } }
:root[data-theme="dark"] { --ok: #5fd3a0; --bad: #ff8c96; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--surface); color: var(--on-surface); font: 400 14px/20px Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .01em; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; font-weight: 400; }
b, strong { font-weight: 500; }
svg { display: block; fill: currentColor; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
#map { position: fixed; inset: 0; background: var(--surface); }

.panel {
  position: fixed; z-index: 800; left: 16px; top: 16px; width: 360px; max-height: calc(100dvh - 32px); overflow: auto; scrollbar-width: none;
  background: var(--glass-hi); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); border-radius: 28px; box-shadow: var(--e3); padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.panel::-webkit-scrollbar { display: none; }
.panel > * { flex-shrink: 0; }   /* bij een lange inhoud scrollt het paneel, in plaats van dat onderdelen over elkaar schuiven */
.top { display: flex; align-items: center; gap: 12px; }
.back { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--on-surface); background: var(--secondary-container); text-decoration: none; }
.back svg { width: 22px; height: 22px; }
.top h1 { font-size: 18px; line-height: 24px; }
.top p { color: var(--on-surface-var); font-size: 12px; line-height: 16px; }
.top-t { flex: 1; min-width: 0; }
.top-sum { display: none; }
/* Inklapknop: alleen op een telefoon */
.panel-toggle { display: none; flex: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; color: var(--on-surface); }
.panel-toggle:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.panel-toggle svg { width: 26px; height: 26px; transition: transform .2s var(--ease); }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--on-surface) 5%, transparent); border: 1.5px solid transparent;
}
.choice:hover { background: color-mix(in srgb, var(--on-surface) 9%, transparent); }
.choice[aria-pressed="true"] { background: var(--secondary-container); border-color: var(--primary); }
.choice .sw { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.choice .nm { flex: 1; }
.choice .pc { font-size: 16px; font-variant-numeric: tabular-nums; }
.choice .pc.bad { color: var(--bad); } .choice .pc.ok { color: var(--ok); }
.big { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.big .num { font-size: 44px; line-height: 48px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.big .verdict { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.big .verdict.ok { color: var(--ok); } .big .verdict.bad { color: var(--bad); }
.big .verdict svg { width: 18px; height: 18px; }
.meter { position: relative; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--on-surface) 12%, transparent); margin-top: 6px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--ok); }
.meter i.bad { background: var(--bad); }
.meter u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--on-surface); text-decoration: none; }
.meter-lbl { position: relative; height: 16px; color: var(--on-surface-var); font-size: 12px; line-height: 16px; }
.meter-lbl span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.facts { color: var(--on-surface-var); font-size: 13px; line-height: 20px; }
.facts b { color: var(--on-surface); }
.export { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px 0 14px; border-radius: 20px; background: var(--secondary-container); color: var(--on-secondary-container); }
.export svg { width: 20px; height: 20px; }
.export:hover { box-shadow: var(--e1); }
.export:disabled { opacity: .45; cursor: default; box-shadow: none; }
.legend { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--outline-var); padding-top: 12px; }
.legend label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.legend input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot { box-shadow: 0 0 0 2px #fff; }
.dot.in, .dot.hub { box-shadow: none; }
.lg-t { flex: 1; display: flex; flex-direction: column; }
.lg-t small { color: var(--on-surface-var); font-size: 12px; line-height: 16px; }
.lg-n { font-weight: 400; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-top: 2px; }
.split i { display: block; min-width: 3px; }
.split-lbl { color: var(--on-surface-var); font-size: 12px; line-height: 16px; margin-top: 4px; }
.dot.in { background: var(--off); width: 8px; height: 8px; margin: 2px; }
.dot.hub2 { background: color-mix(in srgb, var(--hub) 12%, transparent); border: 2px dashed var(--hub); border-radius: 4px; box-shadow: none; }
.dot.hub { background: color-mix(in srgb, var(--hub) 35%, transparent); border: 2px solid var(--hub); border-radius: 4px; }
.note { color: var(--on-surface-var); font-size: 12px; line-height: 16px; }
#msg { color: var(--on-surface-var); }
#msg.err { color: var(--error); }
.retry { align-self: flex-start; padding: 0 16px; height: 36px; border-radius: 18px; background: var(--primary); color: var(--on-primary); }
.pop-title { font-size: 15px; }
.pop-sub { color: var(--on-surface-var); margin-top: 4px; }
.pop-id { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.pop-id span { color: var(--on-surface-var); font-size: 12px; line-height: 16px; }
.pop-id code { font: 400 13px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; user-select: all; -webkit-user-select: all; word-break: break-all; }
@media (max-width: 839px) {
  .panel-toggle { display: grid; }
  /* Ingeklapt: alleen de kop met een korte samenvatting, zodat de kaart vrij blijft */
  .panel.dicht > :not(.top) { display: none !important; }
  .panel.dicht .top-desc { display: none; }
  .panel.dicht .top-sum { display: block; color: var(--on-surface); font-size: 14px; line-height: 20px; }
  .panel.dicht .panel-toggle svg { transform: rotate(180deg); }
  .panel { left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 56dvh; border-radius: 24px; padding: 14px; gap: 12px; }
  .big .num { font-size: 36px; line-height: 40px; }
  .leaflet-bottom.leaflet-left, .leaflet-bottom.leaflet-right { display: none; }
  /* Geen kopbalk: de knoppen staan bovenaan (12 px van de rand) en schuiven omlaag als het zoekveld open is. */
  .leaflet-top { margin-top: calc(2px + env(safe-area-inset-top, 0px)); }
  body.addr-open .leaflet-top { margin-top: calc(76px + env(safe-area-inset-top, 0px)); }
}
