/* Eltern-Chat · Familienseite: hell, warm, freundlich (E-018), Handy zuerst, große Schrift. Logische Eigenschaften → Arabisch spiegelt sich selbst. */
:root {
  --grund: #fff8f1; --karte: #ffffff; --text: #2b2522; --still: #6f6158; --linie: #f0dfd0;
  --akzent: #e76f2e; --akzent-dunkel: #b94f16; --eigen: #ffe3cc; --team: #ffffff; --ok: #2e7d4f; --gefahr: #b3261e;
  --rund: 18px; --schrift: 18px;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #1f1a17; --karte: #2a2420; --text: #f6ece4; --still: #c2b2a6; --linie: #3d3430; --eigen: #5a3a24; --team: #2f2824; --akzent-dunkel: #ffb38a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--grund); color: var(--text); font: var(--schrift)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.45em; line-height: 1.2; margin: .3em 0 .5em; } h2 { font-size: 1.2em; margin: .2em 0 .5em; } h3 { font-size: 1em; margin: 1.1em 0 .4em; color: var(--still); }
p { margin: .5em 0; }
a { color: var(--akzent-dunkel); }
.laden { text-align: center; color: var(--still); margin-top: 40vh; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--rund); padding: 18px; margin: 10px 0; box-shadow: 0 2px 10px rgba(120, 70, 30, .06); }
.karte.mitte { text-align: center; }
.logo { width: 64px; height: 64px; margin: 4px auto 8px; border-radius: 18px; background: var(--akzent) url(icon.svg) center/100% no-repeat; }
.sprachen { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.sprache { flex: 1 1 auto; min-height: 44px; border: 1px solid var(--linie); background: var(--karte); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9em; }
.sprache.an { border-color: var(--akzent); background: var(--eigen); font-weight: 600; }
label { display: block; margin: 12px 0; font-weight: 600; }
input:not([type=checkbox]), textarea { display: block; width: 100%; margin-top: 6px; font: inherit; padding: 12px; border: 1px solid var(--linie); border-radius: 12px; background: var(--grund); color: var(--text); }
textarea { resize: none; }
button { font: inherit; cursor: pointer; }
.haupt, .zweit, .gefahr { display: block; width: 100%; min-height: 52px; border-radius: 14px; border: 0; margin: 14px 0 6px; font-weight: 600; }
.haupt { background: var(--akzent); color: #fff; } .haupt:disabled { opacity: .6; }
.haupt.gross { font-size: 1.1em; min-height: 60px; }
.zweit { background: var(--eigen); color: var(--text); }
.gefahr { background: transparent; border: 1px solid var(--gefahr); color: var(--gefahr); margin-top: 22px; }
.link { background: none; border: 0; padding: 6px 0; color: var(--akzent-dunkel); text-decoration: underline; font-size: .95em; }
.klein { font-size: .82em; color: var(--still); }
.ok { color: var(--ok); font-weight: 600; }
.meldung { color: var(--gefahr); font-weight: 600; min-height: 1.2em; }
.notfall { font-size: .85em; color: var(--still); text-align: center; margin: 14px 0 4px; }
.honig { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.haken { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; background: var(--grund); border-radius: 12px; padding: 12px; }
.haken input { width: 26px; height: 26px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--akzent); }
.versteckt { display: none !important; }
.testband { background: #ffd27a; color: #4a3200; font-size: .78em; font-weight: 700; text-align: center; border-radius: 10px; padding: 6px 10px; margin: 0 0 8px; }
.code { text-align: center; font-size: 1.6em !important; letter-spacing: .3em; max-width: 260px; margin: 6px auto 0 !important; }
.entwurf { background: #fff3cd; color: #6b4e00; border-radius: 10px; padding: 8px 10px; font-size: .85em; }
.schritte li { margin: 8px 0; }

/* Chat: feste Höhe, nur der Verlauf scrollt (neueste Nachricht unten sichtbar, Eingabe immer erreichbar) */
main.chat { height: 100vh; height: 100dvh; min-height: 0; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
main.chat .verlauf { min-height: 0; }
.kopf { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; background: var(--grund); padding: 6px 0 10px; border-bottom: 1px solid var(--linie); }
.kopf-text { flex: 1; min-width: 0; } .kopf-text strong { font-size: 1.15em; }
.abwesend { font-size: .82em; color: var(--akzent-dunkel); font-weight: 600; }
.menue { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--linie); background: var(--karte); color: var(--text); font-size: 1.4em; line-height: 1; }
#hinweisleiste:empty { display: none; }
.leiste-knopf { width: 100%; margin: 8px 0 0; min-height: 46px; border: 1px dashed var(--akzent); background: var(--eigen); color: var(--text); border-radius: 12px; font-weight: 600; }
.verlauf { flex: 1; overflow-y: auto; padding: 8px 0; display: flex; flex-direction: column; gap: 6px; min-height: 40vh; }
.tag { align-self: center; font-size: .75em; color: var(--still); background: var(--karte); border-radius: 999px; padding: 2px 12px; margin: 8px 0 2px; border: 1px solid var(--linie); }
.leer { text-align: center; color: var(--still); margin-top: 20vh; }
.blase { max-width: 86%; padding: 9px 13px; border-radius: var(--rund); background: var(--team); border: 1px solid var(--linie); align-self: flex-start; overflow-wrap: anywhere; }
.blase.eigen { align-self: flex-end; background: var(--eigen); border-color: transparent; border-end-end-radius: 6px; }
.blase.team { border-end-start-radius: 6px; }
.blase .wer { font-size: .78em; font-weight: 700; color: var(--akzent-dunkel); margin-bottom: 2px; }
.blase .text { white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.blase .zeit { font-size: .7em; color: var(--still); text-align: end; margin-top: 3px; }
.blase .still { font-style: italic; color: var(--still); }
.blase .bild { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; margin-top: 4px; }
.blase .datei { display: inline-block; margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }
.system { align-self: center; max-width: 90%; text-align: center; font-size: .8em; color: var(--still); background: var(--karte); border: 1px dashed var(--linie); border-radius: 12px; padding: 6px 12px; }
.status { font-size: .85em; color: var(--gefahr); min-height: 1.2em; }
.eingabe { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; background: var(--grund); padding: 8px 0 0; }
.eingabe textarea { margin: 0; min-height: 50px; max-height: 160px; border-radius: 24px; padding: 12px 16px; }
.anhang, .senden { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3em; margin: 0; }
.anhang { border: 1px solid var(--linie); background: var(--karte); cursor: pointer; font-weight: 400; }
.senden { border: 0; background: var(--akzent); color: #fff; }
[dir=rtl] .senden { transform: scaleX(-1); }

/* Overlay */
.overlay { position: fixed; inset: 0; z-index: 10; background: rgba(40, 25, 15, .45); display: flex; align-items: flex-end; justify-content: center; }
.blatt { background: var(--karte); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zu { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linie); background: var(--grund); color: var(--text); font-size: 1.4em; }
@media (min-width: 700px) { .overlay { align-items: center; } .blatt { border-radius: 22px; } }
