:root {
  --bg: #081F30; --bg2: #0D2A40; --bg3: #133752; --lyn: #1E4763; --teks: #E8F1F7; --dof: #8FB0C4;
  --groen: #3DDC97; --blou: #3B82F6; --rooi: #EF4444; --oranje: #F97316; --geel: #FACC15;
  --kop: 56px; --r: 10px;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--teks);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* kopstrook */
#kop { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: calc(var(--kop) + var(--st));
  padding: var(--st) calc(8px + var(--sr)) 0 calc(8px + var(--sl)); display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-bottom: 1px solid var(--lyn); }
.merk { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .2px; flex: none; }
.merk .naam { font-size: 17px; }
.soek { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 10px;
  background: var(--bg2); border: 1px solid var(--lyn); border-radius: 20px; max-width: 520px; margin-left: auto; }
.soek svg { width: 18px; height: 18px; color: var(--dof); flex: none; }
.soek input { flex: 1; min-width: 0; height: 38px; background: none; border: 0; outline: 0; color: var(--teks); font-size: 16px; }
.soek input::-webkit-search-cancel-button { display: none; }
#kernKnoppie { flex: none; display: flex; }

.knop { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px;
  padding: 0 12px; border-radius: var(--r); border: 1px solid var(--lyn); background: var(--bg2); cursor: pointer; }
.knop.ikoon { padding: 0; width: 44px; border: 0; background: transparent; }
.knop.klein { min-height: 32px; min-width: 32px; width: 32px; }
.knop svg { width: 20px; height: 20px; }
.knop:hover { background: var(--bg3); }
.knop.aan { border-color: var(--groen); color: var(--groen); }

#kaart { position: fixed; inset: calc(var(--kop) + var(--st)) 0 0 0; }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(8, 31, 48, .7) !important; color: var(--dof); }
.maplibregl-ctrl-attrib a { color: var(--dof); }
.maplibregl-ctrl-group { background: var(--bg2); border: 1px solid var(--lyn); }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--lyn); }
.maplibregl-ctrl-icon { filter: invert(1) hue-rotate(180deg); }

/* sweefknoppies */
#knoppies { position: fixed; z-index: 20; left: calc(10px + var(--sl)); bottom: calc(14px + var(--sb)); display: flex; gap: 8px; }
.vknop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 64px; height: 58px;
  border-radius: 12px; border: 1px solid var(--lyn); background: rgba(8, 31, 48, .92); cursor: pointer; font-size: 11px; color: var(--dof); }
.vknop svg { width: 22px; height: 22px; color: var(--teks); }
.vknop[aria-pressed="true"] { border-color: var(--groen); color: var(--groen); }
.vknop[aria-pressed="true"] svg { color: var(--groen); }

/* legende */
.legende { position: fixed; z-index: 15; right: calc(10px + var(--sr)); bottom: calc(14px + var(--sb)); max-width: min(300px, 60vw);
  max-height: 40vh; overflow: auto; background: rgba(8, 31, 48, .92); border: 1px solid var(--lyn); border-radius: 12px; padding: 8px 10px; font-size: 12px; }
.legende .ry { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.legende .ry button { margin-left: auto; }
.kol { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.gradient { height: 8px; border-radius: 4px; margin: 4px 0 2px; }
.legende .skaal { display: flex; justify-content: space-between; color: var(--dof); font-size: 10px; }

/* soeklys */
.soeklys { position: fixed; z-index: 40; top: calc(var(--kop) + var(--st) + 4px); right: calc(8px + var(--sr)); width: min(520px, calc(100vw - 16px));
  max-height: 60vh; overflow: auto; background: var(--bg); border: 1px solid var(--lyn); border-radius: 12px; padding: 6px; }
.soeklys h4 { margin: 8px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--dof); }
.soeklys button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; background: none; border: 0;
  border-radius: 8px; cursor: pointer; text-align: left; }
.soeklys button:hover, .soeklys button:focus { background: var(--bg2); outline: 0; }
.soeklys .sub { color: var(--dof); font-size: 12px; margin-left: auto; text-align: right; }

/* paneel: onderste vel op die foon, sypaneel op die rekenaar */
.paneel { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; max-height: 72vh; display: flex; flex-direction: column;
  background: var(--bg); border-top: 1px solid var(--lyn); border-radius: 16px 16px 0 0; padding-bottom: var(--sb); box-shadow: 0 -8px 24px rgba(0, 0, 0, .35); }
@media (min-width: 900px) {
  .paneel { left: auto; top: calc(var(--kop) + var(--st)); right: 0; bottom: 0; width: 420px; max-height: none; border-radius: 0;
    border-top: 0; border-left: 1px solid var(--lyn); box-shadow: none; }
  body.paneel-oop .legende { right: 430px; }
}
.paneel-kop { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 4px; border-bottom: 1px solid var(--lyn); }
.paneel-kop h2 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paneel-lyf { overflow: auto; padding: 10px 14px 18px; -webkit-overflow-scrolling: touch; }
.paneel h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--dof); }
.paneel h3:first-child { margin-top: 4px; }
.dof { color: var(--dof); }
.klein { font-size: 12px; }

.feite { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.feit { background: var(--bg2); border: 1px solid var(--lyn); border-radius: var(--r); padding: 8px 10px; }
.feit b { display: block; font-size: 16px; }
.feit span { color: var(--dof); font-size: 12px; }

.staaf { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 6px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: left; }
.staaf:hover { background: var(--bg2); }
.staaf .nm { flex: 1; min-width: 0; }
.staaf .nm small { display: block; color: var(--dof); font-size: 11px; }
.staaf .bal { width: 90px; height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; flex: none; }
.staaf .bal i { display: block; height: 100%; }
.staaf .pc { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--dof); font-size: 13px; }
.staaf.aan { background: var(--bg2); outline: 1px solid var(--groen); }

/* lae */
.laag { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 2px; border-bottom: 1px solid var(--bg3); }
.laag .nm { flex: 1; }
.laag .nm small { display: block; color: var(--dof); font-size: 12px; }
.skakel { position: relative; width: 46px; height: 28px; flex: none; border-radius: 14px; border: 1px solid var(--lyn); background: var(--bg3); cursor: pointer; }
.skakel::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dof); transition: transform .15s; }
.skakel[aria-checked="true"] { background: rgba(61, 220, 151, .25); border-color: var(--groen); }
.skakel[aria-checked="true"]::after { transform: translateX(18px); background: var(--groen); }
.oortjies { display: flex; gap: 6px; margin: 2px 0 10px; }
.oortjies button { flex: 1; min-height: 40px; border-radius: 8px; border: 1px solid var(--lyn); background: var(--bg2); cursor: pointer; font-size: 13px; }
.oortjies button.aan { border-color: var(--groen); color: var(--groen); }
.filter { width: 100%; height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--lyn); background: var(--bg2); color: var(--teks); font-size: 16px; margin-bottom: 8px; }

/* bome */
.boom ul { list-style: none; margin: 0; padding-left: 14px; border-left: 1px dashed var(--lyn); }
.boom > ul { padding-left: 0; border: 0; }
.boom li { margin: 2px 0; }
.nodus { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 6px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; }
.nodus:hover { background: var(--bg2); }
.nodus .ka { margin-left: auto; color: var(--dof); font-size: 12px; white-space: nowrap; }
.nodus.aan { outline: 1px solid var(--groen); background: var(--bg2); }
.nodus .pyl { width: 16px; height: 16px; color: var(--dof); flex: none; transition: transform .15s; }
.nodus[aria-expanded="true"] .pyl { transform: rotate(90deg); }
.beskryf { margin: 2px 0 8px 30px; color: var(--dof); font-size: 13px; }
.beskryf .knop { min-height: 36px; margin-top: 6px; font-size: 13px; }

.nota { background: var(--bg2); border-left: 3px solid var(--geel); padding: 8px 10px; border-radius: 6px; color: var(--dof); font-size: 12px; margin-top: 14px; }

#toast { position: fixed; z-index: 50; left: 50%; bottom: calc(86px + var(--sb)); transform: translateX(-50%); background: var(--bg3);
  border: 1px solid var(--lyn); border-radius: 10px; padding: 10px 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.wys { opacity: 1; }

@media (max-width: 600px) {
  .merk .naam { display: none; }
  .vknop { width: 56px; height: 54px; }
  body.paneel-oop #knoppies, body.paneel-oop .legende { display: none; }
}
