/* Wir bleiben wir – Gestaltung (mobil zuerst) */
:root {
  --dunkelblau: #02426b;
  --blau: #005c99;
  --hellblau: #238af1;
  --orange: #e17a00;
  --hellgrau: #eaeaea;

  --grund: #f6f7f9;
  --flaeche: #ffffff;
  --text: #1d2a35;
  --text-ruhig: #55636f;
  --linie: #dfe3e8;
  --blau-zart: #eaf3fb;
  --orange-zart: #fdf2e4;
  --privat: #2f3b46;
  --privat-zart: #eef0f2;
  --erfolg: #1f7a4d;
  --fehler: #b3261e;

  --radius: 16px;
  --radius-klein: 10px;
  --schatten: 0 1px 2px rgba(2, 66, 107, .06), 0 4px 16px rgba(2, 66, 107, .06);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 17px;
  line-height: 1.55;
}
h1, h2, h3 { color: var(--dunkelblau); line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--blau); }
h1:focus { outline: none; }
:focus-visible { outline: 3px solid var(--hellblau); outline-offset: 2px; border-radius: 6px; }

.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Rahmen ---------- */
.seite { max-width: 680px; margin: 0 auto; padding: 16px 16px 40px; }
.seite-mitte { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.kopf {
  max-width: 680px; margin: 0 auto; padding: 14px 16px 4px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
}
.kopf-name { font-weight: 700; color: var(--dunkelblau); margin: 0; }
.kopf-leitworte { margin: 0; font-size: .82rem; color: var(--text-ruhig); letter-spacing: .02em; }
.kopf-woche { margin: 0; font-size: .85rem; color: var(--blau); font-weight: 600; }
.fuss {
  max-width: 680px; margin: 0 auto; padding: 8px 16px 32px;
  display: flex; justify-content: space-between; align-items: center; font-size: .9rem;
}
.seitentitel { margin: 8px 0 14px; }

/* ---------- Karten ---------- */
.karte {
  background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 20px; margin: 0 0 16px;
}
.karte-akzent { border-top: 4px solid var(--orange); }
.freischaltung {
  display: flex; gap: 8px; align-items: flex-start; margin: -4px 4px 16px; padding: 10px 12px;
  font-size: .9rem; color: var(--text-ruhig); border-left: 3px solid var(--erfolg); background: #f3faf6; border-radius: 6px;
}
.freischaltung .symbol { color: var(--erfolg); margin-top: 2px; width: 1.1em; height: 1.1em; }
.freischaltung a { font-weight: 600; white-space: nowrap; }

/* ---------- Texte ---------- */
.leitworte { color: var(--orange); font-weight: 600; font-size: .85rem; letter-spacing: .04em; margin-bottom: .4rem; }
.unterzeile { color: var(--text-ruhig); margin-bottom: 1.4rem; }
.fliesstext { white-space: pre-line; }
.klein { font-size: .88rem; color: var(--text-ruhig); }
.beschriftung { display: block; font-weight: 600; font-size: .95rem; margin: 12px 0 6px; color: var(--dunkelblau); }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 20px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.knopf-haupt { background: var(--blau); color: #fff; }
.knopf-haupt:hover { background: var(--dunkelblau); }
.knopf-ruhig { background: var(--flaeche); color: var(--blau); border-color: var(--blau); }
.knopf-ruhig:hover { background: var(--blau-zart); }
.knopf-breit { width: 100%; margin-top: 8px; }
.knopf:disabled { background: var(--hellgrau); color: #77838d; border-color: var(--hellgrau); cursor: not-allowed; }
.knopf-link {
  background: none; border: none; padding: 8px 0; font: inherit; color: var(--blau);
  cursor: pointer; text-decoration: underline; display: inline-flex; gap: 6px; align-items: center; min-height: 44px;
}
.symbol { width: 1.25em; height: 1.25em; flex: none; }
.symbol-gross { width: 2rem; height: 2rem; }

/* ---------- Eingaben ---------- */
.eingabe {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border-radius: var(--radius-klein);
  border: 1.5px solid #c9d1d9; background: #fff; color: var(--text);
}
.eingabe:focus { border-color: var(--hellblau); outline: none; box-shadow: 0 0 0 3px rgba(35, 138, 241, .2); }
textarea.eingabe { resize: vertical; min-height: 4.5em; }
.eingabe-code { font-size: 1.25rem; letter-spacing: .12em; text-align: center; text-transform: uppercase; }

/* ---------- Hinweise ---------- */
.hinweis { padding: 12px 14px; border-radius: var(--radius-klein); margin: 10px 0; font-size: .95rem; }
.hinweis-fehler { background: #fdecea; color: var(--fehler); }
.hinweis-info { background: var(--blau-zart); color: var(--dunkelblau); }
.erledigt { display: flex; align-items: center; gap: 6px; color: var(--erfolg); font-weight: 600; margin: 8px 0; }

/* ---------- Anmeldung / Willkommen ---------- */
.anmelde-karte { max-width: 440px; width: 100%; margin: 0 auto; padding: 28px 22px; }
.willkommen h1 { margin-bottom: 1rem; }

/* ---------- Fortschritt ---------- */
.fortschritt { margin: 8px 0 16px; }
.fortschritt-zahlen { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; color: var(--text-ruhig); font-size: .92rem; }
.prozent { font-size: 1.6rem; font-weight: 700; color: var(--dunkelblau); }
.balken { height: 8px; background: var(--hellgrau); border-radius: 999px; overflow: hidden; }
.balken-fuellung { height: 100%; background: linear-gradient(90deg, var(--blau), var(--hellblau)); border-radius: 999px; transition: width .7s cubic-bezier(.2, .7, .3, 1); }
.naechster-titel { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--orange); margin: 0 0 2px; }
.naechster-text { font-weight: 600; color: var(--dunkelblau); }

/* ---------- Der Weg (Übersicht) ---------- */
.weg { list-style: none; margin: 0 0 8px; padding: 0; position: relative; }
.weg-schritt { position: relative; padding-left: 46px; }
.weg-schritt::before {
  content: ""; position: absolute; left: 17px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--hellblau) 0 6px, transparent 6px 12px); opacity: .45;
}
.weg-schritt:first-child::before { top: 24px; }
.weg-schritt:last-child::before { bottom: calc(100% - 24px); }
.weg-marke {
  position: absolute; left: 0; top: 16px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  background: var(--flaeche); color: var(--blau); border: 2px solid var(--blau); z-index: 1;
}
.zustand-abgeschlossen .weg-marke { background: var(--blau); color: #fff; }
.zustand-gesperrt .weg-marke { border-color: #b8c2cb; color: #8a96a1; }
.zustand-in_arbeit .weg-marke, .zustand-nicht_begonnen .weg-marke { border-color: var(--orange); color: var(--orange); }
.etappe-karte h2 { margin-bottom: .3rem; }
.zustand-gesperrt .etappe-karte { background: #fbfbfc; box-shadow: none; border: 1.5px dashed #d3d9df; }
.zustand-gesperrt .etappe-karte h2 { color: #5d6b77; }
.etappe-nr { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-ruhig); margin: 0 0 4px; }
.etappe-kurz { color: var(--text-ruhig); font-size: .95rem; }
.etappe-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--hellgrau); color: #4a5763; }
.chip-in_arbeit { background: var(--orange-zart); color: #8a4b00; }
.chip-abgeschlossen { background: #e3f3ea; color: var(--erfolg); }
.chip-nicht_begonnen { background: var(--blau-zart); color: var(--blau); }
.punkte { display: inline-flex; align-items: center; gap: 5px; }
.punkt { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--blau); }
.punkt-voll { background: var(--blau); }
.punkte-text { font-size: .85rem; color: var(--text-ruhig); margin-left: 4px; }
.gesperrt-hinweis { display: flex; gap: 8px; align-items: flex-start; color: var(--text-ruhig); font-size: .92rem; margin: 8px 0 0; }
.gesperrt-hinweis .symbol { margin-top: 2px; }
.teaser-kopf { display: flex; align-items: center; gap: 10px; color: var(--orange); margin-bottom: 6px; }
.teaser-kopf h2 { margin: 0; }

/* ---------- Etappenseite ---------- */
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.etappe-kopf { margin: 4px 0 18px; }
.etappe-kopf .chip { margin-bottom: 12px; }
.impuls { padding: 0; overflow: hidden; }
.impuls-text { padding: 16px 20px 20px; }
.impuls-text h2 { margin-bottom: 2px; }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--dunkelblau); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-platzhalter {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--dunkelblau), var(--blau)); color: rgba(255, 255, 255, .85); font-size: .95rem;
}
.symbol-video { width: 56px; height: 56px; stroke-width: 1.2; }
.impuls-erledigt .video-platzhalter { background: linear-gradient(135deg, #4b6a80, #6c8aa0); }

/* ---------- Navi ---------- */
.navi { border-top: 4px solid var(--hellblau); }
.navi-privat { border-top-color: var(--privat); }
.navi-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.navi-kopf h2 { margin: 0; font-size: 1.3rem; }
.navi-symbol {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blau-zart); color: var(--blau);
}
.symbol-navi { width: 30px; height: 30px; }
.navi-intro { font-size: .95rem; color: var(--text-ruhig); }

.modus-leiste { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 10px; }
.modus-seite { display: inline-flex; align-items: center; gap: 6px; color: #8a96a1; font-weight: 600; font-size: .95rem; }
.modus-seite .symbol { width: 26px; height: 26px; }
.modus-aktiv { color: var(--dunkelblau); }
.navi-privat .modus-aktiv { color: var(--privat); }
.schalter { position: relative; display: inline-block; width: 64px; height: 36px; cursor: pointer; }
.schalter-eingabe { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.schalter-bahn { position: absolute; inset: 0; background: var(--hellblau); border-radius: 999px; transition: background-color .2s; }
.schalter-bahn::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.schalter-eingabe:checked + .schalter-bahn { background: var(--privat); }
.schalter-eingabe:checked + .schalter-bahn::after { transform: translateX(28px); }
.schalter-eingabe:focus-visible + .schalter-bahn { outline: 3px solid var(--orange); outline-offset: 3px; }

.modus-info { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-klein); margin-bottom: 14px; }
.modus-info-normal { background: var(--blau-zart); color: var(--dunkelblau); }
.modus-info-privat { background: var(--privat-zart); color: var(--privat); border: 1.5px solid #c8ced4; }
.modus-titel { font-weight: 700; margin-bottom: 2px; }
.modus-text { margin-bottom: 4px; font-size: .95rem; }
.modus-details { font-size: .85rem; }
.modus-details summary { cursor: pointer; min-height: 32px; }

.navi-verlauf { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 8px; }
.navi-leer { color: var(--text-ruhig); font-size: .92rem; text-align: center; padding: 14px; border: 1.5px dashed var(--linie); border-radius: var(--radius-klein); margin: 0; }
.nachricht { padding: 12px 14px; border-radius: 14px; max-width: 92%; }
.nachricht-eltern { align-self: flex-end; background: var(--blau); color: #fff; border-bottom-right-radius: 4px; }
.nachricht-navi { align-self: flex-start; background: #f1f4f7; border-bottom-left-radius: 4px; }
.navi-privat .nachricht-eltern { background: var(--privat); }
.nachricht-sicherheit { background: var(--orange-zart); border-left: 4px solid var(--orange); }
.nachricht-wartet { color: var(--text-ruhig); font-style: italic; }
.nachricht-wer { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 2px; opacity: .8; }
.nachricht-text { white-space: pre-line; margin: 0; }
.vormerken { margin-top: 6px; border-top: 1px solid var(--linie); padding-top: 4px; }
.vormerken .knopf-link { font-size: .9rem; color: var(--orange); }
.vormerken-form .knopf { margin-top: 10px; }

.navi-form { margin-top: 8px; }
.navi-form-zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.zaehler { font-size: .85rem; color: var(--text-ruhig); font-variant-numeric: tabular-nums; }
.kontingent { font-weight: 600; color: var(--blau); margin: 12px 0 4px; font-size: .95rem; }
.kontingent-leer { color: var(--fehler); }
.navi-aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.navi-aktionen .knopf { flex: 1 1 200px; min-height: 46px; font-size: .95rem; }

/* ---------- Rückmeldung ---------- */
.rueckmeldung-form .knopf, .rueckmeldung-vorschau .knopf { margin-top: 12px; }
.vorschau {
  white-space: pre-wrap; font-family: var(--schrift); font-size: .95rem; background: #f1f4f7;
  padding: 14px; border-radius: var(--radius-klein); margin: 0;
}
.rueckmeldung-aktionen { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Dialog ---------- */
.dialog {
  border: none; border-radius: var(--radius); padding: 22px; max-width: min(440px, calc(100vw - 32px));
  box-shadow: 0 10px 40px rgba(2, 66, 107, .25); color: var(--text);
}
.dialog::backdrop { background: rgba(2, 30, 50, .45); }
.dialog-kopf { display: flex; align-items: center; gap: 10px; color: var(--dunkelblau); margin-bottom: 8px; }
.dialog-kopf h2 { margin: 0; }
.dialog-knoepfe { display: flex; flex-wrap: wrap-reverse; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.dialog-knoepfe .knopf { flex: 1 1 160px; }

/* ---------- Familienkompass ---------- */
.kompass-seite { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); padding: 22px 18px; margin: 14px 0; }
.kompass-titel { text-align: center; font-size: 1.4rem; margin-bottom: 16px; }
.kompass-grafik {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "oben oben" "rose rose" "links rechts" "unten unten";
}
.kompass-rose { grid-area: rose; display: grid; place-items: center; }
.rose-svg { width: 150px; height: 150px; }
.kompass-feld { background: var(--blau-zart); border-radius: var(--radius-klein); padding: 12px 14px; }
.kompass-feld h3 { font-size: .95rem; margin-bottom: 6px; }
.kompass-oben { grid-area: oben; text-align: center; }
.kompass-unten { grid-area: unten; text-align: center; background: var(--orange-zart); }
.kompass-links { grid-area: links; }
.kompass-rechts { grid-area: rechts; }
.kompass-stichworte { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kompass-oben .kompass-stichworte, .kompass-unten .kompass-stichworte { justify-content: center; }
.kompass-stichworte li { background: #fff; border-radius: 999px; padding: 3px 10px; font-size: .9rem; font-weight: 600; color: var(--dunkelblau); }
.kompass-leer { font-size: .85rem; color: var(--text-ruhig); margin: 0; }
.kompass-abschnitt { margin-bottom: 18px; }
.kompass-abschnitt h3 { border-bottom: 2px solid var(--hellgrau); padding-bottom: 4px; }
.kompass-eintrag { margin: 10px 0 14px; padding-left: 12px; border-left: 3px solid var(--hellblau); }
.kompass-stichwort { font-weight: 700; color: var(--dunkelblau); margin-bottom: 2px; }
.kompass-text, .kompass-einleitung { white-space: pre-line; }
.kompass-fuss { text-align: center; font-size: .8rem; color: var(--text-ruhig); margin: 18px 0 0; }

@media (min-width: 640px) {
  body { font-size: 17.5px; }
  h1 { font-size: 1.9rem; }
  .karte { padding: 24px 26px; }
  .kompass-grafik { grid-template-columns: 1fr 170px 1fr; grid-template-areas: ". oben ." "links rose rechts" ". unten ."; align-items: center; }
  .rose-svg { width: 170px; height: 170px; }
}

/* ---------- Sanfte Übergänge ---------- */
@keyframes einblenden {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes dialog-ein {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes hintergrund-ein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.einblenden { animation: einblenden .32s cubic-bezier(.2, .7, .3, 1) both; }
.dialog[open] { animation: dialog-ein .26s cubic-bezier(.2, .7, .3, 1); }
.dialog[open]::backdrop { animation: hintergrund-ein .26s ease-out; }
.modus-info, .navi, .nachricht { transition: background-color .3s, border-color .3s, color .3s; }
.modus-seite { transition: color .25s; }

@media (prefers-reduced-motion: reduce) {
  .einblenden, .dialog[open], .dialog[open]::backdrop { animation: none !important; }
  .balken-fuellung, .schalter-bahn, .schalter-bahn::after { transition: none !important; }
}

/* ---------- Druck / PDF ---------- */
.druckbereich { display: none; }
@media print {
  @page { size: A4; margin: 16mm; }
  body { background: #fff; font-size: 11.5pt; }
  .nicht-drucken, .fuss, .zurueck { display: none !important; }
  .karte, .kompass-seite { box-shadow: none; }
  .kompass-seite { border: none; padding: 0; margin: 0; }
  .kompass-neue-seite { break-before: page; }
  .kompass-grafik { grid-template-columns: 1fr 150px 1fr; grid-template-areas: ". oben ." "links rose rechts" ". unten ."; align-items: center; }
  .kompass-feld, .kompass-stichworte li { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kompass-eintrag { break-inside: avoid; }

  body.druck-verlauf .app { display: none; }
  body.druck-verlauf .druckbereich { display: block; }
  .druckbereich h1 { font-size: 16pt; }
  .druck-nachricht { border-left: 3px solid #238af1; padding: 4px 10px; margin: 10px 0; break-inside: avoid; }
}
