/* Angehörigen-Portal – dunkelblauer App-Look wie die Helfer-App (Navy/Gold, Lora + Nunito Sans, selbst gehostet) */
@font-face { font-family: "Lora"; font-weight: 600; font-display: swap; src: url("../core/fonts/lora-600.5ec93d4b0359.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400 700; font-display: swap; src: url("../core/fonts/nunito-sans.14ea133c476f.woff2") format("woff2"); }
:root {
  color-scheme: dark;
  --navy: #0b1120; --gold: #e9c05a; --gold-licht: #e9c05a; --gold-hell: #f6e7c1; --gold-dunkel: #e9c05a; --auf-gold: #1d1606;
  --bg: #0e1424; --surface: #172036; --surface-2: #1d2740; --line: #2c3854; --fg: #e9e6de; --stark: #f6f2e8; --muted: #a3a9b8;
  --ok: #6fcf9a; --ok-bg: #1b3a2c; --warn: #f0b860; --warn-bg: #3d2e14; --crit: #f08a8a; --crit-bg: #432222; --info-bg: #22304f;
  --feld: #10182b; --feld-linie: #36446a;
  --f-display: "Lora", Georgia, "Times New Roman", serif;
  --f-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  padding-bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; margin: 0; text-wrap: balance; color: var(--stark); }
h1 { font-size: 1.35rem; }
a { color: var(--gold-licht); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.kopf { background: rgba(11,17,32,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--stark); display: flex; gap: .65rem; align-items: center;
  padding: calc(.7rem + env(safe-area-inset-top, 0px)) 1rem .65rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.kopf img { width: 32px; height: auto; }
.kopf .t { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.2; }
.kopf .s { font-size: .78rem; color: var(--muted); }
.kopf .rechts { margin-left: auto; display: flex; gap: .3rem; align-items: center; }
.glocke { position: relative; color: var(--gold-licht); padding: .3rem; display: block; }
.glocke svg { width: 24px; height: 24px; display: block; }
.glocke .zahl { position: absolute; top: -2px; right: -4px; background: #d65454; color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 9px; min-width: 18px; padding: 0 4px; text-align: center; }
.kopf form button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: .25rem .6rem; font-size: .8rem; cursor: pointer; }

main { max-width: 560px; margin: 0 auto; padding: 1rem; display: grid; gap: .8rem; }
.wahl-kunde { display: flex; gap: .4rem; flex-wrap: wrap; }
.wahl-kunde a { text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: .25rem .8rem; font-size: .85rem; color: var(--fg); }
.wahl-kunde a.an { background: var(--gold); color: var(--auf-gold); border-color: var(--gold); font-weight: 700; }

.karte { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; display: grid; gap: .5rem; }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.naechster { background: linear-gradient(135deg, #24345a, #1a2440); color: var(--stark); border-color: #3a4b78; }
.naechster .label { color: var(--gold-licht); }
.naechster .gross { font-family: var(--f-display); font-size: 1.2rem; }
.naechster .klein { font-size: .88rem; color: var(--muted); }
.zeile { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.zeile.zw { justify-content: space-between; }
a.karte { text-decoration: none; color: inherit; }
.leise { color: var(--muted); font-size: .88rem; margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #3a3220; color: var(--gold-licht); display: grid; place-items: center; font-weight: 700; flex: none; }
.kopfzeile { display: flex; gap: .6rem; align-items: center; }
.kopfzeile .wer { font-weight: 700; }
.kopfzeile .wann { color: var(--muted); font-size: .82rem; }
.stimmung { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 700; padding: .15rem .6rem; border-radius: 20px; }
.stimmung::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.gut { background: var(--ok-bg); color: var(--ok); } .mittel { background: var(--warn-bg); color: var(--warn); } .schlecht { background: var(--crit-bg); color: var(--crit); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: .1rem .6rem; }
.text { margin: 0; white-space: pre-line; }
.werte { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; font-size: .88rem; }
.werte div { background: var(--surface-2); border-radius: 8px; padding: .35rem .55rem; }
.werte b { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hinweis { border-radius: 8px; padding: .55rem .7rem; font-size: .92rem; display: grid; gap: .1rem; }
.hinweis.wichtig { background: var(--crit-bg); border-left: 3px solid var(--crit); }
.hinweis.wichtig b { color: var(--crit); }
.hinweis.info { background: var(--info-bg); }

.pegel { font-size: .74rem; font-weight: 700; padding: .1rem .55rem; border-radius: 10px; white-space: nowrap; }
.p-LEE { background: var(--crit-bg); color: var(--crit); } .p-FAS { background: var(--warn-bg); color: var(--warn); } .p-ok { background: var(--ok-bg); color: var(--ok); }
.eintrag { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.eintrag:first-of-type { border-top: 0; }
.eintrag .n { font-weight: 700; }
.eintrag .m { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.eintrag form { grid-column: 1 / -1; display: flex; gap: .4rem; flex-wrap: wrap; }

.knopf { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 9px; padding: .5rem .85rem;
  font-size: .9rem; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.knopf.haupt { background: #2a3a63; color: var(--stark); border-color: #3a4b78; }
.knopf.gold { background: var(--gold); color: var(--auf-gold); border-color: var(--gold); }
.knopf.breit { width: 100%; padding: .75rem; font-size: 1rem; }

.termin { display: grid; grid-template-columns: 56px 1fr; gap: .7rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.termin:first-of-type { border-top: 0; }
.datum { text-align: center; background: var(--surface-2); border-radius: 8px; padding: .25rem 0; line-height: 1.1; }
.datum b { display: block; font-family: var(--f-display); font-size: 1.25rem; }
.datum span { font-size: .7rem; text-transform: uppercase; color: var(--muted); }
.balken { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.balken i { display: block; height: 100%; background: var(--gold); }
.zahlen { font-variant-numeric: tabular-nums; }

.nachricht { display: flex; gap: .6rem; align-items: flex-start; padding-top: .55rem; border-top: 1px solid var(--line); }
.nachricht:first-of-type { border-top: 0; padding-top: 0; }
.nachricht > div { min-width: 0; }
.nachricht.FAM .avatar { background: var(--info-bg); color: #b9c8ee; }

label.feld { display: grid; gap: .3rem; font-weight: 700; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[inputmode], textarea, select {
  width: 100%; border: 1px solid var(--feld-linie); border-radius: 9px; padding: .65rem .75rem; background: var(--feld); color: var(--fg); font-size: 1rem; font-weight: 400; }
textarea { min-height: 5.5rem; resize: vertical; }
.code-eingabe { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.meldung { padding: .65rem .9rem; border-radius: 9px; background: var(--info-bg); }
.meldung.error { background: var(--crit-bg); color: #fcd4d4; } .meldung.success { background: var(--ok-bg); color: #c8f0d8; }
.fehler { color: var(--crit); font-size: .85rem; font-weight: 400; }
.mitte { text-align: center; }
details summary { cursor: pointer; color: var(--stark); font-weight: 700; }

.reiter { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: rgba(15,22,40,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 5; }
.reiter a { flex: 1; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 700; display: grid; justify-items: center; gap: 2px;
  padding: .5rem 0 .45rem; position: relative; }
.reiter a svg { width: 22px; height: 22px; }
.reiter a.an { color: var(--gold-licht); }
.reiter .punkt { position: absolute; top: 6px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: #e05c5c; }
.ungelesen { border-left: 3px solid var(--gold); }

/* ------------------------------------------------------------- App-Gefühl */
body { overscroll-behavior-y: none; }
a, button { touch-action: manipulation; }
@view-transition { navigation: auto; }
.als-app .kopf { padding-top: calc(.8rem + env(safe-area-inset-top, 0px)); }
.leise-knopf { background: transparent; color: var(--muted); }
.app-hinweis { grid-template-columns: 44px 1fr; align-items: center; gap: .4rem .75rem; border-color: #4a4026;
  background: linear-gradient(135deg, #2a2616, #1d2740); }
.app-hinweis img { border-radius: 11px; }
.app-hinweis b { display: block; color: var(--stark); }
.app-hinweis .leise { display: block; }
.app-hinweis-knoepfe { grid-column: 1 / -1; display: flex; gap: .4rem; }
.app-hinweis-knoepfe .knopf { flex: 1; }
.app-link .zeile b { color: var(--stark); }
.app-link span[aria-hidden] { color: var(--gold-licht); font-size: 1.4rem; line-height: 1; }
.app-kopf { display: flex; gap: .9rem; align-items: center; }
.app-kopf img { border-radius: 18px; box-shadow: 0 6px 20px rgba(0,0,0,.45); flex: none; }
.anleitung summary { display: flex; justify-content: space-between; align-items: center; list-style: none; }
.anleitung summary::-webkit-details-marker { display: none; }
.anleitung summary::after { content: "›"; color: var(--gold-licht); font-size: 1.4rem; transition: transform .2s; }
.anleitung[open] summary::after { transform: rotate(90deg); }
.anleitung .dein { display: none; margin-left: auto; margin-right: .6rem; font-size: .72rem; background: var(--gold); color: var(--auf-gold);
  border-radius: 10px; padding: .05rem .5rem; }
.anleitung.dein-geraet { border-color: #5a4c26; }
.anleitung.dein-geraet .dein { display: inline-block; }
.schritte { margin: .2rem 0 0; padding-left: 1.3rem; display: grid; gap: .55rem; }
.schritte li::marker { color: var(--gold-licht); font-weight: 700; }
.sym { width: 18px; height: 18px; vertical-align: -3px; color: var(--gold-licht); }
.nur-installierbar, .nur-als-app { display: none; }
.kann-installieren .nur-installierbar { display: grid; }
.als-app .nur-als-app { display: grid; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ------------------------------------------------------------- Helles Aussehen (Schalter oben, Wahl bleibt auf dem Gerät) */
html[data-thema="hell"] {
  color-scheme: light;
  --navy: #15233e; --gold: #c69829; --gold-dunkel: #8a6420; --auf-gold: #241a05;
  --bg: #f3f1ec; --surface: #fff; --surface-2: #f8f6f1; --line: #e2ddd2; --fg: #1d2433; --stark: #15233e; --muted: #5f6676;
  --ok: #2f7d55; --ok-bg: #e3f2ea; --warn: #a3620e; --warn-bg: #fbeed6; --crit: #b23b3b; --crit-bg: #f8e1e1; --info-bg: #e8edf6;
  --feld: #fff; --feld-linie: #cfc8b8;
}
html[data-thema="hell"] a { color: #1c2d4d; }
html[data-thema="hell"] .kopf { background: #15233e; border-bottom: 3px solid var(--gold); color: #fff; }
html[data-thema="hell"] .kopf .t { color: #fff; }
html[data-thema="hell"] .kopf .s { color: #d9cfae; }
html[data-thema="hell"] .kopf form button, html[data-thema="hell"] .thema-knopf { border-color: rgba(246,231,193,.35); color: #f6e7c1; }
html[data-thema="hell"] .glocke { color: #f6e7c1; }
html[data-thema="hell"] .naechster { background: #15233e; border-color: #15233e; color: #fff; }
html[data-thema="hell"] .naechster h1, html[data-thema="hell"] .naechster h2, html[data-thema="hell"] .naechster .gross { color: #fff; }
html[data-thema="hell"] .naechster .label { color: #e9c05a; }
html[data-thema="hell"] .naechster .klein { color: #f6e7c1; }
html[data-thema="hell"] .avatar { background: #f6e7c1; color: #5b4313; }
html[data-thema="hell"] .nachricht.FAM .avatar { color: #15233e; }
html[data-thema="hell"] .knopf.haupt { background: #15233e; color: #fff; border-color: #15233e; }
html[data-thema="hell"] .meldung.error { color: #7f1d1d; }
html[data-thema="hell"] .meldung.success { color: #14532d; }
html[data-thema="hell"] .reiter { background: rgba(255,255,255,.96); }
html[data-thema="hell"] .reiter a.an { color: #8a6420; }
html[data-thema="hell"] .app-hinweis { background: #fcf8ee; border-color: #ecdfbd; }
html[data-thema="hell"] .app-hinweis b, html[data-thema="hell"] .app-link .zeile b { color: #15233e; }
html[data-thema="hell"] .app-link span[aria-hidden], html[data-thema="hell"] .anleitung summary::after,
html[data-thema="hell"] .sym, html[data-thema="hell"] .schritte li::marker { color: #8a6420; }
html[data-thema="hell"] .anleitung.dein-geraet { border-color: #ecdfbd; }
html[data-thema="hell"] .app-kopf img { box-shadow: 0 6px 20px rgba(21,35,62,.25); }

.thema-knopf { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted); }
.thema-knopf svg { width: 17px; height: 17px; }
.thema-knopf .sonne { display: none; }
html[data-thema="hell"] .thema-knopf .sonne { display: block; }
html[data-thema="hell"] .thema-knopf .mond { display: none; }

/* Beschwerde, Datenschutz, Fußzeile */
label.haken { display: flex; gap: .55rem; align-items: center; font-weight: 700; font-size: .92rem; }
label.haken input { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
label.feld[hidden] { display: none; }
.beschwerde-link .zeile b { color: var(--stark); }
.beschwerde-link span[aria-hidden] { color: var(--gold-licht); font-size: 1.4rem; line-height: 1; }
html[data-thema="hell"] .beschwerde-link span[aria-hidden] { color: #8a6420; }
.fuss { text-align: center; font-size: .8rem; color: var(--muted); padding: .4rem 0 .8rem; }
.fuss a { color: var(--muted); }
.rechtstext h2 { font-size: 1.05rem; margin-top: .4rem; }
.rechtstext p, .rechtstext ul { margin: 0; }
.rechtstext ul { padding-left: 1.2rem; display: grid; gap: .25rem; }
