:root {
  --marke: #9f0f2f; --akzent: #f78911; --text: #1d1d1f; --leise: #575c63; --grund: #f6f4f2; --flaeche: #fff;
  --rand: #d9d6d2; --rand2: #a9a49e; --fehler: #b42318; --fehler-hell: #fdecea; --gut: #1e6b45; --gut-hell: #e6f4ec;
  --warn-hell: #fff4e5; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--grund); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
a { color: var(--marke); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.rahmen { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--flaeche); }

.kopf { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 3px solid var(--akzent); background: #fff; }
.logo { height: 40px; width: auto; display: block; }
.kopf-titel { margin-left: auto; font-weight: 700; color: var(--marke); font-size: 15px; }
.test-hinweis { background: var(--warn-hell); color: #7a4100; padding: 6px 16px; font-size: 14px; text-align: center; }

.inhalt { flex: 1; padding: 16px 16px 96px; outline: none; }
.laden { color: var(--leise); }
h1 { font-size: 21px; margin: 4px 0 12px; line-height: 1.3; }
h2 { font-size: 18px; margin: 20px 0 8px; }
.leise { color: var(--leise); font-size: 14px; }

/* Standort + Menü */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kacheln.eins { grid-template-columns: 1fr; }
.kachel { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; min-height: 92px; text-align: left;
  background: #fff; border: 1px solid var(--rand); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.kachel:hover { border-color: var(--marke); }
.kachel svg { width: 26px; height: 26px; stroke: var(--marke); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kachel .unter { font-weight: 400; font-size: 14px; color: var(--leise); }
.kachel-breit { grid-column: 1 / -1; min-height: 64px; flex-direction: row; align-items: center; }
.standort-zeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding: 10px 12px; background: var(--grund); border-radius: 10px; font-size: 15px; }
.link-knopf { background: none; border: 0; color: var(--marke); text-decoration: underline; cursor: pointer; padding: 4px; min-height: 44px; }

/* Formular */
.zurueck { margin: -4px 0 4px -6px; }
.hinweis { background: var(--grund); border-left: 4px solid var(--akzent); padding: 10px 12px; border-radius: 6px; margin: 0 0 16px; font-size: 15px; }
.notfall { background: var(--fehler-hell); border-left: 4px solid var(--fehler); padding: 10px 12px; border-radius: 6px; margin: 0 0 12px; font-weight: 600; }
.feld { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.feld > label, .feld > legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.pflicht { color: var(--fehler); }
.hilfe { font-size: 14px; color: var(--leise); margin: -2px 0 6px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rand2); border-radius: 10px; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.ungueltig input, .ungueltig select, .ungueltig textarea { border-color: var(--fehler); border-width: 2px; }
.feld-fehler { color: var(--fehler); font-size: 14px; margin-top: 4px; font-weight: 600; }
.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rand2); border-radius: 10px; cursor: pointer; background: #fff; font-weight: 500; }
.wahl input { width: 20px; height: 20px; accent-color: var(--marke); margin: 0; }
.wahl label:has(input:checked) { border-color: var(--marke); background: #fbf1f3; }
.wahl.spalte { flex-direction: column; }
.wunsch { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--rand); border-radius: var(--radius); }
.wunsch .unterlabel { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.daten-zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.daten-zeile input { flex: 1 1 160px; }
.datei-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.datei-liste li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--grund); border-radius: 8px; font-size: 14px; word-break: break-all; }
.einwilligung { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 8px 0 16px; }
.einwilligung input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--marke); }
.honig { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 10px; border: 0;
  background: var(--marke); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.knopf-voll { width: 100%; }
.knopf-leise { background: #fff; color: var(--marke); border: 1px solid var(--marke); }
.knopf:disabled { opacity: .55; cursor: wait; }
.meldung { margin: 10px 0; font-weight: 600; }
.meldung.fehler { color: var(--fehler); }
.meldung.gut { color: var(--gut); }

/* Chat */
.gespraeche { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gespraeche button { width: 100%; text-align: left; padding: 12px; border: 1px solid var(--rand); border-radius: var(--radius); background: #fff; cursor: pointer; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.blase { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.blase-ich { align-self: flex-end; background: #fbf1f3; border: 1px solid #ecc7cf; border-bottom-right-radius: 4px; }
.blase-praxis { align-self: flex-start; background: var(--grund); border: 1px solid var(--rand); border-bottom-left-radius: 4px; }
.blase-bestaetigung { border-color: var(--gut); background: var(--gut-hell); }
.blase-kopf { font-size: 13px; color: var(--leise); margin-bottom: 4px; white-space: normal; }
.system { align-self: center; font-size: 14px; color: var(--leise); text-align: center; }
.anhang { display: block; margin-top: 6px; font-size: 14px; }
.eingabe { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 72px; background: var(--flaeche); padding-top: 8px; }
.eingabe-zeile { display: flex; gap: 8px; }
.eingabe-zeile .knopf { flex: 0 0 auto; }
.linkbox { background: var(--grund); border-radius: var(--radius); padding: 12px; margin-top: 16px; font-size: 15px; }
.linkbox input { font-size: 13px; }

/* Download / Info */
.dok-liste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.dok-liste button { width: 100%; justify-content: flex-start; }
.standort-info { padding: 12px; border: 1px solid var(--rand); border-radius: var(--radius); margin-bottom: 10px; }
.standort-info strong { display: block; margin-bottom: 4px; }

/* Leiste unten */
.unten { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: #fff; border-top: 1px solid var(--rand); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.unten button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; min-height: 60px;
  background: none; border: 0; color: var(--leise); font-size: 13px; cursor: pointer; position: relative; }
.unten svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.unten button[aria-current="page"] { color: var(--marke); font-weight: 700; }
.punkt { position: absolute; top: 8px; right: calc(50% - 18px); width: 10px; height: 10px; background: var(--akzent); border-radius: 50%; }
.noscript { padding: 16px; }
@media (min-width: 520px) { .kacheln { grid-template-columns: 1fr 1fr 1fr; } .kacheln.eins { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
input.kurz { max-width: 120px; }
.feld .hinweis { margin: 8px 0 0; }
.eingabe-label { font-weight: 600; font-size: 15px; }
.link-dezent { font-size: 13px; color: var(--leise); word-break: break-all; }
.link-knopf.klein { font-size: 14px; min-height: 32px; padding: 2px 4px; }

/* ===== Chat wie WhatsApp (26.10.): Verlauf füllt das Fenster, Eingabe unten fest ===== */
body.chat-modus { overflow: hidden; }
body.chat-modus .rahmen { height: 100vh; height: 100dvh; min-height: 0; }
body.chat-modus .inhalt { flex: 1 1 auto; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
body.chat-modus .unten { position: static; flex: 0 0 auto; }
body.chat-modus .test-hinweis { padding: 3px 12px; font-size: 13px; }
body.chat-modus .kopf { padding: 8px 16px; }
body.chat-modus .logo { height: 32px; }
.chat-ansicht { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #efeae2; }
.chat-kopf { flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--rand); padding: 6px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.chat-titel { font-weight: 700; color: var(--marke); }
.geraet { flex: 1 1 100%; font-size: 13px; color: var(--leise); }
.geraet > summary { cursor: pointer; padding: 4px 0; list-style: none; }
.geraet > summary::-webkit-details-marker { display: none; }
.geraet > summary::after { content: " ▾"; }
.geraet[open] > summary::after { content: " ▴"; }
.geraet-inhalt { padding: 4px 0 8px; font-size: 14px; color: var(--text); }
.geraet-inhalt p { margin: 4px 0; }
.geraet-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.geraet-knoepfe .knopf { min-height: 40px; font-size: 14px; padding: 0 12px; }
.verlauf { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 6px; }
.verlauf > :first-child { margin-top: auto; } /* wenige Nachrichten: unten über der Eingabe, wie WhatsApp */
.verlauf .blase { max-width: 85%; padding: 6px 10px 4px; border-radius: 10px; white-space: normal; box-shadow: 0 1px 1px rgba(0,0,0,.08); border: 0; }
.verlauf .blase-ich { align-self: flex-end; background: #fbe3e8; border-bottom-right-radius: 3px; }
.verlauf .blase-praxis { align-self: flex-start; background: #fff; border-bottom-left-radius: 3px; }
.verlauf .blase-bestaetigung { background: var(--gut-hell); border: 1px solid var(--gut); }
.blase-text { white-space: pre-wrap; word-wrap: break-word; }
.blase-text.gekuerzt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blase .mehr { min-height: 28px; padding: 0; font-size: 14px; }
.blase-kopf { font-size: 12px; font-weight: 700; color: var(--marke); margin-bottom: 2px; }
.blase-zeit { font-size: 11px; color: var(--leise); text-align: right; margin-top: 2px; }
.verlauf .system { align-self: center; max-width: 90%; font-size: 12.5px; color: var(--leise); background: rgba(255,255,255,.75); padding: 3px 10px; border-radius: 8px; margin: 2px 0; }
.tag { align-self: center; font-size: 12px; color: var(--leise); }
.tag span { background: rgba(255,255,255,.85); padding: 2px 10px; border-radius: 8px; }
.chat-meldung { flex: 0 0 auto; margin: 0; padding: 0 12px; font-size: 14px; color: var(--fehler); font-weight: 600; }
.chat-meldung:empty { display: none; }
.chat-eingabe { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px; background: #f6f4f2; border-top: 1px solid var(--rand); }
.chat-eingabe textarea { flex: 1 1 auto; min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 14px; line-height: 1.35; overflow-y: auto; }
.rund { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rund svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rund-senden { background: var(--marke); color: #fff; }
.rund-leise { background: transparent; color: var(--leise); }
.rund:disabled { opacity: .5; cursor: wait; }
.versteckt { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ===== Anmeldebogen (26.10.) ===== */
.bogen-karte { background: var(--grund); border: 1px solid var(--rand); border-radius: var(--radius); padding: 12px 14px 14px; margin-bottom: 18px; }
.bogen-karte h1 { font-size: 19px; margin: 2px 0 6px; }
.bogen-fortschritt { display: flex; gap: 6px; margin: 0 0 6px; }
.bogen-fortschritt span { flex: 1; height: 5px; border-radius: 3px; background: var(--rand); }
.bogen-fortschritt span.an { background: var(--marke); }
.bogen-text { font-size: 14.5px; line-height: 1.5; background: var(--grund); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.bogen-zwischentitel { font-weight: 700; margin: 18px 0 10px; }
.en { display: block; font-style: italic; font-weight: 400; color: var(--leise); font-size: 13px; }
.feld-janein .wahl label { min-width: 84px; justify-content: center; }
.feld-janein legend span { display: block; }
canvas.unterschrift { display: block; width: 100%; max-width: 520px; height: 170px; border: 2px dashed var(--rand2); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.ungueltig canvas.unterschrift { border-color: var(--fehler); }
.bogen-knoepfe { display: flex; gap: 10px; justify-content: space-between; margin-top: 8px; }
.bogen-knoepfe .knopf[type=submit] { flex: 1; }
.knopf-bogen { margin-top: 8px; min-height: 42px; width: 100%; }
