/* IBM Plex Sans, lokaal gehost (SIL OFL, zie fonts/OFL.txt): geen verzoek naar Google Fonts,
   dus geen IP-adres van deelnemers bij een derde partij. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #EAF0F2;
  --bg-top: #F7FAFB;
  --surface: #FFFFFF;
  --ink: #17262D;
  --muted: #5A6B73;
  --faint: #8A9AA1;
  --line: #D3DDE1;
  --accent: #0E6A76;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1EFF1;
  --warn: #7A5200;
  --warn-soft: #FBF0D9;
  --radius-l: 12px;
  --radius-s: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10181B; --bg-top: #162126; --surface: #1A252A; --ink: #E4EDF0; --muted: #9AABB2; --faint: #6E8088;
    --line: #2C3A40; --accent: #5BB8C4; --accent-ink: #0D1A1D; --accent-soft: #1E363B;
    --warn: #F0C46A; --warn-soft: #3A2F18; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10181B; --bg-top: #162126; --surface: #1A252A; --ink: #E4EDF0; --muted: #9AABB2; --faint: #6E8088;
  --line: #2C3A40; --accent: #5BB8C4; --accent-ink: #0D1A1D; --accent-soft: #1E363B;
  --warn: #F0C46A; --warn-soft: #3A2F18; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 420px) var(--bg);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg-top) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar .wrap { padding-top: 12px; padding-bottom: 12px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-weight: 600; font-size: 15px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.badge svg { width: 12px; height: 12px; }
.progress { display: none; margin-top: 10px; }
.progress.on { display: block; }
.segments { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 4px; }
.segments span { height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.segments span.done, .segments span.now { background: var(--accent); }
.segments span.now { opacity: .55; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }

main { padding: 28px 0 48px; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 60ch; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 4px 20px; }
.panel.pad { padding: 20px; }

/* Intro */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.facts li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15px; }
.facts svg { width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.field { margin-top: 22px; }
label.lbl { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.code-input {
  width: 100%; max-width: 240px; font: inherit; font-size: 20px; letter-spacing: .12em;
  text-transform: uppercase; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--bg-top); color: var(--ink);
}
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error { font-size: 13px; color: var(--warn); margin-top: 6px; }

/* Example on intro */
.example { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.example p { margin: 0 0 4px; font-size: 14px; color: var(--muted); }

/* Item: two poles with a slider between */
.item { padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.poles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 14px; }
.pole { font-size: 15.5px; line-height: 1.4; color: var(--muted); transition: color .15s; }
.pole.b { text-align: right; }
.item.lean-a .pole.a, .item.lean-b .pole.b { color: var(--ink); font-weight: 500; }
.item.lean-a .pole.b, .item.lean-b .pole.a { color: var(--faint); }
.item.mid .pole { color: var(--ink); }

.scale { position: relative; }
.scale input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px;
  background: transparent; margin: 0; cursor: pointer; display: block;
}
/* Fill runs from the centre to the chosen side */
.scale input[type=range]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--line) var(--from, 50%), var(--accent) var(--from, 50%), var(--accent) var(--to, 50%), var(--line) var(--to, 50%));
}
.scale input[type=range]::-moz-range-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--line) var(--from, 50%), var(--accent) var(--from, 50%), var(--accent) var(--to, 50%), var(--line) var(--to, 50%));
}
.scale input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; margin-top: -7px;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.scale input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
}
/* Untouched: dashed track, no thumb, so nobody gets a silent middle */
.scale.untouched input[type=range]::-webkit-slider-runnable-track {
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 13px);
}
.scale.untouched input[type=range]::-moz-range-track {
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 13px);
}
.scale.untouched input[type=range]::-webkit-slider-thumb { opacity: 0; }
.scale.untouched input[type=range]::-moz-range-thumb { opacity: 0; }

.ticks { display: flex; justify-content: space-between; padding: 0 9px; margin-top: 2px; }
.ticks span { width: 1px; height: 6px; background: var(--line); }
.ticks span:nth-child(1), .ticks span:nth-child(11) { height: 9px; background: var(--muted); }
.ticks span:nth-child(6) { height: 12px; width: 2px; background: var(--muted); }

.item-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; min-height: 24px; }
.item-foot output {
  font-size: 13px; font-weight: 500; padding: 1px 10px; border-radius: 999px;
  background: var(--line); color: var(--muted);
}
.scale:not(.untouched) + .item-foot output { background: var(--accent-soft); color: var(--accent); }
.link {
  font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; padding: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}

textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; min-height: 96px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg-top); color: var(--ink); resize: vertical;
}
textarea::placeholder, .code-input::placeholder { color: var(--muted); opacity: .8; }

.notice { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--warn); font-size: 14px; }

/* Nav */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.btn {
  font: inherit; font-size: 15px; font-weight: 500; padding: 11px 20px; border-radius: var(--radius-s);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.nav .spacer { flex: 1; }

/* Done */
.done-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.done-mark svg { width: 22px; height: 22px; }
details { margin-top: 18px; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; }
pre {
  margin: 10px 0 0; padding: 14px; border-radius: var(--radius-s); background: var(--bg-top);
  border: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; overflow-x: auto; color: var(--ink);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 480px) {
  h1 { font-size: 23px; }
  .panel { padding: 4px 16px; }
  .panel.pad { padding: 16px; }
  .poles { gap: 14px; }
  .pole { font-size: 14.5px; }
}

/* ---------- Toevoegingen voor de app ---------- */
:root { --zone-a: #008C9E; --zone-mid: #A9B6BC; --zone-b: #C0662A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --zone-a: #1E9FB0; --zone-mid: #5E6E75; --zone-b: #D07A40; } }
:root[data-theme="dark"] { --zone-a: #1E9FB0; --zone-mid: #5E6E75; --zone-b: #D07A40; }

/* Touch-doelen minimaal 44px */
.btn { min-height: 44px; }
.link { min-height: 44px; padding: 0 4px; }
.code-input { min-height: 44px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.ticks { margin-top: -10px; }

/* Staafdiagram */
.grafiek { width: 100%; height: auto; display: block; overflow: visible; }
.grafiek .staaf.links path { fill: var(--zone-a); }
.grafiek .staaf.midden path { fill: var(--zone-mid); }
.grafiek .staaf.rechts path { fill: var(--zone-b); }
.grafiek .raak { fill: transparent; }
.grafiek .staaf:hover path { opacity: .8; }
.grafiek .aantal { font-size: 13px; font-weight: 600; fill: var(--ink); }
.grafiek .as { font-size: 11px; fill: var(--muted); }
.grafiek .pool { font-size: 12px; fill: var(--muted); }
.grafiek .nullijn { stroke: var(--line); stroke-width: 1; }

.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; font-size: 14px; }
.zones div { padding: 6px 8px; border-radius: var(--radius-s); background: var(--bg-top); border: 1px solid var(--line); }
.zones b { display: block; font-size: 18px; }
.zones .za { border-left: 4px solid var(--zone-a); }
.zones .zm { border-left: 4px solid var(--zone-mid); text-align: center; }
.zones .zb { border-left: 4px solid var(--zone-b); text-align: right; }

.patroon-kop { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 10px; }
.patroon-kop h3 { margin: 0; font-size: 18px; text-transform: capitalize; }
.patroon-kop span { color: var(--muted); font-size: 14px; }
.vraagkaart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px; margin-bottom: 14px; }
.vraagkaart .uitspraken { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.vraagkaart .uitspraken div:last-child { text-align: right; }
.vraagkaart .vid { font-size: 12px; color: var(--faint); font-weight: 500; }
.muted { color: var(--muted); }

/* Scherm (beamer) */
body.scherm .wrap { max-width: 1400px; }
body.scherm .teller { text-align: center; padding: 12vh 0; }
body.scherm .teller .groot { font-size: clamp(64px, 14vw, 180px); font-weight: 600; line-height: 1; color: var(--accent); }
body.scherm .teller p { font-size: clamp(20px, 3vw, 34px); color: var(--muted); margin: 16px 0 0; }
.kaarten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.kaarten .vraagkaart { margin-bottom: 0; }
body.scherm .vraagkaart .uitspraken { font-size: 17px; }
body.scherm .zones { font-size: 16px; }
body.scherm .zones b { font-size: 24px; }
body.scherm .patroon-kop h3 { font-size: 26px; }
body.scherm .patroon-kop span { font-size: 18px; }
body.scherm .vrijgegeven { margin-top: 24px; display: grid; gap: 12px; }
.vrijgegeven .item-vrij { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: var(--radius-s); padding: 14px 18px; font-size: 20px; }
.vrijgegeven .item-vrij small { display: block; font-size: 13px; color: var(--muted); }

/* Presentator */
body.presentator .wrap { max-width: 1100px; }
.balk { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.balk form { margin: 0; }
.status-pil { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line); }
.status-pil.open { background: var(--accent); color: var(--accent-ink); }
.voorstel { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.voorstel form { flex-shrink: 0; }
.btn.klein { font-size: 13px; padding: 6px 12px; }
.melding { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent); }
.melding.fout { background: var(--warn-soft); color: var(--warn); }
.opmerkingen { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.opmerkingen li { background: var(--bg-top); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; white-space: pre-wrap; }
section.blok { margin-top: 32px; }
textarea.afspraken { min-height: 220px; font-family: inherit; }
input[type=password] { font: inherit; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg-top); color: var(--ink); min-height: 44px; width: 100%; max-width: 320px; }

/* Stemmen */
.voorstel > button { flex-shrink: 0; }
.stemblok { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-s); padding: 14px 18px; margin: 12px 0; }
.stemblok small { display: block; font-size: 13px; color: var(--muted); }
.stemblok .voorsteltekst { font-size: 18px; font-weight: 500; margin: 4px 0 8px; }
.stemblok .stemteller { margin: 0; color: var(--muted); }
.stemblok .uitslag { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.stemblok.aangenomen { border-left-color: var(--zone-a); }
.stemblok.aangenomen .uitslag { color: var(--accent); }
.stemblok.verworpen, .stemblok.te_weinig { border-left-color: var(--faint); }
.stemaantallen { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); }
.stemaantallen b { color: var(--ink); font-size: 18px; margin-left: 4px; }
body.scherm .stemblok { padding: 22px 28px; }
body.scherm .stemblok small { font-size: 18px; }
body.scherm .stemblok .voorsteltekst { font-size: clamp(24px, 3vw, 40px); }
body.scherm .stemblok .stemteller, body.scherm .stemaantallen { font-size: 22px; }
body.scherm .stemblok .uitslag { font-size: clamp(28px, 3.5vw, 44px); }
body.scherm .stemaantallen b { font-size: 30px; }
.uitslag-pil { flex-shrink: 0; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.uitslag-pil.aangenomen { background: var(--accent-soft); color: var(--accent); }

/* Stemmen op de telefoon */
.keuzes { display: grid; gap: 10px; margin-top: 14px; }
.keuze { font: inherit; font-size: 17px; font-weight: 500; min-height: 52px; border-radius: var(--radius-s); border: 2px solid var(--line); background: var(--bg-top); color: var(--ink); cursor: pointer; }
.keuze[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
