:root {
  --bg: #f6f2ec; --card: #fffdf9; --ink: #201b16; --mut: #6d645a; --line: #e4dccf;
  --red: #b3261e; --red-ink: #fff; --ok: #2e7d4f; --ok-bg: #e3f3e8; --near: #9a6700; --near-bg: #fbf0d2; --bad: #b3261e; --bad-bg: #fbe4e1;
  --de: #2f6fb0; --het: #c2570c; --hi: #f2b632; --hi-s: #8a5a00;
  --wall: #e9d9c2; --roof: #b9694f; --glass: #cfe4ee; --frame: #fff; --stroke: #5b5046; --room: #f4ead9; --skin: #f0d9c4; --bone: #fff; --organ: #e8a9a0;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181512; --card: #221e1a; --ink: #f1ebe2; --mut: #a79c8f; --line: #3a332c;
    --red: #e2574c; --red-ink: #1a0f0d; --ok: #6cc58f; --ok-bg: #1c3326; --near: #e5b84b; --near-bg: #3a2f12; --bad: #f08379; --bad-bg: #3d1d1a;
    --de: #7fb3e6; --het: #f0a15e; --hi: #f2b632; --hi-s: #ffe19a;
    --wall: #5b5046; --roof: #7c4636; --glass: #3d5a68; --frame: #cfc6ba; --stroke: #d9cfc2; --room: #3a332c; --skin: #6b5a4b; --bone: #d9cfc2; --organ: #8a544d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h2, h3 { margin: 0; }
p { margin: 0 0 10px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Navigatie */
nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav a { flex: 1; max-width: 128px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; text-decoration: none; color: var(--mut); }
nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
nav a.on { color: var(--red); font-weight: 600; }
.in-session nav { display: none; }
.in-session main { padding-bottom: 24px; }

/* Koppen */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.top.back { display: block; }
.backlink { display: inline-block; text-decoration: none; color: var(--mut); font-size: 14px; margin-bottom: 4px; padding: 4px 0; }
.kicker { margin: 0; color: var(--mut); font-size: 14px; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mut); margin: 26px 0 10px; }
.lead { color: var(--mut); font-size: 15px; }
.streak { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px; line-height: 1.1; }
.streak b { display: block; font-size: 22px; color: var(--red); }
.streak span { font-size: 11px; color: var(--mut); }
.warn { display: block; background: var(--near-bg); color: var(--near); border-radius: var(--r); padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.wide { width: 100%; margin-top: 14px; min-height: 50px; font-size: 17px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; }
.btn:focus-visible, .opt:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent); outline-offset: 2px; }
.link { background: none; border: 0; padding: 4px 0; color: var(--mut); text-decoration: underline; font-size: 14px; cursor: pointer; }
.link.danger { color: var(--bad); margin-top: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.actions.center { justify-content: center; }
.spk { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; border: 0; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); border-radius: 999px; min-width: 34px; height: 34px; padding: 0 8px; cursor: pointer; font-size: 14px; font-weight: 600; flex: none; }
.spk.slow { background: none; border: 1px solid var(--line); color: var(--mut); font-weight: 500; }
.x { border: 0; background: none; font-size: 20px; width: 40px; height: 40px; color: var(--mut); cursor: pointer; flex: none; }
.x.small { width: 30px; height: 30px; font-size: 14px; }

/* Vandaag */
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.step { display: flex; align-items: center; gap: 12px; padding: 14px; }
.step + .step { border-top: 1px solid var(--line); }
.num { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.step.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.step-t span { color: var(--mut); font-size: 14px; }
.prow { margin-bottom: 14px; }
.plabel { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.plabel span { color: var(--mut); white-space: nowrap; }
.pbar { position: relative; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pbar i, .pbar u { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--c); }
.pbar i { opacity: 0.4; }

/* Lijsten */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lrow, .wrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; }
.lrow + .lrow, .wrow + .wrow { border-top: 1px solid var(--line); }
.lcover, .thumb { width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--c, var(--line)) 18%, var(--card)); display: grid; place-items: center; color: var(--c); font-weight: 700; font-size: 18px; }
.thumb { width: 44px; height: 44px; }
.lcover img, .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ltext, .wtext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wtext span, .ltext span { color: var(--mut); font-size: 14px; }
.wtext .mis { color: var(--bad); font-size: 12px; }
.chip { display: inline-block; font-style: normal; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.chip.plain { color: var(--ink); background: var(--line); font-weight: 500; }
.tick { color: var(--ok); flex: none; }
.art { font-weight: 700; }
.art.de { color: var(--de); }
.art.het { color: var(--het); }
.dots { display: flex; gap: 3px; flex: none; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots.s1 i:nth-child(-n+1), .dots.s2 i:nth-child(-n+2), .dots.s3 i { background: var(--ok); }
input[type=search], input[type=text], input[type=password], input:not([type]), select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
textarea { resize: vertical; line-height: 1.5; }
.filters { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.fchip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.fchip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.panel h3 { font-size: 15px; margin: 12px 0 6px; }
.panel h3:first-child { margin-top: 0; }
.panel label { display: block; margin: 10px 0; font-size: 14px; color: var(--mut); }
.panel label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.panel label.btn { display: inline-flex; margin: 0; color: var(--ink); font-size: 16px; }
.panel input[type=range] { width: 100%; }
.addform { display: grid; gap: 8px; }
.addform .row { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.errtype { display: flex; justify-content: space-between; margin: 4px 0; }
.credits p { font-size: 12px; color: var(--mut); margin: 2px 0; overflow-wrap: anywhere; }
.checks { margin: 0; padding-left: 20px; }
.err { border-top: 1px solid var(--line); padding: 8px 0; }
.err p { margin: 0 0 3px; }
.err s { color: var(--bad); }
.chips { font-size: 14px; color: var(--mut); line-height: 2; }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.prose p:last-child { margin: 0; }
.prose.reading { font-size: 17px; line-height: 1.65; }
.rq { border: 0; padding: 0; margin: 0 0 14px; }
.rq legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.ropt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: var(--card); }
.ropt.ok { border-color: var(--ok); background: var(--ok-bg); }
.ropt.bad { border-color: var(--bad); background: var(--bad-bg); }

/* Afbeeldingen en tekeningen */
.media { border-radius: var(--r); overflow: hidden; background: var(--card); border: 1px solid var(--line); margin: 0 auto 12px; max-width: 420px; }
.media img { display: block; width: 100%; max-height: 38vh; object-fit: contain; background: #0000000d; }
.media .diagram { display: block; width: 100%; max-height: 40vh; }
.media.big { max-width: 520px; }
.media.big .diagram { max-height: 58vh; }
.diagram * { vector-effect: non-scaling-stroke; }
.diagram .p, .diagram .ln, .diagram .frame, .diagram .slab, .diagram .door, .diagram .roofline { stroke: var(--stroke); stroke-width: 1.2; stroke-linejoin: round; }
.diagram .ln { fill: none; }
.diagram .ln.thin { stroke-width: 0.6; opacity: 0.45; }
.diagram .ground, .diagram .soil { fill: color-mix(in srgb, var(--stroke) 22%, var(--bg)); }
.diagram .wall, .diagram .dormer { fill: var(--wall); }
.diagram .brick { fill: color-mix(in srgb, var(--roof) 55%, var(--wall)); }
.diagram .roof, .diagram .roofline { fill: var(--roof); }
.diagram .tile { fill: color-mix(in srgb, var(--roof) 60%, #f3c9a5); }
.diagram .glass { fill: var(--glass); }
.diagram .frame, .diagram .rail, .diagram .gutter, .diagram .cupboard { fill: var(--frame); }
.diagram .door, .diagram .stair, .diagram .beam { fill: color-mix(in srgb, var(--roof) 40%, var(--frame)); }
.diagram .room { fill: var(--room); }
.diagram .room.dark, .diagram .shaft { fill: color-mix(in srgb, var(--stroke) 14%, var(--room)); }
.diagram .slab, .diagram .ceil { fill: color-mix(in srgb, var(--stroke) 45%, var(--room)); }
.diagram .skin { fill: var(--skin); stroke: var(--stroke); stroke-width: 1; }
.diagram .bone, .diagram .joint { fill: var(--bone); }
.diagram .bonefill { fill: color-mix(in srgb, var(--bone) 55%, transparent); }
.diagram .organ { fill: var(--organ); }
.diagram .organ.soft { fill: color-mix(in srgb, var(--organ) 45%, var(--skin)); stroke-dasharray: 3 3; }
.diagram .organ.heart { fill: #c0392b; }
.diagram .hi, .diagram g.hi > *:not(.ln):not(.glass) { fill: var(--hi) !important; stroke: var(--hi-s) !important; stroke-width: 2.2 !important; }
.dot-ring { fill: transparent; }
.dot-core { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.diagram:not(.tappable) .dot-core { fill: var(--red); stroke: #fff; r: 6px; }
.diagram:not(.tappable) .dot-ring { fill: var(--red); opacity: 0.3; transform-box: fill-box; transform-origin: center; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.5); opacity: 0.5; } to { transform: scale(1.3); opacity: 0; } }
.tappable .dot { cursor: pointer; }
.tappable .dot.hi .dot-core { fill: var(--ok); stroke: #fff; }
.tappable .dot.wrong .dot-core { fill: var(--bad); stroke: #fff; }
.explore-name { text-align: center; min-height: 1.5em; }
@media (prefers-reduced-motion: reduce) { .dot-ring { animation: none !important; } }

/* Sessie */
.sess-top { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px -8px; }
.bar { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width 0.3s; }
.count { color: var(--mut); font-size: 13px; font-variant-numeric: tabular-nums; }
.sess-body { text-align: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c); margin-bottom: 8px; }
.task { color: var(--mut); font-size: 15px; margin-bottom: 12px; }
.term { font-size: 30px; line-height: 1.2; margin: 6px 0; overflow-wrap: anywhere; hyphens: auto; }
.term.q { font-size: 22px; margin: 18px 0; }
.say-row, .say-big { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.say-big { margin: 28px 0; }
.say-big .spk:first-child { height: 64px; padding: 0 26px; font-size: 17px; }
.say-big .spk.slow { height: 64px; padding: 0 18px; }
.meta { color: var(--mut); font-size: 14px; }
.def { font-size: 17px; margin: 10px 0 6px; }
.ex { font-style: italic; color: var(--mut); }
.en { display: block; color: var(--mut); font-size: 14px; margin-bottom: 8px; }
.cloze { font-size: 20px; margin: 16px 0 8px; }
.opts { display: grid; gap: 8px; margin-top: 14px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 17px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); opacity: 1; }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); opacity: 1; }
.answer { display: flex; gap: 8px; margin-top: 14px; }
.answer input { flex: 1; min-width: 0; font-size: 18px; min-height: 52px; }
.answer .btn { min-height: 52px; }
.hint { color: var(--near); font-size: 14px; min-height: 1.2em; margin: 6px 0 0; }
.hint.bad { color: var(--bad); }
.line, .bank { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.line { min-height: 58px; padding: 8px; border-bottom: 2px solid var(--line); margin: 14px 0; align-content: center; }
.ghost { color: var(--mut); font-size: 14px; align-self: center; }
.tile { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 16px; cursor: pointer; box-shadow: 0 1px 0 var(--line); }
.tile.used { opacity: 0.25; }
.fb { margin-top: 16px; border-radius: var(--r); padding: 14px; text-align: left; }
.fb.ok { background: var(--ok-bg); } .fb.near { background: var(--near-bg); } .fb.bad { background: var(--bad-bg); }
.fb-title { font-weight: 700; margin-bottom: 4px; }
.fb.ok .fb-title { color: var(--ok); } .fb.near .fb-title { color: var(--near); } .fb.bad .fb-title { color: var(--bad); }
.fb-ans { font-size: 19px; margin-bottom: 6px; }
.fb p { margin: 0 0 4px; font-size: 15px; }
.fb-ex { font-style: italic; }
.fb-en { color: var(--mut); font-size: 13px !important; }
.finish { text-align: center; padding-top: 12vh; }
.badge { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.badge svg { width: 36px; height: 36px; }
.finish h1 { margin-bottom: 8px; }
.listen { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.file { font-size: 14px; color: var(--mut); }
@media (min-width: 700px) { main { padding-top: 28px; } }
