/* web/style.css */
:root {
  color-scheme: light dark;
  --c-green: #2f9e44;
  --c-yellow: #f2c200;
  --c-orange: #f08c00;
  --c-red: #e03131;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e0e0e0;
  --text: #1d1d1f;
  --muted: #6b6b6b;
  --accent: #3a45a0;
  --track: rgba(128,128,128,.10);
  --chart-axis: rgba(128,128,128,.4);
  --chart-line: #222222;
  --map-empty: #e9e9e9;
  --map-stroke: #ffffff;
  --map-selected-stroke: #111111;
  --surface-stroke: #ffffff;
  --shadow: rgba(0,0,0,.3);
  --stale-bg: #fff3bf;
  --stale-border: #ffe066;
  --radius: 12px;
  --space: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --card: #1b1d22;
    --border: #343842;
    --text: #f3f4f6;
    --muted: #b5bac4;
    --accent: #8ea2ff;
    --track: rgba(255,255,255,.09);
    --chart-axis: rgba(255,255,255,.22);
    --chart-line: #f3f4f6;
    --map-empty: #2c313b;
    --map-stroke: #1b1d22;
    --map-selected-stroke: #f3f4f6;
    --surface-stroke: #f3f4f6;
    --shadow: rgba(0,0,0,.45);
    --stale-bg: #4d3d06;
    --stale-border: #8f6a00;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); }
main { max-width: 600px; margin: 0 auto; padding: var(--space); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space); margin-bottom: var(--space); }
.row { display: flex; gap: 8px; align-items: center; }
.muted { color: var(--muted); font-size: 13px; }
.verdict { display: inline-block; padding: 4px 12px; border-radius: 999px; color: #fff; font-weight: 700; }
button, input { font: inherit; }
button { cursor: pointer; border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 8px 12px; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input { background: var(--card); color: var(--text); border: 1px solid var(--border); }
#stale-banner { background: var(--stale-bg); border: 1px solid var(--stale-border); padding: 8px 12px; border-radius: 8px; }
#stale-banner[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
svg { display: block; width: 100%; height: auto; }

/* Component-classes — render-functies gebruiken deze voor structuur;
   inline style alleen voor dynamische posities/breedtes/kleur. */
.scale-ticks { display: flex; justify-content: space-between; margin: 0 0 4px 64px; font-size: 10.5px; color: var(--muted); }
.dayrow { display: flex; align-items: center; margin: 7px 0; }
.dayrow .lbl { width: 64px; font-size: 13px; font-weight: 600; }
.track { position: relative; flex: 1; height: 16px; background: var(--track); border-radius: 8px; }
.bar { position: absolute; height: 16px; border-radius: 8px; }
.dot { position: absolute; top: -3px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-stroke); box-shadow: 0 1px 3px var(--shadow); color: #fff; font-size: 9.5px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
/* Min/max van de dag-range, net buiten de uiteinden van het balkje. */
.rangebadge { position: absolute; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; pointer-events: none; }
.rangebadge.lo { transform: translate(-100%, -50%); padding-right: 4px; }
.rangebadge.hi { padding-left: 4px; }
/* Pulserende "live"-stip voor de huidige dag (vandaag = nu). */
.dayrow.is-today .lbl { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.live { position: relative; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live::after { animation: none; } }
.chart-wrap { position: relative; margin-top: 28px; padding-left: 42px; }
.chart-axis { position: absolute; inset: 0 auto 0 0; width: 38px; }
.chart-y-tick { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10px; color: var(--muted); line-height: 1; white-space: nowrap; }
.chart-y-tick.major { color: var(--text); font-weight: 600; }
.day-band { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.day-band.even { background: rgba(255,255,255,.03); }
.day-band.odd { background: rgba(255,255,255,.06); }
.chart-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--chart-axis); pointer-events: none; }
.chart-gridline.minor { opacity: .28; }
.chart-gridline.major { opacity: .5; }
.chart { position: relative; height: 160px; margin: 0; border-left: 1px solid var(--chart-axis); border-bottom: 1px solid var(--chart-axis); }
.chart svg { position: absolute; inset: 0; height: 100%; }
.maxbadge { position: absolute; transform: translate(-50%,-130%); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.scrub { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--accent); }
.day-divider { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--chart-axis); opacity: .18; pointer-events: none; }
.day-labels { position: relative; height: 16px; margin: 4px 0 0 42px; }
.day-label { position: absolute; bottom: 0; padding-left: 3px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-toggle { display: flex; gap: 4px; }
.day-toggle button { padding: 3px 9px; font-size: 12px; }
.day-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
#impression p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
#impression p:first-child { margin-top: 0; }
#nl-map path { cursor: pointer; }
#nl-map path:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.6; }

@media (max-width: 420px) { main { padding: 10px; } }
footer { text-align: center; padding: 8px var(--space) 20px; font-size: 11px; color: var(--muted); }
