/* ============================================================
   EMS Leeromgeving — radarscoop-thema
   Donker antraciet-groen, fosforgroen + amber accenten
   ============================================================ */

:root {
  --bg:          #0b1410;
  --bg-panel:    #101b16;
  --bg-raised:   #15231d;
  --bg-hover:    #1a2c24;
  --border:      #233a30;
  --border-soft: #1a2c24;
  --text:        #d8e6de;
  --text-dim:    #8fa89b;
  --text-faint:  #5f7a6c;
  --accent:      #3ddc84;
  --accent-dim:  #2aa763;
  --accent-bg:   rgba(61, 220, 132, 0.08);
  --amber:       #ffb454;
  --amber-bg:    rgba(255, 180, 84, 0.08);
  --danger:      #ff6b6b;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 56px;
  --sidebar-w: 320px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(61, 220, 132, 0.05), transparent),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.004) 3px 4px);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- Topbar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 20, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent);
  flex-shrink: 0;
}

.brand-logo { width: 28px; height: 28px; }

.brand-logo .sweep {
  transform-origin: 16px 16px;
  animation: sweep 6s linear infinite;
}

@keyframes sweep { to { transform: rotate(360deg); } }

.brand-text {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-sep { color: var(--accent); }

.search-wrap { position: relative; margin-left: auto; width: min(420px, 45vw); }

/* ---------- Taalkiezer ---------- */

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.lang-globe { width: 18px; height: 18px; }

#lang-select {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 7px 28px 7px 10px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238fa89b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px;
  max-width: 180px;
}

#lang-select:hover { border-color: var(--accent-dim); }
#lang-select:focus { border-color: var(--accent-dim); }
#lang-select option { background: var(--bg-raised); color: var(--text); }

body.lang-loading #lang-select {
  opacity: 0.55;
  pointer-events: none;
}

/* Korte melding (toast) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  max-width: min(440px, 90vw);
  background: var(--bg-raised);
  border: 1px solid var(--amber);
  color: var(--text);
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

#search {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 8px 14px;
  outline: none;
  transition: border-color 0.15s;
}

#search:focus { border-color: var(--accent-dim); }
#search::placeholder { color: var(--text-faint); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  padding: 6px;
}

.search-results a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
}

.search-results a:hover { background: var(--bg-hover); }

.search-results .sr-snippet {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results .sr-empty { padding: 12px; color: var(--text-dim); font-size: 14px; }

/* ---------- Layout ---------- */

.layout { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 10px 0;
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.topbar-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-link:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent-dim); }
@media (max-width: 820px) { .topbar-link { display: none; } }

.sidebar-credit {
  padding: 8px 10px 2px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--text-faint);
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.sidebar-overlay { display: none; }

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 36px clamp(20px, 5vw, 64px) 100px;
  max-width: calc(var(--sidebar-w) + 980px);
}

/* ---------- Nav tree ---------- */

.nav-ch { margin-bottom: 4px; }

.nav-ch-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-ch-head:hover { background: var(--bg-hover); }

.nav-ch-head .ch-caret {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 10px;
  transition: transform 0.15s;
}

.nav-ch.open .ch-caret { transform: rotate(90deg); }

.nav-sections { display: none; padding: 2px 0 6px; }
.nav-ch.open .nav-sections { display: block; }

.nav-sec {
  display: block;
  padding: 6px 10px 6px 24px;
  font-size: 13.5px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 7px;
  border-left: 2px solid transparent;
}

.nav-sec:hover { background: var(--bg-hover); color: var(--text); }

.nav-sec.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-left-color: var(--accent);
}

/* ---------- Home ---------- */

.home-hero { margin: 10px 0 40px; }

.home-kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.home-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 700;
}

.home-hero p { max-width: 720px; color: var(--text-dim); font-size: 17px; }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.chapter-item { display: flex; flex-direction: column; }
.chapter-item .chapter-card { flex: 1; }

.card-audio:empty { display: none; }
.card-audio { margin-top: 8px; }
.card-audio .media-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 2px 0 5px;
}
.card-audio audio { width: 100%; height: 34px; }

.chapter-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.chapter-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-raised);
  transform: translateY(-2px);
}

.chapter-card h3 { margin: 8px 0 8px; font-size: 17px; line-height: 1.3; }

.chapter-card p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

.chapter-card .cc-count {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- Lespagina ---------- */

.crumbs {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 8px; color: var(--text-faint); }

.page-head { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 28px; }

.page-head h1 { margin: 6px 0 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }

article.lesson h2 {
  font-size: 21px;
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

article.lesson h2:first-child { border-top: none; margin-top: 8px; padding-top: 0; }

article.lesson h3 { font-size: 16.5px; margin: 26px 0 8px; color: var(--text); }

article.lesson p { margin: 0 0 14px; max-width: 76ch; }

article.lesson ul, article.lesson ol { margin: 0 0 16px; padding-left: 26px; max-width: 72ch; }
article.lesson li { margin-bottom: 6px; }

article.lesson strong { color: #eaf5ee; }
article.lesson em { color: var(--text); }

article.lesson a { color: var(--accent); }

/* Kruisverwijzing naar een ander topic */
a.xref {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-dim);
}

a.xref:hover { border-bottom-style: solid; }

/* Begrippen / vaktermen */
.term {
  color: var(--amber);
  font-style: normal;
  font-weight: 500;
}

/* Formuleblok */
.formula {
  font-family: var(--mono);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 15.5px;
  overflow-x: auto;
  max-width: 76ch;
}

.formula .f-where {
  display: block;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-dim);
}

.formula .f-where span { display: block; padding-left: 1em; }

/* Notitie / waarschuwing */
.note, .warn, .example {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  max-width: 76ch;
  font-size: 14.5px;
}

.note { background: var(--accent-bg); border: 1px solid rgba(61,220,132,0.25); }
.warn { background: var(--amber-bg); border: 1px solid rgba(255,180,84,0.3); }
.example { background: var(--bg-panel); border: 1px solid var(--border); }

.note .lbl, .warn .lbl, .example .lbl {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.note .lbl { color: var(--accent); }
.warn .lbl { color: var(--amber); }
.example .lbl { color: var(--text-dim); }

.note p:last-child, .warn p:last-child, .example p:last-child { margin-bottom: 0; }

/* Bronvermelding (discrete voetnoot onder een sectie) */
p.src { font-size: 0.82em; font-style: italic; color: var(--text-dim); margin-top: 0.6rem; }

/* Tabellen */
table.data {
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  width: 100%;
  max-width: 820px;
}

table.data th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding: 8px 14px 8px 0;
}

table.data td {
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 14px 8px 0;
  vertical-align: top;
}

table.data tr:hover td { background: rgba(255,255,255,0.015); }

/* Diagrammen (SVG) */
figure.diagram {
  margin: 24px 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 820px;
}

figure.diagram svg { width: 100%; height: auto; display: block; }

figure.diagram figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.dg-line   { stroke: var(--text-dim); stroke-width: 1.5; fill: none; }
.dg-accent { stroke: var(--accent); stroke-width: 2; fill: none; }
.dg-amber  { stroke: var(--amber); stroke-width: 2; fill: none; }
.dg-fill   { fill: var(--accent-bg); }
.dg-text   { fill: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.dg-text-b { fill: var(--text); font-family: var(--mono); font-size: 12px; }
.dg-dash   { stroke-dasharray: 5 4; }

/* Foto's (echte afbeeldingen) */
figure.photo {
  margin: 24px 0;
  max-width: 820px;
}

figure.photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}

figure.photo.compact { max-width: 520px; }

figure.photo figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1.5;
}

figure.photo figcaption .credit {
  color: var(--text-faint);
  font-style: normal;
}

/* Geïmporteerde illustraties (bijv. Wikimedia) — vaak met witte achtergrond */
figure.illustration { margin: 24px 0; max-width: 760px; }

figure.illustration img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-sizing: border-box;
}

figure.illustration figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1.5;
}

figure.illustration figcaption .credit { color: var(--text-faint); }

/* Interactieve rekenhulp (calculator) */
.calc {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
  max-width: 480px;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.calc-row label { font-size: 14px; color: var(--text-dim); }

.calc-row input {
  width: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 6px 10px;
}

.calc-row input:focus { outline: none; border-color: var(--accent-dim); }

.calc-out {
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-dim);
}

.calc-out strong { color: var(--accent); font-family: var(--mono); font-size: 17px; }

/* ---------- Media-slots ---------- */

.media-slot { margin: 20px 0; max-width: 820px; }

.media-slot video, .media-slot audio { width: 100%; border-radius: 10px; outline: none; }

.media-slot video { background: #000; border: 1px solid var(--border); }

.media-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.media-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.media-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

/* ---------- Prev / next ---------- */

.pager {
  display: flex;
  gap: 14px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pager a {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.pager a:hover { border-color: var(--accent-dim); }

.pager .pg-dir {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.pager .pg-next { text-align: right; }

.pager .pg-title { font-size: 14px; }

/* ---------- Responsief ---------- */

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .brand-text { display: none; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 90;
    width: min(var(--sidebar-w), 85vw);
  }

  body.nav-open .sidebar { transform: translateX(0); }

  body.nav-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 80;
  }

  .content { margin-left: 0; padding: 24px 18px 80px; }

  .search-wrap { width: auto; flex: 1; }
  .lang-globe { display: none; }
  #lang-select { max-width: 130px; font-size: 12.5px; padding: 6px 24px 6px 8px; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Print / PDF-knop (zwevend, rechtsboven in het contentgebied) ---------- */
.print-fab {
  position: fixed; top: 74px; right: 30px; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 9px; padding: 9px 15px; cursor: pointer;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}
.print-fab:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
@media (max-width: 820px) {
  .print-fab { top: auto; bottom: 18px; right: 16px; padding: 11px 14px; }
  .print-fab-lbl { display: none; }
}

/* ---------- Glossary flashcards ---------- */
.fc-bar { margin: 14px 0; }
.fc-btn {
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: var(--mono);
  font-size: 13px; letter-spacing: 0.04em;
}
.fc-btn:hover { background: var(--bg-hover); }
.fc-wrap { margin: 16px 0; max-width: 560px; }
.fc-card {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: var(--bg-raised); border-radius: 10px; padding: 26px 22px; min-height: 120px;
  cursor: pointer; text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.fc-card .fc-q { font-size: 24px; font-weight: 600; color: var(--text); font-family: var(--mono); }
.fc-card .fc-a { font-size: 16px; color: var(--text-dim); line-height: 1.5; }
.fc-card .fc-hint { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); letter-spacing: 0.05em; }
.fc-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.fc-controls button {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 7px; padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.fc-controls button:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent-dim); }
.fc-progress { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

/* ---------- Topbar: call-to-action variant (Lesomgeving) ---------- */
.topbar-link.primary { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-bg); }

/* ---------- Nav: modulegroepering (Deel A) ---------- */
.nav-mod { margin-bottom: 4px; }
.nav-mod-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; color: var(--accent);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  text-align: left; padding: 11px 10px 6px; cursor: pointer;
}
.nav-mod-head .mod-caret { margin-left: auto; color: var(--text-faint); font-size: 10px; transition: transform 0.15s; }
.nav-mod.open > .nav-mod-head .mod-caret { transform: rotate(90deg); }
.nav-mod-chs { display: none; padding-bottom: 4px; }
.nav-mod.open .nav-mod-chs { display: block; }

/* ---------- Home: modulegroepering (Deel A) ---------- */
.home-mod { margin-top: 38px; }
.home-mod:first-child { margin-top: 18px; }
.home-mod-head {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px;
}
.home-mod-tag { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.home-mod-head h2 { font-size: 19px; margin: 0; font-weight: 600; }
.home-mod-count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }

/* ============================================================
   Lesomgeving (#/les) — Deel B
   ============================================================ */
.les-badge {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-dim);
  border-radius: 20px; padding: 4px 14px; margin-bottom: 18px;
}
.les-lead { color: var(--text-dim); font-size: 16.5px; max-width: 720px; margin: 0 0 26px; }

.les-share {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 22px; font-size: 13.5px; color: var(--text-dim);
}
.les-share-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.les-share-actions button { font-family: var(--mono); font-size: 12px; border-radius: 7px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }

.les-btn {
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 8px; padding: 9px 16px; cursor: pointer; font-family: var(--mono); font-size: 13px;
  text-decoration: none; display: inline-block;
}
.les-btn:hover { background: var(--bg-hover); }
.les-btn.ghost { background: none; border-color: var(--border); color: var(--text-dim); }
.les-btn.ghost:hover { color: var(--accent); border-color: var(--accent-dim); }

.les-tiny { background: none; border: none; color: var(--text-faint); font-family: var(--mono); font-size: 11.5px; text-decoration: underline; cursor: pointer; padding: 0; }
.les-tiny:hover { color: var(--accent); }
.les-tiny-label { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; }

.les-topline { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.les-chip {
  display: inline-flex; align-items: center; gap: 9px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 6px 5px 12px; font-size: 13px;
}
.les-chip.les-chip-anon { opacity: 0.7; padding: 5px 14px; }
.les-chip .les-av {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); border: 1px solid var(--accent-dim);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.les-chip button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 12px; padding: 2px 6px; }
.les-chip button:hover { color: var(--accent); }
.les-overall { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 14px; }

.les-profiles { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.les-slot {
  display: flex; align-items: center; gap: 12px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; cursor: pointer; min-width: 190px; transition: 0.15s;
}
.les-slot:hover { border-color: var(--accent-dim); background: var(--bg-raised); }
.les-slot .les-av {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); border: 1px solid var(--accent-dim);
  color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 600; font-size: 14px;
}
.les-slot-name { font-weight: 600; }
.les-slot-sub { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.les-slot.add { border-style: dashed; color: var(--text-dim); }
.les-slot.add .les-av { background: none; border-style: dashed; color: var(--text-dim); }

.les-resume {
  margin: 22px 0 30px; background: var(--accent-bg); border: 1px solid var(--accent-dim);
  border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.les-resume-text { flex: 1; min-width: 200px; }
.les-resume-text b { color: var(--accent); }

.les-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.les-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  transition: 0.15s; text-align: left; color: var(--text); display: block; text-decoration: none;
}
.les-card:hover { border-color: var(--accent-dim); background: var(--bg-raised); transform: translateY(-2px); }
.les-card .les-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--accent); }
.les-card h3 { margin: 6px 0 6px; font-size: 16.5px; }
.les-card p { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); }
.les-bar { height: 7px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.les-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.les-foot { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.les-back { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); cursor: pointer; background: none; border: none; padding: 0; margin-bottom: 18px; }
.les-back:hover { color: var(--accent); }

.les-h { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 26px 0 12px; }

.les-item { display: flex; align-items: flex-start; gap: 14px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.les-check {
  width: 22px; height: 22px; flex: none; border: 1px solid var(--accent-dim); border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 14px; margin-top: 2px;
}
.les-item.done .les-check { background: var(--accent); color: #08130c; }
.les-item-body { flex: 1; }
.les-item-body a { color: var(--text); text-decoration: none; font-weight: 600; }
.les-item-body a:hover { color: var(--accent); }
.les-item-why { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.les-item-ref { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-left: 8px; }
.les-ext { color: var(--amber) !important; }

/* Niveau-bolletje per leesitem (Deel C) */
.les-lvl { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 8px; vertical-align: middle; cursor: help; }
.les-lvl-b { background: var(--accent); }
.les-lvl-i { background: var(--amber); }
.les-lvl-a { background: var(--danger); }

/* Hoofdstuk-groepering binnen een module (Deel C) */
.les-chgroup { margin: 22px 0 6px; }
.les-chgroup-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.les-chgroup-head h3 { font-size: 15px; margin: 0; color: var(--text-dim); font-weight: 600; }
.les-chgroup-count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-faint); flex: none; }

/* Niveau-schakelaar (segmented control), gedeeld tussen les-home en module-detail */
.les-levelbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 26px; flex-wrap: wrap; }
.les-level-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.les-level-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.les-level-btn {
  background: var(--bg-panel); border: none; border-right: 1px solid var(--border); color: var(--text-dim);
  padding: 7px 14px; cursor: pointer; font-size: 13px; font-family: var(--sans);
}
.les-level-btn:last-child { border-right: none; }
.les-level-btn:hover { background: var(--bg-hover); color: var(--text); }
.les-level-btn.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* Kennischeck-kop: mastery-teller + "Nieuwe vragen" */
.les-quiz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.les-quiz-mastery { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.les-quiz-head .les-btn { margin-left: auto; }

.les-quiz { background: var(--bg-panel); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 20px 22px; margin-top: 8px; margin-bottom: 14px; }
.les-q { font-weight: 600; margin: 0 0 12px; }
.les-opt {
  display: block; width: 100%; text-align: left; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 14px; margin-bottom: 8px; color: var(--text); cursor: pointer; font-family: inherit; font-size: 14px;
}
.les-opt:hover { border-color: var(--accent-dim); }
.les-opt.good { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.les-opt.bad { border-color: var(--danger); background: rgba(255, 107, 107, 0.08); color: var(--danger); }
.les-qfb { font-size: 13px; margin-top: 6px; color: var(--text-dim); min-height: 1em; }

.les-modal-back { position: fixed; inset: 0; background: rgba(4, 8, 6, 0.75); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.les-modal { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 28px; max-width: 480px; width: 100%; }
.les-modal h3 { margin: 0 0 10px; font-size: 17px; }
.les-modal p { margin: 0 0 14px; color: var(--text-dim); font-size: 13.5px; }
.les-modal textarea {
  width: 100%; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; color: var(--accent);
  font-family: var(--mono); font-size: 12.5px; padding: 10px; resize: none; height: 60px;
}
.les-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.les-msg { font-size: 12.5px; color: var(--amber); margin-top: 8px; min-height: 1em; }

/* ---------- Print-weergave (Ctrl+P / Opslaan als PDF) ---------- */
@media print {
  .topbar, .sidebar, .sidebar-overlay, #search-results, .nav-toggle,
  .print-fab, .fc-bar, .fc-wrap, .card-audio, audio, video,
  .les-share, .les-topline, .les-modal-back { display: none !important; }
  html, body, .layout, .content { background: #fff !important; color: #111 !important; }
  .layout { display: block !important; }
  .content { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
  a { color: #111 !important; text-decoration: underline; }
  h1, h2, h3, .term, strong { color: #111 !important; }
  .note, .warn, .example { border: 1px solid #999 !important; background: #f5f5f5 !important; color: #111 !important; }
  .note .lbl, .warn .lbl, .example .lbl { color: #111 !important; }
  table.data th { color: #111 !important; border-bottom-color: #999 !important; }
  table.data td { border-bottom-color: #ccc !important; }
  figure.diagram, figure.illustration, table.data, .note, .warn, .example { break-inside: avoid; }
  figure.diagram svg { max-width: 100% !important; }
}
