:root {
  --ongeval: #e31a1c;
  --hinder: #ff7f00;
  --file: #b10026;
  --afsluiting: #6a3d9a;
  --rijstrook: #1f78b4;
  --werkzaamheden: #1f78b4;
  --snelheid: #33a02c;
  --omleiding: #b15928;
  --brug: #0aa5b5;
  --overig: #7a7a7a;
  --ink: #1c1d21;
  --muted: #6b6f78;
  --line: #e4e5e9;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
#map { position: absolute; inset: 0; }

#panel {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 290px;
  max-height: calc(100% - 24px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.35;
}
#panel h1 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
#panel .sub { margin: 4px 0 10px; color: var(--muted); }
#panel a { color: inherit; }

.layers { border-top: 1px solid var(--line); padding-top: 8px; }
.layer { display: flex; align-items: center; gap: 7px; padding: 5px 0; cursor: pointer; }
.layer .name { flex: 1; font-weight: 600; }
.layer.sub-option { padding-left: 22px; margin-top: -4px; }
.layer.sub-option .name { font-weight: 400; color: var(--muted); }
.count { color: var(--muted); font-variant-numeric: tabular-nums; }

.swatch { display: inline-block; width: 12px; height: 12px; flex: none; background: var(--c); }
.swatch.dot { border-radius: 50%; }
.swatch.line { height: 4px; border-radius: 2px; }
.swatch.square { border-radius: 2px; }

.cats { padding: 0 0 6px 22px; display: grid; grid-template-columns: 1fr; gap: 1px; }
.cats label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.cats label .name { flex: 1; }
.cats label.empty { opacity: 0.45; }

.legend.ramp { display: flex; gap: 3px; padding: 0 0 6px 22px; flex-wrap: wrap; }
.legend.ramp span { font-size: 11px; padding: 1px 5px; border-radius: 3px; background: var(--c); color: #111; }
.legend.ramp span.unit { background: none; color: var(--muted); }

footer { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; color: var(--muted); }
footer .hint { margin-top: 2px; font-size: 12px; }

/* Popups */
.maplibregl-popup-content { padding: 10px 12px; border-radius: 8px; font-size: 13px; max-width: 320px; }
.pop h3 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pop .tag { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; }
.pop img { display: block; max-width: 100%; margin-top: 6px; image-rendering: pixelated; background: #000; border-radius: 3px; }
.pop pre { margin: 6px 0 0; padding: 6px 8px; background: #111; color: #ffd400; border-radius: 3px; font: 600 12px/1.3 ui-monospace, monospace; white-space: pre-wrap; }
.pop .id { margin-top: 6px; color: var(--muted); font-size: 11px; word-break: break-all; }

@media (max-width: 640px) {
  #panel { width: auto; right: 12px; max-height: 45%; }
}
.pop pre .drip-symbol { font-size: 15px; line-height: 1; }
