:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #fcfcfb;
  --surface-2: #efeee9;
  --border: #dddbd3;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-muted: #77756f;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefb;
  --good: #1b7f3b;
  --good-soft: #e3f4e8;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --grid: #e7e5df;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #c98500;
  --ghost: #9a988f;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #33322f;
    --text: #f0efec; --text-2: #c3c2b7; --text-muted: #8f8d85;
    --accent: #3987e5; --accent-ink: #fff; --accent-soft: #1d2a3b;
    --good: #5cc27e; --good-soft: #17301f; --bad: #f08a83; --bad-soft: #3a1a18;
    --grid: #2a2a28;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --ghost: #77756f;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #33322f;
  --text: #f0efec; --text-2: #c3c2b7; --text-muted: #8f8d85;
  --accent: #3987e5; --accent-ink: #fff; --accent-soft: #1d2a3b;
  --good: #5cc27e; --good-soft: #17301f; --bad: #f08a83; --bad-soft: #3a1a18;
  --grid: #2a2a28;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --ghost: #77756f;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--text-muted); }
button { font: inherit; color: inherit; }

/* ---- top ---- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand svg { width: 26px; height: 26px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: .95rem; }
.top nav a.active, .top nav a:hover { background: var(--surface-2); color: var(--text); }
.top .spacer { flex: 1; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 10px; cursor: pointer; }

main { max-width: 1440px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---- buttons ---- */
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn:hover { filter: brightness(1.05); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { text-decoration: none; color: var(--text); border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: .88rem; }
.chip:hover, .chip.on { border-color: var(--accent); background: var(--accent-soft); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- home ---- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; margin-bottom: 28px; }
.hero p { color: var(--text-2); font-size: 1.05rem; max-width: 60ch; }
.hero-art { padding: 16px; }
.hero-art svg { width: 100%; height: auto; display: block; }
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.progress-bar > div { height: 100%; background: var(--good); border-radius: 99px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.lesson-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden; transition: transform .12s, border-color .12s; }
.lesson-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.lesson-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.lesson-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lesson-card .num { font-size: .8rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.lesson-card h3 { margin: 0; }
.lesson-card p { margin: 0; color: var(--text-2); font-size: .93rem; }
.lesson-card .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); margin-top: auto; padding-top: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.badge.done { background: var(--good-soft); color: var(--good); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.tool-card { padding: 18px; text-decoration: none; color: inherit; }
.tool-card:hover { border-color: var(--accent); }
.tool-card p { color: var(--text-2); margin: 0; font-size: .93rem; }

/* ---- lesson ---- */
.lesson { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.player-col { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 88px); }
.video-wrap { flex-shrink: 0; position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-wrap video { width: 100%; display: block; aspect-ratio: 16/9; }
.caption {
  position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%);
  width: min(92%, 900px); text-align: center; pointer-events: none;
}
.caption span { display: inline; background: rgba(0,0,0,.78); color: #fff; padding: 2px 8px; line-height: 1.7; font-size: clamp(13px, 1.35vw, 18px); box-decoration-break: clone; -webkit-box-decoration-break: clone; border-radius: 4px; }
.caption .en { color: #ffe08a; font-size: .9em; }
.player-bar { flex-shrink: 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.player-bar .grp { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.player-bar .grp button { border: 0; background: transparent; padding: 3px 9px; border-radius: 6px; cursor: pointer; font-size: .85rem; color: var(--text-2); }
.player-bar .grp button.on { background: var(--accent); color: var(--accent-ink); }
.player-bar .lbl { font-size: .8rem; color: var(--text-muted); margin-left: 4px; }
.transcript { flex: 1; min-height: 160px; overflow: auto; padding: 6px; }
.transcript .cue { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: .92rem; }
.transcript .cue:hover { background: var(--surface-2); }
.transcript .cue.now { background: var(--accent-soft); }
.transcript .cue .tm { color: var(--accent); font-variant-numeric: tabular-nums; font-size: .8rem; padding-top: 2px; }
.transcript .cue .en { color: var(--text-muted); font-size: .85rem; display: block; margin-top: 2px; }
.transcript-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 0; gap: 8px; flex-wrap: wrap; }
.transcript-head label { font-size: .82rem; color: var(--text-muted); display: flex; gap: 4px; align-items: center; }

.lesson-head .eyebrow { color: var(--accent); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.lesson-head .en-title { color: var(--text-muted); font-size: .9rem; margin-top: -4px; }
.summary { font-size: 1.04rem; color: var(--text-2); }
.goals { padding: 14px 18px; margin: 16px 0; }
.goals h3 { margin-bottom: 6px; }
.goals ul { margin: 0; padding-left: 20px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }

.section { padding: 20px 22px; margin: 18px 0; scroll-margin-top: 80px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.play-btn { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 999px; padding: 3px 12px; font-size: .85rem; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.play-btn:hover { background: var(--accent-soft); }
.frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 14px 0; }
.frames figure { margin: 0; position: relative; cursor: zoom-in; }
.frames img { width: 100%; border-radius: 8px; display: block; background: #000; border: 1px solid var(--border); }
.frames figcaption { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: .75rem; padding: 0 6px; border-radius: 4px; }
.section .body p { margin: .6em 0; }
.keypoints { background: var(--surface-2); border-radius: 10px; padding: 10px 16px 10px 34px; margin: 14px 0 6px; }
.keypoints li { margin: 3px 0; }
.quote { border-left: 3px solid var(--series-2); padding: 4px 14px; margin: 12px 0 0; color: var(--text-2); font-style: italic; }
.quote small { display: block; font-style: normal; color: var(--text-muted); font-size: .78rem; }

.gloss-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.gloss-table th, .gloss-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.gloss-table th { color: var(--text-muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.gloss-table td:first-child { font-weight: 600; white-space: nowrap; }
.gloss-table .lessons a { font-size: .8rem; margin-right: 4px; }

.quiz-q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-q .q { font-weight: 600; margin-bottom: 8px; }
.quiz-q .opts { display: grid; gap: 6px; }
.quiz-q .opt { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.quiz-q .opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-q .opt.right { border-color: var(--good); background: var(--good-soft); }
.quiz-q .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-q .opt:disabled { cursor: default; }
.quiz-q .explain { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: .93rem; }
.score { font-weight: 700; }

.exercise { padding: 14px 0; border-bottom: 1px solid var(--border); }
.exercise:last-child { border-bottom: 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 6px; }
details > div { padding: 8px 12px; background: var(--surface-2); border-radius: 8px; margin-top: 6px; }
textarea.notes { width: 100%; min-height: 140px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.done-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 16px 20px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; }
.lightbox .btn-row { margin: 0; }

/* ---- simulator ---- */
.sim { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.sim-controls { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; padding-right: 4px; }
.sim-controls fieldset { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin: 0 0 12px; padding: 8px 14px 12px; }
.sim-controls legend { font-weight: 700; font-size: .85rem; padding: 0 6px; color: var(--text-2); }
.ctl { display: block; margin: 8px 0; font-size: .88rem; }
.ctl > span { display: block; color: var(--text-2); margin-bottom: 2px; }
.ctl.check { display: flex; gap: 8px; align-items: center; }
.ctl.check > span { margin: 0; }
.ctl select { width: 100%; padding: 5px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.rng { display: grid; grid-template-columns: 1fr 72px; gap: 8px; align-items: center; }
.rng input[type=range] { width: 100%; accent-color: var(--accent); }
.rng input[type=number] { width: 100%; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-variant-numeric: tabular-nums; }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.tile span { display: block; font-size: .78rem; color: var(--text-muted); }
.tile b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.tile.warn { grid-column: 1 / -1; border-color: var(--bad); background: var(--bad-soft); }
.tile.warn b { color: var(--bad); }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 8px; margin-bottom: 12px; }
.chart-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.chart-head h3 { margin: 0 0 6px; font-size: .95rem; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.chart { position: relative; }
.chart canvas { display: block; cursor: crosshair; }
.chart-tip { position: absolute; display: none; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0,0,0,.15); border-radius: 8px; padding: 6px 10px; font-size: .8rem; color: var(--text); min-width: 150px; font-variant-numeric: tabular-nums; }
.chart-tip i { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; }
.sim-help { margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

.search { width: 100%; max-width: 420px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; margin: 8px 0 16px; }
.pending { padding: 30px; text-align: center; color: var(--text-muted); }

@media (max-width: 1000px) {
  .lesson, .sim, .hero { grid-template-columns: 1fr; }
  .player-col, .sim-controls { position: static; max-height: none; }
  .transcript { max-height: 320px; }
}
@media (max-width: 600px) {
  main { padding: 16px 16px 60px; }
  .top { padding: 8px 16px; gap: 8px; flex-wrap: wrap; }
  .section { padding: 16px; }
  .gloss-table td:first-child { white-space: normal; }
}

/* =========================================================
   Læsbarhed: serif-brødtekst, 18 px, ~70 tegn pr. linje
   ========================================================= */
:root {
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, Cambria, "Times New Roman", serif;
  --read-size: 1.125rem;   /* 18 px */
  --read-lh: 1.7;
}
/* Tekstkolonnen: 41rem ≈ 656 px (minus padding) → ca. 65–70 tegn pr. linje ved 18 px serif */
.lesson { grid-template-columns: minmax(0, 1fr) minmax(0, 41rem); gap: 32px; }
.summary, .section .body, .keypoints, .goals li, .quote,
.quiz-q .q, .quiz-q .opt, .quiz-q .explain, .exercise > div, details > div,
.gloss-table td:nth-child(3), textarea.notes {
  font-family: var(--serif);
  font-size: var(--read-size);
  line-height: var(--read-lh);
  font-optical-sizing: auto;
}
.section .body p { margin: 0 0 1em; hyphens: auto; -webkit-hyphens: auto; }
.section .body li { margin: .25em 0; }
.summary { font-size: 1.2rem; line-height: 1.65; color: var(--text-2); }
.section { padding: 26px 30px; }
.keypoints { font-size: 1.05rem; padding: 12px 18px 12px 38px; }
.quote { font-size: 1.05rem; }
.quiz-q .opt { font-size: 1.05rem; line-height: 1.5; }
.quiz-q .explain { font-size: 1.02rem; }
.transcript .cue { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.transcript .cue .en { font-size: .92rem; }
.gloss-table { font-size: 1rem; }
.lesson-card p, .hero p { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }
.hero p { font-size: 1.15rem; }

/* =========================================================
   Video-overlay: spol ±5 s, CC, fuld skærm
   ========================================================= */
.vo { position: absolute; inset: 0; pointer-events: none; }
.vo button { pointer-events: auto; cursor: pointer; border: 0; color: #fff; font-family: "Segoe UI", system-ui, sans-serif; }
.vo-skip {
  position: absolute; top: 50%; transform: translateY(-60%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,0,0,.55); font-size: .78rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  opacity: 0; transition: opacity .2s, background .15s;
}
.vo-skip span { font-size: 1.5rem; margin-bottom: 2px; }
.vo-skip.left { left: 4%; }
.vo-skip.right { right: 4%; }
.vo-skip:hover { background: rgba(42,120,214,.85); }
.vo-top { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.vo-btn { background: rgba(0,0,0,.6); border-radius: 6px; padding: 5px 10px; font-size: .85rem; font-weight: 700; }
.vo-btn:hover { background: rgba(42,120,214,.85); }
.vo-btn.off { opacity: .6; text-decoration: line-through; }
.video-wrap:hover .vo-skip, .video-wrap:hover .vo-top,
.video-wrap.active .vo-skip, .video-wrap.active .vo-top { opacity: 1; }
.vo-flash {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.7); color: #fff; font: 700 1.3rem "Segoe UI", system-ui, sans-serif;
  padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .25s;
}
.vo-flash.show { opacity: 1; }
.caption { z-index: 1; }
.caption span { font-family: "Segoe UI", system-ui, sans-serif; }

/* Fuld skærm: hele afspilleren (video + tekst + knapper) */
.video-wrap:fullscreen { background: #000; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.video-wrap:fullscreen video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.video-wrap:fullscreen .caption { bottom: 9%; width: min(80%, 1400px); }
.video-wrap:fullscreen .caption span { font-size: clamp(20px, 2.1vw, 40px); line-height: 1.6; padding: 3px 12px; }
.video-wrap:fullscreen .vo-skip { width: 88px; height: 88px; font-size: .95rem; }
.video-wrap:fullscreen .vo-skip span { font-size: 2rem; }
.video-wrap:fullscreen .vo-top { top: 18px; right: 18px; }
.video-wrap:fullscreen:not(.active) { cursor: none; }

@media (max-width: 1000px) {
  .lesson { grid-template-columns: 1fr; }
  .content-col { max-width: 41rem; margin: 0 auto; width: 100%; }
}
@media (max-width: 600px) {
  :root { --read-size: 1.0625rem; }
  .section { padding: 18px 16px; }
  .vo-skip { width: 50px; height: 50px; }
}

/* =========================================================
   Printvenlig version  (#/print/NN  og  #/print/alle)
   ========================================================= */
.p-toolbar {
  position: sticky; top: 58px; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.p-opts-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.p-opts-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.p-select { padding: 7px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }

/* Papiret er altid lyst – også i mørkt tema */
.paper {
  --ink: #161616; --ink-2: #444; --ink-3: #6b6b6b; --rule: #d6d4cc; --tint: #f3f2ee; --accent-p: #1c5cab;
  color-scheme: light;
  background: #fff; color: var(--ink);
  width: 210mm; max-width: 100%; margin: 0 auto; padding: 18mm 18mm 22mm;
  box-shadow: 0 2px 18px rgba(0,0,0,.18);
  font-family: var(--serif); font-size: 11pt; line-height: 1.55;
  font-optical-sizing: auto; hyphens: auto; -webkit-hyphens: auto;
}
.paper h1, .paper h2, .paper h3, .paper h4 { font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink); hyphens: manual; }
.paper a { color: var(--ink); }

.p-cover { min-height: 230mm; display: flex; flex-direction: column; justify-content: center; }
.p-cover h1 { font-size: 30pt; line-height: 1.1; margin: 4mm 0 6mm; }
.p-cover > p { font-size: 13pt; color: var(--ink-2); margin: 0 0 18mm; max-width: 130mm; }
.p-cover h3 { font-size: 11pt; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); border-bottom: 1px solid var(--rule); padding-bottom: 2mm; }
.p-toc { padding-left: 7mm; margin: 0; }
.p-toc li { margin: 0 0 4mm; }
.p-toc li b { font-family: "Segoe UI", system-ui, sans-serif; font-size: 12pt; }
.p-toc li span { color: var(--ink-3); font-size: 9.5pt; }

.p-chapter + .p-chapter, .p-cover + .p-chapter { margin-top: 20mm; padding-top: 14mm; border-top: 2px solid var(--ink); }
.p-eyebrow { font-family: "Segoe UI", system-ui, sans-serif; font-weight: 700; font-size: 9pt; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-p); }
.p-head h1 { font-size: 22pt; line-height: 1.15; margin: 1mm 0 2mm; }
.p-sub { font-size: 9pt; color: var(--ink-3); font-family: "Segoe UI", system-ui, sans-serif; margin-bottom: 6mm; }
.p-summary { font-size: 12pt; line-height: 1.55; color: var(--ink-2); margin: 0 0 5mm; }
.p-box { border: 1px solid var(--rule); border-radius: 3mm; padding: 3mm 5mm; margin: 0 0 6mm; background: var(--tint); }
.p-box h3 { font-size: 10pt; margin: 0 0 1mm; text-transform: uppercase; letter-spacing: .06em; }
.p-box ul { margin: 0; padding-left: 5mm; }

.p-section { margin: 0 0 7mm; }
.p-section h2 { font-size: 14pt; margin: 8mm 0 3mm; display: flex; gap: 3mm; align-items: baseline; flex-wrap: wrap; }
.p-section h2 span { color: var(--accent-p); font-variant-numeric: tabular-nums; }
.p-section h2 small { font-size: 8.5pt; font-weight: 400; color: var(--ink-3); margin-left: auto; }
.p-body p { margin: 0 0 2.6mm; text-align: justify; }
.p-body ul, .p-body ol { margin: 0 0 2.6mm; padding-left: 6mm; }
.p-frames { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; margin: 0 0 4mm; }
.p-frames.n1 { grid-template-columns: 1fr; width: 78%; margin-left: auto; margin-right: auto; }
.p-frames figure { margin: 0; }
.p-frames img { width: 100%; display: block; border: .3mm solid var(--rule); border-radius: 1.5mm; }
.p-frames figcaption { font-size: 8pt; color: var(--ink-3); font-family: "Segoe UI", system-ui, sans-serif; margin-top: 1mm; }
.paper.invert .p-frames img { filter: invert(1) hue-rotate(180deg) contrast(1.15) saturate(1.3); }
.p-key { border-left: 1mm solid var(--accent-p); background: var(--tint); padding: 2.5mm 4mm; margin: 3mm 0; font-size: 10.5pt; }
.p-key b { font-family: "Segoe UI", system-ui, sans-serif; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-p); }
.p-key ul { margin: 1mm 0 0; padding-left: 5mm; }
.p-quote { margin: 3mm 0 0; padding: 0 0 0 4mm; border-left: .6mm solid var(--rule); font-style: italic; color: var(--ink-2); font-size: 10pt; }
.p-quote span { font-style: normal; color: var(--ink-3); font-size: 8.5pt; }

.p-gloss table { width: 100%; border-collapse: collapse; font-size: 9.5pt; line-height: 1.4; }
.p-gloss th { text-align: left; font-family: "Segoe UI", system-ui, sans-serif; font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-bottom: .4mm solid var(--ink); padding: 1.5mm 2mm; }
.p-gloss td { padding: 1.5mm 2mm; border-bottom: .2mm solid var(--rule); vertical-align: top; }
.p-gloss td:first-child { font-weight: 600; width: 28%; }
.p-gloss td:nth-child(2) { width: 26%; }

.p-quiz > ol { padding-left: 6mm; }
.p-quiz > ol > li { margin: 0 0 4mm; }
.p-q { font-weight: 600; margin-bottom: 1mm; }
.p-opts { list-style: upper-alpha; padding-left: 7mm; margin: 0; }
.p-opts li { margin: .5mm 0; }
.p-opts li::marker { font-weight: 700; }
.p-exercise { margin: 0 0 5mm; }
.p-exercise h3, .p-exercise h4 { font-size: 11pt; margin: 4mm 0 1.5mm; }
.p-hint { font-size: 10pt; color: var(--ink-2); margin-top: 1.5mm; }
.p-mynotes { font-size: 10.5pt; margin-bottom: 4mm; }
.p-lines { height: 80mm; background: repeating-linear-gradient(to bottom, transparent 0, transparent 7.6mm, var(--rule) 7.6mm, var(--rule) 8mm); }
.p-facit { font-size: 10pt; line-height: 1.45; }
.p-facit h2 { border-bottom: .4mm solid var(--ink); padding-bottom: 1.5mm; }
.p-facit h3 { font-size: 10pt; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 4mm 0 2mm; }
.p-facit > ol { padding-left: 6mm; }
.p-facit > ol > li { margin: 0 0 2.5mm; }
.p-explain { color: var(--ink-2); }
.paper .katex { font-size: 1.05em; }

@media (max-width: 800px) {
  .paper { padding: 16px; font-size: 16px; }
  .p-cover { min-height: 0; }
}

/* ---- Selve printet ---- */
@page { size: A4; margin: 16mm 16mm 18mm; }
@media print {
  html, body { background: #fff !important; }
  body.print-mode .top, body.print-mode .p-toolbar { display: none !important; }
  body.print-mode main { padding: 0; max-width: none; }
  body.print-mode .paper { width: auto; padding: 0; margin: 0; box-shadow: none; font-size: 10.5pt; }
  .p-cover { min-height: 250mm; break-after: page; }
  .p-chapter { break-before: page; }
  .p-chapter + .p-chapter, .p-cover + .p-chapter { margin-top: 0; padding-top: 0; border-top: 0; }
  .p-section h2, .p-exercise h3, .p-exercise h4, .p-box h3 { break-after: avoid; }
  .p-frames figure, .p-key, .p-quote, .p-quiz > ol > li, .p-box, .p-gloss tr, .katex-display { break-inside: avoid; }
  .p-frames { break-inside: avoid; break-after: avoid; }
  .p-notes, .p-facit { break-before: page; }
  .p-body p { orphans: 3; widows: 3; }
  .paper img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-box, .p-key { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =========================================================
   Læsetilstand: centreret artikel i avisstil
   ========================================================= */
.video-slot { flex-shrink: 0; aspect-ratio: 16 / 9; }
.vo-close { display: none; }

.lesson.reading { display: block; max-width: 40rem; margin: 0 auto; --read-size: 1.1875rem; /* 19 px ≈ 65 tegn pr. linje */ }
.lesson.reading .player-col { position: static; max-height: none; margin: 28px -4rem 36px; }
.lesson.reading .player-col > .card { display: none !important; }   /* transskriptionen */
.lesson.reading .player-bar { justify-content: center; margin-top: 8px; }

.reading .lesson-head { text-align: center; padding-top: 12px; }
.reading .lesson-head .eyebrow { font-size: .78rem; letter-spacing: .18em; }
.reading .lesson-head h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  line-height: 1.08; letter-spacing: -.015em; margin: 10px 0 10px; text-wrap: balance;
}
.reading .lesson-head .en-title { font-family: var(--serif); font-style: italic; font-size: 1rem; }
.reading .lesson-head .btn-row { justify-content: center; }
.reading .summary {
  font-size: 1.35rem; line-height: 1.55; color: var(--text); font-weight: 400;
  margin: 0 0 8px; padding: 0 0 26px; border-bottom: 1px solid var(--border); text-wrap: pretty;
}
.reading .goals { background: transparent; border: 0; box-shadow: none; border-left: 3px solid var(--accent); border-radius: 0; padding: 4px 0 4px 20px; margin: 28px 0; }
.reading .goals h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.reading .toc { justify-content: center; margin: 28px 0 8px; }

.reading .section {
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
  padding: 40px 0 0; margin: 40px 0 0; border-top: 1px solid var(--border);
}
.reading .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
.reading .section-head h2 { font-family: var(--serif); font-weight: 700; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.reading .play-btn { order: -1; font-size: .78rem; padding: 2px 10px; }
.reading .section .body p { text-align: left; text-wrap: pretty; }
.reading #sec0 .body > p:first-of-type::first-letter {
  float: left; font-family: var(--serif); font-weight: 700; font-size: 4.1em; line-height: .82;
  padding: .06em .09em 0 0; color: var(--accent);
}
/* billeder i fuld spaltebredde, gerne lidt bredere end teksten */
.reading .frames { grid-template-columns: 1fr; gap: 18px; margin: 22px -2rem 26px; }
.reading .frames figure { cursor: zoom-in; }
.reading .frames img { border-radius: 4px; border: 0; }
.reading .frames figcaption {
  position: static; background: none; color: var(--text-muted); padding: 6px 2rem 0;
  font-size: .8rem; font-family: "Segoe UI", system-ui, sans-serif;
}
.reading .frames figcaption::before { content: "Fra videoen, "; }
.reading .keypoints { background: transparent; border-left: 3px solid var(--series-2); border-radius: 0; padding: 4px 0 4px 34px; margin: 22px 0; }
.reading .quote { border-left: 0; text-align: center; font-size: 1.2rem; padding: 10px 1rem 0; margin: 26px 0 0; color: var(--text-2); }
.reading .quote::before { content: "”"; display: block; font-family: var(--serif); font-size: 3rem; line-height: .6; color: var(--series-2); }
.reading #gloss, .reading #quiz, .reading #ex { border-top: 0; margin-top: 48px; padding: 26px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Mini-afspiller i hjørnet */
.video-wrap.docked {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: min(400px, 46vw); border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  animation: dockIn .2s ease-out;
}
.video-wrap.docked .vo-close { display: inline-block; }
.video-wrap.docked .vo-skip { width: 44px; height: 44px; font-size: .65rem; }
.video-wrap.docked .vo-skip span { font-size: 1.1rem; }
.video-wrap.docked .caption { bottom: 40px; }
.video-wrap.docked .caption span { font-size: 12px; }
@keyframes dockIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 1000px) {
  .lesson.reading .player-col { margin: 20px 0 28px; }
  .reading .frames { margin-left: 0; margin-right: 0; }
  .reading .frames figcaption { padding-left: 0; }
}
@media (max-width: 600px) {
  .lesson.reading { --read-size: 1.0625rem; }
  .reading .summary { font-size: 1.15rem; }
  .reading #gloss, .reading #quiz, .reading #ex { padding: 18px 16px; }
  .video-wrap.docked { width: 60vw; right: 10px; bottom: 10px; }
}

/* =========================================================
   Zetland-inspireret artikel (læsetilstand)
   ========================================================= */
:root {
  --sans-head: "Figtree", "Segoe UI", system-ui, sans-serif;
  --z-bg: #fdf8ee; --z-ink: #1c1a17; --z-ink-2: #4a463f; --z-rule: #e6dfd0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --z-bg: #1b1915; --z-ink: #eee8dc; --z-ink-2: #bdb5a6; --z-rule: #36322b; }
}
:root[data-theme="dark"] { --z-bg: #1b1915; --z-ink: #eee8dc; --z-ink-2: #bdb5a6; --z-rule: #36322b; }

.z-hero, .z-meta, .z-intro, .lead-in + * { }
.z-hero, .z-meta, .z-intro, .quote .who { display: none; }
body.z-page { background: var(--z-bg); }
body.z-page .top { background: color-mix(in srgb, var(--z-bg) 92%, transparent); }

.reading { --lc: #E8501A; color: var(--z-ink); max-width: 36rem !important; --read-size: 1.1875rem; --read-lh: 1.68; }
.reading .lesson-head, .reading .summary { display: none; }

/* Topbillede: farveflade + billede */
.reading .z-hero {
  display: grid; grid-template-columns: 1fr 1fr;
  width: min(1400px, calc(100vw - 40px)); margin-left: calc(50% - min(700px, 50vw - 20px));
  min-height: min(72vh, 640px); margin-top: -4px; margin-bottom: 0;
}
.z-hero-text { background: var(--lc); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 96px); }
.z-kicker { font-family: var(--sans-head); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-bottom: 18px; }
.z-hero h1 { font-family: var(--sans-head); font-weight: 500; font-size: clamp(1.6rem, 2.5vw, 2.35rem); line-height: 1.18; letter-spacing: -.01em; margin: 0; text-wrap: pretty; color: #fff; }
.z-hero h1 b { font-weight: 800; }
.z-hero-img { margin: 0; position: relative; background: #000; overflow: hidden; }
.z-hero-img { display: flex; align-items: center; }
.z-hero-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.z-hero-img figcaption { position: absolute; right: 12px; bottom: 8px; color: rgba(255,255,255,.75); font: 500 .68rem var(--sans-head); }

/* Infoblok under toppen */
.reading .z-meta { display: block; margin: 40px 0 28px; font-family: var(--sans-head); color: var(--z-ink); }
.z-by { font-size: .95rem; padding-bottom: 18px; border-bottom: 1px solid var(--z-rule); }
.z-series { display: flex; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--z-rule); font-size: .85rem; line-height: 1.5; color: var(--z-ink-2); }
.z-series b { color: var(--z-ink); font-size: .92rem; }
.z-series a { color: var(--lc); }
.z-sq { flex: 0 0 18px; height: 18px; background: var(--lc); border-radius: 2px; margin-top: 2px; }
.z-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--z-rule); }
.z-facts { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--z-ink-2); }
.z-facts span:first-child { font-weight: 700; color: var(--z-ink); }
.z-play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--lc); color: #fff; font-size: .95rem; cursor: pointer; padding-left: 3px; flex-shrink: 0; }
.z-play:hover { filter: brightness(1.1); }
.z-tools { display: flex; gap: 18px; padding-top: 12px; }
.z-link { background: none; border: 0; padding: 0; font: 600 .82rem var(--sans-head); color: var(--z-ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.z-link:hover { color: var(--lc); }

.lesson.reading .player-col { margin: 0 -3rem 32px; }
.reading .z-intro { display: block; font-family: var(--serif); font-size: var(--read-size); line-height: var(--read-lh); margin: 0 0 6px; }

/* Brødtekst */
.reading .section .body, .reading .keypoints, .reading .goals li { color: var(--z-ink); }
.reading .goals { border-left-color: var(--lc); }
.reading .goals h3 { color: var(--lc); font-family: var(--sans-head); }
.reading .toc { justify-content: flex-start; }
.reading .toc .chip { background: transparent; font-family: var(--sans-head); font-size: .8rem; border-color: var(--z-rule); }

.reading .section { border-top: 1px solid var(--z-rule); padding-top: 36px; margin-top: 36px; }
.reading .section-head h2 { font-family: var(--sans-head); font-weight: 800; font-size: 1.5rem; line-height: 1.22; letter-spacing: -.01em; color: var(--z-ink); }
.reading .play-btn {
  border: 0; padding: 0; background: none; color: var(--lc); font: 700 .78rem var(--sans-head);
  letter-spacing: .04em; display: inline-flex; align-items: center; gap: 8px;
}
.reading .pb-i {
  width: 24px; height: 24px; border-radius: 50%; background: var(--lc); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .6rem; padding-left: 2px;
}
.reading .pb-t::before { content: "Se afsnittet i videoen · "; }
.reading .play-btn:hover { background: none; text-decoration: underline; }

/* Initial + kapitæler */
.reading #sec0 .body > p:first-of-type::first-letter {
  float: left; font-family: var(--sans-head); font-weight: 800; color: var(--z-ink);
  font-size: 5.3em; line-height: .76; padding: .07em .1em 0 0; margin-left: -.03em;
}
.reading .lead-in { font-variant: small-caps; text-transform: lowercase; font-weight: 700; letter-spacing: .04em; font-size: 1.08em; }

.reading .frames { margin: 26px -3rem 28px; }
.reading .frames figcaption { padding: 7px 3rem 0; font-family: var(--sans-head); color: var(--z-ink-2); }
.reading .keypoints { border-left-color: var(--lc); font-size: 1.05rem; }
.reading .quote { text-align: left; font-style: normal; font-family: var(--serif); font-size: var(--read-size); line-height: var(--read-lh); color: var(--z-ink); padding: 0; margin: 22px 0 0; }
.reading .quote::before { content: none; }
.reading .quote .who { display: inline; font-weight: 700; }
.reading .quote small { display: none; }
.reading .section.last .body > p:last-of-type::after {
  content: ""; display: inline-block; width: .62em; height: .62em; background: var(--lc); border-radius: 1px; margin-left: .45em; vertical-align: baseline;
}
.reading #gloss, .reading #quiz, .reading #ex { background: color-mix(in srgb, var(--z-bg) 60%, var(--surface)); border-color: var(--z-rule); }
.reading #gloss h2, .reading #quiz h2, .reading #ex h2 { font-family: var(--sans-head); font-weight: 800; }
.reading .card { border-color: var(--z-rule); }

@media (max-width: 1000px) {
  .reading .z-hero { grid-template-columns: 1fr; width: calc(100vw - 32px); margin-left: calc(50% - 50vw + 16px); min-height: 0; }
  .z-hero-img { aspect-ratio: 16 / 9; }
  .lesson.reading .player-col, .reading .frames { margin-left: 0; margin-right: 0; }
  .reading .frames figcaption { padding-left: 0; }
}


/* ---- Artikler uden video ---- */
.lesson.article .player-col, .lesson.article .read-toggle { display: none !important; }
.art-thumb { aspect-ratio: 16 / 9; background: var(--lc); color: #fff; display: flex; align-items: center; justify-content: center; }
.art-thumb { padding: 0 20px; text-align: center; }
.art-thumb span { font: 800 clamp(1.05rem, 1.7vw, 1.5rem) var(--sans-head, "Segoe UI"), system-ui, sans-serif; letter-spacing: -.01em; }
.z-hero-formula { display: flex !important; align-items: center; justify-content: center; color: #f4efe4; padding: 32px; font-size: clamp(1.3rem, 2.4vw, 2.2rem); background: #141414; }
.z-hero-formula .katex-display { margin: 0; }
.z-hero-formula .katex { color: #f4efe4; }

/* tabeller i artikeltekst */
.section .body table { width: 100%; border-collapse: collapse; margin: 18px 0 22px; font-size: .95em; line-height: 1.45; }
.section .body th { text-align: left; font: 700 .72rem var(--sans-head, "Segoe UI"), system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); border-bottom: 2px solid currentColor; padding: 6px 10px 6px 0; }
.section .body td { border-bottom: 1px solid var(--z-rule, var(--border)); padding: 8px 10px 8px 0; vertical-align: top; }
.section .body td:first-child { font-weight: 700; white-space: nowrap; }
.section .body pre { background: #161616; color: #ece6da; border-radius: 6px; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.55 Consolas, "Cascadia Mono", monospace; margin: 16px 0 20px; }
.section .body pre .c { color: #8fbf7f; }
.section .body code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.section .body pre code { background: none; padding: 0; font-size: inherit; }
.section .body .say { border-left: 3px solid var(--lc, var(--accent)); padding: 2px 0 2px 16px; margin: 12px 0; }
.section .body .say code { display: inline-block; margin-bottom: 4px; }
.paper .p-body table { width: 100%; border-collapse: collapse; font-size: 9.5pt; margin: 2mm 0 4mm; }
.paper .p-body th, .paper .p-body td { text-align: left; border-bottom: .2mm solid var(--rule); padding: 1.2mm 2mm 1.2mm 0; vertical-align: top; }
.paper .p-body pre { background: #f3f2ee; border: .2mm solid var(--rule); padding: 3mm; font: 8.5pt/1.45 Consolas, monospace; white-space: pre-wrap; break-inside: avoid; }
.paper .p-body pre .c { color: #4d7a3f; }
.paper .p-body .say { border-left: .8mm solid var(--rule); padding-left: 3mm; margin: 2mm 0; break-inside: avoid; }
