:root {
  --bg: #0f1720;
  --surface: #17212c;
  --surface-2: #1e2a37;
  --border: #4a6278;
  --text: #e8eef4;
  --text-muted: #aab9c7;
  --accent: #4fa3e0;
  --accent-2: #2569a8;
  --green: #3fb27f;
  --yellow: #d9a441;
  --orange: #d97a41;
  --red: #e2726d;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

.app-footer {
  max-width: 720px;
  margin: 24px auto 40px;
  padding: 0 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* Während einer aktiven Lernkarte ausgeblendet (siehe routeTo() in js/app.js) —
   schafft zusätzlichen Platz, ohne den Hinweis auf allen anderen Seiten zu verlieren. */
body.learn-active .app-footer { display: none; }

.storage-warning {
  background: var(--red);
  color: white;
  padding: 10px 16px;
  font-size: 0.85rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 11;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.navlinks { display: flex; flex-wrap: wrap; gap: 6px; }

.navlink {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink.active { background: var(--accent-2); color: white; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.container.narrow { max-width: 640px; }

h1 { font-size: 1.6rem; margin-bottom: 8px; }
h2 { font-size: 1.2rem; margin-top: 32px; margin-bottom: 12px; }

.muted { color: var(--text-muted); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.cta-row { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { filter: brightness(1.15); }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: white; }
.btn-secondary { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* Verhindert horizontales Überlaufen der Seite: die Tabelle scrollt in ihrem
   eigenen Rahmen, statt Spalten am rechten Rand abzuschneiden (v.a. Handy). */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 8px; }
.module-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.module-table th, .module-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.module-table th { color: var(--text-muted); font-weight: 600; }
.row-actions { white-space: nowrap; }

.part-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 6px;
}

.bar { background: var(--surface-2); border-radius: 6px; height: 8px; overflow: hidden; width: 100px; display: inline-block; vertical-align: middle; }
.bar-fill { background: var(--green); height: 100%; }
.bar-label { margin-left: 8px; font-size: 0.82rem; color: var(--text-muted); }

label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: var(--text-muted); }
select, input[type="text"] {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.drug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.drug-item {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.drug-item:hover { background: var(--surface-2); border-color: var(--accent); }
.drug-item--learned { border-color: var(--green); }
.learned-check { color: var(--green); font-weight: 700; }

.guideline-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}
.guideline-group--learned { border-color: var(--green); }
.guideline-group h2 { margin: 0 0 10px; font-size: 1rem; }
.guideline-group .guideline-grid { margin-top: 12px; }

.flashcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 1.15rem;
  margin-top: 16px;
}

/* Karten wachsen mit dem Inhalt und die Seite scrollt normal — keine
   verschachtelte Scrollbox, damit nie Inhalt "versteckt" abgeschnitten wirkt. */

.flashcard-back {
  border-top: 1px dashed var(--border);
  margin-top: 20px;
  padding-top: 20px;
  color: var(--text);
  text-align: left;
  white-space: pre-line;
  font-size: 0.92rem;
  line-height: 1.6;
}

.flashcard-back strong { color: var(--accent); }
.hidden { display: none; }

/* Steckbrief-Layout (Medikamentenkarten): links ausgerichtet, breiter, kein Fließtext */
.flashcard-profile {
  text-align: left;
  align-items: stretch;
  max-width: 100%;
}

.flashcard-back.profile-back {
  white-space: normal;
  font-size: 1rem;
}

.db-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 4px 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.db-row:last-child { border-bottom: none; }

.db-label {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-top: 2px;
}

.db-value {
  font-size: 0.93rem;
  line-height: 1.55;
}

.db-row--mechanism {
  background: rgba(79, 163, 224, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border-bottom: none;
}
.db-row--mechanism .db-label { color: var(--accent); }

.db-row--warning {
  border-left: 3px solid var(--red);
  padding-left: 10px;
  background: rgba(226, 114, 109, 0.1);
  border-radius: 0 8px 8px 0;
  border-bottom: none;
  margin-bottom: 2px;
}
.db-row--warning .db-label { color: var(--red); }

.db-row--antidote {
  border-left: 3px solid var(--green);
  padding-left: 10px;
  background: rgba(63, 178, 127, 0.08);
  border-radius: 0 8px 8px 0;
  border-bottom: none;
  margin-bottom: 2px;
}
.db-row--antidote .db-label { color: var(--green); }

.db-row--source {
  padding-top: 12px;
}
.db-row--source .db-value { font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 640px) {
  .db-row { grid-template-columns: 1fr; gap: 2px; }
  .db-label { padding-top: 6px; }
}

@media (max-width: 480px) {
  .topnav { padding: 12px 16px; }
  .navlink { padding: 6px 9px; font-size: 0.85rem; }
  .navlinks { gap: 2px; }
}

/* Begriff markieren & nachschlagen: jedes Wort in einem .lookup-source-Text ist
   einzeln antippbar/klickbar (zuverlässiger als Text-Selektion auf dem Handy). */
.lookup-word {
  cursor: pointer;
  border-radius: 3px;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, color 0.15s;
}
.lookup-word:hover { background: rgba(79, 163, 224, 0.25); }
.lookup-word-active { background: var(--accent-2) !important; color: white; }

.lookup-confirm {
  position: fixed;
  z-index: 150;
  background: var(--accent-2);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-width: min(260px, calc(100vw - 16px));
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.lookup-confirm:hover { filter: brightness(1.1); }
.lookup-confirm-sub { font-size: 0.75rem; opacity: 0.85; font-weight: 400; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-width: 90vw;
  text-align: center;
}

.gap-list { list-style: none; padding: 0; margin: 8px 0 0; }
.gap-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.gap-item .gap-source { color: var(--text-muted); font-size: 0.78rem; }

.module-details summary { cursor: pointer; list-style: none; }
.module-details summary::-webkit-details-marker { display: none; }
.module-details summary h2 { display: inline-block; margin: 0; }
.module-details summary h2::before { content: "▾ "; color: var(--text-muted); }
.module-details:not([open]) summary h2::before { content: "▸ "; }

.lookup-hint { margin-top: 18px; font-size: 0.8rem; }

/* Kompakte Navigation während einer aktiven Lernkarte (siehe nav(route, compact)):
   nur Marke + Beenden-Link statt aller 12 Reiter, damit Karte und Bewertungs-Buttons
   möglichst ohne Scrollen auf den Bildschirm passen. */
.topnav-compact { padding: 10px 16px; justify-content: flex-start; gap: 14px; }
.nav-exit-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.nav-exit-link:hover { background: var(--surface-2); color: var(--text); }

/* Sofort-Vorschau: zeigt den gefundenen Lerninhalt direkt an, statt nur die
   Warteschlange umzusortieren — der Wissensdurst wird sofort gestillt. */
.lookup-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lookup-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}

.lookup-modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.lookup-modal-close:hover { color: var(--text); }

.lookup-modal-front {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-right: 28px;
}

.modal-plain-back {
  white-space: pre-line;
  line-height: 1.6;
  font-size: 0.95rem;
}

.lookup-modal-hint { margin-top: 18px; font-size: 0.8rem; }

.onboarding-modal { text-align: center; }
.onboarding-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.onboarding-modal h2 { margin: 4px 0 10px; }
.onboarding-modal p { line-height: 1.6; color: var(--text-muted); }
.onboarding-dots { display: flex; justify-content: center; gap: 6px; margin: 18px 0 6px; }
.onboarding-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: inline-block; }
.onboarding-dot--active { background: var(--accent); }
.onboarding-actions { justify-content: space-between; }

.session-progress { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 4px; }
.exam-timer { float: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.exam-timer-warn { color: var(--red); }

.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.rating-row button { padding: 12px 4px; }
.rating-again { border-color: var(--red); color: var(--red); }
.rating-hard { border-color: var(--orange); color: var(--orange); }
.rating-good { border-color: var(--green); color: var(--green); }
.rating-easy { border-color: var(--accent); color: var(--accent); }

.confidence-row button kbd, .rating-row button kbd {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 0.75rem;
  font-family: inherit;
  margin-right: 4px;
  opacity: 0.75;
}
.step-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; margin: 18px 0 6px; }
.confidence-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.confidence-row button { padding: 12px 4px; font-size: 0.9rem; }
.confidence-sicher { border-color: var(--green); color: var(--green); }
.confidence-unsicher { border-color: var(--orange); color: var(--orange); }
.confidence-keine { border-color: var(--red); color: var(--red); }

.question-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 12px;
}

.question-text { font-size: 1.05rem; margin-bottom: 16px; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.option-row:hover { background: var(--surface-2); }
.option-row input { accent-color: var(--accent); }
.option-row.option-correct { border-color: var(--green); background: rgba(63, 178, 127, 0.1); }
.option-row.option-wrong-selected { border-color: var(--red); background: rgba(226, 114, 109, 0.12); }
.option-row.option-wrong-disabled { opacity: 0.6; }

/* Algorithmen: Übersichtskarten, Nachlese-Timeline und Trainer-Fortschritt */
.algo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 8px; }
.algo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.algo-card-title { font-weight: 600; margin-bottom: 4px; }
.algo-card-meta { font-size: 0.8rem; margin-bottom: 12px; }

.back-link { display: inline-block; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; margin-bottom: 10px; }
.back-link:hover { color: var(--text); }

.algo-timeline { list-style: none; padding: 0; margin: 16px 0; counter-reset: none; }
.algo-step {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
  line-height: 1.5;
}
.algo-step:last-child { border-bottom: none; }
.algo-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.algo-step.done .algo-step-num { background: rgba(63, 178, 127, 0.2); color: var(--green); }
.algo-question { font-size: 1rem; font-weight: 600; margin: 10px 0 14px; }

.algo-flowchart { margin: 16px 0; display: flex; justify-content: center; }
.algo-flowchart svg { width: 100%; max-width: 340px; height: auto; display: block; }
.flow-box { stroke-width: 1.5; }
.flow-box-action { fill: var(--surface-2); stroke: var(--accent); }
.flow-box-decision { fill: var(--surface-2); stroke: var(--orange); }
.flow-box-current { fill: var(--surface); stroke: var(--text-muted); stroke-dasharray: 4 3; }
.flow-text-current { font-weight: 700; fill: var(--text-muted); }
.flow-text { fill: var(--text); font-size: 12px; font-family: inherit; }
.flow-arrow-line { stroke: var(--text-muted); stroke-width: 1.5; }
.flow-arrow-head { fill: var(--text-muted); }

@media (max-width: 640px) {
  .algo-grid { grid-template-columns: 1fr; }
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 16px 0;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.wrong-answer { color: var(--red); font-size: 0.9rem; }
.correct-answer { color: var(--green); font-size: 0.9rem; }
.explanation { color: var(--text-muted); font-size: 0.88rem; margin-top: 8px; }

.progress-module { margin-bottom: 14px; }
.progress-module-title { font-size: 0.9rem; margin-bottom: 6px; }
.progress-module .bar { width: 100%; height: 10px; }

/* Box-Verteilung (Neu/Lernend/Jung/Reif) statt einer einzelnen Mastery-Zahl */
.box-dist-key { font-size: 0.82rem; margin-bottom: 14px; }
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 5px 0 12px; }
.key-dot:first-child { margin-left: 0; }
.key-dot--neu { background: var(--border); }
.key-dot--lernend { background: var(--red); }
.key-dot--jung { background: var(--orange); }
.key-dot--reif { background: var(--green); }

.box-dist-bar { display: flex; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.box-seg { height: 100%; }
.box-seg--neu { background: var(--border); }
.box-seg--lernend { background: var(--red); }
.box-seg--jung { background: var(--orange); }
.box-seg--reif { background: var(--green); }
.box-dist-legend { font-size: 0.78rem; margin-top: 4px; }

/* 7-Tage-Fälligkeitsvorschau */
.forecast-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
  margin: 16px 0 24px;
  padding: 0 4px;
}
.forecast-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.forecast-bar {
  width: 100%;
  max-width: 40px;
  background: var(--accent-2);
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 4px;
}
.forecast-count { font-size: 0.72rem; color: white; margin-top: 2px; }
.forecast-label { font-size: 0.72rem; margin-top: 6px; text-align: center; }

@media (max-width: 640px) {
  .container { padding: 16px; }
  .rating-row { grid-template-columns: repeat(2, 1fr); }
  .confidence-row { grid-template-columns: 1fr; }

  /* Mehr von der Karte sichtbar ohne Scrollen: Lernkarte und Abstände auf dem
     Handy spürbar enger takten als auf dem Desktop, wo der Platz kein Problem ist. */
  .flashcard { padding: 18px 16px; min-height: 0; margin-top: 10px; }
  .flashcard-back { margin-top: 14px; padding-top: 14px; }
  .step-label { margin: 10px 0 5px; }
  .cta-row { margin: 10px 0; }
  .rating-row { margin-top: 10px; }
  .rating-row button, .confidence-row button { padding: 10px 4px; }

  /* Tabellen werden auf dem Handy zu gestapelten Karten statt horizontal zu
     scrollen — sonst wirkt rechts immer etwas "abgeschnitten". */
  .table-scroll { overflow-x: visible; }
  .module-table { min-width: 0; width: 100%; border-collapse: separate; border-spacing: 0; }
  .module-table thead { display: none; }
  .module-table, .module-table tbody, .module-table tr, .module-table td { display: block; width: 100%; }
  .module-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 4px 12px;
    background: var(--surface);
  }
  .module-table td {
    border-bottom: none;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
  }
  .module-table td:not(:last-child) { border-bottom: 1px dashed var(--border); }
  .module-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }
  .module-table td[data-label="Modul"] { flex-direction: column; align-items: flex-start; gap: 2px; }
  .module-table td[data-label="Modul"]::before { display: none; }
  .row-actions { justify-content: flex-end; }

  /* Referenztabellen (Vergleichstabellen) haben deutlich längere Zellinhalte als
     die Modul-Übersicht — nebeneinander (Label links, Wert rechts) sprengt dann
     die Zeile. Gestapeltes Layout (Label über Wert) gibt beiden die volle Breite. */
  .ref-table td {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
  }
  .ref-table td::before { flex-shrink: 1; }
  .ref-table td { overflow-wrap: break-word; word-break: break-word; }
}

/* Spezialwissen: vertiefte Organkapitel (Lesemodus) */
.sw-organ-card { margin-bottom: 14px; }
.sw-organ-stats { font-size: 0.85rem; margin: 0 0 10px; }
.sw-chapter h1 { margin-top: 6px; }
.sw-body p, .sw-list li { overflow-wrap: break-word; }
.sw-body p { margin: 0 0 12px; }
.sw-subhead { font-size: 1.02rem; margin: 22px 0 8px; color: var(--accent); }
.sw-h2 { font-size: 1.1rem; margin: 26px 0 10px; }
.sw-list { padding-left: 20px; margin: 0 0 12px; }
.sw-list li { margin-bottom: 6px; }
.sw-box { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px; margin: 16px 0; background: var(--surface); }
.sw-box p { margin: 0; }
.sw-box .sw-list { margin-bottom: 0; }
.sw-box-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.sw-leitfrage { border-left-color: var(--accent); }
.sw-merke { border-left-color: var(--green); }
.sw-klinik { border-left-color: var(--orange); }
.sw-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 4px 0 14px; }
.sw-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.sw-table th, .sw-table td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--border); overflow-wrap: break-word; }
.sw-table th { color: var(--text-muted); font-weight: 600; }
.sw-warum { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; background: var(--surface); }
.sw-warum summary { cursor: pointer; font-weight: 600; }
.sw-warum p { margin: 10px 0 0; }
.sw-hint { font-weight: 400; color: var(--text-muted); font-size: 0.82rem; }
.sw-test-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; }
.sw-test-q { margin: 0 0 8px; }
.sw-test-a { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); }
.sw-actions, .sw-nav { margin-top: 18px; flex-wrap: wrap; }
.sw-nav .btn { white-space: normal; text-align: left; }
.sw-level { display: inline-block; font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); vertical-align: middle; }
.sw-level-zelle { border-color: var(--accent); color: var(--accent); }
.sw-level-gewebe { border-color: var(--green); color: var(--green); }
.sw-level-organ { border-color: var(--yellow); color: var(--yellow); }
.sw-level-system { border-color: var(--orange); color: var(--orange); }
.sw-level-klinik { border-color: var(--red); color: var(--red); }
.sw-toc { list-style: none; padding: 0; margin: 16px 0; }
.sw-toc li { margin-bottom: 8px; }
.sw-read { color: var(--green); font-weight: 700; }
.sw-method { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.sw-method summary { cursor: pointer; }
.sw-sources { padding-left: 18px; font-size: 0.8rem; color: var(--text-muted); }
.sw-sources li { margin-bottom: 4px; overflow-wrap: break-word; }
.sw-small { font-size: 0.8rem; margin: 8px 0 4px; }
.sw-fig { margin: 18px 0; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.sw-fig svg { width: 100%; height: auto; display: block; }
.sw-fig figcaption { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
.sw-fig .ax { stroke: var(--text-muted); stroke-width: 1.2; fill: none; }
.sw-fig .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.sw-fig .c1 { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.sw-fig .c2 { stroke: var(--green); stroke-width: 2.5; fill: none; }
.sw-fig .dash { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 6 4; fill: none; }
.sw-fig .dot { stroke: var(--yellow); stroke-width: 1.5; stroke-dasharray: 2 3; fill: none; }
.sw-fig .pt { fill: var(--text); }
.sw-fig .ar { stroke: var(--text-muted); stroke-width: 1.5; fill: none; }
.sw-fig .t-h { fill: var(--text); font-size: 12px; font-weight: 600; }
.sw-fig .t-s { fill: var(--text-muted); font-size: 10px; }
.sw-fig .t-n { fill: var(--text-muted); font-size: 9px; font-style: italic; }
.sw-fig .t-l { fill: var(--text); font-size: 11px; font-weight: 600; }
.sw-fig .b1 { fill: var(--accent); }
.sw-fig .b2 { fill: var(--green); }
.sw-fig .b3 { fill: var(--orange); }
.sw-fig .s0, .sw-fig .s1, .sw-fig .s2, .sw-fig .s3, .sw-fig .s4, .sw-fig .s5 { fill: var(--surface); stroke-width: 1.5; }
.sw-fig .s0 { stroke: var(--text-muted); }
.sw-fig .s1 { stroke: var(--accent); }
.sw-fig .s2 { stroke: var(--green); }
.sw-fig .s3 { stroke: var(--yellow); }
.sw-fig .s4 { stroke: var(--orange); }
.sw-fig .s5 { stroke: var(--red); }
.sw-key { background: rgba(217, 164, 65, 0.22); color: var(--text); padding: 0 3px; border-radius: 3px; }
.sw-einfach { border-left-color: var(--yellow); }
.sw-falle { border-left-color: var(--red); }
.sw-kette { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.sw-kette-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.sw-kette-step { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; overflow-wrap: break-word; }
.sw-kette-arrow { text-align: center; color: var(--yellow); font-weight: 700; font-size: 1.15rem; line-height: 1.4; }
.sw-formel { margin: 12px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border); }
.sw-formel-eq { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; overflow-wrap: anywhere; }
.sw-formel-erkl { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.glossary-line { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; text-align: left; }
.glossary-line strong { color: var(--text); }
.glossary-title { font-weight: 600; margin-right: 4px; }
.sw-glossary { margin-top: 22px; }

/* v27: Prüfstand (Leitlinienstand), Fehler melden, Rechnen, Kurven */
.stand-badge { margin-top: 10px; padding: 6px 10px; border-radius: 8px; font-size: 0.8rem; border: 1px solid var(--border); color: var(--text-muted); text-align: left; }
.stand-badge.stand-ok { border-color: rgba(63, 178, 127, 0.5); }
.stand-badge.stand-alt { border-color: var(--yellow); color: var(--yellow); background: rgba(217, 164, 65, 0.08); }
.stand-badge.stand-unklar { border-style: dashed; }
.guideline-group .stand-badge { margin: 0 0 10px; }
.report-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.report-btn { font-size: 0.75rem; opacity: 0.8; }
.report-textarea { width: 100%; margin-top: 8px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.85rem; }
.rechnen-eingabe { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.rechnen-eingabe input { flex: 1; min-width: 0; font-size: 1.1rem; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.rechnen-einheit { color: var(--text-muted); white-space: nowrap; }
.kurve-fig { margin: 12px 0; }
button.option-row.kurve-option { width: 100%; text-align: left; background: transparent; color: var(--text); font: inherit; margin-bottom: 6px; }

/* v28: Wirkkette in Medikamenten-Steckbriefen */
.db-row--chain .db-label { color: var(--yellow); }
.db-kette { margin: 4px 0 0; padding: 8px; }
.db-liste { margin: 4px 0 0; }
.db-liste li { font-size: 0.92em; }
.db-value { overflow-wrap: anywhere; min-width: 0; }
.db-row { min-width: 0; }
main h1, main h2 { overflow-wrap: break-word; }
