:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --accent: #00a3a3;
  --accent-dark: #007a7a;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5b6b7e;
  --border: #e2e8f0;
  --danger: #c0392b;
  --ok: #1e8a5a;
  --shadow: 0 6px 24px rgba(11, 37, 69, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #042; letter-spacing: -1px;
}
.brand .title-sm { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand .title-sm small { display: block; font-weight: 400; opacity: .8; font-size: 12px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-user { font-size: 14px; opacity: .9; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, background .2s ease, opacity .2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #042; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.section { padding: 56px 0; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 70px 0 80px;
}
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: 13px;
  color: var(--accent); font-weight: 700; margin-bottom: 14px;
}
.hero h1 { font-size: 40px; line-height: 1.1; margin: 0 0 16px; }
.hero p.lead { font-size: 18px; max-width: 680px; opacity: .92; }
.hero .lecturer {
  margin-top: 26px; display: inline-flex; gap: 14px; align-items: center;
  background: rgba(255,255,255,.08); padding: 14px 18px; border-radius: 12px;
}
.hero .avatar {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; font-weight: 800; color: #042;
}
.hero-cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.chapter-card { display: flex; flex-direction: column; gap: 10px; transition: transform .12s ease, box-shadow .2s; }
.chapter-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(11,37,69,.14); }
.chapter-card .num {
  width: 38px; height: 38px; border-radius: 9px; background: #e6f7f7; color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 800;
}
.chapter-card h3 { margin: 4px 0 0; font-size: 18px; }
.chapter-card p { color: var(--muted); font-size: 14px; margin: 0; }
.chapter-card .meta { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }

.section-title { font-size: 26px; margin: 0 0 6px; }
.section-sub { color: var(--muted); margin: 0 0 28px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.badge-locked { background: #fff3e0; color: #b26a00; }
.badge-done { background: #e3f6ec; color: var(--ok); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { margin: 0 0 4px; }
.auth-card .muted { color: var(--muted); margin: 0 0 22px; }
.tabs { display: flex; gap: 6px; background: #eef2f7; padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.tab { flex: 1; text-align: center; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab.active { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--navy-2); }
.field input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 15px; transition: border .15s;
}
.field input:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.alert-ok { background: #e3f6ec; color: var(--ok); border: 1px solid #b8e3c9; }

/* ---------- Dashboard ---------- */
.progress-bar { height: 10px; background: #e6ebf1; border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s ease; }
.welcome { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.welcome h1 { margin: 0; font-size: 28px; }
.stat { font-size: 14px; color: var(--muted); }

/* ---------- Chapter view ---------- */
.chapter-head { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 40px 0; }
.chapter-head .kicker { color: var(--accent); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.chapter-head h1 { margin: 8px 0 10px; font-size: 30px; }
.chapter-head p { max-width: 720px; opacity: .92; margin: 0; }
.section-block { margin-bottom: 26px; }
.section-block h3 {
  font-size: 19px; color: var(--navy); margin: 0 0 12px;
  padding-left: 14px; border-left: 4px solid var(--accent);
}
.section-block ul { margin: 0; padding-left: 22px; }
.section-block li { margin-bottom: 9px; color: #2c3744; }
.lit-box { background: #f0f4f8; border-radius: 12px; padding: 18px 22px; }
.lit-box h4 { margin: 0 0 8px; color: var(--navy-2); }
.lit-box ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c7d3e2; padding: 30px 0; font-size: 14px; margin-top: 40px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.center { text-align: center; }
.spinner { color: var(--muted); padding: 40px; text-align: center; }

/* ---------- Druckansicht ---------- */
.print-body { background: #e9edf2; }
.print-toolbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: 12px 22px;
}
.print-toolbar-title { font-weight: 700; flex: 1; min-width: 160px; }
.print-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.print-doc {
  background: #fff; color: #1c2430;
  max-width: 820px; margin: 28px auto; padding: 48px 56px;
  box-shadow: 0 6px 30px rgba(11,37,69,.12); border-radius: 4px;
}
.print-doc.hide-solutions .quiz-sol { display: none; }
.print-doc.hide-solutions .quiz-opts-print .opt-correct { font-weight: inherit; }
.print-doc.hide-solutions .quiz-opts-print .opt-correct::after { content: ""; }
.print-doc.hide-quiz .quiz-print { display: none; }

.print-cover { text-align: center; padding: 40px 0 30px; border-bottom: 3px solid var(--accent); margin-bottom: 30px; }
.print-eyebrow { text-transform: uppercase; letter-spacing: 2px; color: var(--accent-dark); font-weight: 700; font-size: 13px; }
.print-cover h1 { font-size: 30px; margin: 14px 0 8px; color: var(--navy); }
.print-cover-sub { font-size: 20px; color: var(--navy-2); margin: 0 0 18px; font-weight: 600; }
.print-lecturer { margin: 18px 0 6px; font-weight: 600; }
.print-lecturer span { font-weight: 400; color: var(--muted); }
.print-date { color: var(--muted); font-size: 14px; }

.print-toc { margin-bottom: 30px; }
.print-toc h2 { color: var(--navy); font-size: 20px; }
.print-toc ol { padding-left: 22px; }
.print-toc li { margin-bottom: 6px; }

.print-chapter-title { font-size: 24px; color: var(--navy); border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.print-chapter-summary { color: var(--muted); font-style: italic; }
.print-section { margin-bottom: 22px; }
.print-section h3 { font-size: 18px; color: var(--navy-2); border-left: 4px solid var(--accent); padding-left: 12px; }

.quiz-print {
  border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin: 16px 0;
  background: #fafbfc;
}
.quiz-print-title { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.quiz-print-title::before { content: "❓ "; }
.quiz-q-print { margin-bottom: 14px; }
.quiz-q-print:last-child { margin-bottom: 0; }
.quiz-opts-print { list-style: none; padding-left: 0; margin: 6px 0; }
.quiz-opts-print li { padding: 3px 0; }
.quiz-opts-print .opt-correct { font-weight: 700; color: var(--ok); }
.quiz-sol { font-size: 14px; color: #2c3744; background: #eef5fb; border-radius: 6px; padding: 8px 12px; margin: 6px 0 0; }

@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; }
  .site-header, .site-footer, .print-toolbar, .no-print { display: none !important; }
  .print-doc {
    max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0;
  }
  .print-chapter { break-before: page; }
  .print-cover, .print-toc { break-after: page; }
  .print-cover + .print-toc { break-before: avoid; }
  /* Erstes Kapitel nicht zwingend auf neue Seite, wenn kein TOC/Cover davor */
  .print-section, .example, .quiz-print, .quiz-q-print,
  .table-wrap, .diagram, .journal, .def-box, .callout { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  .rich-table thead { display: table-header-group; }
  a { color: #1c2430; text-decoration: none; }
  .diagram { border: none; padding: 6px 0; }
  body { font-size: 11.5pt; }
}

/* ---------- Rich content blocks ---------- */
.rich-p { margin: 0 0 14px; color: #2c3744; }
.rich-h { font-size: 16px; color: var(--navy-2); margin: 20px 0 10px; }
.rich-list { margin: 0 0 14px; padding-left: 22px; }
.rich-list li { margin-bottom: 8px; color: #2c3744; }
.rich-list .rich-list { margin: 8px 0 4px; }

.def-box {
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  background: #f7f9fc;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 16px;
}
.def-term { display: block; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.def-text { color: #2c3744; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 13px 16px;
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
}
.callout-icon { font-weight: 800; flex-shrink: 0; }
.callout-info { background: #eef5fb; border: 1px solid #cfe2f3; color: #1c3d57; }
.callout-tip  { background: #eafaf1; border: 1px solid #bce8cf; color: #1c5a3a; }
.callout-warn { background: #fef3e7; border: 1px solid #f6d2a8; color: #8a4b00; }
.callout-law  { background: #f3f0fa; border: 1px solid #d8cdef; color: #4a3a78; }
.callout-law .callout-icon { font-size: 20px; line-height: 1; }

.example {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.example-head {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 15px;
}
.example-head::before { content: "📝 "; }
.example-body { padding: 16px 18px 4px; background: #fff; }
.example-body > *:last-child { margin-bottom: 16px; }

.table-wrap { margin: 0 0 18px; overflow-x: auto; }
.rich-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.rich-table th, .rich-table td {
  border: 1px solid var(--border);
  padding: 9px 13px;
  text-align: left;
  vertical-align: top;
}
.rich-table thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}
.rich-table tbody tr:nth-child(even) { background: #f7f9fc; }
.table-wrap figcaption, .diagram figcaption {
  font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center;
}

.journal {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 16px;
  background: #fbfcfe;
}
.journal-title { font-weight: 700; color: var(--navy-2); margin-bottom: 8px; }
.journal table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.journal td { padding: 4px 8px; }
.journal .acc { font-weight: 600; color: var(--navy); }
.journal .haben { color: var(--navy-2); font-weight: 500; }
.journal .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal .jrow-note td { color: var(--muted); font-style: italic; padding-top: 8px; }
.journal-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

.diagram {
  margin: 0 0 20px;
  padding: 18px;
  background: #fbfdfd;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.diagram .mermaid { display: flex; justify-content: center; }
.diagram svg { max-width: 100%; height: auto; }

/* ---------- Quiz ---------- */
.quiz {
  border: 1px solid #cfe2f3;
  background: linear-gradient(180deg, #f5fafe 0%, #fff 100%);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 26px 0 8px;
}
.quiz-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.quiz-title { font-weight: 700; color: var(--navy); font-size: 16px; }
.quiz-title::before { content: "🧠 "; }
.quiz-score {
  font-size: 13px; font-weight: 700; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px;
}
.quiz-complete .quiz-score { background: #e3f6ec; color: var(--ok); border-color: #b8e3c9; }
.quiz-q { margin-bottom: 18px; }
.quiz-q:last-child { margin-bottom: 0; }
.quiz-question { font-weight: 600; color: var(--text); margin: 0 0 10px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 15px; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: #f4fbfb; }
.quiz-option:disabled { cursor: default; }
.quiz-letter {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
  background: #eef2f7; color: var(--navy-2); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.quiz-option.correct { border-color: var(--ok); background: #e9f9f0; }
.quiz-option.correct .quiz-letter { background: var(--ok); color: #fff; }
.quiz-option.correct::after { content: "✓"; margin-left: auto; color: var(--ok); font-weight: 800; }
.quiz-option.wrong { border-color: var(--danger); background: #fdecea; }
.quiz-option.wrong .quiz-letter { background: var(--danger); color: #fff; }
.quiz-option.wrong::after { content: "✕"; margin-left: auto; color: var(--danger); font-weight: 800; }
.quiz-explain {
  margin-top: 10px; padding: 11px 14px; border-radius: 9px;
  background: #fff; border: 1px solid var(--border); font-size: 14px; color: #2c3744;
}

/* ---------- Didaktische Zusatzkomponenten ---------- */
.box-label { font-weight: 800; color: var(--navy); margin-bottom: 8px; font-size: 15px; }
.edu-box { border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin: 0 0 24px; }

.objectives { background: #eef5fb; border-color: #cfe2f3; }
.objectives-intro { margin: 0 0 8px; font-weight: 600; color: var(--navy-2); }
.objectives ul { margin: 0; padding-left: 22px; }
.objectives li { margin-bottom: 6px; }

.summary-block { background: linear-gradient(180deg,#f3faf7 0%,#fff 100%); border-color: #bce8cf; }
.takeaways { margin: 0 0 14px; padding-left: 22px; }
.takeaways li { margin-bottom: 7px; }
.normen { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 12px 16px; }
.normen-label { font-weight: 700; color: var(--navy-2); margin-bottom: 6px; font-size: 14px; }
.normen ul { margin: 0; padding-left: 20px; font-size: 14px; color: #2c3744; }
.normen li { margin-bottom: 4px; }

.synopsis-table .syn-aspect { font-weight: 600; color: var(--navy); background: #f7f9fc; }

.casestudy { border: 1px solid #d8cdef; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.cs-title { background: linear-gradient(135deg,#3a2f63 0%,#4a3a78 100%); color: #fff; padding: 11px 18px; font-weight: 700; }
.cs-title::before { content: "📊 "; }
.cs-scenario { padding: 16px 18px 4px; }
.cs-solution { border-top: 1px dashed var(--border); }
.cs-solution > summary {
  cursor: pointer; padding: 12px 18px; font-weight: 700; color: var(--accent-dark);
  list-style: none; user-select: none;
}
.cs-solution > summary::before { content: "▸ "; }
.cs-solution[open] > summary::before { content: "▾ "; }
.cs-solution > summary:hover { background: #f4fbfb; }
.cs-solution-body { padding: 4px 18px 12px; background: #fafbfc; }

.open-q { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin-bottom: 16px; }
.open-q-text { font-weight: 600; margin: 0 0 6px; }
.open-q details > summary {
  cursor: pointer; color: var(--accent-dark); font-weight: 600; font-size: 14px;
  list-style: none; user-select: none;
}
.open-q details > summary::before { content: "▸ Musterlösung"; }
.open-q details > summary { font-size: 0; }
.open-q details > summary::before { font-size: 14px; }
.open-q details[open] > summary::before { content: "▾ Musterlösung"; }
.open-a { margin-top: 8px; padding: 11px 14px; background: #eef5fb; border-radius: 9px; font-size: 14.5px; }

.practice-box { background: #fef6ea; border: 1px solid #f3dcb6; border-radius: 12px; padding: 14px 18px; }
.practice-label { font-weight: 700; color: #8a5a00; margin-bottom: 8px; }
.practice-box ul { margin: 0; padding-left: 20px; }
.practice-box li { margin-bottom: 8px; color: #5c4a2a; }

.crossrefs { background: #f0f4f8; border-radius: 10px; padding: 12px 16px; margin: 0 0 8px; font-size: 14px; }
.crossrefs .box-label { display: inline; margin-right: 6px; }

@media print {
  details > * { display: block !important; }
  .cs-solution > summary, .open-q details > summary { font-weight: bold; }
}

/* ---------- Glossar ---------- */
.glossar-controls { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.glossar-controls input[type="search"] {
  flex: 1; min-width: 240px; padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 15px;
}
.glossar-controls input[type="search"]:focus { outline: none; border-color: var(--accent); }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--border); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.glossar-list { display: grid; gap: 14px; }
.glossar-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); }
.glossar-term { font-weight: 700; font-size: 17px; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.glossar-def { margin: 8px 0 0; color: #2c3744; }
.glossar-see { margin: 8px 0 0; font-size: 14px; color: var(--accent-dark); }
.sys-HGB { background: #eef5fb; color: #1c3d57; }
.sys-IFRS { background: #e6f7f7; color: var(--accent-dark); }
.sys-Allgemein { background: #f0f4f8; color: var(--muted); }

.steps { display: grid; gap: 12px; margin: 0 0 18px; }
.step-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: #fff;
}
.step-card .step-num {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #042; font-weight: 800;
  display: grid; place-items: center;
}
.step-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Lesefluss im Kapitel: angenehme Spaltenbreite */
.chapter-body { max-width: 820px; }

/* ---------- Kapitel-Layout mit fixem Seitenmenü ---------- */
html { scroll-behavior: smooth; }

.chapter-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}
.chapter-sidebar { position: sticky; top: 84px; align-self: start; }
.sidebar-inner {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.sidebar-title {
  margin: 6px 8px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
#chapter-nav-menu { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: block;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--navy-2);
  border-left: 3px solid transparent;
  line-height: 1.35;
}
.nav-link:hover { background: #f0f4f8; text-decoration: none; }
.nav-link.active {
  background: #e6f7f7;
  color: var(--accent-dark);
  border-left-color: var(--accent);
  font-weight: 600;
}
.section-block, #literaturhinweise { scroll-margin-top: 92px; }

@media (max-width: 900px) {
  .chapter-layout { grid-template-columns: 1fr; gap: 20px; }
  .chapter-sidebar { position: static; }
  .sidebar-inner { max-height: none; }
}

.toc {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 28px;
}
.toc h4 { margin: 0 0 10px; color: var(--navy); }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; }
.reading-time { color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 30px; }
  .nav .brand .title-sm small { display: none; }
}
