/* ── CSS-Variablen ─────────────────────────────────────────── */
:root {
  --c-bg:           #f8f9fb;
  --c-surface:      #ffffff;
  --c-border:       #dde1e8;
  --c-border-light: #eceef2;
  --c-hero-bg:      #1e2942;
  --c-hero-text:    #e8ecf4;
  --c-primary:      #2d5fa8;
  --c-primary-dark: #1e4080;
  --c-accent:       #2a7d5a;
  --c-caution:      #8a4a1a;
  --c-caution-bg:   #fdf3ec;
  --c-info-bg:      #eef4ff;
  --c-text:         #1c2333;
  --c-text-muted:   #5f6a7d;
  --c-text-light:   #8a94a6;
  --c-chip-bg:      rgba(255,255,255,0.14);
  --c-chip-border:  rgba(255,255,255,0.28);
  --c-phase-1:      #eef4ff;
  --c-phase-2:      #eefaf4;
  --c-phase-3:      #fdf6ee;
  --c-phase-4:      #f5eeff;
  --c-phase-5:      #ffeef0;
  --c-phase-6:      #eef9ff;
  --radius:         6px;
  --radius-lg:      10px;
  --shadow:         0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:      0 2px 10px rgba(0,0,0,0.10);
  --max-w:          860px;
  --font:           system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); line-height: 1.65; }
h1, h2, h3, h4 { line-height: 1.25; }
h2 { font-size: 1.45rem; font-weight: 700; color: var(--c-text); margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--c-text); margin-bottom: 0.35rem; }
p  { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }
a  { color: var(--c-primary); }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.25rem; }
strong { font-weight: 600; }

/* ── Layout ────────────────────────────────────────────────── */
.wrapper { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3rem 0; border-bottom: 1px solid var(--c-border-light); }
.section:last-child { border-bottom: none; }
.section-label {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-text-muted); margin-bottom: 0.6rem;
}
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--c-text); }

/* ── Navigation Bar ────────────────────────────────────────── */
.nav-bar {
  background: var(--c-hero-bg);
  padding: 0.65rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.nav-bar .wrapper { display: flex; align-items: center; gap: 1.5rem; }
.nav-logo {
  font-size: 0.92rem; font-weight: 800; color: #ffffff;
  text-decoration: none; white-space: nowrap; letter-spacing: 0.02em;
}
.nav-logo span { color: rgba(255,255,255,0.45); font-weight: 400; margin-left: 0.3rem; }
.nav-links { display: flex; gap: 0.2rem; list-style: none; padding: 0; margin: 0; }
.nav-links a {
  color: rgba(255,255,255,0.65); text-decoration: none;
  font-size: 0.85rem; padding: 0.3rem 0.75rem;
  border-radius: var(--radius); transition: background 0.12s, color 0.12s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.12); font-weight: 600; }

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.8rem; color: var(--c-text-muted);
  margin-bottom: 1.8rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #b0bac8; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--c-primary); color: #fff; text-decoration: none;
  padding: 0.8rem 1.6rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; margin-top: 0.5rem;
  transition: background 0.15s; border: none; cursor: pointer;
}
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--c-surface); color: var(--c-text); text-decoration: none;
  padding: 0.75rem 1.4rem; border-radius: var(--radius);
  font-weight: 500; font-size: 0.9rem; margin-top: 0.5rem;
  border: 1px solid var(--c-border); box-shadow: var(--shadow);
  transition: background 0.12s; cursor: pointer;
}
.btn-secondary:hover { background: var(--c-info-bg); border-color: #c0d4f0; }

/* ── Chapter page nav (Prev / Next) ───────────────────────── */
.chapter-page-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 0; border-top: 1px solid var(--c-border-light);
  margin-top: 2.5rem; gap: 1rem; flex-wrap: wrap;
}
.btn-nav {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 0.55rem 1.1rem;
  font-size: 0.85rem; color: var(--c-text); text-decoration: none;
  box-shadow: var(--shadow); transition: background 0.12s;
}
.btn-nav:hover { background: var(--c-info-bg); border-color: #c0d4f0; }
.btn-nav.disabled { opacity: 0.35; pointer-events: none; }
.btn-nav-back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--c-text-muted); text-decoration: none;
}
.btn-nav-back:hover { color: var(--c-primary); }


/* ── Hero ──────────────────────────────────────────────────── */
.hero { background: var(--c-hero-bg); color: var(--c-hero-text); padding: 3.5rem 0 3rem; }
.hero-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2.1rem; font-weight: 800; color: #ffffff;
  margin-bottom: 0.6rem; line-height: 1.2;
}
.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.78); margin-bottom: 1.4rem; font-weight: 400; }
.hero-desc {
  font-size: 0.97rem; color: rgba(255,255,255,0.65);
  max-width: 600px; margin-bottom: 1.8rem; line-height: 1.7;
}
.hero-open-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(45,90,168,0.35); border: 1px solid rgba(45,90,168,0.6);
  border-radius: 20px; padding: 0.35rem 0.9rem;
  font-size: 0.85rem; color: #c4d8f8; margin-bottom: 1.6rem;
}
.hero-open-badge::before { content: "✓"; font-weight: 700; color: #7ec8a0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.chip {
  background: var(--c-chip-bg); border: 1px solid var(--c-chip-border);
  border-radius: 20px; padding: 0.28rem 0.85rem;
  font-size: 0.8rem; color: rgba(255,255,255,0.75);
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

/* ── Page header (non-hero) ────────────────────────────────── */
.page-header {
  background: var(--c-hero-bg); color: var(--c-hero-text);
  padding: 2.2rem 0 2rem;
}
.page-header .page-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0.5rem; display: block;
}
.page-header h1 { font-size: 1.7rem; font-weight: 800; color: #fff; margin-bottom: 0.4rem; }
.page-header p { font-size: 0.95rem; color: rgba(255,255,255,0.65); margin: 0; }

/* ── Chapter header ────────────────────────────────────────── */
.chapter-header {
  background: none; padding: 2.2rem 0 2rem;
  border-bottom: 1px solid var(--c-border);
}
.chapter-header .wrapper { display: flex; align-items: flex-start; gap: 1.2rem; }
.chapter-header-num {
  font-size: 1.1rem; font-weight: 800; color: #fff;
  background: var(--c-primary); border: none;
  border-radius: var(--radius); padding: 0.3rem 0.7rem;
  white-space: nowrap; flex-shrink: 0; margin-top: 0.2rem;
}
.chapter-header-body { flex: 1; }
.chapter-header h1 { font-size: 1.55rem; font-weight: 800; color: var(--c-text); margin-bottom: 0.3rem; }
.chapter-header .chapter-benefit { font-size: 0.92rem; color: var(--c-text-muted); }

/* ── Karten ────────────────────────────────────────────────── */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.cards-2col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards-3col { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 1.2rem 1.4rem; box-shadow: var(--shadow);
}
.card-icon { font-size: 1.4rem; margin-bottom: 0.6rem; }
.card h3 { font-size: 0.98rem; margin-bottom: 0.4rem; }
.card p  { font-size: 0.9rem; color: var(--c-text-muted); margin-bottom: 0; }
.card ul { font-size: 0.9rem; color: var(--c-text-muted); padding-left: 1.2rem; }
.card li { margin-bottom: 0.2rem; }
.card--accent  { border-left: 3px solid var(--c-primary); background: var(--c-info-bg); }
.card--positive { border-left: 3px solid var(--c-accent); background: #eef8f3; }
.card--caution  { border-left: 3px solid #c07040; background: var(--c-caution-bg); }

/* ── Infoboxen ─────────────────────────────────────────────── */
.infobox { border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0; font-size: 0.9rem; }
.infobox--info    { background: var(--c-info-bg); border: 1px solid #c0d4f0; color: #1e3a6a; }
.infobox--caution { background: var(--c-caution-bg); border: 1px solid #d9a07a; color: var(--c-caution); }
.infobox--positive { background: #eef8f3; border: 1px solid #8ac8a8; color: #1e5438; }
.infobox-label {
  font-weight: 700; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.06em; display: block; margin-bottom: 0.35rem;
}

/* ── Tabellen ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; margin-top: 1rem;
  border-radius: var(--radius-lg); border: 1px solid var(--c-border); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: var(--c-surface); }
thead tr { background: var(--c-hero-bg); }
thead th {
  color: rgba(255,255,255,0.85); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; padding: 0.75rem 1rem; text-align: left;
}
tbody tr { border-bottom: 1px solid var(--c-border-light); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafbfc; }
td { padding: 0.7rem 1rem; vertical-align: top; line-height: 1.5; overflow-wrap: break-word; }
td strong { color: var(--c-text); }
td .caution-note {
  display: inline-block; font-size: 0.8rem; color: var(--c-caution);
  background: var(--c-caution-bg); border-radius: 3px; padding: 0.1rem 0.4rem;
}

/* ── Kapitel-Nutzen-Zeile ──────────────────────────────────── */
.chapter-benefit {
  display: inline-block; font-size: 0.78rem;
  color: var(--c-accent); font-weight: 600; margin-top: 0.15rem;
}

/* ── Kapitel-Nummerierung ──────────────────────────────────── */
.chapter-num {
  font-size: 0.8rem; font-weight: 700; color: var(--c-primary);
  background: var(--c-info-bg); border: 1px solid #c0d4f0;
  border-radius: var(--radius); padding: 0.2rem 0.4rem;
  text-align: center; line-height: 1.6; margin-top: 0.1rem;
}

/* ── Materialien ───────────────────────────────────────────── */
.material-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.75rem; margin-top: 1rem;
}
.material-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.material-card .mat-icon { font-size: 1.3rem; margin-bottom: 0.4rem; }
.material-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; }
.material-card p  { font-size: 0.82rem; color: var(--c-text-muted); margin: 0; }
.material-card.optional { opacity: 0.75; border-style: dashed; }

/* ── Nicht enthalten ───────────────────────────────────────── */
.not-list {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem; margin-top: 1rem;
}
.not-list li {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.9rem; color: var(--c-text-muted);
  background: var(--c-surface); border: 1px solid var(--c-border-light);
  border-radius: var(--radius); padding: 0.55rem 0.85rem;
}
.not-list li::before { content: "—"; color: #b0bac8; font-weight: 700; flex-shrink: 0; }

/* ── MVP 3-Spalten ─────────────────────────────────────────── */
.mvp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.mvp-col {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
}
.mvp-col h3 {
  font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.8rem;
  padding-bottom: 0.5rem; border-bottom: 2px solid var(--c-border-light);
}
.mvp-col.mvp-yes   h3 { color: var(--c-accent); border-color: #8ac8a8; }
.mvp-col.mvp-no    h3 { color: #9a6030; border-color: #d9a07a; }
.mvp-col.mvp-later h3 { color: var(--c-primary); border-color: #a0bce0; }
.mvp-col ul { font-size: 0.88rem; padding-left: 1.2rem; }
.mvp-col li { color: var(--c-text-muted); margin-bottom: 0.3rem; }

/* ── Roadmap ───────────────────────────────────────────────── */
.roadmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.phase-card { border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; border: 1px solid var(--c-border); box-shadow: var(--shadow); }
.phase-card:nth-child(1) { background: var(--c-phase-1); }
.phase-card:nth-child(2) { background: var(--c-phase-2); }
.phase-card:nth-child(3) { background: var(--c-phase-3); }
.phase-card:nth-child(4) { background: var(--c-phase-4); }
.phase-card:nth-child(5) { background: var(--c-phase-5); }
.phase-card:nth-child(6) { background: var(--c-phase-6); }
.phase-num { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-muted); margin-bottom: 0.3rem; }
.phase-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.phase-card p  { font-size: 0.86rem; color: var(--c-text-muted); margin: 0; }
.phase-status {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 20px; margin-top: 0.6rem;
}
.status-active { background: #d4ece3; color: #1e5438; }
.status-open   { background: #e8ecf2; color: #4a5568; }

/* ── Versprechen ───────────────────────────────────────────── */
.promise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.promise-item {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 1rem 1.1rem;
  display: flex; align-items: flex-start; gap: 0.7rem; box-shadow: var(--shadow);
}
.promise-check { font-size: 1.1rem; color: var(--c-accent); line-height: 1.4; flex-shrink: 0; }
.promise-item p { font-size: 0.9rem; margin: 0; }

/* ── Offline-Tabelle ───────────────────────────────────────── */
.offline-table td:first-child { font-weight: 600; color: var(--c-text); }
.offline-table td:last-child  { color: var(--c-text-muted); }

/* ── Hinweis-Leiste ────────────────────────────────────────── */
.disclaimer-section { background: #f5f5f5; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); padding: 2rem 0; }
.disclaimer-section p { font-size: 0.88rem; color: var(--c-text-muted); }

/* ── Footer ────────────────────────────────────────────────── */
.footer-section { background: var(--c-hero-bg); color: var(--c-hero-text); padding: 2.5rem 0 3rem; }
.footer-section h2 { color: #ffffff; font-size: 1.3rem; margin-bottom: 0.6rem; }
.footer-section p  { color: rgba(255,255,255,0.65); font-size: 0.92rem; }
.footer-features { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.footer-tag {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; padding: 0.3rem 0.8rem;
  font-size: 0.84rem; color: rgba(255,255,255,0.75);
}
.footer-nav { display: flex; gap: 1.2rem; margin-top: 1.2rem; flex-wrap: wrap; }
.footer-nav a { color: rgba(255,255,255,0.55); font-size: 0.85rem; text-decoration: none; }
.footer-nav a:hover { color: rgba(255,255,255,0.9); }

/* ── Preview-Hinweis ───────────────────────────────────────── */
.preview-notice {
  background: #fffbe6; border-bottom: 2px solid #e6c840;
  padding: 0.55rem 1.25rem; font-size: 0.8rem; color: #6b5500; text-align: center;
}

/* ── Zonen-Trennbanner ─────────────────────────────────────── */
.zone-banner { border-top: 2px solid; border-bottom: 2px solid; padding: 0.7rem 0; }
.zone-banner .wrapper { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.zone-banner--product { background: #f0f2f5; border-color: var(--c-border); }
.zone-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 0.18rem 0.75rem; border-radius: 20px; white-space: nowrap;
}
.zone-banner--product .zone-tag { background: var(--c-text-muted); color: #fff; }
.zone-title { font-size: 0.92rem; font-weight: 700; color: var(--c-text); }
.zone-note { font-size: 0.82rem; color: var(--c-text-muted); margin-left: auto; }




/* ── Kapitel-Farben ────────────────────────────────────────── */
.cap-01  { --cap-color: #2563eb; } /* Blau       – Was ist KI?              */
.cap-02  { --cap-color: #0891b2; } /* Cyan       – KI-Werkzeuge             */
.cap-03  { --cap-color: #059669; } /* Smaragd    – Was KI gut kann          */
.cap-04  { --cap-color: #c2410c; } /* Terrakotta – Was KI nicht kann        */
.cap-05  { --cap-color: #dc2626; } /* Rot        – Sichere Nutzung          */
.cap-06  { --cap-color: #7c3aed; } /* Violett    – Datenschutz              */
.cap-07  { --cap-color: #b91c1c; } /* Dunkelrot  – Scamming & Selbstverteidigung */
.cap-08  { --cap-color: #be185d; } /* Pink       – Prompt-Formel            */
.cap-09  { --cap-color: #ea580c; } /* Orange     – Texte und E-Mails        */
.cap-10  { --cap-color: #0f766e; } /* Petrol     – Zusammenfassen           */
.cap-11  { --cap-color: #65a30d; } /* Gelbgrün   – Alltagshilfe             */
.cap-12  { --cap-color: #4338ca; } /* Indigo     – Teams & Selbstständige   */
.cap-13  { --cap-color: #d97706; } /* Amber      – 7-Tage-Plan              */
.cap-14  { --cap-color: #1e40af; } /* Dunkelblau – GitHub & Copilot         */
.cap-15  { --cap-color: #0369a1; } /* VS-Code-Blau – IDEs & VS Code         */
.cap-16  { --cap-color: #475569; } /* Schiefer   – Glossar                  */
.cap-anhang { --cap-color: #1e3a8a; } /* Marineblau – Anhang               */


/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .nav-bar, .preview-notice, .chapter-page-nav { display: none; }
  .hero, .page-header, .chapter-header { background: #1e2942 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section { padding: 1.5rem 0; }
  .card, .material-card, .phase-card, .mvp-col, .promise-item { break-inside: avoid; box-shadow: none; }
  .table-wrap { overflow: visible; }
  body { font-size: 14px; }
  .wrapper { max-width: 100%; padding: 0 1rem; }
}

/* ── Iframe-Einbettung: Chrome ausblenden ──────────────────── */
html.in-iframe .nav-bar,
html.in-iframe .preview-notice,
html.in-iframe .footer-section,
html.in-iframe .breadcrumb,
html.in-iframe .btn-nav-back,
html.in-iframe .chapter-page-nav,
html.in-iframe .chapter-header { display: none !important; }
html.in-iframe body { padding-top: 0 !important; }
html.in-iframe .page-header { margin-top: 0 !important; }

/* ── Rail-Tooltip (Portal, position:fixed) ─────────────────── */
#rail-tp {
  display: none; position: fixed; z-index: 1000;
  width: 290px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--cap-color, var(--c-primary));
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  pointer-events: none;
}
.tp-benefit {
  display: block; font-size: 0.77rem; font-weight: 600;
  color: var(--cap-color, var(--c-primary));
  margin-bottom: 0.4rem;
}
.tp-desc {
  font-size: 0.8rem; color: var(--c-text-muted); line-height: 1.5;
  margin: 0 0 0.55rem;
}
.tp-learns {
  margin: 0; padding-left: 1rem; list-style: disc;
  font-size: 0.78rem; color: var(--c-text); line-height: 1.55;
}
.tp-learns li { margin-bottom: 0.1rem; }

/* ── Split-Layout (kurs.html) ──────────────────────────────── */
body.kurs-split-page {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}
/* Keine äußere Nav auf kurs-split-page – Iframe-interne wird per JS ausgeblendet */
body.kurs-split-page .nav-bar,
body.kurs-split-page .chapter-title-bar { flex-shrink: 0; }

/* ── Kapitel-Titelleiste ───────────────────────────────────── */
.chapter-title-bar {
  display: flex; align-items: center; justify-content: center; gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  background: var(--c-surface);
  border-bottom: 2px solid var(--c-border);
}
.ctb-num {
  font-size: 1.1rem; font-weight: 800; color: #fff;
  background: var(--cap-color, var(--c-primary));
  border-radius: var(--radius); padding: 0.3rem 0.7rem;
  white-space: nowrap; flex-shrink: 0;
}
.ctb-title {
  font-size: 1.55rem; font-weight: 800; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.split-layout {
  display: flex; flex: 1; overflow: hidden;
}

/* Linke Kapitelleiste */
.chapter-rail {
  width: 250px; min-width: 180px; flex-shrink: 0;
  overflow-y: auto;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  padding: 0 0.35rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.rail-header {
  position: sticky; top: 0; z-index: 1;
  background: var(--c-surface);
  padding: 0.7rem 0.6rem 0.45rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 0.35rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.rail-header-title {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--c-text-muted);
}
.rail-header-count { font-size: 0.62rem; color: var(--c-text-muted); }

.rail-item {
  display: flex; align-items: flex-start; gap: 0.45rem;
  padding: 0.48rem 0.6rem;
  border-radius: 6px; margin-bottom: 1px;
  text-decoration: none; color: inherit;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.rail-item:hover {
  background: #f0f4ff;
  border-left-color: var(--cap-color, var(--c-primary));
  text-decoration: none;
}
.rail-item.active {
  background: var(--c-info-bg, #eef4ff);
  border-left-color: var(--cap-color, var(--c-primary));
}
.rail-num {
  font-size: 0.66rem; font-weight: 800; color: #fff;
  background: var(--cap-color, var(--c-primary));
  border-radius: 4px; padding: 0.12rem 0.38rem;
  flex-shrink: 0; margin-top: 2px; white-space: nowrap;
  align-self: flex-start;
}
.rail-title {
  font-size: 0.79rem; font-weight: 600; line-height: 1.35;
  color: inherit;
}

/* Rechter Inhaltsbereich */
.chapter-pane { flex: 1; overflow: hidden; }
#chapter-frame {
  width: 100%; height: 100%; border: none; display: block;
  opacity: 1;
  transition: opacity 0.22s ease;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.55rem; }
  .section-title { font-size: 1.25rem; }
  .cards { grid-template-columns: 1fr; }
  .mvp-grid { grid-template-columns: 1fr; }
  .not-list { grid-template-columns: 1fr; }
  thead th { font-size: 0.75rem; padding: 0.6rem 0.75rem; }
  td { padding: 0.6rem 0.75rem; }
  .zone-note { display: none; }
  .chapter-page-nav { flex-direction: column; align-items: flex-start; }
  .nav-links { display: none; }
  /* Split-Layout: Rail verstecken auf kleinen Screens */
  .chapter-rail { display: none; }
  #chapter-frame { height: calc(100vh - 80px); }
}
