:root {
  --ink: #111;
  --paper: #fff;
  --accent: #1b3a2b;
  --accent-ink: #fff;
  --gps: #0a5bd6;
  --line: #111;
  --muted: #555;
  --tap: 64px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

#app { display: flex; flex-direction: column; height: 100dvh; }

/* Kaart */
#map { position: relative; flex: 1; min-height: 0; background: #e8e8e8; }

/* Eigen canvas voor reliëf, gemengd met wat eronder ligt */
.relief-layer { mix-blend-mode: hard-light; }

#crosshair {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%); pointer-events: none; z-index: 5;
}
#crosshair::before, #crosshair::after {
  content: ""; position: absolute; background: #fff;
  box-shadow: 0 0 0 2px #111;
}
#crosshair::before { left: 50%; top: 0; width: 3px; height: 100%; transform: translateX(-50%); }
#crosshair::after { top: 50%; left: 0; height: 3px; width: 100%; transform: translateY(-50%); }

.round {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 5;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--paper); color: var(--gps); border: 3px solid var(--line);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.round[aria-pressed="true"] { background: var(--gps); color: #fff; }

/* Infolabel linksboven: wat ligt onder het vizier */
.chip {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 5;
  max-width: calc(100% - 112px); text-align: left;
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px;
  padding: 7px 12px 8px; font-size: 17px; font-weight: 700; line-height: 1.25;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.chip a, .card .v a { color: var(--gps); text-decoration: underline; text-underline-offset: 2px; }
.chip { cursor: pointer; }
.chip-k { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Wissel tussen schermvullende kaart en kaartkeuze */
.round-bottom { top: auto; bottom: 12px; color: var(--ink); }
.round-bottom[aria-pressed="true"] { background: var(--paper); color: var(--ink); bottom: max(12px, env(safe-area-inset-bottom)); }
#btn-full .ico-close { display: none; }
#btn-full[aria-pressed="true"] .ico-open { display: none; }
#btn-full[aria-pressed="true"] .ico-close { display: inline; }
#app.full #controls, #app.full #info { display: none; }

.ol-attribution { bottom: 6px; left: 6px; right: auto; font-size: 11px; }
.ol-attribution.ol-uncollapsible { left: 6px; }

/* Bediening */
#controls {
  background: var(--paper); border-top: 3px solid var(--line);
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}

.slider-row { display: flex; align-items: center; gap: 12px; min-height: var(--tap); }
.slider-label { font-weight: 700; width: 4.2em; }
.pct { font-weight: 700; width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.big-value { font-size: 34px; font-weight: 800; width: 3.2em; font-variant-numeric: tabular-nums; }

input[type=range] {
  flex: 1; appearance: none; -webkit-appearance: none; background: transparent; height: var(--tap); margin: 0;
}
input[type=range]::-webkit-slider-runnable-track { height: 12px; background: #ccc; border: 2px solid var(--line); border-radius: 8px; }
input[type=range]::-moz-range-track { height: 12px; background: #ccc; border: 2px solid var(--line); border-radius: 8px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 44px; height: 44px; margin-top: -18px;
  border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line);
}
input[type=range]::-moz-range-thumb {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line);
}

#layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#layers button {
  min-height: 56px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); font-weight: 700; font-size: 16px; padding: 2px;
}
#layers button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.primary {
  min-height: 68px; border: 0; border-radius: 14px; background: var(--ink); color: #fff;
  font-size: 22px; font-weight: 800; letter-spacing: .02em;
}

/* Infopaneel: schuift over de bediening */
#info {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 62dvh; overflow-y: auto;
  background: var(--paper); border-top: 3px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 8px 16px max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.25);
}
.info-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -8px; background: var(--paper); padding-top: 8px; }
.info-head h2 { margin: 0; font-size: 22px; }
#btn-close { width: var(--tap); height: var(--tap); border: 2px solid var(--line); border-radius: 12px; background: var(--paper); font-size: 26px; }

.card { border-top: 2px solid #ddd; padding: 12px 0; }
.card:first-child { border-top: 0; }
.card .k { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.card .s { font-size: 17px; margin-top: 4px; line-height: 1.35; }
.card a { color: var(--gps); font-weight: 700; }
.loading { color: var(--muted); font-style: italic; }

@media (min-width: 700px) {
  #app { flex-direction: row; }
  #controls { width: 380px; border-top: 0; border-left: 3px solid var(--line); order: 2; justify-content: flex-end; }
  #info { left: auto; width: 380px; max-height: 100dvh; top: 0; border-radius: 0; border-top: 0; border-left: 3px solid var(--line); }
}
