/* =========================================================
   Deutsch B1 Trainer – globale Stile
   Einfaches, klares Design für B1-Lernende
   ========================================================= */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2fa;
  --text: #1f2733;
  --text-soft: #5b6573;
  --primary: #2f6df0;
  --primary-dark: #1f53c4;
  --primary-soft: #e6efff;
  --accent: #ffb703;
  --green: #2bb673;
  --green-soft: #e3f7ee;
  --red: #e5484d;
  --red-soft: #fdecec;
  --border: #e2e7f0;
  --shadow: 0 6px 24px rgba(31, 39, 51, 0.08);
  --shadow-sm: 0 2px 8px rgba(31, 39, 51, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
}

img { max-width: 100%; display: block; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Dunkles Design ---------- */
:root[data-theme="dark"] {
  --bg: #0f141c;
  --surface: #182029;
  --surface-2: #212b37;
  --text: #e7ecf3;
  --text-soft: #9aa7b8;
  --primary: #6f9bf7;
  --primary-dark: #a9c4fb;
  --primary-soft: #1b2740;
  --accent: #ffc233;
  --green: #3ecf8e;
  --green-soft: #15271e;
  --red: #f2686d;
  --red-soft: #2c1a1c;
  --border: #2b3543;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .site-header { background: rgba(18, 24, 33, 0.92); }
:root[data-theme="dark"] .self-assess { background: var(--surface-2); border-color: var(--border); }
:root[data-theme="dark"] .beispiel { background: var(--green-soft); border-color: #245c3d; }
:root[data-theme="dark"] .foto-modal-inner,
:root[data-theme="dark"] .foto-cell { background: var(--surface); border-color: var(--border); }
:root[data-theme="dark"] .bild-frame { background: var(--surface); }
:root[data-theme="dark"] .btn.white { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .btn.white:hover { background: var(--surface); }

.theme-toggle {
  margin-left: auto; flex: 0 0 auto;
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--primary); }

/* Umschalter Handy-/Desktop-Ansicht – steht direkt neben dem Theme-Knopf */
.ansicht-toggle {
  flex: 0 0 auto;
  width: 38px; height: 38px; padding: 0;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ansicht-toggle:hover { border-color: var(--primary); }
/* In der erzwungenen Desktop-Ansicht ist alles klein – der Knopf darf größer bleiben,
   damit man ihn mit dem Finger wieder trifft. */
:root[data-ansicht="desktop"] .ansicht-toggle { width: 44px; height: 44px; font-size: 1.2rem; }

/* ---------- Kopfzeile / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;      /* Name nie umbrechen */
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand .flag {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(180deg, #111 0 33%, var(--red) 33% 66%, var(--accent) 66% 100%);
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;      /* ein Menüpunkt = eine Zeile */
}
/* Mittlere Breiten: enger setzen, damit alle Punkte in EINER Zeile bleiben */
@media (max-width: 1180px) and (min-width: 761px) {
  .brand { font-size: 1rem; gap: 7px; }
  .brand .flag { width: 24px; height: 24px; }
  .nav { gap: 10px; }
  .nav-links { gap: 1px; }
  .nav-links a { padding: 8px 7px; font-size: 0.86rem; }
}
@media (max-width: 920px) and (min-width: 761px) {
  .brand { font-size: 0.92rem; gap: 6px; }
  .brand .flag { width: 20px; height: 20px; }
  .nav { gap: 6px; }
  .nav-links a { padding: 7px 5px; font-size: 0.8rem; }
}
.nav-links a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); }

.nav-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.6rem; cursor: pointer;
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #2f6df0 0%, #5b8cff 60%, #7aa5ff 100%);
  color: #fff;
  padding: 60px 0 70px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 14px;
  font-weight: 800;
  line-height: 1.2;
}
.hero p {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto 26px;
  opacity: 0.95;
}
.hero .btn { box-shadow: var(--shadow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  transition: transform 0.05s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--primary); border: 2px solid var(--primary); }
.btn.secondary:hover { background: var(--primary-soft); }
.btn.ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.big { font-size: 1.1rem; padding: 14px 30px; }
.btn.white { background: #fff; color: var(--primary-dark); }
.btn.white:hover { background: #f0f4ff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Sections ---------- */
section { padding: 46px 0; }
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0 0 6px;
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--text-soft);
  max-width: 620px;
  margin: 0 auto 32px;
}

/* ---------- Prüfungs-Auswahl ---------- */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.exam-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}
.exam-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary); text-decoration: none; }
.exam-card .badge {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.exam-card h3 { margin: 0 0 8px; font-size: 1.35rem; color: var(--text); }
.exam-card p { margin: 0 0 18px; color: var(--text-soft); flex: 1; }
.exam-card .parts { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 16px; }
.exam-card .parts span {
  display: inline-block;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px 9px;
  margin: 0 6px 6px 0;
  font-weight: 600;
}

/* ---------- Modul-Karten ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.module-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.module-card .icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 14px;
  background: var(--primary-soft);
}
.module-card.lesen .icon { background: #e6efff; }
.module-card.hoeren .icon { background: #e3f7ee; }
.module-card.schreiben .icon { background: #fff3d6; }
.module-card.sprechen .icon { background: #fde8ef; }
.module-card h3 { margin: 0 0 6px; color: var(--text); font-size: 1.2rem; }
.module-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.module-card .arrow { position: absolute; top: 22px; right: 22px; color: var(--text-soft); font-size: 1.2rem; }

/* ---------- Info-Reihe ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.feature {
  text-align: center;
  padding: 10px;
}
.feature .emoji { font-size: 2rem; }
.feature h4 { margin: 8px 0 4px; }
.feature p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Übungs-Seiten ---------- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 24px;
}
.crumbs { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 10px; }
.crumbs a { color: var(--text-soft); }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
.page-head .lead { margin: 0; color: var(--text-soft); }
/* Luft unter der Kopfzeile: früher kam der Abstand vom Werbe-Platzhalter.
   Seit der ausgeblendet ist, klebte der Inhalt direkt an der Trennlinie. */
.page-head + .container { padding-top: 26px; }

.exam-switch {
  display: inline-flex;
  /* Ohne align-items werden Beschriftung und Knöpfe auf dieselbe Höhe gestreckt.
     Die Beschriftung hat aber keine Innenabstände, ihr Text säße dann rund 5 px
     zu hoch. Mit center sitzt alles auf einer Linie. */
  align-items: center;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.exam-switch a {
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.exam-switch a:hover { text-decoration: none; color: var(--text); }
.exam-switch a.active { background: var(--primary); color: #fff; }
.exam-switch a.level-toggle { background: transparent; color: var(--primary); font-weight: 700; }
.exam-switch a.level-toggle:hover { background: var(--surface); }
/* Freies Training – abgesetzt, damit es nicht wie eine Prüfung aussieht */
.exam-switch a.training-link { background: transparent; border: 1px dashed var(--border); color: var(--text-soft); }
.exam-switch a.training-link::before { content: "＋ "; }
.exam-switch a.training-link.active { background: var(--surface-2); color: var(--text); border-style: solid; }

/* Niveau-Umschalter (Startseite) */
.level-tabs { display: inline-flex; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 5px; margin: 0 0 22px; }
.level-tab {
  border: 0; cursor: pointer; background: transparent;
  padding: 9px 22px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  color: var(--text-soft); font-family: inherit;
}
.level-tab:hover { color: var(--text); }
.level-tab.active { background: var(--primary); color: #fff; }

/* Beispiel-Box (offizielles Format) */
.beispiel { background: #f1f8f3; border: 1px solid #cfe9d6; border-radius: 8px; padding: 8px 12px; margin: 10px 0; font-size: 0.95rem; }
.beispiel strong { color: #15803d; }

/* Kleiner Button + PDF-Leiste */
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.pdf-bar { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pdf-bar .pdf-label { font-size: 0.85rem; color: var(--text-soft); margin-right: 2px; }

/* Wasserzeichen: eine kleine Marke unten rechts (nicht über dem Motiv) */
.wm-mark { position: absolute; right: 8px; bottom: 8px; z-index: 2; pointer-events: none;
  font: 600 0.72rem/1 system-ui, Arial, sans-serif; letter-spacing: .02em;
  color: rgba(255,255,255,.92); background: rgba(0,0,0,.42);
  padding: 4px 8px; border-radius: 6px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* PDF-Render (außerhalb des Bildschirms aufgebaut) */
.pdf-holder { position: fixed; left: -10000px; top: 0; }
.pdf-root { width: 794px; padding: 26px 30px; background: #fff; color: #111; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5; }
.pdf-root h1 { font-size: 18px; margin: 0 0 4px; }
.pdf-head { border-bottom: 2px solid #2563eb; padding-bottom: 8px; margin-bottom: 14px; }
.pdf-brand { font-weight: 700; color: #2563eb; font-size: 12px; }
.pdf-root .pp { margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid #eee; page-break-inside: avoid; }
.pdf-root .pl { display: inline-block; background: #eef2ff; color: #2563eb; font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.pdf-root h3 { font-size: 15px; margin: 6px 0; }
.pdf-root h4 { font-size: 13px; margin: 8px 0 4px; }
.pdf-root .pi { color: #444; font-style: italic; }
.pdf-root ol.q { margin: 6px 0; padding-left: 20px; }
.pdf-root ol.q > li { margin: 4px 0; }
.pdf-root ul.opt { list-style: none; padding-left: 14px; margin: 3px 0; }
.pdf-root ul.pts { margin: 4px 0 4px 18px; }
.pdf-root .rf { color: #555; white-space: nowrap; font-size: 12px; }
.pdf-root .sol { color: #15803d; }
.pdf-root .ex { color: #666; font-size: 11px; margin: 2px 0 6px; }
.pdf-root .bank { background: #f6f7f9; padding: 6px 9px; border-radius: 6px; margin: 6px 0; font-size: 12px; }
.pdf-root .bank ul { margin: 4px 0 0 16px; }
.pdf-root .gap { line-height: 2; }
.pdf-root .lines { margin: 8px 0; }
.pdf-root .lines .line { border-bottom: 1px solid #bbb; height: 22px; }
.pdf-root .sample { background: #f0fdf4; border-left: 3px solid #15803d; padding: 8px 10px; margin: 8px 0; font-size: 12px; }
.pdf-root .rm { background: #f6f7f9; padding: 6px 9px; border-radius: 6px; margin: 6px 0; font-size: 12px; }
.pdf-root .bild-print { position: relative; display: inline-block; max-width: 100%; }
.pdf-root .bild-print svg, .pdf-root .bild-print img { max-width: 520px; height: auto; border: 1px solid #ddd; display: block; }
.pdf-root .wm-print { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; color: rgba(0,0,0,0.18); font-weight: 700; transform: rotate(-20deg); pointer-events: none; }
.pdf-foot { margin-top: 14px; border-top: 1px solid #ddd; padding-top: 6px; color: #999; font-size: 11px; text-align: center; }

/* Varianten-Auswahl */
.variant-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 24px 0 4px;
  box-shadow: var(--shadow-sm);
}
.variant-label { font-weight: 700; }
.variant-select {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  cursor: pointer;
}
.variant-count { margin-left: auto; font-size: 0.9rem; }
@media (max-width: 600px) { .variant-count { margin-left: 0; width: 100%; } }

/* Teil-Navigation */
.part-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.part-tab {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.part-tab:hover { background: var(--surface-2); }
.part-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.part-tab .dot { color: var(--green); }

/* Aufgaben-Block */
.task {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.task-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 6px;
}
.task h2 { margin: 0 0 4px; font-size: 1.3rem; }
.task .instruction { color: var(--text-soft); margin: 0 0 18px; }

.tip {
  background: #fff8e6;
  border: 1px solid #ffe39e;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 0.95rem;
  color: #6b5300;
}
.tip strong { color: #6b5300; }

.reading-text {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 0 0 22px;
  line-height: 1.75;
}
.reading-text h4 { margin: 0 0 8px; }
.reading-text p { margin: 0 0 10px; }
.reading-text p:last-child { margin-bottom: 0; }

/* E-Mail-Format (weitergeleitete Beschwerden u. Ä.) */
.reading-text.mail-box { padding: 0; overflow: hidden; }
.reading-text .mail { padding: 16px 20px; }
.reading-text .mail-sep { border-top: 2px solid var(--border); }
.reading-text .mail-head {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  line-height: 1.55;
}
.reading-text .mail-row { display: flex; gap: 10px; }
.reading-text .mail-label { flex: 0 0 88px; font-weight: 700; color: var(--text-soft); }
.reading-text .mail-value { flex: 1 1 auto; }
.reading-text .mail-text { margin: 0 0 10px; }
.reading-text .mail-text:last-child { margin-bottom: 0; }

/* Übersetzungsfeld – wird im Erklär-Spiel und im Verbtrainer eingesetzt */
.ue-feld { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ue-wahl-klein {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 0.88rem;
}
.ue-ausgabe { color: var(--text); }
.ue-ausgabe.rtl { direction: rtl; unicode-bidi: isolate; }
@media (max-width: 520px) { .ue-feld { flex-direction: column; align-items: flex-start; } }

/* Protokoll-Format (DTB B2, Lesen Teil 4) */
.reading-text.protokoll-box h4 { margin: 0 0 12px; }
.reading-text .prot-head {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  line-height: 1.55;
}
.reading-text .prot-row { display: flex; gap: 10px; }
.reading-text .prot-row + .prot-row { margin-top: 3px; }
.reading-text .prot-label { flex: 0 0 120px; font-weight: 700; color: var(--text-soft); }
.reading-text .prot-value { flex: 1 1 auto; }
.reading-text .prot-tops {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.reading-text .prot-tops ul { margin: 0; padding-left: 20px; }
.reading-text .prot-tops li { margin: 0 0 2px; }
.reading-text .prot-tops h5,
.reading-text .prot-abschnitt h5 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}
.reading-text .prot-abschnitt { margin: 0 0 16px; }
.reading-text .prot-abschnitt:last-child { margin-bottom: 0; }
.reading-text .prot-abschnitt p:last-child { margin-bottom: 0; }

/* Schmale Bildschirme: Beschriftung über den Wert statt daneben */
@media (max-width: 520px) {
  .reading-text .prot-row { display: block; }
  .reading-text .prot-label { display: block; }
  .reading-text .prot-row + .prot-row { margin-top: 8px; }
}

/* Schreiben: Stimulus-Boxen (Zitat / E-Mail / Themenwahl) – passen sich dem Theme an */
.stimulus-quote { background: var(--surface-2); color: var(--text); }
.stimulus-quote .quote-author { color: var(--text-soft); }
.stimulus-mail { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.stimulus-mail .stimulus-label { color: var(--text-soft); }

/* Anzeigen / Karten zum Zuordnen */
.ad-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.ad-cards .acard {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface-2);
  font-size: 0.95rem;
}
.ad-cards .acard .letter {
  display: inline-block;
  font-weight: 800;
  color: var(--primary);
  margin-right: 6px;
}

/* Fragen */
.question {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.question:first-of-type { border-top: none; }
.question .q-text { font-weight: 600; margin: 0 0 12px; }
.question .q-text .num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.85rem; font-weight: 800;
  margin-right: 8px;
}

.options { display: flex; flex-direction: column; gap: 10px; }
.options.row { flex-direction: row; flex-wrap: wrap; }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  background: var(--surface);
}
.option:hover { border-color: var(--primary); background: var(--primary-soft); }
.option input { accent-color: var(--primary); width: 18px; height: 18px; flex: 0 0 auto; }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.option .mark { margin-left: auto; font-weight: 800; }
.option.correct .mark { color: var(--green); }
.option.wrong .mark { color: var(--red); }

/* Zuordnung über Dropdown */
.match-select {
  font-family: inherit;
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  min-width: 90px;
}
.match-select.correct { border-color: var(--green); background: var(--green-soft); }
.match-select.wrong { border-color: var(--red); background: var(--red-soft); }

/* Lückentext */
.gap-text { line-height: 2.4; }
.gap-text select {
  font-family: inherit; font-size: 0.98rem;
  padding: 4px 8px; border-radius: 8px;
  border: 1.5px solid var(--primary);
  background: var(--primary-soft); margin: 0 3px;
}
.gap-text select.correct { border-color: var(--green); background: var(--green-soft); }
.gap-text select.wrong { border-color: var(--red); background: var(--red-soft); }
.word-bank {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 18px; padding: 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.word-bank span {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 11px; font-weight: 600; font-size: 0.92rem;
}

.explain {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 8px 0 0;
  padding-left: 34px;
}
.explain.show { color: var(--text); }

/* Ergebnis */
.result-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
  padding: 14px 0;
  z-index: 40;
}
.result-bar .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.score {
  font-weight: 800; font-size: 1.05rem;
}
.score .num { color: var(--primary); }
.score.pass .num { color: var(--green); }
.score.fail .num { color: var(--red); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Hören: Player */
.player {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 18px;
  flex-wrap: wrap;
}
.player .play-btn {
  width: 50px; height: 50px; border-radius: 50%;
  border: none; background: var(--primary); color: #fff;
  font-size: 1.3rem; cursor: pointer; flex: 0 0 auto;
}
.player .play-btn:hover { background: var(--primary-dark); }
.player .p-info { font-size: 0.92rem; color: var(--text-soft); }
.player .p-info strong { color: var(--text); display: block; }
.player .speed { margin-left: auto; }
.player select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); font-family: inherit; }
.transcript {
  margin-top: 14px; padding: 14px 16px;
  background: #fff; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; color: var(--text-soft);
}
.transcript-block { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 16px; }
.transcript-block > .btn { width: 100%; }
.t-line { padding: 4px 8px; border-radius: 8px; margin: 2px 0; transition: background 0.15s ease; }
.t-line.t-active { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.t-who { font-weight: 700; color: var(--primary-dark); }

/* Fortschritt / erledigt */
.part-tab.done { border-color: var(--green); color: var(--green); }
.btn.done { background: var(--green); color: #fff; }
.btn.done:hover { background: #229e63; }
.progress-summary { font-weight: 700; color: var(--text-soft); font-size: 0.9rem; }
.score-summary { color: var(--primary); }
.self-assess { background: #f6f8ff; border: 1px solid #d6def5; border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
.self-assess h4 { margin: 0 0 6px; color: #2b4a8b; }
.self-assess .muted { font-size: 0.9rem; margin: 0 0 8px; }
.self-assess .crit-list { list-style: none; padding: 0; margin: 8px 0; }
.self-assess .crit-list li { margin: 5px 0; display: flex; align-items: flex-start; gap: 8px; }
.self-assess .crit-list input { margin-top: 3px; flex: none; }
.self-score { margin-top: 8px; font-size: 0.97rem; }
.self-score strong { color: var(--primary); }
.audio-hint { margin-top: 8px; font-size: 0.9rem; }

/* Foto-Auswahl (Mehrere Fotos -> ein PDF) */
.foto-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.foto-modal-inner { background: #fff; border-radius: 14px; max-width: 940px; width: 100%; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.foto-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #eee; }
.foto-count { color: var(--primary); font-weight: 700; white-space: nowrap; }
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 16px; overflow-y: auto; }
.foto-cell { position: relative; border: 2px solid #e5e7eb; border-radius: 10px; overflow: hidden; cursor: pointer; background: #f8fafc; }
.foto-cell img { width: 100%; height: 130px; object-fit: cover; display: block; }
.foto-cell input { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; z-index: 3; cursor: pointer; }
.foto-cell:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 3px var(--primary); }
.foto-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px 8px 6px; font-size: 0.8rem; font-weight: 700; line-height: 1.2; color: #fff; background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0)); text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.foto-modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid #eee; flex-wrap: wrap; }
.foto-modal-foot .btn.small:nth-child(3) { margin-left: auto; }
.ft-body { padding: 16px; overflow-y: auto; }
.ft-body .muted { margin: 0 0 12px; font-size: 0.9rem; }
.ft-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.ft-row input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.ft-row .ft-name { flex: 1; font-weight: 600; }
.ft-row .ft-var { padding: 5px 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.9rem; }
.ft-sol { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; cursor: pointer; }
.ft-sol input { width: 20px; height: 20px; }

/* Stoppuhr */
.stopwatch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 14px 0; }
.sw-label { font-weight: 700; }
.sw-time { font-size: 1.5rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; min-width: 70px; }

/* Bildbeschreibung */
.bild-frame { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 0 0 18px; background: #fff; box-shadow: var(--shadow-sm); }
.bild-frame svg { width: 100%; height: auto; display: block; }

/* Wortschatz-Karteikarten */
.flashcard { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 36px 24px; text-align: center; box-shadow: var(--shadow-sm); min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.flashcard.known { border-color: var(--green); }
.fc-word { font-size: 1.9rem; font-weight: 800; color: var(--text); }
.fc-def { margin-top: 16px; font-size: 1.1rem; color: var(--primary-dark); }
.fc-bsp { margin-top: 10px; font-size: 1.05rem; color: var(--text-soft); font-style: italic; }
.fc-hint { margin-top: 14px; }

/* Schreiben */
.write-area {
  width: 100%;
  min-height: 220px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  background: var(--surface-2);
  color: var(--text);
}
.write-area:focus { outline: none; border-color: var(--primary); }

/* Eingabefelder folgen dem Theme (Standard-Weiß wäre in dunkler Ansicht störend) */
input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="password"], textarea, select {
  background: var(--surface-2);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-soft); opacity: 1; }
.write-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 10px; font-size: 0.92rem; color: var(--text-soft);
}
.word-count strong { color: var(--primary); }
.word-count.ok strong { color: var(--green); }
.points-list { margin: 0 0 18px; padding: 0; list-style: none; }
.points-list li {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.points-list li:before { content: "✏️"; }
.redemittel {
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 16px 0;
}
.redemittel h4 { margin: 0 0 8px; }
.redemittel ul { margin: 0; padding-left: 20px; }
.redemittel li { margin: 8px 0; }
.redemittel .bsp { display: block; color: var(--text-soft); font-style: italic; margin-top: 2px; font-size: 0.95rem; }
/* Aufbau-Hilfe für die Bildbeschreibung (Schritt für Schritt) */
.aufbau {
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 18px; margin: 16px 0;
}
.aufbau h4 { margin: 0 0 8px; }
.aufbau ol { margin: 0; padding-left: 22px; }
.aufbau li { margin: 6px 0; line-height: 1.55; }
.aufbau em { color: var(--text-soft); }
/* Beispiel-Beschreibung: Absätze statt einem Block */
.sample p { margin: 0 0 12px; }
.sample p:last-child { margin-bottom: 0; }
.sample {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px 18px; margin-top: 14px;
  line-height: 1.75; white-space: pre-line;
}

/* Sprechen */
.speak-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 18px 20px; margin: 16px 0;
}
.timer {
  font-size: 2.4rem; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums; text-align: center; margin: 8px 0;
}
.recorder { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.recorder audio { height: 40px; }
.rec-dot { color: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Werbung ---------- */
.ad-slot {
  margin: 26px auto;
  text-align: center;
  min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ad-slot.in-content { margin: 30px auto; }
.ad-placeholder {
  width: 100%;
  border: 1px dashed #c7cfdd;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, #f3f6fc, #f3f6fc 12px, #eef2fa 12px, #eef2fa 24px);
  color: #9aa4b5;
  padding: 26px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.ad-label {
  display: block; font-size: 0.7rem; color: #aeb6c4;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px;
}

/* ---------- Fußzeile ---------- */
.site-footer {
  background: #1a2230;
  color: #c7cdd8;
  padding: 40px 0 26px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  /* 170px, damit die fünf Spalten auf dem Desktop in EINE Reihe passen */
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 22px 24px;
  margin-bottom: 26px;
}
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.site-footer a { color: #c7cdd8; display: block; padding: 3px 0; font-size: 0.95rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2c3647;
  padding-top: 18px; font-size: 0.85rem; color: #8a93a3;
  text-align: center;
}

/* ---------- Hilfsklassen ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.muted { color: var(--text-soft); }
.notice {
  background: var(--primary-soft); border: 1px solid #c5d8ff;
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 18px 0;
  font-size: 0.95rem; color: var(--primary-dark);
}

/* Prosa-Seiten (Datenschutz / Impressum) */
.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { margin-top: 0; }
.prose h2 { margin-top: 32px; font-size: 1.25rem; }
.prose p, .prose li { color: var(--text); }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px;
    gap: 2px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .hero { padding: 44px 0 50px; }
  section { padding: 34px 0; }
  .explain { padding-left: 0; }
}

.footer-quellen { margin-top:10px; font-size:.78rem; opacity:.75; line-height:1.6; text-align:center; }
/* Muss inline sein – .site-footer a ist block, sonst steht jede Quelle
   in einer eigenen Zeile und der Satz zerfällt. */
.footer-quellen a { display:inline; padding:0; text-decoration:underline; font-size:inherit; }
