/* Lesson page (forked from study_page/css/study.css).
   Dutch text is set in a serif (ink), English in a sans (muted), word meanings in small sans:
   the three kinds of text never look alike. The current line gets a highlighter mark.
   Colours follow the channel: teal accent, warm paper; "de" words blue, "het" words orange.
   Shared tokens (--paper, --ink, --accent ...) are defined in site.css, which loads first. */

:root {
  --delft: #2449b3;          /* "de" */
  --delft-soft: #e6ecfb;
  --het: #b04d1b;            /* "het" */
  --het-soft: #fcebdf;
  --marker: #ffe27a;         /* highlighter */
  --marker-edge: #f2c94c;
  --good: #17804a;
  --good-soft: #e3f4ea;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --amber: #f0a92e;
  --shadow: 0 1px 2px rgba(24, 33, 58, .06), 0 6px 20px rgba(24, 33, 58, .07);
  --radius: 14px;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --seg-dialogue: #9fb3ea;
  --seg-words: #8fd0bd;
  --seg-quiz: #f3c66b;
  --seg-recap: #c3b5e6;
  --seg-exam: #ee9f9f;
  --seg-other: #c9ced8;
  --player-bg: #0d1117;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --delft: #8eaaff; --delft-soft: #1f2a48; --het: #ffa36b; --het-soft: #3a2417;
    --marker: rgba(255, 214, 92, .30); --marker-edge: rgba(255, 214, 92, .55);
    --good: #5fd08f; --good-soft: #16301f; --bad: #ff8a80; --bad-soft: #3a1c1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --seg-dialogue: #4c64a8; --seg-words: #2f8f78; --seg-quiz: #a8812f; --seg-recap: #6d5fa0; --seg-exam: #a35a5a; --seg-other: #485064;
  }
}
:root[data-theme="dark"] {
  --delft: #8eaaff; --delft-soft: #1f2a48; --het: #ffa36b; --het-soft: #3a2417;
  --marker: rgba(255, 214, 92, .30); --marker-edge: rgba(255, 214, 92, .55);
  --good: #5fd08f; --good-soft: #16301f; --bad: #ff8a80; --bad-soft: #3a1c1a;
  --seg-dialogue: #4c64a8; --seg-words: #2f8f78; --seg-quiz: #a8812f; --seg-recap: #6d5fa0; --seg-exam: #a35a5a; --seg-other: #485064;
}

/* ---------- lesson heading ---------- */
.mock-banner {
  background: repeating-linear-gradient(-45deg, #ffe27a 0 14px, #ffd24d 14px 28px);
  color: #3b2f00; font-weight: 600; font-size: 14px; padding: 6px 16px; text-align: center;
}
.ep-head {
  display: flex; align-items: flex-end; gap: 16px;
  max-width: 1480px; margin: 0 auto; padding: 6px 24px 14px;
}
.title-block { flex: 1; min-width: 0; }
.eyebrow {
  margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center;
}
.eyebrow .crumb { color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 14px; }
.eyebrow .crumb:hover { text-decoration: underline; }
.level {
  display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; padding: 1px 7px; letter-spacing: .02em;
}
.level.track { background: var(--accent-2); }
:root[data-theme="dark"] .level { color: #10141f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .level { color: #10141f; } }
.ep-head h1 {
  margin: 4px 0 0; font-family: var(--font-nl); font-weight: 700;
  font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; overflow-wrap: anywhere;
}
.ep-en { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.yt-link { white-space: nowrap; }

/* ---------- layout ---------- */
.layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr);
  gap: 24px;
}
@media (min-width: 961px) {
  /* the lesson fills the window under the site header; the page goes on below it (about the lesson, footer) */
  .layout { height: calc(100vh - var(--head-h, 64px)); height: calc(100dvh - var(--head-h, 64px)); min-height: 560px; }
  .stage { overflow-y: auto; min-height: 0; padding-bottom: 8px; scrollbar-width: thin; }
  .panel { min-height: 0; display: flex; flex-direction: column; position: relative; }
  .tab-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}

/* ---------- video ----------
   .video-wrap is the black box: the 16:9 player, then the English strip under it (never over it:
   YouTube's rules forbid drawing over its player), then any message. In full screen the same box
   fills the screen, with the question panel beside the player when one is open. */
.video-wrap {
  position: relative;
  background: var(--player-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  container-type: inline-size;
  color: #fff;
}
.vcell { position: relative; }
.vbox { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player { position: absolute; inset: 0; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }

/* the picture before the first play: our own copy of the thumbnail; YouTube loads only on play */
.facade {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; margin: 0;
  background: #000; cursor: pointer; display: block; color: #fff; border-radius: 0;
}
.facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .45)); }
.facade-play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; z-index: 1;
  border-radius: 50%; background: rgba(255, 255, 255, .95); color: #1d6f69;
  display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); transition: transform .15s;
}
.facade-play svg { width: 38px; height: 38px; margin-left: 5px; fill: currentColor; }
.facade:hover .facade-play, .facade:focus-visible .facade-play { transform: scale(1.06); }
.facade:focus-visible { outline: 4px solid var(--marker-edge); outline-offset: -4px; }
.facade-note {
  position: absolute; left: 12px; bottom: 10px; z-index: 1; font: 600 13px/1.3 var(--font-ui);
  background: rgba(0, 0, 0, .62); padding: 4px 9px; border-radius: 999px; text-align: left;
}
.facade.busy .facade-play svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .facade.busy .facade-play svg { animation: none; } }
.facade-soon {
  position: absolute; right: 12px; bottom: 10px; z-index: 1; font: 700 14px/1.3 var(--font-ui);
  background: var(--accent-2); color: #fff; padding: 5px 11px; border-radius: 999px;
}

/* ---------- the English under the video ---------- */
.vrow { display: flex; align-items: center; gap: 10px; }
.vstrip {
  flex: 1; min-width: 0;
  display: flex; justify-content: center; align-items: center;
  padding: 7px 14px 9px;
  min-height: calc(2 * 1.32em + 16px);
  font: 600 17px/1.32 var(--font-ui);
  font-size: clamp(15px, calc(7px + 1.55cqi), 30px);
  text-align: center;
  text-wrap: balance;
}
.vt-box { max-width: 100%; }
.vt-a, .vt-b { display: block; }
.vt-b { font-weight: 500; font-size: .88em; opacity: .88; }
.vt-b[hidden] { display: none; }
.vt-nl { font-family: var(--font-nl); font-weight: 700; color: #ffd66b; }
.vstrip.hint { font-weight: 500; color: rgba(255, 255, 255, .72); font-size: clamp(13px, calc(5px + 1.2cqi), 22px); }
.video-wrap.vt-off .vstrip { display: none; }
.video-wrap.vt-off:not(.is-fs) .vrow { display: none; }
.video-msg {
  padding: 9px 14px 11px; font-size: 15px; line-height: 1.4; text-align: center;
  background: #1b2130; color: #fff; border-top: 1px solid rgba(255, 255, 255, .08);
}
.video-msg.error, .video-msg.blocked { background: #3a2a12; }
.video-msg a { color: #ffd66b; font-weight: 600; }

/* ---------- full screen: the box around player + English (+ question), not the video alone ---------- */
.fs-bar { display: none; }
.video-wrap.is-fs {
  position: fixed; inset: 0; z-index: 55;
  width: 100%; height: 100%; height: 100dvh;
  border-radius: 0; box-shadow: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}
.video-wrap.is-fs .vcell { grid-area: 1 / 1; container-type: size; display: grid; place-items: center; min-height: 0; min-width: 0; }
.video-wrap.is-fs .vbox { width: min(100cqw, 100cqh * 16 / 9); }
.video-wrap.is-fs .vrow { grid-area: 2 / 1 / 3 / 3; padding: 0 12px 0 0; }
.video-wrap.is-fs .video-msg { grid-area: 3 / 1 / 4 / 3; }
.video-wrap.is-fs .vstrip { min-height: calc(2 * 1.32em + 16px); }
.video-wrap.is-fs .fs-bar { display: flex; gap: 8px; flex: none; }
.video-wrap.is-fs .quiz-dock {
  grid-area: 1 / 2; position: static; width: min(440px, 42vw); inset: auto; padding: 12px; background: transparent;
  overflow-y: auto; align-self: stretch;
}
@media (orientation: portrait) {
  .video-wrap.is-fs { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); align-content: start; }
  .video-wrap.is-fs .vcell { grid-area: 1 / 1; container-type: inline-size; }
  .video-wrap.is-fs .vbox { width: 100%; }
  .video-wrap.is-fs .vrow { grid-area: 2 / 1; flex-wrap: wrap; justify-content: center; padding: 0 8px 8px; }
  .video-wrap.is-fs .vstrip { flex: 1 1 100%; }   /* its own row; the buttons go under it */
  .video-wrap.is-fs .video-msg { grid-area: 3 / 1; }
  .video-wrap.is-fs .quiz-dock { grid-area: 4 / 1; width: auto; }
}
.fs-chip {
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff;
  font: 600 15px/1 var(--font-ui); padding: 10px 14px; min-height: 44px; white-space: nowrap;
}
.fs-chip svg { width: 20px; height: 20px; fill: currentColor; vertical-align: -4px; }
.fs-chip:hover { background: rgba(255, 255, 255, .24); }
@media (max-height: 500px) {
  .video-wrap.is-fs .vstrip { min-height: calc(2 * 1.25em + 8px); padding: 3px 10px 5px; line-height: 1.25; }
  .fs-chip { padding: 8px 11px; min-height: 40px; font-size: 14px; }
}
html.fs-lock, html.fs-lock body { overflow: hidden; }
html.fs-lock .stage-sticky, html.fs-lock .tabs { position: static !important; z-index: auto !important; }   /* a sticky parent clips the full-window box */
.ctl-main { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.ctl-extra { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.vt-switch { white-space: nowrap; }
#fsBtn .i-fs-exit { display: none; }
body.in-fs #fsBtn .i-fs { display: none; }
body.in-fs #fsBtn .i-fs-exit { display: block; }

/* the static transcript the build writes into the page (no JavaScript, search engines); app.js replaces it */
.static-note { color: var(--muted); font-size: 15px; margin: 12px 18px; }
details.static-q { margin: 0 8px 8px; color: var(--muted); }
details.static-q summary { cursor: pointer; padding: 8px 4px; }
.qcard ol.static-opts { margin: 8px 0 0; padding-left: 22px; font-family: var(--font-nl); font-size: 18px; }

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 8px;
  flex-wrap: wrap;
}
.ctl {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--card);
  cursor: pointer;
  flex: none;
}
.ctl:hover { border-color: var(--accent); }
.ctl svg { width: 22px; height: 22px; fill: currentColor; }
.ctl.play {
  width: 64px; height: 64px;
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 14px rgba(29, 111, 105, .32);
}
:root[data-theme="dark"] .ctl.play { color: #10141f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ctl.play { color: #10141f; } }
.ctl.play svg { width: 28px; height: 28px; }
.ctl.play .i-pause { display: none; }
.ctl.play.playing .i-play { display: none; }
.ctl.play.playing .i-pause { display: block; }
.speeds {
  margin-left: auto;
  display: flex;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
}
.speed {
  border: 0; background: transparent; cursor: pointer;
  min-width: 56px; height: 40px; border-radius: 999px;
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.speed[aria-checked="true"] { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .speed[aria-checked="true"] { color: #10141f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .speed[aria-checked="true"] { color: #10141f; } }

.chapter-bar {
  position: relative;
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--rule);
  cursor: pointer;
  margin-top: 2px;
}
.chapter-bar .seg {
  height: 100%;
  border: 0;
  padding: 0;
  border-right: 2px solid var(--paper);
  cursor: pointer;
  background: var(--seg-other);
}
.chapter-bar .seg:last-of-type { border-right: 0; }
.seg[data-type="dialogue"] { background: var(--seg-dialogue); }
.seg[data-type="words"] { background: var(--seg-words); }
.seg[data-type="quiz"] { background: var(--seg-quiz); }
.seg[data-type="recap"] { background: var(--seg-recap); }
.seg[data-type="exam"] { background: var(--seg-exam); }
.chapter-bar .head {
  position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px;
  background: var(--ink); border-radius: 2px; pointer-events: none;
}
.now-part {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  min-height: 21px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-part b { color: var(--ink); font-weight: 600; }

.tips {
  margin-top: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid var(--rule);
  font-size: 15px;
}
.tips p { margin: 0 0 6px; }
.tips ul { margin: 0 0 10px; padding-left: 20px; }
.tips li { margin: 3px 0; }
.tip-nl { font-family: var(--font-nl); font-weight: 700; }
.kbd {
  display: inline-block; min-width: 1.6em; text-align: center;
  border: 1px solid var(--rule); border-radius: 6px; padding: 0 5px; font-weight: 700; background: var(--paper);
}

/* ---------- panel + tabs ---------- */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  z-index: 5;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 14px 6px 12px;
  min-height: 50px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.count {
  font-weight: 600; font-size: 12px; color: var(--muted);
  background: var(--paper); border-radius: 999px; padding: 1px 7px; margin-left: 2px;
  font-variant-numeric: tabular-nums;
}
.tab-body { position: relative; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--card); z-index: 3;
}
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; min-height: 40px; font-size: 15px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 38px; height: 22px; border-radius: 11px; background: var(--rule); position: relative; flex: none;
  transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 15px; margin: 14px 18px 4px; }

/* ---------- transcript ---------- */
.transcript { padding: 6px 10px 120px; }
.sec-head {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 8px 6px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.sec-head:first-child { border-top: 0; margin-top: 8px; padding-top: 0; }
.sec-type {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 6px; background: var(--seg-other); color: #18213a; flex: none;
}
.sec-type[data-type="dialogue"] { background: var(--seg-dialogue); }
.sec-type[data-type="words"] { background: var(--seg-words); }
.sec-type[data-type="quiz"] { background: var(--seg-quiz); }
.sec-type[data-type="recap"] { background: var(--seg-recap); }
.sec-type[data-type="exam"] { background: var(--seg-exam); }
:root[data-theme="dark"] .sec-type { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sec-type { color: #fff; } }
.sec-name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.sec-title { font-weight: 600; min-width: 0; font-size: 15px; line-height: 1.3; }
.sec-title[lang="nl"] { font-family: var(--font-nl); font-size: 16px; }
.sec-go {
  border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: 4px 12px;
  min-height: 34px; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sec-go:hover { border-color: var(--accent); }
.sec-note { margin: 2px 8px 10px; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 8px 10px; }
.chip {
  border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 5px 12px;
  min-height: 36px; cursor: pointer; font-family: var(--font-nl); font-size: 15px;
}
.chip:hover { border-color: var(--accent); }
.reveal-lines {
  margin: 0 8px 8px; border: 1px dashed var(--rule); background: transparent; border-radius: 10px;
  padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: 14px; width: calc(100% - 16px); text-align: left;
}

.line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  padding: 6px 10px 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  scroll-margin: 80px;
  -webkit-tap-highlight-color: transparent;
}
.line::before {
  content: ""; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 4px; border-radius: 2px;
  background: transparent;
}
.line:hover { background: var(--paper); }
.line.current::before { background: var(--marker-edge); }
.line.done .nl { color: var(--ink); }
.meta {
  grid-column: 1; grid-row: 1; align-self: center;
  display: flex; gap: 10px; align-items: baseline;
  font-size: 12.5px; color: var(--faint); font-weight: 600; letter-spacing: .03em;
}
.spk { text-transform: uppercase; }
.spk.s1 { color: var(--delft); }
.spk.s2 { color: var(--het); }
.time { font-family: var(--font-num); font-weight: 400; font-size: 12px; }
.nl {
  margin: 1px 0 0;
  font-family: var(--font-nl);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
}
.hl {
  background-image: linear-gradient(transparent 14%, var(--marker) 14%, var(--marker) 90%, transparent 90%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .45s ease-out;
  padding: 0 2px;
  margin: 0 -2px;
}
.line.current .hl { background-size: 100% 100%; }
@media (prefers-reduced-motion: reduce) { .hl { transition: none; } }

.tok {
  border-radius: 4px;
  cursor: pointer;
  padding: 0 1px;
  margin: 0 -1px;
}
.tok:hover { box-shadow: inset 0 -2px 0 var(--accent); }
.tok:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.tok.on { background: var(--accent); color: #fff; box-shadow: none; }
:root[data-theme="dark"] .tok.on { color: #10141f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tok.on { color: #10141f; } }
.tok.pair { box-shadow: inset 0 -3px 0 var(--accent); }
.tok .g { display: none; }

.line.glossed .nl { line-height: 1.25; }
.line.glossed .hl { background: none; padding: 0; margin: 0; }
.line.glossed.current .tok .w {
  background: var(--marker); border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.line.glossed .tok {
  display: inline-flex; flex-direction: column; align-items: flex-start; vertical-align: top;
  margin: 0 .12em 10px 0; padding: 0 2px;
}
.line.glossed .tok .g {
  display: block;
  font: 500 12.5px/1.25 var(--font-ui);
  color: var(--muted);
  max-width: 10em;
  margin-top: 2px;
  white-space: normal;
}
.line.glossed .tok .g .art { font-weight: 700; }
.line.glossed .tok.on .g { color: inherit; }
.art-de { color: var(--delft); }
.art-het { color: var(--het); }

.en {
  margin: 4px 0 0;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--muted);
}
.hide-en .en {
  color: transparent;
  background: var(--paper);
  border-radius: 6px;
  user-select: none;
  position: relative;
  min-height: 1.45em;
}
.hide-en .en::after {
  content: "Tap to show English";
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 13px; white-space: nowrap;
}
html[data-ui="nl"] .hide-en .en::after { content: "Tik om het Engels te zien"; }
.hide-en .line.peek .en { color: var(--muted); background: transparent; }
.hide-en .line.peek .en::after { content: none; }

.body { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.acts { grid-column: 2; grid-row: 1; display: flex; gap: 6px; align-self: center; }
.act {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--card);
  display: grid; place-items: center; cursor: pointer; font-weight: 700; font-size: 14px;
  color: var(--muted);
}
.act:hover { border-color: var(--accent); color: var(--accent); }
.act svg { width: 20px; height: 20px; fill: currentColor; }
.act[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.act.aa { font-family: var(--font-nl); font-size: 16px; }

.follow {
  position: sticky; bottom: 16px; left: 50%;
  display: block; margin: -60px auto 0; transform: none;
  border: 0; background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 10px 18px; min-height: 44px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
  z-index: 4;
}

/* ---------- popover ---------- */
.pop {
  position: fixed;
  z-index: 50;
  width: min(340px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(24, 33, 58, .22);
  padding: 14px 16px 12px;
}
.pop-head { display: flex; align-items: baseline; gap: 8px; padding-right: 36px; flex-wrap: wrap; }
.pop-word { font-family: var(--font-nl); font-size: 26px; font-weight: 700; line-height: 1.15; }
.pop-pos { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.pop-close {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: transparent;
  border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
}
.pop-gloss { font-size: 19px; line-height: 1.35; margin: 6px 0 8px; font-weight: 600; }
.pop-gloss small { display: block; font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1px; }
.pop-rows { margin: 0 0 10px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 15px; }
.pop-rows dt { color: var(--muted); }
.pop-rows dd { margin: 0; font-family: var(--font-nl); font-size: 17px; }
.pop-art { font-family: var(--font-ui); font-size: 15px; }
.art-chip { display: inline-block; font-weight: 700; padding: 0 7px; border-radius: 6px; font-family: var(--font-ui); font-size: 14px; }
.art-chip.de { background: var(--delft-soft); color: var(--delft); }
.art-chip.het { background: var(--het-soft); color: var(--het); }
.pop-key {
  font-size: 14px; margin: 0 0 10px; padding: 6px 10px; background: var(--accent-soft); border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pop-key button { border: 0; background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; min-height: 32px; white-space: nowrap; }
.pop-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pop-acts .btn { min-height: 42px; padding: 8px 14px; font-size: 15px; }

/* ---------- words ---------- */
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 10px 18px 40px;
}
.wcard {
  display: flex; flex-direction: column;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}
.wcard:hover { border-color: var(--accent); }
.wcard.playing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.wimg { aspect-ratio: 3 / 2; background: var(--paper); width: 100%; height: auto; object-fit: cover; display: block; }   /* height: auto, or the img height attribute wins */
.wimg.none { display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.wbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.wnl { font-family: var(--font-nl); font-size: 23px; font-weight: 700; line-height: 1.2; }
.wnl .a { font-weight: 400; }
.wen { font-size: 16px; font-weight: 600; }
.wex { font-family: var(--font-nl); font-size: 16px; margin-top: 6px; color: var(--ink); }
.wex-en { font-size: 14px; color: var(--muted); }
.wgo { margin-top: auto; padding-top: 10px; font-size: 14px; font-weight: 600; color: var(--accent); }

/* ---------- quiz ---------- */
.quiz-list { padding: 8px 18px 40px; }
.qgroup { margin: 18px 0 6px; font-weight: 600; font-family: var(--font-nl); font-size: 16px; }
.qcard {
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; background: var(--card);
}
.qnum { font-size: 12px; font-weight: 700; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.qtext { font-family: var(--font-nl); font-size: 21px; line-height: 1.35; margin: 4px 0 2px; font-weight: 700; }
.qtext-en { color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.opts { display: grid; gap: 8px; margin: 10px 0 6px; }
.opt {
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px;
  text-align: left; border: 1.5px solid var(--rule); background: var(--card); border-radius: 12px;
  padding: 10px 12px; min-height: 52px; cursor: pointer;
}
.opt:hover:not([disabled]) { border-color: var(--accent); }
.opt .letter {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); font-weight: 700; font-size: 14px;
}
.opt .o-nl { font-family: var(--font-nl); font-size: 18px; line-height: 1.3; }
.opt .o-en { display: block; font-family: var(--font-ui); font-size: 14px; color: var(--muted); margin-top: 1px; }
.opt[disabled] { cursor: default; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .letter { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.qfoot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; min-height: 40px; padding: 4px 6px; font-size: 15px; }
.verdict { border-radius: 10px; padding: 10px 12px; margin: 8px 0 4px; font-size: 15.5px; }
.verdict.ok { background: var(--good-soft); }
.verdict.no { background: var(--bad-soft); }
.verdict b { display: block; margin-bottom: 2px; }

/* ---------- question panel (never over the player) ---------- */
.quiz-dock {
  position: absolute; inset: 0; z-index: 30;      /* laptop: over the study panel on the right */
  background: rgba(16, 20, 31, .38);
  padding: 14px;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.dock-card {
  background: var(--card); color: var(--ink);
  border-radius: 18px; box-shadow: 0 16px 50px rgba(0, 0, 0, .28);
  padding: 16px 18px 14px; margin: 0 auto; width: 100%; max-width: 600px;
}
.dock-card .qcard { border: 0; padding: 0; margin: 0; }
.dock-hint { margin: 0 0 4px !important; }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.modal-top .qnum { font-size: 13px; }

/* ---------- summary ---------- */
.sum { padding: 16px 18px 40px; }
.sum-card {
  scroll-margin-top: 80px;
  border: 1px solid var(--rule); border-radius: 18px; padding: 16px 18px 14px; background: var(--card);
}
.sum-card h2 { margin: 0; font-family: var(--font-nl); font-size: 21px; line-height: 1.25; }
.sum-kicker { margin: 0 0 2px; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sum-sub { margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--paper); border-radius: 12px; padding: 9px 10px 8px; }
.stat b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); line-height: 1.25; display: block; margin-top: 2px; }
.sum-list { margin: 12px 0 0; font-size: 14.5px; }
.sum-list dt { color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-top: 8px; }
.sum-list dd { margin: 1px 0 0; }
.sum-list dd.nl { font-family: var(--font-nl); font-size: 16px; }
.sum-foot { margin: 12px 0 0; font-size: 12.5px; color: var(--faint); }
.fb { margin-top: 22px; }
.fb h3 { margin: 0 0 4px; font-size: 18px; }
.fb .note { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.fq { margin: 0 0 16px; border: 0; padding: 0; }
.fq legend, .fq label.q { font-weight: 600; margin-bottom: 8px; display: block; padding: 0; }
.seg-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-ctl button {
  border: 1.5px solid var(--rule); background: var(--card); border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer;
}
.seg-ctl button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--card); font-size: 20px; cursor: pointer; }
.stepper output { min-width: 48px; text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
textarea {
  width: 100%; min-height: 76px; border: 1.5px solid var(--rule); border-radius: 12px; padding: 10px 12px;
  font: 16px/1.4 var(--font-ui); background: var(--card); color: var(--ink); resize: vertical; margin-top: 8px;
}
textarea:focus { border-color: var(--accent); outline: none; }
.sum-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
}

/* ---------- phone / narrow ---------- */
@media (max-width: 960px) {
  .ep-head { padding: 4px 16px 10px; flex-wrap: wrap; gap: 6px 12px; }
  .ep-head h1 { font-size: 24px; }
  .ep-en { font-size: 15px; }
  .layout { display: block; padding: 0 0 24px; }
  .stage { display: contents; }
  .stage-sticky {
    position: sticky; top: 0; z-index: 20;
    background: var(--paper);
    padding: 0 0 6px;
  }
  .video-wrap { border-radius: 0; box-shadow: none; }
  .vstrip { padding: 6px 12px 8px; }
  .facade-note, .facade-soon { font-size: 12px; padding: 3px 8px; bottom: 8px; }
  .facade-note { left: 8px; } .facade-soon { right: 8px; }
  .controls { padding: 8px 12px 2px; gap: 2px 6px; flex-wrap: wrap; }
  .ctl-main { flex-basis: 100%; gap: 6px; }
  .ctl-extra { flex-basis: 100%; justify-content: space-between; margin-left: 0; }
  .ctl-extra .ctl { width: 40px; height: 40px; }
  .vt-switch { min-height: 36px; font-size: 14px; }
  .ctl { width: 44px; height: 44px; }
  .ctl.play { width: 56px; height: 56px; }
  .speed { min-width: 0; padding: 0 9px; height: 38px; font-size: 14px; }
  .chapter-bar { margin: 2px 12px 0; height: 10px; }
  .now-part { margin: 4px 12px 0; font-size: 13px; min-height: 19px; }
  .tips { margin: 10px 12px 12px; }
  .panel { border-radius: 0; box-shadow: none; overflow: visible; background: var(--card); }
  .tabs { position: sticky; top: var(--stick-h, 0px); }
  .tab { min-height: 46px; padding: 12px 4px 10px; font-size: 15px; }
  .toolbar { position: static; padding: 6px 14px; gap: 0 16px; }
  .transcript { padding: 4px 4px 140px; }
  .nl { font-size: 20px; }
  .line { padding: 9px 6px 11px 14px; }
  .act { width: 44px; height: 44px; }
  .word-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 10px 12px 40px; }
  .wnl { font-size: 20px; }
  .quiz-list { padding: 4px 12px 40px; }
  .sum { padding: 12px 12px 40px; }
  .quiz-dock { position: fixed; left: 0; right: 0; bottom: 0; top: var(--stick-h, 40vh); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 40; }
  .dock-card { padding: 14px 14px 12px; border-radius: 16px; }
  body.dock-open { overflow: hidden; }
  .follow { bottom: 12px; }
}
@media (max-width: 960px) {
  body.tab-summary .stage-sticky { position: static; }
  body.tab-summary .tabs { top: 0; }
  .sum-card h2 { font-size: 18px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 12px; }
}
/* phones held sideways: a sticky 16:9 video would fill the whole screen, so the video area scrolls with the
   page (full screen is the landscape mode), it is a bit smaller, and the controls take one row */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .stage-sticky { position: static; }
  .tabs { top: 0; }
  .video-wrap:not(.is-fs) .vbox { width: min(100%, calc(72vh * 16 / 9)); width: min(100%, calc(72dvh * 16 / 9)); margin: 0 auto; }
  .ctl-main, .ctl-extra { flex-basis: auto; }
  .ctl-extra { margin-left: auto; gap: 8px; }
  .quiz-dock { top: 0; }
}
@media (max-width: 560px) {
  .word-grid { grid-template-columns: 1fr; }
  .wcard { flex-direction: row; }
  .wcard .wimg { width: 36%; flex: none; aspect-ratio: auto; height: auto; align-self: stretch; object-fit: cover; }
  .wbody { padding: 10px 12px 12px; }
}
@media (max-width: 380px) {
  .ctl { width: 40px; height: 40px; }
  .ctl svg { width: 19px; height: 19px; }
  .ctl.play { width: 52px; height: 52px; }
  .speed { padding: 0 7px; font-size: 13px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (pointer: coarse) {
  .nl { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
@media print {
  .stage, .tabs, .toolbar, .fb, .sum-actions, .site-head, .site-foot { display: none !important; }
}
