/* SachkundeTOGO Lehrbuch – Reader „Modern App" (responsive, mobil-first) */

.reader-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* -------- obere Leiste -------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bar);
  color: var(--bar-ink);
  flex: 0 0 auto;
  z-index: 60;
}
.topbar-title {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.icon-btn {
  border: none;
  background: var(--bg);
  color: var(--bar-ink);
  border-radius: 12px;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .08s;
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn:active { transform: scale(.95); }

/* -------- Lesefortschritt -------- */
.reading-progress {
  height: 4px;
  background: var(--line);
  flex: 0 0 auto;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transition: width .25s ease;
}

/* -------- Lesefläche -------- */
.page-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 120px;          /* unten Platz für floating Nav */
}
.page-content {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 30px;
  font-size: calc(16px + (var(--font-step) - 1) * 2px);
  line-height: 1.7;
}

/* -------- Inhaltsblöcke -------- */
.blk-heading { font-family: var(--font-head); color: var(--text); line-height: 1.22; }
.blk-heading.lvl1 {
  font-weight: 800;
  font-size: 1.6em;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
}
.blk-heading.lvl1::after {
  content: "";
  display: block;
  width: 46px; height: 5px;
  margin-top: .45em;
  border-radius: 99px;
  background: var(--accent);
}
.blk-heading.lvl2 { font-weight: 700; font-size: 1.25em; margin: 1.35em 0 .4em; color: var(--accent); }
.blk-paragraph { margin: 0 0 .95em; }
.blk-list { margin: 0 0 1.1em; padding-left: 1.35em; }
.blk-list li { margin: .4em 0; }
.blk-list li::marker { color: var(--accent); }
.blk-list li.lvl1 { margin-left: 1.1em; list-style-type: circle; }
.blk-list li.lvl2 { margin-left: 2.2em; list-style-type: square; }

.blk-image { margin: 1.2em 0; text-align: center; }
.blk-image img {
  max-width: 100%; height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(17, 24, 39, .08);
  -webkit-user-drag: none; user-select: none;
}

/* Reine Bildseiten (Canva): Bild füllt die volle Breite, mittig, kein Platz verschwendet.
   Hintergrund = Seitenfarbe (#FAF6EF) -> Canva-Seiten in derselben Farbe verschmelzen nahtlos. */
.page-scroll.image-mode { padding: 0; background: var(--bg-page); }
.page-content.image-only {
  max-width: 100%;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 8px 8px calc(80px + env(safe-area-inset-bottom));   /* unten Platz für floating Navi */
  border: none;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: safe center;
}
.page-content.image-only .blk-image { margin: 0; width: 100%; }
.page-content.image-only .blk-image img {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .14);
}
@media (min-width: 720px) {
  .page-content.image-only { max-width: 560px; }   /* am Desktop nicht unendlich breit */
}

/* ===== Immersive Folien-Anzeige (Bild-Modus) – bildschirmfüllend, beide Ausrichtungen ===== */
body.img-reading .reader-view { background: #0a0a0e; }
body.img-reading .topbar {
  background: rgba(14,14,20,.72);
  -webkit-backdrop-filter: saturate(150%) blur(16px); backdrop-filter: saturate(150%) blur(16px);
  color: #fff; border: none; border-bottom: 1px solid rgba(255,255,255,.07);
}
body.img-reading .topbar .icon-btn { background: rgba(255,255,255,.10); color: #fff; border-radius: 10px; }
body.img-reading .topbar .icon-btn:hover { background: rgba(255,255,255,.18); }
body.img-reading .topbar-title { color: #fff; opacity: .96; }
body.img-reading .reading-progress { background: rgba(255,255,255,.10); }
body.img-reading .quiz-launch {
  background: rgba(255,255,255,.15) !important; color: #fff !important;
  border: 1px solid rgba(255,255,255,.30); border-radius: 999px;
  box-shadow: none; font-weight: 600;
}
body.img-reading .quiz-launch:hover { background: rgba(255,255,255,.24) !important; }

/* Bühne: unscharfer Folien-Hintergrund statt totem Rand */
.page-scroll.image-mode {
  padding: 0; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a0e;
}
.page-scroll.image-mode::before {
  content: ''; position: absolute; inset: -12%;
  background-image: var(--slide-bg, none); background-size: cover; background-position: center;
  filter: blur(48px) brightness(.40) saturate(1.2); transform: scale(1.18);
  z-index: 0; pointer-events: none;
}
.page-content.image-only {
  position: relative; z-index: 1;
  height: 100%; max-width: 100%; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.page-content.image-only .blk-image { margin: 0; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; }
/* Folie so groß wie möglich (contain): Hochformat -> volle Breite, Querformat -> volle Höhe */
.page-content.image-only .blk-image img {
  width: auto; height: auto; max-width: 100vw; max-height: 100%;
  object-fit: contain; border-radius: 0; border: none;
  box-shadow: 0 0 55px rgba(0,0,0,.55);
}
.page-content.image-only .zoom-hint { display: none; }

/* Hochformat: Vor/Zurück + Seitenzahl als dunkle Glas-Pille unten (Seitenränder fehlen ja).
   Seitenzahl bleibt IN der Pille (kein position:fixed -> kein Container-Bug). */
body.img-reading .pagenav {
  background: rgba(14,14,20,.74); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
body.img-reading .page-indicator { color: rgba(255,255,255,.92); }
body.img-reading #prev-btn { background: rgba(255,255,255,.12); color: #fff; }
body.img-reading #next-btn { background: var(--accent); color: #fff; }
body.img-reading #next-btn:hover:not(:disabled) { filter: brightness(1.06); }

/* „Handy quer halten" – nur im Hochformat UND während des Lesens */
.rotate-hint {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--text); text-align: center; padding: 24px;
}
.rotate-hint-inner { max-width: 320px; }
.rotate-ico { font-size: 56px; color: var(--accent); animation: rot 2.2s ease-in-out infinite; }
.rotate-hint strong { color: var(--accent); }
.rotate-sub { margin-top: 10px; color: var(--text-muted); font-size: 14px; }
@keyframes rot { 0%,60%{transform:rotate(0)} 80%{transform:rotate(90deg)} 100%{transform:rotate(90deg)} }
/* Kein Dreh-Zwang mehr: Folien sind in BEIDER Ausrichtung bildschirmfüllend.
   (Quadratische Folien sind im Hochformat am größten, 16:9 im Querformat.) */
.rotate-hint { display: none !important; }

/* ===== Quiz ===== */
.quiz-launch { background: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 700; white-space: nowrap; min-width: auto !important; padding: 0 12px; }
.quiz { position: fixed; inset: 0; z-index: 400; background: var(--bg); color: var(--text); display: flex; flex-direction: column; }
.quiz[hidden] { display: none; }
.quiz-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bar); border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.quiz-progress { font-weight: 700; font-size: 14px; color: var(--text); }
.quiz-body { flex: 1 1 auto; overflow-y: auto; padding: 22px 16px 36px; max-width: 680px; width: 100%; margin: 0 auto; }
.quiz-q { font-family: var(--font-head); font-weight: 800; font-size: 1.25em; line-height: 1.35; margin-bottom: 10px; }
.quiz-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  text-align: left; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg-page); color: var(--text); font-size: 15px; line-height: 1.4; cursor: pointer;
}
.quiz-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt.locked { cursor: default; }
.quiz-opt.correct { border-color: #1f9d55; background: #e7f7ee; color: #11633a; }
.quiz-opt.wrong { border-color: #d23f31; background: #fdecea; color: #9b271b; }
[data-theme="dark"] .quiz-opt.correct { background: #16331f; color: #8fe3b0; border-color: #2f7d52; }
[data-theme="dark"] .quiz-opt.wrong { background: #3a1a16; color: #ffb0a4; border-color: #8a3328; }
.quiz-action { margin-top: 18px; width: 100%; padding: 15px; border: none; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; cursor: pointer; }
.quiz-action.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--text); margin-top: 10px; }
.quiz-feedback { margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 14px; }
.quiz-feedback.ok { background: #e7f7ee; color: #11633a; }
.quiz-feedback.no { background: #fdecea; color: #9b271b; }
.quiz-feedback.partial { background: #fff6e3; color: #8a5a00; }
[data-theme="dark"] .quiz-feedback.ok { background: #16331f; color: #9be8b8; }
[data-theme="dark"] .quiz-feedback.no { background: #3a1a16; color: #ffb3a8; }
[data-theme="dark"] .quiz-feedback.partial { background: #3a2e12; color: #ffd98a; }
.quiz-pts { float: right; font-weight: 700; font-size: 13px; opacity: .85; }
.quiz-feedback strong { font-size: 15px; }
.quiz-ex { margin-top: 8px; line-height: 1.55; white-space: pre-wrap; }
.quiz-result { text-align: center; padding: 30px 0 10px; }
.quiz-score { font-size: 48px; font-weight: 800; color: var(--accent); font-family: var(--font-head); }
.quiz-score-sub { color: var(--text-muted); margin-top: 4px; }
.quiz-loading { color: var(--text-muted); text-align: center; padding: 48px 16px; }

/* ===== "Unterrichtung oder Sachkunde?" – eigene CI (Dark Navy + 34A-Blau) =====
   Bewusst nur auf #unterrichtung gescoped, damit das normale Schriftlich-Quiz
   unverändert bleibt. Navy #092652 = exakter Folien-Hintergrund (oeso-Design). */
#unterrichtung {
  --u-navy: #092652; --u-navy-2: #0d3068; --u-card: #0f2f66; --u-line: #1f3f78;
  --u-blue: #1C44D8; --u-blue-lt: #6486FF; --u-ink: #ffffff; --u-muted: #9db2dd;
  background: var(--u-navy); color: var(--u-ink);
}
#unterrichtung .quiz-head {
  background: linear-gradient(120deg, var(--u-blue), var(--u-navy-2));
  border-bottom: 1px solid var(--u-line);
}
#unterrichtung .quiz-progress { color: #fff; }
#unterrichtung .icon-btn { background: rgba(255,255,255,.16); color: #fff; border-radius: 10px; }
#unterrichtung .quiz-q { color: #fff; }
#unterrichtung .quiz-hint { color: var(--u-muted); }
#unterrichtung .quiz-opt {
  background: var(--u-card); border-color: var(--u-line); color: #fff;
}
#unterrichtung .quiz-opt:not(.locked):hover { border-color: var(--u-blue-lt); }
#unterrichtung .quiz-opt.correct { background: #123b28; border-color: #34d399; color: #9bf0c3; }
#unterrichtung .quiz-opt.wrong { background: #3a1a2a; border-color: #f77; color: #ffb3c2; }
#unterrichtung .quiz-action {
  background: var(--u-blue); color: #fff; box-shadow: 0 8px 22px rgba(28,68,216,.35);
}
#unterrichtung .quiz-action.ghost { background: transparent; border-color: var(--u-line); color: var(--u-muted); }
#unterrichtung .quiz-feedback.ok { background: #123b28; color: #9bf0c3; }
#unterrichtung .quiz-feedback.no { background: #3a1a2a; color: #ffb3c2; }
#unterrichtung .quiz-ex { color: var(--u-muted); }
#unterrichtung .quiz-score { color: var(--u-blue-lt); }
#unterrichtung .quiz-score-sub { color: var(--u-muted); }
#unterrichtung .quiz-result p { color: #dfe7f7; }
#unterrichtung .quiz-loading { color: var(--u-muted); }
#unterrichtung .faelle-img {
  border: 1px solid var(--u-line); background: var(--u-navy-2); position: relative;
}
#unterrichtung .faelle-img::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url("../logos/34a-togo.png") no-repeat center / 34%; opacity: .1;
}
#unterrichtung .faelle-img::after { background: rgba(9,38,82,.55); }
/* Situationsbilder vollständig zeigen statt beschneiden (Comic-Bilder sind quadratisch) */
#unterrichtung .faelle-img img { max-height: none; object-fit: contain; width: 100%; height: auto; }

/* ===== Situationsbild in Karten-Übungen (z. B. Unterrichtung/Sachkunde) ===== */
.faelle-img { position: relative; margin: 0 0 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--accent-soft); }
.faelle-img img { display: block; width: 100%; max-height: 320px; object-fit: cover; cursor: zoom-in; }
.faelle-img::after { content: "🔍"; position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; pointer-events: none; }

/* ===== Admin-Modus: Seiten ausblenden (?admin=1) ===== */
.admin-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 90;
  display: flex; gap: 10px; align-items: center;
  background: rgba(18,18,22,.92); color: #fff; padding: 7px 10px 7px 7px;
  border-radius: 999px; box-shadow: 0 10px 28px rgba(0,0,0,.45); font-size: 13px;
}
.admin-toggle { border: none; cursor: pointer; background: #d23f31; color: #fff; padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.admin-toggle.is-hidden { background: #1f9d55; }
.admin-count { opacity: .85; white-space: nowrap; }
.admin-copy { border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; padding: 7px 11px; border-radius: 999px; cursor: pointer; font-size: 12px; }
.page-content.page-hidden-mark { outline: 3px dashed #d23f31; outline-offset: -3px; opacity: .6; }
.page-content.page-hidden-mark::after {
  content: 'AUSGEBLENDET'; position: absolute; top: 10px; right: 10px;
  background: #d23f31; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 6px; z-index: 5;
}
.page-content { position: relative; }

/* ===== Quer-Modus = Vollbild-Folien-Viewer (Beamer-Look) ===== */
@media (orientation: landscape) {
  body.reading .reader-view { background: #0a0a0e; }

  /* Edle, transluzente Leiste oben (mit Blur) */
  body.reading .topbar {
    background: rgba(14,14,20,.72); -webkit-backdrop-filter: saturate(150%) blur(16px); backdrop-filter: saturate(150%) blur(16px);
    color: #fff; border: none; border-bottom: 1px solid rgba(255,255,255,.07); padding: 8px 14px;
  }
  body.reading .topbar .icon-btn {
    background: rgba(255,255,255,.10); color: #fff; min-width: 34px; height: 34px;
    border-radius: 10px; transition: background .15s ease;
  }
  body.reading .topbar .icon-btn:hover { background: rgba(255,255,255,.18); }
  body.reading .topbar-title { font-size: 13px; letter-spacing: .2px; opacity: .96; }
  body.reading .reading-progress { background: rgba(255,255,255,.10); }
  /* „Quiz" – dezente Glas-Pille */
  body.reading .quiz-launch {
    background: rgba(255,255,255,.15) !important; color: #fff !important;
    border: 1px solid rgba(255,255,255,.30); border-radius: 999px; height: 34px;
    box-shadow: none; font-weight: 600;
  }

  /* Bühne: unscharfer Folien-Hintergrund statt totem Schwarz */
  body.reading .page-scroll.image-mode { background: #0a0a0e; padding: 0; position: relative; overflow: hidden; }
  body.reading .page-scroll.image-mode::before {
    content: ''; position: absolute; inset: -12%;
    background-image: var(--slide-bg, none); background-size: cover; background-position: center;
    filter: blur(48px) brightness(.40) saturate(1.2); transform: scale(1.18);
    z-index: 0; pointer-events: none;
  }
  body.reading .page-content.image-only { height: 100%; width: 100%; padding: 0; justify-content: center; position: relative; z-index: 1; }
  body.reading .page-content.image-only .blk-image {
    height: 100%; width: 100%; display: flex; align-items: center; justify-content: center;
    padding: 0;
  }
  /* Folie VOLLBILD (füllt die Höhe komplett) – größtmöglich & lesbar */
  body.reading .page-content.image-only .blk-image img {
    max-width: 100vw; max-height: 100%; width: auto; height: auto;
    border-radius: 0; border: none;
    box-shadow: 0 0 55px rgba(0,0,0,.55);   /* hebt die Folie nur dezent vom Verlauf ab */
  }
  body.reading .page-scroll.image-mode .zoom-hint { display: none; }

  /* Vor/Zurück: glasige Kreise, vertikal mittig an den Rändern (kein translate -> Pille bleibt am Bildschirm) */
  body.reading .pagenav {
    width: 100%; left: 0; right: 0; top: 0; bottom: auto; height: 100%;
    transform: none; translate: none; background: transparent; border: none; box-shadow: none;
    padding: 0 14px; justify-content: space-between; align-items: center; pointer-events: none;
  }
  body.reading .pagenav .nav-btn {
    pointer-events: auto; width: 46px; height: 46px; padding: 0; border-radius: 999px;
    background: rgba(12,12,17,.80); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: #fff; font-size: 0; border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 6px 20px rgba(0,0,0,.45); transition: background .15s ease, transform .1s ease;
  }
  body.reading .pagenav .nav-btn:hover:not(:disabled) { background: rgba(40,40,50,.85); }
  /* ID-Regeln (Theme-Farben) im Landscape neutral überschreiben -> beide Pfeile gleich */
  body.reading #prev-btn, body.reading #next-btn { background: rgba(12,12,17,.80); color: #fff; }
  body.reading #prev-btn:hover:not(:disabled), body.reading #next-btn:hover:not(:disabled) { background: rgba(40,40,50,.85); filter: none; }
  body.reading #prev-btn::after { content: '‹'; font-size: 24px; line-height: 1; }
  body.reading #next-btn::after { content: '›'; font-size: 24px; line-height: 1; }

  /* Seitenzahl: dezente Glas-Pille unten mittig */
  body.reading .page-indicator {
    position: fixed; top: auto; left: 50%; transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom));
    color: rgba(255,255,255,.92); font-size: 12px; font-weight: 600; z-index: 72;
    background: rgba(14,14,20,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: 5px 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,.11);
  }
}

/* Themen-Trenner (Teil 1/2/3) – wie eine Kapitel-Titelseite */
.page-content.divider-page {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.page-content.divider-page .blk-heading.lvl1 { font-size: 2em; }
.page-content.divider-page .blk-heading.lvl1::after { margin-left: auto; margin-right: auto; }
.page-content.divider-page .blk-paragraph { color: var(--text-muted); max-width: 30ch; margin: 0; }

/* Hinweis unter Folienseiten */
.zoom-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  opacity: .85;
}

/* Vollbild-Bildbetrachter */
.imgviewer {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10, 10, 12, .94);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.imgviewer[hidden] { display: none; }
.iv-stage {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.iv-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
}
.iv-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px;
  z-index: 2;
  width: 42px; height: 42px; border-radius: 999px;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font-size: 18px;
}
.iv-hint {
  position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.75); font-size: 12px; pointer-events: none;
}
.iv-zoom { position: absolute; bottom: calc(46px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 2; display: flex; justify-content: center; gap: 10px; }
.iv-zbtn { min-width: 48px; height: 48px; padding: 0 16px; border: none; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; }
.iv-zbtn:hover { background: rgba(255,255,255,.32); }
.iv-zreset { font-size: 13px; }
/* Lupen-Hinweis auf Folien (im Lehrbuch) */
.sec-img::after { content: "🔍"; position: absolute; top: 14px; right: 16px; width: 30px; height: 30px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; pointer-events: none; }

/* ============ MARKEN-WASSERZEICHEN „34A To GO" ============
   Einzelnes Logo, mittig & transparent auf JEDER Folie – im Leser (beide
   Render-Pfade: .blk-image = Text-Themen, .sec-img = Bild-Themen) und im Zoom.
   Größe/Deckkraft über die Variablen unten steuerbar. */
:root { --wm-opacity: .08; --wm-size: 42%; }
.blk-image, .sec-img { position: relative; }
.blk-image::before, .sec-img::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("../logos/34a-togo.png") no-repeat center / var(--wm-size);
  opacity: var(--wm-opacity);
}
.iv-stage { position: relative; }
.iv-stage::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url("../logos/34a-togo.png") no-repeat center / 34%;
  opacity: .1;
}

.blk-table-wrap { overflow-x: auto; margin: 1em 0; border-radius: var(--radius-sm); }
.blk-table { border-collapse: collapse; width: 100%; font-size: .95em; }
.blk-table th, .blk-table td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.blk-table th { background: var(--accent-soft); font-weight: 700; }

/* -------- untere Navigation (floating Pille) -------- */
.pagenav {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px;
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
}
.nav-btn {
  border: none;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform .08s, filter .15s, background .15s;
}
#prev-btn { background: var(--bg); color: var(--text); }
#prev-btn:hover:not(:disabled) { background: var(--accent-soft); }
#next-btn { background: var(--accent); color: var(--accent-ink); }
#next-btn:hover:not(:disabled) { filter: brightness(1.06); }
.nav-btn:active:not(:disabled) { transform: scale(.97); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.page-indicator { color: var(--text-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* -------- Inhaltsverzeichnis -------- */
.toc-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45); display: flex; }
.toc-panel {
  width: min(380px, 86vw);
  background: var(--bg-page);
  display: flex; flex-direction: column; height: 100%;
  border-top-right-radius: 22px; border-bottom-right-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.toc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  font-weight: 800; font-size: 16px; color: var(--text);
}
.toc-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.toc-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-radius: 12px;
  color: var(--text); padding: 12px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.toc-item:hover { background: var(--accent-soft); }

/* Aufklappbare Bereichs-Gruppen im Menü */
.toc-group { border-bottom: 1px solid var(--line); }
.toc-group-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; cursor: pointer;
  padding: 14px 14px; font-weight: 700; font-size: 14px; color: var(--text);
}
.toc-group-head:hover { background: var(--accent-soft); }
.toc-caret { color: var(--accent); transition: transform .18s; }
.toc-group.collapsed .toc-caret { transform: rotate(-90deg); }
.toc-group-body { padding-bottom: 6px; }
.toc-group.collapsed .toc-group-body { display: none; }
.toc-group-body .toc-item { padding: 9px 14px 9px 24px; font-size: 13.5px; color: var(--text-muted); }
.toc-group-body .toc-item:hover { color: var(--text); }

@media (min-width: 640px) {
  .page-scroll { padding: 30px 24px 130px; }
  .page-content { padding: 38px 42px 44px; }
}

/* ===== Start-Bildschirm / Bibliothek ===== */
.home-view { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--text); overflow: hidden; }
/* Marken-Band (Kopf) in 34A-Blau */
.home-top {
  display: flex; align-items: center; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 18px 16px;
  background: linear-gradient(120deg, #1C44D8, #102a8e);
  color: #fff;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 24px rgba(16,42,142,.28);
}
.home-logo { width: 54px; height: 54px; object-fit: contain; flex: 0 0 auto;
  background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.home-top .brand { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.home-top .brand-mark { font-size: 1.18rem; letter-spacing: .2px; color: #fff; font-weight: 700; }
.home-top .brand-mark strong { color: #fff; }
.home-top .brand-sub { font-size: .8rem; color: rgba(255,255,255,.88); text-transform: none; letter-spacing: .2px; margin-top: 2px; }
.home-top .icon-btn { background: rgba(255,255,255,.18); color: #fff; flex: 0 0 auto; }
.home-top .icon-btn:hover { background: rgba(255,255,255,.28); }
.home-top .home-campus { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.home-top .home-campus:hover { background: rgba(255,255,255,.28); }
.home-scroll { padding-top: 18px; }
.home-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(30px + env(safe-area-inset-bottom)); }
.home-h1 { font-family: var(--font-head, inherit); font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 10px 4px 16px; }

.home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 720px; margin: 0 auto; }
/* Themen-Kachel = dein freigestelltes Logo, edel auf dunkler Karte */
.topic-tile {
  position: relative; display: block; aspect-ratio: 1 / 1; padding: 0;
  border-radius: 18px; overflow: hidden; cursor: pointer; text-decoration: none;
  border: 1px solid rgba(255,255,255,.08);
  background: radial-gradient(120% 120% at 50% 0%, #26397F, #15224F 72%);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .15s ease;
}
.topic-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.topic-tile:active { transform: scale(.99); }
.tile-logo { width: 100%; height: 100%; object-fit: contain; display: block; padding: 16px; box-sizing: border-box; }

/* Fallback ohne Logo: farbige Kachel mit Nummer + Titel */
.topic-tile.no-logo {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 5px;
  padding: 16px; color: #fff; border: none; text-align: left;
  background: var(--tile, #3a3a44);
  background-image: linear-gradient(180deg, rgba(255,255,255,.04) 38%, rgba(0,0,0,.24));
}
.tile-num { position: absolute; top: 12px; right: 16px; font-size: 26px; font-weight: 800; opacity: .34; line-height: 1; }
.tile-title { font-size: .96rem; font-weight: 700; line-height: 1.22; overflow-wrap: anywhere; hyphens: auto; }

/* Prüfungsfragen: volle Breite, Marken-Türkis, klarer CTA */
.tile-ico { font-size: 28px; }
.tile-sub { font-size: .76rem; opacity: .92; }
.tile-titlewrap { display: flex; flex-direction: column; gap: 2px; }
.pruefung-tile {
  grid-column: 1 / -1; aspect-ratio: auto; min-height: 84px;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px;
  color: #fff; border: none;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
}
.pruefung-tile .tile-title { font-size: 1.18rem; font-weight: 800; color: #fff; letter-spacing: -.01em; }
/* Prüfungs-Karten (Schriftlich | Mündlich) im Kachel-Raster */
.home-sub { grid-column: 1 / -1; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 14px 4px 0; }
.pruef-tile { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 18px; text-align: center; }
.pruef-img { height: 42%; width: auto; max-width: 76%; object-fit: contain; }
.pruef-t { color: #fff; font-weight: 800; font-size: 1.1rem; }
.pruef-s { color: rgba(255,255,255,.82); font-size: .74rem; }

/* ===== Echtes Text-Kapitel (kind:text) ===== */
body.text-chapter .reader-view { background: var(--bg) !important; }
body.text-chapter .page-scroll.section-scroll { background: var(--bg) !important; display: block; padding: 0 0 8px; }
body.text-chapter .sec-head { background: var(--accent); }
body.text-chapter .sec-head .sec-back { background: rgba(255,255,255,.20); }
.chapter-body { max-width: 820px; margin: 0 auto; padding: 24px 20px calc(44px + env(safe-area-inset-bottom)); color: var(--text); font-size: 1.02rem; line-height: 1.62; }
.chapter-body .blk-heading { font-weight: 800; letter-spacing: -.01em; margin: 26px 0 12px; padding-left: 14px; border-left: 4px solid var(--accent); color: var(--text); }
.chapter-body .blk-heading.lvl1 { font-size: 1.7rem; border: none; padding: 0; }
.chapter-body .blk-heading.lvl2 { font-size: 1.3rem; }
.chapter-body .blk-heading.lvl3 { font-size: 1.08rem; }
.chapter-body .blk-paragraph { margin: 0 0 14px; }
.chapter-body strong { color: var(--accent-2); }
.chapter-body .blk-list { list-style: none; margin: 8px 0 14px; padding: 0; }
.chapter-body .blk-list li { padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bar); margin-bottom: 9px; box-shadow: 0 1px 2px rgba(16,40,48,.04); }
.chapter-body .blk-merke { background: var(--accent-soft); border: 1px solid rgba(28,68,216,.28); border-radius: 16px; padding: 16px 18px; margin: 22px 0; }
.chapter-body .blk-merke-h { font-weight: 800; color: var(--accent-2); margin-bottom: 6px; }
.chapter-body .blk-merke p { margin: 0; }
.chapter-body .blk-table-wrap { overflow-x: auto; margin: 16px 0; }
.chapter-body .blk-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: .94rem; }
.chapter-body .blk-table th, .chapter-body .blk-table td { padding: 11px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.chapter-body .blk-table thead th { background: var(--accent); color: #fff; font-weight: 700; }
.chapter-body .blk-table tbody th { background: var(--accent-soft); color: var(--text); width: 30%; font-weight: 700; }
.chapter-body .blk-table tbody tr:last-child th, .chapter-body .blk-table tbody tr:last-child td { border-bottom: none; }
body.text-chapter .sec-nav-btn { background: var(--bar); border: 1px solid var(--line); color: var(--text); }
body.text-chapter .sec-nav-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Schaubild (Original-Folie) im Text-Kapitel */
/* Folien im Text-Kapitel: groß & füllend (wie bei den Bild-Themen), nicht als kleines Kästchen.
   Negative Ränder heben das Container-Padding auf -> Folie nutzt die volle Breite. */
.chapter-body .blk-image { margin: 22px -20px 10px; }
.chapter-body .blk-image img { display: block; width: 100%; max-width: none; margin: 0; height: auto; border: none; border-radius: 14px; box-shadow: 0 10px 30px rgba(9,38,82,.28); cursor: zoom-in; }
.chapter-body .blk-image::after { content: "Zum Vergrößern tippen"; display: block; text-align: center; font-size: .72rem; color: var(--text-muted); margin-top: 8px; }
/* Spiel-Block (öffnet ein interaktives Lernspiel) */
.chapter-body .blk-spiel { display: flex; align-items: center; gap: 14px; text-decoration: none; margin: 22px 0; padding: 16px 18px; border-radius: 16px; background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 22px rgba(28,68,216,.30); }
button.chapter-body .blk-spiel, .chapter-body button.blk-spiel { border: none; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.chapter-body .blk-spiel:hover { filter: brightness(1.06); }
.blk-spiel-ic { font-size: 1.9rem; line-height: 1; flex: 0 0 auto; }
.blk-spiel-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.blk-spiel-t { font-weight: 800; font-size: 1.05rem; }
.blk-spiel-s { font-size: .82rem; color: rgba(255,255,255,.85); }
.blk-spiel-go { font-size: 1.15rem; opacity: .9; flex: 0 0 auto; }

/* Karteikarten im Kapitel (Frage -> antippen -> Auflösung), eigene CI (Dark Navy) */
.blk-flipcards {
  --fc-navy: #092652; --fc-navy-2: #0d3068; --fc-line: #1f3f78;
  --fc-blue: #1C44D8; --fc-blue-lt: #6486FF;
  margin: 26px 0; padding: 18px 16px 20px; border-radius: 18px;
  background: var(--fc-navy); box-shadow: 0 10px 30px rgba(9,38,82,.35);
}
.fc-title { color: #fff; font-weight: 800; font-size: 1.05rem; text-align: center; margin-bottom: 10px; }
.fc-head { display: flex; justify-content: center; margin-bottom: 12px; }
.fc-counter { color: var(--fc-blue-lt); font-weight: 700; font-size: .82rem; letter-spacing: .04em; }
.fc-stage { perspective: 1600px; max-width: 420px; margin: 0 auto; }
.fc-card { aspect-ratio: 1/1; cursor: pointer; }
.fc-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4,.1,.2,1);
}
.fc-card-inner.is-flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--fc-line);
  background: var(--fc-navy-2); box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.fc-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fc-back { transform: rotateY(180deg); }
.fc-hint { text-align: center; color: #9db2dd; font-size: .78rem; margin-top: 12px; }
.fc-nav { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.fc-btn {
  border: none; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: .85rem;
  cursor: pointer; background: var(--fc-navy-2); color: #fff; border: 1px solid var(--fc-line);
}
.fc-btn.fc-next { background: var(--fc-blue); border-color: var(--fc-blue); box-shadow: 0 6px 16px rgba(28,68,216,.35); }
.fc-btn:disabled { opacity: .35; cursor: default; }
.fc-btn:not(:disabled):hover { filter: brightness(1.1); }

/* Sprachen-Menü */
.lang-menu { position: fixed; z-index: 130; background: var(--bg-page); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(16,40,48,.22); padding: 6px; min-width: 176px; }
.lang-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; background: none; border-radius: 9px; font-size: .95rem; color: var(--text); cursor: pointer; text-align: left; }
.lang-opt:hover { background: var(--bar); }
.lang-opt.is-active { background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }
.lang-flag { font-size: 1.15rem; line-height: 1; }
/* RTL (Arabisch) – nur der Lese-Inhalt, UI bleibt LTR */
body.rtl .chapter-body { direction: rtl; text-align: right; }
body.rtl .chapter-body .blk-heading { border-left: none; border-right: 4px solid var(--accent); padding-left: 0; padding-right: 14px; }
body.rtl .chapter-body .blk-table th, body.rtl .chapter-body .blk-table td { text-align: right; }
body.rtl .chapter-body .blk-merke { text-align: right; }
.pruefung-tile .tile-sub { color: rgba(255,255,255,.85); }
.pf-arrow { font-size: 1.5rem; font-weight: 700; opacity: .9; flex: 0 0 auto; }
.pruefung-tile:hover { filter: brightness(1.06); }
.pruefung-tile:hover .pf-arrow { transform: translateX(3px); transition: transform .15s; }

/* ===== Prüfungsfragen-Overlay ===== */
.pruefung { position: fixed; inset: 0; z-index: 410; background: var(--bg); color: var(--text); display: flex; flex-direction: column; }
.pruefung[hidden] { display: none; }
.pruefung-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 18px 10px;
}
.pruefung-title { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
/* Segment-Control statt klobiger Buttons */
.pruefung-tabs {
  display: inline-flex; align-self: center; gap: 4px; padding: 4px;
  margin: 2px auto 10px; background: var(--accent-soft); border-radius: 999px;
}
.pruefung-tab {
  border: none; background: transparent; color: var(--text-muted);
  padding: 9px 24px; border-radius: 999px; font-weight: 700; font-size: .92rem; cursor: pointer;
  transition: color .15s, background .15s;
}
.pruefung-tab.is-active { background: var(--bar); color: var(--accent-2); box-shadow: var(--shadow); }
.pruefung-body { flex: 1; overflow-y: auto; padding: 12px 18px calc(28px + env(safe-area-inset-bottom)); }
.pf-pane { max-width: 480px; margin: 16px auto 0; }
.pf-card { background: var(--bar); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px 22px; }
.pf-h { font-size: 1.18rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -.01em; }
.pf-desc { color: var(--text-muted); font-size: .95rem; line-height: 1.5; margin: 0 0 20px; }
.pf-stats { display: flex; gap: 10px; margin: 0 0 22px; }
.pf-stat { flex: 1; background: var(--accent-soft); border-radius: 14px; padding: 14px 8px; text-align: center; }
.pf-stat-n { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent-2); line-height: 1; }
.pf-stat-l { display: block; font-size: .7rem; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }
.pf-illu { display: block; height: 92px; margin: 0 auto 14px; }
.pf-cta { width: 100%; padding: 15px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow); transition: filter .15s; }
/* Illustrationen auf der Prüfungsfragen-Kachel (weiße Mini-Karten) */
.pf-illus { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.pf-illus img { height: 56px; width: 56px; object-fit: contain; background: rgba(255,255,255,.95); border-radius: 12px; padding: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
/* Mündlich-Intro über der Deck-Liste */
.mue-intro { display: flex; align-items: center; gap: 14px; max-width: 560px; margin: 4px auto 14px; padding: 0 2px; }
.mue-intro-img { height: 64px; width: 64px; object-fit: contain; background: var(--bar); border: 1px solid var(--line); border-radius: 14px; padding: 6px; flex: 0 0 auto; }
.mue-intro-t { font-size: .92rem; color: var(--text-muted); line-height: 1.45; margin: 0; }
.pf-cta:hover { filter: brightness(1.05); }
.pf-soon { text-align: center; }
.pf-badge { display: inline-block; margin-top: 4px; padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: .85rem; }

/* ===== Mündlich: Deck-Liste ===== */
.mue-decks { max-width: 560px; margin: 6px auto 0; display: flex; flex-direction: column; gap: 10px; }
.mue-deck { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; font: inherit;
  background: var(--bar); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s; }
.mue-deck:hover { border-color: var(--accent); }
.mue-all { background: var(--accent-soft); border-color: transparent; }
.mue-deck-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mue-deck-t { font-weight: 700; font-size: 1rem; }
.mue-deck-s { font-size: .78rem; color: var(--text-muted); }
.mue-badge { flex: 0 0 auto; font-size: .76rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--accent); color: #fff; white-space: nowrap; }
.mue-badge.done { background: transparent; color: var(--text-muted); border: 1px solid var(--line); }

/* ===== Mündlich: Lernsession (Karteikarte) ===== */
.mue { position: fixed; inset: 0; z-index: 420; background: var(--bg); color: var(--text); display: flex; flex-direction: column; }
.mue[hidden] { display: none; }
.mue-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--line); }
.mue-title { flex: 1; font-weight: 700; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mue-prog { font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mue-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4px; overflow: hidden; min-height: 0; }
.mue-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); cursor: zoom-in; }
/* HTML-Karteikarte (skalierbarer Text statt Bild) */
.mcard { position: relative; width: 100%; height: 100%; background: #719edf; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.mcard[hidden] { display: none; }
.mcard-logo { position: absolute; top: 4%; left: 4.5%; height: 15%; max-height: 96px; width: auto; }
.mcard-deco { position: absolute; top: 3%; right: 5%; display: flex; align-items: flex-start; gap: .35em; font-weight: 800; line-height: .8; letter-spacing: -.04em; user-select: none; }
.mcard-deco span:nth-child(1) { font-size: clamp(26px, 7vmin, 60px); transform: translateY(.18em) rotate(-8deg); opacity: .85; }
.mcard-deco span:nth-child(2) { font-size: clamp(38px, 9.5vmin, 86px); }
.mcard-deco span:nth-child(3) { font-size: clamp(28px, 7.5vmin, 66px); transform: translateY(.24em) rotate(8deg); opacity: .9; }
.q-deco { color: #a7c57e; }
.a-deco { color: #e7d24a; }
.mcard-text { color: #16223C; text-align: center; font-weight: 600; line-height: 1.34; padding: 0 6%; font-size: clamp(1.9rem, 6.2vw, 3.6rem); }
.mcard-text strong { font-weight: 800; }
.mcard-awrap { position: absolute; inset: 13% 5% 5%; display: flex; flex-direction: column; align-items: center; gap: 2.5%; }
.mcard-awrap .mcard-text { font-size: clamp(1.2rem, 4.2vw, 2.4rem); padding: 0; }
.mcard-adiagram { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 8px; }
/* Hinweis „Handy drehen" – nur im Hochformat (Karten sind querformatig) */
.mue-rotate-hint { display: none; }
@media (orientation: portrait) {
  .mue-rotate-hint { display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 10px 14px 0; padding: 11px 14px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: .9rem;
    border: 1px solid rgba(28,68,216,.25); text-align: center; }
  .mue-rotate-ic { font-size: 1.15rem; line-height: 1; }
}
.mue-controls { padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-wrap: nowrap; gap: 8px; max-width: 680px; margin: 0 auto; width: 100%; }
.mue-show { flex: 1; padding: 12px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow); }
.mue-show:hover { filter: brightness(1.05); }
.mue-rate { flex: 1; min-width: 0; padding: 11px 4px; border: none; border-radius: 12px; font-weight: 700; font-size: .88rem; line-height: 1.15; cursor: pointer; color: #fff; box-shadow: var(--shadow); }
.mue-rate.r-no { background: #d2453a; }
.mue-rate.r-mid { background: #d99a16; }
.mue-rate.r-yes { background: #1f9d55; }
.mue-rate:hover { filter: brightness(1.05); }
.mue-done { flex: 1 0 100%; text-align: center; font-weight: 700; padding: 10px 0; }
.mue-done span { display: block; font-weight: 400; color: var(--text-muted); font-size: .86rem; margin-top: 8px; }
/* Querformat: Bild füllt die Höhe, Buttons als schmale Spalte rechts (fressen keine Höhe).
   MUSS nach den Basis-.mue-Regeln stehen, sonst überschreiben diese die Breite. */
@media (orientation: landscape) {
  .mue { flex-direction: row; align-items: stretch; }
  .mue-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; border: none;
    padding: calc(5px + env(safe-area-inset-top)) 12px 6px; gap: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,0)); }
  .mue-top .mue-title { color: #fff; font-size: .84rem; }
  .mue-top .mue-prog { color: rgba(255,255,255,.85); font-size: .78rem; }
  .mue-top .icon-btn { width: 32px; height: 32px; background: rgba(255,255,255,.2); color: #fff; }
  .mue-stage { flex: 1; padding: 4px; min-width: 0; }
  .mue-img { border-radius: 10px; }
  .mue-controls { flex-direction: column; width: 138px; max-width: 138px; align-self: stretch;
    justify-content: center; gap: 9px; padding: 10px 9px calc(10px + env(safe-area-inset-bottom));
    margin: 0; background: var(--bar); border-left: 1px solid var(--line); }
  .mue-show, .mue-rate { width: 100%; flex: 0 0 auto; padding: 13px 6px; font-size: .9rem; min-width: 0; }
  .mue-done { flex: 0 0 auto; }
}

/* ===== Abschnitts-Navigation (Themen mit sections) ===== */
body.section-mode .pagenav { display: none; }
body.section-mode .reading-progress { display: none; }

/* Abschnittsliste (hell, folgt Theme) */
body.section-list .reader-view { background: var(--bg) !important; }
body.section-list .page-scroll { background: var(--bg) !important; display: block; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sec-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.sec-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bar); color: var(--text); font: inherit; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.06); transition: border-color .15s ease, transform .1s ease;
}
.sec-card:hover { border-color: var(--accent); }
.sec-card:active { transform: scale(.99); }
.sec-num { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.sec-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sec-title { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.sec-count { font-size: .78rem; color: var(--text-muted); }
.sec-go { color: var(--accent); font-size: 1.5rem; font-weight: 700; }
/* Quiz als letzter „Themenpunkt" – hervorgehoben */
/* Aktivitäts-Kachel: sofort als Übung erkennbar (Verlauf + Badge + ▶) */
.sec-card.sec-aktiv { background: linear-gradient(100deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: 0 8px 20px rgba(28,68,216,.30); position: relative; }
.sec-card.sec-aktiv:hover { border-color: #fff; filter: brightness(1.06); }
.sec-card.sec-aktiv .sec-title, .sec-card.sec-aktiv .sec-go { color: #fff; }
.sec-card.sec-aktiv .sec-count { color: rgba(255,255,255,.85); }
.sec-card.sec-aktiv .sec-num { background: rgba(255,255,255,.2); font-size: 1.05rem; }
.sec-card.sec-aktiv .sec-go { font-size: .8rem; }
.sec-badge { position: absolute; top: -8px; right: 14px; background: #fbbf24; color: #4a3200; font-size: .6rem; font-weight: 800; letter-spacing: .09em; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

.sec-quiz { background: var(--accent); border-color: var(--accent); margin-top: 6px; box-shadow: 0 8px 20px rgba(28,68,216,.28); }
.sec-quiz:hover { border-color: #fff; }
.sec-quiz .sec-title, .sec-quiz .sec-go { color: #fff; }
.sec-quiz .sec-count { color: rgba(255,255,255,.85); }
.sec-quiz .sec-num { background: rgba(255,255,255,.22); color: #fff; }
/* Quiz-Button oben rechts ausblenden – Zugang ist jetzt der Punkt unten in der Liste */
.topbar .quiz-launch { display: none; }

/* Abschnitts-Ansicht: Folien gestapelt (scrollen), dunkler Lese-Hintergrund */
body.section-view .reader-view { background: #0b0b0f !important; }
.page-scroll.section-scroll { display: block; padding: 0 0 8px; background: #0b0b0f; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page-content.section-pages { display: block; max-width: 1100px; margin: 0 auto; padding: 0; }
.sec-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: rgba(14,14,20,.85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff;
}
.sec-back { flex: 0 0 auto; background: rgba(255,255,255,.14); color: #fff; border: none; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.sec-head-title { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-img { margin: 0; padding: 7px 8px 0; }
.sec-img img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.40); cursor: zoom-in; }
.sec-foot { display: flex; gap: 10px; padding: 16px 12px calc(26px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
.sec-nav-btn { flex: 1; min-width: 150px; padding: 13px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font-weight: 600; font-size: .9rem; cursor: pointer; }
.sec-nav-btn.primary { background: var(--accent); border-color: var(--accent); }
/* (Folien füllen jetzt die Breite – kein 640px-Limit mehr) */

/* Admin in der Abschnitts-Ansicht: löschen / wieder einblenden direkt an der Folie */
.sec-img { position: relative; }
.sec-del {
  position: absolute; top: 16px; right: 16px; z-index: 6;
  background: rgba(210,63,49,.94); color: #fff; border: none; border-radius: 999px;
  padding: 9px 15px; font-weight: 700; font-size: .85rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.40);
}
.sec-del.restore { background: rgba(31,157,85,.94); }
.sec-img.sec-hidden img { opacity: .35; outline: 3px dashed #d23f31; outline-offset: -3px; }
.sec-admin {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 95;
  display: flex; gap: 10px; align-items: center;
  background: rgba(18,18,24,.92); color: #fff; padding: 8px 10px 8px 14px;
  border-radius: 999px; box-shadow: 0 10px 28px rgba(0,0,0,.45); font-size: 13px;
}
.sec-admin-count { white-space: nowrap; }
.sec-admin-copy { border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 12px; }

/* Gruppen-Trenner in der Kapitelliste (z. B. Allgemeiner / Besonderer Teil) */
.sec-gruppe{
  margin: 22px 4px 8px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--topic, #1C44D8);
  border-bottom: 2px solid currentColor;
  padding-bottom: 6px;
  opacity: .85;
}
.sec-list > .sec-gruppe:first-child{ margin-top: 4px; }

/* ── Weg zum Prüfungssimulator ──────────────────────────────────────────────
   Das Üben im Lehrbuch endet nicht beim Fragenpool. Im Ergebnis einer
   Prüfungsrunde und unter dem Start-Knopf steht der Weg zur echten Prüfung.
   Der Zugang dort läuft über den Code aus dem Bundle – die Texte versprechen
   deshalb keinen offenen Zutritt. */
.quiz-sim { margin-top: 22px; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card, transparent); text-align: center; }
.quiz-sim-h { font-weight: 800; font-size: 1rem; margin-bottom: 6px; }
.quiz-sim-d { font-size: .9rem; line-height: 1.5; color: var(--muted); margin-bottom: 14px; }
.quiz-sim-cta { display: block; padding: 14px; border-radius: 12px; background: var(--accent);
  color: #fff; font-weight: 800; font-size: .98rem; text-decoration: none; }
.quiz-sim-cta:hover { filter: brightness(1.08); }
.quiz-sim-n { font-size: .78rem; color: var(--muted); margin-top: 10px; }

.pf-sim { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pf-sim-t { font-size: .82rem; color: var(--muted); }
.pf-sim-a { font-weight: 700; font-size: .92rem; color: var(--accent); text-decoration: none; }
.pf-sim-a:hover { text-decoration: underline; }
