/* =============================================================
   Herzfenster – Familie
   =============================================================

   Klar, hell, aufgeräumt – wie eine App, die man täglich in der Hand
   hat, nicht wie ein Formular vom Amt. Weiße Karten auf neutralem
   Grund, ein kräftiger Akzent aus dem Herz im Logo, sonst Graustufen.

   Drei Regeln:

   1. DER AKZENT HEISST "TUN". Herzrot steht auf dem, was man drückt,
      um etwas zu bewirken – Abschicken, Speichern, Einladen – und auf
      dem aktiven Reiter. Nirgends als Dekoration.

   2. LAMPENLICHT GIBT ES GENAU EINMAL. "Gezeigt" ist das, wofür die
      Familie bezahlt: Der Moment stand in ihrem Zimmer auf dem Schirm.
      Diese warme Bernsteinfarbe kommt nirgendwo sonst vor.

   3. FARBE TRÄGT NIE ALLEIN. Jeder Zustand steht auch im Text.

   Die Leser sind 40 bis 60 und lesen unterwegs auf dem Telefon:
   17 px Grundgröße, 48 px kleinste Antippfläche, Kontraste über AA.

   Der Kiosk teilt sich hiermit NICHTS. Er hat eigene Werte in
   kiosk.css, weil er eine andere Aufgabe hat.
   ============================================================= */

:root {
    --grund:       #f4f4f6;
    --flaeche:     #ffffff;
    --flaeche-2:   #f7f7f9;   /* Eingaben und Einschübe auf einer Karte */
    --rand:        #e5e5ea;   /* nur Trennung */
    --rand-feld:   #8d8d99;   /* 3,3:1 – alles, was eine Eingabe begrenzt */
    --tinte:       #17171c;
    --leise:       #5d5d6b;   /* 6,2:1 auf Weiß */

    --akzent:        #c8324c;   /* 5,3:1 mit weißer Schrift */
    --akzent-dunkel: #a6263d;
    --akzent-hauch:  #fdedf0;
    --akzent-text:   #a6263d;

    /* Lampenlicht: nur für "Gezeigt" */
    --lampe:       #d97706;
    --lampe-text:  #92400e;   /* 7:1 auf dem Hauch */
    --lampe-hauch: #fef3c7;

    --gut:         #166534;
    --gut-hauch:   #dcfce7;
    --warnung:     #b42318;
    --warn-hauch:  #fee4e2;

    --schrift: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

    --t-klein:  0.875rem;
    --t-text:   1rem;
    --t-gross:  1.1875rem;
    --t-titel:  1.5rem;
    --t-haupt:  1.875rem;

    --griff: 3rem;            /* kleinste Antippfläche: 48 px */
    --luft:  1.25rem;
    --rund:  16px;
    --rund-k: 12px;
    --schatten: 0 1px 2px rgba(23, 23, 28, 0.04), 0 6px 24px rgba(23, 23, 28, 0.05);

    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

/* Ein eigenes `display` überstimmt sonst das hidden-Attribut. Genau so blieb
   auf dem Kiosk ein leerer Bildrahmen stehen und in der App eine Schaltfläche,
   die längst ersetzt war. Einmal global, damit dieser Fehler nicht ein drittes
   Mal entsteht. */
[hidden] { display: none !important; }

html { font-size: 17px; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--tinte);
    font-family: var(--schrift);
    font-size: var(--t-text);
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--akzent-text); }

:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
    border-radius: 4px;
}

.ic { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.sprungmarke {
    position: absolute;
    left: -9999px;
    background: var(--tinte);
    color: #fff;
    padding: 0.75rem 1rem;
    z-index: 30;
}
.sprungmarke:focus { left: 0.5rem; top: 0.5rem; }

.verborgen-visuell {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* =============================================================
   Kopf und Navigation
   =============================================================
   Oben die Marke, auf dem Telefon die Reiter unten am Daumen – so,
   wie man es von jeder App kennt. Ab Tablet-Breite wandern sie in
   die Kopfzeile. */

.kopf {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--luft);
    padding: 0.5rem var(--luft);
    padding-top: max(0.5rem, env(safe-area-inset-top));
    /* Kein Weichzeichner hier: backdrop-filter machte den Kopf zum Bezugs-
       rahmen für position: fixed – und die Reiter klebten oben statt unten. */
    background: var(--flaeche);
    border-bottom: 1px solid var(--rand);
}

.marke {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--griff);
    font-size: var(--t-gross);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--tinte);
}
.marke img { width: 2rem; height: 2rem; }

.reiter {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    padding: 0.25rem 0.25rem max(0.25rem, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
            backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--rand);
}

.reiter a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-height: 3.5rem;
    padding: 0.25rem;
    border-radius: var(--rund-k);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--leise);
    text-decoration: none;
}
.reiter a .ic { width: 1.5rem; height: 1.5rem; }
.reiter a[aria-current="page"] { color: var(--akzent-text); }

.kopf-abmelden { margin: 0 0 0 auto; }
.kopf-abmelden button {
    display: none;
    min-height: 2.5rem;
    padding: 0 0.875rem;
    font: inherit;
    font-size: var(--t-klein);
    font-weight: 600;
    color: var(--leise);
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.kopf-abmelden button:hover { background: var(--flaeche-2); color: var(--tinte); }

main {
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--luft) var(--luft) 7rem;
}

/* Ohne Anmeldung (Anmelden, Einladung) gibt es keine Reiter. */
body.ohne-reiter main { padding-bottom: 3rem; }

@media (min-width: 48rem) {
    .kopf {
        padding-left: 2rem;
        padding-right: 2rem;
        background: rgba(255, 255, 255, 0.86);
        -webkit-backdrop-filter: saturate(1.6) blur(14px);
                backdrop-filter: saturate(1.6) blur(14px);
    }
    .reiter {
        position: static;
        flex: 1 1 auto;
        justify-content: center;
        gap: 0.25rem;
        padding: 0;
        background: none;
        border: 0;
        -webkit-backdrop-filter: none;
                backdrop-filter: none;
    }
    .reiter a {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 0.5rem;
        min-height: 2.5rem;
        padding: 0 1rem;
        border-radius: 999px;
        font-size: var(--t-klein);
    }
    .reiter a .ic { width: 1.125rem; height: 1.125rem; }
    .reiter a:hover { background: var(--flaeche-2); color: var(--tinte); }
    .reiter a[aria-current="page"] { background: var(--akzent-hauch); color: var(--akzent-text); }
    .kopf-abmelden { margin-left: 0; }
    .kopf-abmelden button { display: inline-flex; align-items: center; }
    main { padding: 2.5rem 2rem 5rem; }
}

/* =============================================================
   Seitenkopf, Karten, Meldungen
   ============================================================= */

.seite-kopf { margin: 0.5rem 0 1.5rem; }
.seite-kopf h1 {
    margin: 0;
    font-size: var(--t-haupt);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
}
.seite-kopf p {
    margin: 0.5rem 0 0;
    color: var(--leise);
    max-width: 38rem;
}

.karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--rund);
    box-shadow: var(--schatten);
    margin: 0 0 1.25rem;
}
.karte-rumpf { padding: var(--luft); }
.karte-kopf {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem var(--luft);
    border-bottom: 1px solid var(--rand);
}
.karte-kopf h2 {
    margin: 0;
    font-size: var(--t-gross);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.karte-kopf p { margin: 0.125rem 0 0; font-size: var(--t-klein); color: var(--leise); }
.karte-kopf-text { flex: 1; min-width: 0; }
.karte-symbol {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--rund-k);
    background: var(--akzent-hauch);
    color: var(--akzent-text);
}

h2.abschnitt {
    margin: 2rem 0 0.75rem;
    font-size: var(--t-klein);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--leise);
}

.leise { color: var(--leise); font-size: var(--t-klein); }

.meldung {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 0 0 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: var(--rund-k);
    background: var(--gut-hauch);
    color: var(--gut);
    font-size: var(--t-klein);
    font-weight: 600;
}
.meldung[data-art="hinweis"] { background: var(--warn-hauch); color: var(--warnung); }

/* =============================================================
   Knöpfe und Felder
   ============================================================= */

.knopf,
.senden {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--griff);
    padding: 0 1.5rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--akzent);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.knopf:hover, .senden:hover { background: var(--akzent-dunkel); color: #fff; }

.knopf.ist-zweit {
    color: var(--tinte);
    background: var(--flaeche);
    border: 1px solid var(--rand-feld);
}
.knopf.ist-zweit:hover { background: var(--flaeche-2); color: var(--tinte); }
.knopf.ist-breit { width: 100%; }

/* Stille Aktionen mit Folgen: Zurückholen, Zurückziehen, Ausschalten. */
.zurueckholen {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 1rem;
    font: inherit;
    font-size: var(--t-klein);
    font-weight: 600;
    color: var(--leise);
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 999px;
    cursor: pointer;
}
.zurueckholen:hover { color: var(--warnung); border-color: var(--warnung); }

.feld { margin: 0 0 1rem; }
.feld:last-child { margin-bottom: 0; }
.feld > label,
.feld-titel {
    display: block;
    margin: 0 0 0.375rem;
    font-size: var(--t-klein);
    font-weight: 700;
}
.feld-hilfe { display: block; margin-top: 0.25rem; font-size: var(--t-klein); font-weight: 400; color: var(--leise); }

.eingabe,
.anmelden input,
.einladen input {
    display: block;
    width: 100%;
    min-height: var(--griff);
    padding: 0.625rem 0.875rem;
    font: inherit;
    color: var(--tinte);
    background: var(--flaeche);
    border: 1px solid var(--rand-feld);
    border-radius: var(--rund-k);
}
.eingabe:focus,
.anmelden input:focus,
.einladen input:focus {
    outline: none;
    border-color: var(--akzent);
    box-shadow: 0 0 0 4px var(--akzent-hauch);
}
select.eingabe { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%); background-position: calc(100% - 1.1rem) 50%, calc(100% - 0.75rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2.25rem; }

/* =============================================================
   Gerätezeile: lebt das Tablet noch?
   ============================================================= */

.geraet {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 1rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--rund-k);
    background: var(--flaeche);
    border: 1px solid var(--rand);
    font-size: var(--t-klein);
    font-weight: 600;
    color: var(--leise);
}

.puls {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--leise);
    flex: none;
}
.geraet[data-zustand="da"] .puls { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.geraet[data-zustand="weg"] .puls { background: var(--warnung); }

/* Farbe trägt hier nie allein – der Text sagt dasselbe noch einmal. */
.geraet[data-zustand="weg"] {
    background: var(--warn-hauch);
    border-color: transparent;
    color: var(--warnung);
}

/* =============================================================
   Das Schreibfeld – die Seite selbst
   ============================================================= */

.schreiben {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 20px;
    box-shadow: var(--schatten);
    padding: var(--luft);
    margin: 0 0 2rem;
}

.schreiben-kopf {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.875rem;
}
.schreiben-kopf h1 {
    margin: 0;
    font-size: var(--t-titel);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--akzent-hauch);
    color: var(--akzent-text);
    font-weight: 800;
}
.avatar.ist-grau { background: var(--flaeche-2); color: var(--leise); }

.schreiben textarea {
    display: block;
    width: 100%;
    min-height: 8rem;
    padding: 1rem;
    font: inherit;
    font-size: var(--t-gross);
    line-height: 1.5;
    color: var(--tinte);
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-radius: var(--rund-k);
    resize: vertical;
}
.schreiben textarea:focus {
    outline: none;
    background: var(--flaeche);
    border-color: var(--akzent);
    box-shadow: 0 0 0 4px var(--akzent-hauch);
}
.schreiben textarea::placeholder { color: var(--leise); }

.werkzeuge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.875rem;
}
.werkzeuge .senden { margin-left: auto; }

/* Wie lange es auf dem Tablet bleibt – eine ruhige Zeile über den Werkzeugen. */
.laufzeit { margin: 0.875rem 0 0; padding: 0; border: 0; min-width: 0; }
.laufzeit legend { margin-bottom: 0.375rem; padding: 0; font-size: var(--t-klein); font-weight: 600; color: var(--leise); }
.laufzeit-aendern .wahl { margin-bottom: 0.5rem; }

/* Foto wählen sieht aus wie ein Knopf, ist aber ein Label –
   der echte Dateiwähler bleibt bedienbar und per Tastatur erreichbar. */
.beilage {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--griff);
    max-width: 100%;
    padding: 0 1.125rem;
    border: 1px solid var(--rand);
    border-radius: 999px;
    background: var(--flaeche-2);
    color: var(--tinte);
    font: inherit;
    font-size: var(--t-klein);
    font-weight: 600;
    cursor: pointer;
}
.beilage > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beilage:hover { border-color: var(--rand-feld); background: var(--flaeche); }
.beilage input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.beilage:focus-within { outline: 3px solid var(--akzent); outline-offset: 2px; }
.beilage[data-gewaehlt="ja"] {
    border-color: var(--akzent);
    background: var(--akzent-hauch);
    color: var(--akzent-text);
}
button.beilage { text-align: left; }

/* --- Sprachmemo aufnehmen --------------------------------------
   Was die beiden Zustände unterscheidet, steht im Text – nicht in
   der Farbe. "Nimmt auf" ist ein Satz, kein roter Punkt.          */

.aufnahme {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.875rem;
    padding: 0.75rem 0.875rem;
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-radius: var(--rund-k);
}
.aufnahme-stand {
    margin: 0;
    font-weight: 700;
    font-size: var(--t-klein);
    font-variant-numeric: tabular-nums;
}
.aufnahme button {
    margin-left: auto;
    min-height: 2.75rem;
    padding: 0 1.25rem;
    font: inherit;
    font-size: var(--t-klein);
    font-weight: 700;
    color: #fff;
    background: var(--tinte);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
#memo-weg { color: var(--tinte); background: var(--flaeche); border: 1px solid var(--rand-feld); }

/* Der native Abspieler ist nicht schön, aber er ist mit Tastatur und
   Screenreader bedienbar und funktioniert in jedem Browser. */
.aufnahme audio,
.moment-memo audio {
    flex: 1 1 14rem;
    min-width: 0;
    max-width: 22rem;
    height: 2.5rem;
}

/* =============================================================
   Die Momente
   ============================================================= */

.momente {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.moment {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--rund);
    box-shadow: var(--schatten);
    overflow: hidden;
}
.moment[data-zurueckgeholt="ja"] {
    background: transparent;
    box-shadow: none;
    border-style: dashed;
    color: var(--leise);
}

/* Das Foto so, wie es hochgeladen wurde: ganz, nie beschnitten. Ein
   Hochformat steht mittig in voller Höhe, statt oben und unten gekappt. */
.moment img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 32rem;
    margin: 0 auto;
}

.moment-kopf {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem var(--luft) 0;
    font-size: var(--t-klein);
    color: var(--leise);
}
.moment-kopf strong { color: var(--tinte); }
.moment-kopf .avatar { width: 2.25rem; height: 2.25rem; font-size: var(--t-klein); }

.moment-text {
    margin: 0;
    padding: 0.75rem var(--luft) 0.875rem;
    font-size: var(--t-gross);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.moment-memo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
    padding: 0 var(--luft) 0.875rem;
}
.memo-marke { font-size: var(--t-klein); font-weight: 700; color: var(--leise); }

.moment-fuss {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem var(--luft);
    border-top: 1px solid var(--rand);
    font-size: var(--t-klein);
    color: var(--leise);
}
.moment-fuss .zurueckholen { margin-left: auto; }
.moment-fuss .jetzt-zeigen + .zurueckholen { margin-left: 0; }

/* Jetzt zeigen: eine freundliche Aktion, also nicht in Warnfarbe. */
.jetzt-zeigen {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    margin-left: auto;
    padding: 0 1rem;
    font: inherit;
    font-size: var(--t-klein);
    font-weight: 700;
    color: var(--akzent-text);
    background: var(--flaeche);
    border: 1px solid var(--rand-feld);
    border-radius: 999px;
    cursor: pointer;
}
.jetzt-zeigen:hover { border-color: var(--akzent); }
.jetzt-zeigen svg { width: 1.1em; height: 1.1em; }

/* Am Tablet vorführen: unter der Gerätezeile, zugeklappt. */
.vorfuehren { margin: -0.5rem 0 1rem; }
.vorfuehren summary {
    display: inline-flex; align-items: center; min-height: 2.75rem;
    font-size: var(--t-klein); font-weight: 700; color: var(--akzent-text); cursor: pointer;
}
.vorfuehren form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.vorfuehren .knopf { flex: 1 1 10rem; }

/* --- Das Signaturelement ------------------------------------- *
 * Der einzige Ort, an dem Lampenlicht vorkommt: der Moment stand
 * in ihrem Zimmer auf dem Bildschirm. "Gezeigt", nicht "gesehen" –
 * das ist die Grenze dessen, was das Gerät belegen kann.          */

.weg {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--flaeche-2);
    font-weight: 600;
}
.weg::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    border: 1.5px solid currentColor;
}
.weg[data-gezeigt="ja"] {
    color: var(--lampe-text);
    background: var(--lampe-hauch);
    font-weight: 700;
}
.weg[data-gezeigt="ja"]::before {
    background: var(--lampe);
    border-color: var(--lampe);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.25);
}

.tage { font-weight: 600; }

/* Ihre Antwort in der Zeitleiste. Das Einzige auf dieser Seite, das von ihr
   kommt und nicht von uns – deshalb eine eigene Fläche mit Symbol. Die
   Bedeutung steht im Satz, nicht in der Farbe. */
.geklatscht {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 var(--luft) 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--rund-k);
    background: var(--akzent-hauch);
    color: var(--akzent-text);
    font-weight: 700;
}

/* Sprachnachrichten vom Tablet: der Spieler über die volle Breite. */
.antworten .antwort .liste-text { display: grid; gap: 0.35rem; }
.antworten audio { width: 100%; }

.fussnote {
    margin: 1.5rem 0 0;
    font-size: var(--t-klein);
    color: var(--leise);
    max-width: 38rem;
}

.leerer-anfang {
    padding: 2rem var(--luft);
    text-align: center;
    color: var(--leise);
    background: var(--flaeche);
    border: 1px dashed var(--rand-feld);
    border-radius: var(--rund);
}
.leerer-anfang p { margin: 0 0 0.5rem; }
.leerer-anfang p:last-child { margin: 0; }
.leerer-anfang .ic { width: 2rem; height: 2rem; color: var(--akzent); margin-bottom: 0.5rem; }

/* =============================================================
   Listen: Menschen, Einladungen, Tablets
   ============================================================= */

.liste { list-style: none; margin: 0; padding: 0; }
.liste > li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem var(--luft);
    border-bottom: 1px solid var(--rand);
}
.liste > li:last-child { border-bottom: 0; }
.liste-text { flex: 1 1 0; min-width: 6rem; }
.liste-text strong { display: block; font-weight: 700; }
.liste-text small { display: block; font-size: var(--t-klein); color: var(--leise); overflow-wrap: anywhere; }

.plakette {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--flaeche-2);
    color: var(--leise);
}
.plakette.ist-akzent { background: var(--akzent-hauch); color: var(--akzent-text); }
.plakette.ist-gut    { background: var(--gut-hauch); color: var(--gut); }
.plakette.ist-warn   { background: var(--warn-hauch); color: var(--warnung); }

/* Der Einladungslink: einmal sichtbar, deshalb auffällig genug, dass ihn
   niemand übersieht. */
.schluessel {
    margin: 0 0 1.25rem;
    padding: var(--luft);
    border-radius: var(--rund);
    background: var(--lampe-hauch);
    border: 1px solid #fcd34d;
    color: #78350f;
}
.schluessel p { margin: 0 0 0.75rem; }
.schluessel input {
    width: 100%;
    min-height: var(--griff);
    padding: 0 0.875rem;
    font-family: var(--mono);
    font-size: var(--t-klein);
    color: var(--tinte);
    background: #fff;
    border: 1px solid #f59e0b;
    border-radius: var(--rund-k);
}
.schluessel .leise { margin: 0.5rem 0 0; color: #78350f; }

.einladen .zeile { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.einladen .zeile input { flex: 1 1 14rem; width: auto; min-width: 0; }

/* =============================================================
   Tablet-Einstellungen
   =============================================================
   Auswahl als Kacheln statt Dropdowns: Man sieht alle Möglichkeiten
   auf einmal, und jede ist eine volle Antippfläche. */

.einstellung { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
.einstellung:last-of-type { margin-bottom: 0; }
.einstellung legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 0.625rem;
    font-weight: 700;
}
.einstellung legend .ic { color: var(--akzent); }
.einstellung > p { margin: -0.25rem 0 0.75rem; font-size: var(--t-klein); color: var(--leise); }

.wahl { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.wahl.ist-zeile { grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); }

.wahl label {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.125rem;
    min-height: var(--griff);
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--rand-feld);
    border-radius: var(--rund-k);
    background: var(--flaeche);
    font-size: var(--t-klein);
    font-weight: 600;
    cursor: pointer;
}
.wahl label small { font-weight: 400; color: var(--leise); }
.wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wahl label:has(input:checked) {
    border-color: var(--akzent);
    background: var(--akzent-hauch);
    color: var(--akzent-text);
    box-shadow: inset 0 0 0 1px var(--akzent);
}
.wahl label:has(input:checked) small { color: var(--akzent-text); }
.wahl label:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Kleine Vorschau des Farbschemas – zeigt, was die Worte meinen. */
.schema-bild {
    display: block;
    height: 4.5rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.schema-bild.ist-dunkel {
    background: linear-gradient(to top, #120f0d 0%, rgba(18, 15, 13, 0.85) 38%, transparent 70%),
                linear-gradient(135deg, #7aa0b8, #c9b48a 60%, #8a6a4f);
}
.schema-bild.ist-hell { background: #fdfbf7; border: 1px solid var(--rand); }
.schema-bild.ist-hell::before {
    content: "";
    position: absolute;
    left: 8%; top: 12%; width: 46%; bottom: 12%;
    border-radius: 4px;
    background: linear-gradient(135deg, #7aa0b8, #c9b48a 60%, #8a6a4f);
}
.schema-bild::after {
    content: "";
    position: absolute;
    height: 0.4rem;
    border-radius: 2px;
}
.schema-bild.ist-dunkel::after { left: 8%; right: 30%; bottom: 14%; background: #f7f2ea; box-shadow: 0 -0.7rem 0 #f7f2ea; }
.schema-bild.ist-hell::after   { left: 60%; right: 8%; top: 38%; background: #14100c; box-shadow: 0 0.7rem 0 #14100c; }

.zeiten { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.zeiten .feld { flex: 1 1 8rem; margin: 0; }

.karte-fuss {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem var(--luft);
    border-top: 1px solid var(--rand);
    background: var(--flaeche-2);
    border-radius: 0 0 var(--rund) var(--rund);
}
.karte-fuss .leise { flex: 1 1 14rem; margin: 0; }

/* Klatschen: der einzige Ort, an dem ein Mikrofon eingeschaltet wird.
   Bewusst mit viel Text: Wer das einschaltet, soll es vorher gelesen haben. */
.klatsch p { margin: 0 0 0.875rem; max-width: 62ch; }
.klatsch p:last-child { margin-bottom: 0; }

.klatsch-schalter { margin: 0.25rem 0 0; flex-basis: 100%; }

/* Die Bestätigung ist kein Häkchen neben einem Wort, sondern ein Satz, den
   man liest. Die ganze Fläche ist anklickbar. */
.bestaetigung {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin: 0 0 0.875rem;
    padding: 0.875rem;
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-radius: var(--rund-k);
    font-size: var(--t-klein);
    line-height: 1.5;
    cursor: pointer;
}
.bestaetigung input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.375rem;
    height: 1.375rem;
    margin: 0;
    accent-color: var(--akzent);
}

/* =============================================================
   Anmelden, Einladung, Konto
   ============================================================= */

.anmelden {
    max-width: 26rem;
    margin: 2rem auto 0;
}
.anmelden-marke { display: flex; justify-content: center; margin: 0 0 1.5rem; }
.anmelden-marke img { width: 4rem; height: 4rem; }
.anmelden h1 {
    margin: 0 0 0.5rem;
    font-size: var(--t-haupt);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-align: center;
}
.anmelden .satz { margin: 0 0 1.5rem; color: var(--leise); text-align: center; }
.anmelden .karte { padding: 1.5rem; }
.anmelden label { display: block; font-size: var(--t-klein); font-weight: 700; margin: 1rem 0 0.375rem; }
.anmelden label:first-of-type { margin-top: 0; }
.anmelden .knopf { width: 100%; margin-top: 1.5rem; }
.anmelden .unter { margin: 1.25rem 0 0; text-align: center; font-size: var(--t-klein); color: var(--leise); }
.anmelden .unter a { font-weight: 700; }

/* Passwort oder Link: zwei Wege, ein Schalter. */
.umschalter {
    display: flex;
    gap: 0.25rem;
    margin: 0 0 1.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
}
.umschalter a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border-radius: 999px;
    font-size: var(--t-klein);
    font-weight: 700;
    color: var(--leise);
    text-decoration: none;
}
.umschalter a[aria-current="page"] { background: var(--flaeche); color: var(--tinte); box-shadow: 0 1px 3px rgba(23, 23, 28, 0.12); }

/* =============================================================
   Steckbrief
   =============================================================
   Das Gespräch als Chat: Fragen der KI links, das Erzählte rechts.
   Wer spricht, steht auch in der Form, nicht nur in der Farbe. */

.steckbrief-zweck { max-width: 62ch; }

.gespraech-weg { margin: 0 0 1rem; font-size: var(--t-klein); color: var(--leise); max-width: 62ch; }

.verlauf {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.verlauf li {
    max-width: 88%;
    padding: 0.75rem 1rem;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.verlauf-frage {
    align-self: flex-start;
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-radius: 4px 18px 18px 18px;
    font-size: var(--t-gross);
    line-height: 1.45;
}
.verlauf-familie {
    align-self: flex-end;
    background: var(--akzent);
    color: #fff;
    border-radius: 18px 4px 18px 18px;
}
.verlauf-fertig {
    align-self: stretch;
    max-width: none !important;
    background: var(--gut-hauch);
    color: var(--gut);
    border-radius: var(--rund-k);
    font-weight: 700;
}

.gespraech textarea,
.steckbrief textarea {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    font: inherit;
    line-height: 1.55;
    color: var(--tinte);
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-radius: var(--rund-k);
    resize: vertical;
}
.gespraech textarea { min-height: 6rem; font-size: var(--t-gross); }
.steckbrief textarea { min-height: 16rem; }
.gespraech textarea:focus,
.steckbrief textarea:focus {
    outline: none;
    background: var(--flaeche);
    border-color: var(--akzent);
    box-shadow: 0 0 0 4px var(--akzent-hauch);
}

/* Läuft das Diktat, sagt es der Knopf mit Worten ("Diktat beenden");
   der gefüllte Punkt ist nur die Zugabe für den schnellen Blick. */
.diktat-punkt {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid currentColor;
    border-radius: 50%;
}
#diktat[data-laeuft="ja"] { border-color: var(--akzent); color: var(--akzent-text); background: var(--akzent-hauch); }
#diktat[data-laeuft="ja"] .diktat-punkt {
    background: currentColor;
    animation: diktat-atmen 1.6s ease-in-out infinite;
}
@keyframes diktat-atmen { 50% { opacity: 0.35; } }

.gespraech-hinweis { margin: 0.875rem 0 0; font-size: var(--t-klein); color: var(--leise); max-width: 62ch; }
.gespraech-hinweis:empty { display: none; }
.gespraech .meldung { margin: 0.875rem 0 0; }

.ungespeichert { font-size: var(--t-klein); font-weight: 700; color: var(--warnung); }

.steckbrief-konflikt {
    margin: 0 0 1.25rem;
    padding: var(--luft);
    background: var(--warn-hauch);
    border-radius: var(--rund);
    color: var(--warnung);
}
.steckbrief-konflikt h2 { margin: 0 0 0.5rem; font-size: var(--t-gross); }
.steckbrief-stand { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--tinte); }

/* =============================================================
   Schmal und groß
   ============================================================= */

@media (min-width: 40rem) {
    :root { --luft: 1.5rem; }
    .schreiben { padding: 1.5rem; }
}

/* Auf schmalen Telefonen – und bei 200 % Zoom – stehen Foto, Memo und
   Abschicken untereinander, jeweils über die volle Breite. */
@media (max-width: 26rem) {
    .werkzeuge > * { flex: 1 1 100%; }
    .werkzeuge .senden { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ein Formular, das nur aus einem Knopf besteht, braucht keinen Abstand nach oben. */
.anmelden form.karte > .knopf:first-child { margin-top: 0; }
.anmelden form.karte { padding: 1.5rem; }

/* Ein Häkchen in den Tablet-Einstellungen: die ganze Zeile ist die Fläche. */
.schalter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--griff);
    margin: 0 0 1rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--rand-feld);
    border-radius: var(--rund-k);
    font-size: var(--t-klein);
    font-weight: 600;
    cursor: pointer;
}
.schalter input { width: 1.375rem; height: 1.375rem; margin: 0; accent-color: var(--akzent); flex-shrink: 0; }
.schalter:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hauch); color: var(--akzent-text); }
.schalter-titel { margin: 0 0 0.5rem !important; font-size: var(--t-klein); font-weight: 700; color: var(--tinte) !important; }

/* Ein Moment mit einem Tag: wofür das Tablet ihn ankündigt. */
.termin {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin: 0 var(--luft) 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--rund-k);
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    font-size: var(--t-klein);
}
.termin { align-items: flex-start; }
.termin .ic { color: var(--akzent); margin-top: 0.125rem; }
.termin p { flex: 1 1 0; min-width: 0; margin: 0; }
.termin form { flex-basis: 100%; margin: 0 0 0 2rem; }
.termin[data-abgesagt="ja"] { background: var(--warn-hauch); border-color: transparent; color: var(--warnung); }
.termin[data-abgesagt="ja"] .ic { color: var(--warnung); }

/* Geburtstage und feste Anrufe: Die Felder wechseln mit der Art – ohne
   JavaScript, über :has(). */
.wk-formular .nur-anruf { display: none; }
.wk-formular:has(input[name="art"][value="anruf"]:checked) .nur-anruf { display: flex; }
.wk-formular:has(input[name="art"][value="anruf"]:checked) span.nur-anruf { display: inline; }
.wk-formular:has(input[name="art"][value="anruf"]:checked) .nur-geburtstag { display: none; }
.wk-formular .wahl { max-width: 24rem; }
.wk-formular .einstellung { margin-bottom: 1rem; }
.wk-vorschau { margin: 0.5rem 0 1rem; }
.wk-formular .zeiten,
.heim-formular .zeiten { margin-bottom: 1rem; }

/* Nachbearbeiten: aufklappbar unter dem Text, damit die Liste ruhig bleibt. */
.moment-hinweis { margin: -0.375rem var(--luft) 0.75rem; font-size: var(--t-klein); color: var(--leise); }
.bearbeiten { margin: 0 var(--luft) 0.875rem; }
.bearbeiten summary {
    display: inline-flex; align-items: center; min-height: 2.75rem;
    font-size: var(--t-klein); font-weight: 700; color: var(--akzent-text); cursor: pointer;
}
.bearbeiten[open] summary { margin-bottom: 0.5rem; }
.bearbeiten textarea {
    display: block; width: 100%; min-height: 7rem; padding: 0.875rem;
    font: inherit; line-height: 1.5; color: var(--tinte);
    background: var(--flaeche-2); border: 1px solid var(--rand); border-radius: var(--rund-k); resize: vertical;
}
.bearbeiten textarea:focus { outline: none; background: var(--flaeche); border-color: var(--akzent); box-shadow: 0 0 0 4px var(--akzent-hauch); }
.bearbeiten .leise { margin: 0.5rem 0 0.75rem; }

/* Einrichtungslink am Tablet: zu, bis man ihn braucht. */
.einrichtungslink { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #ececf0; }
.einrichtungslink summary { cursor: pointer; font-weight: 600; }
.einrichtungslink[open] summary { margin-bottom: 1rem; }

/* Wie eine echte App: kein Zoom per Doppeltipp (Scrollen bleibt). */
html { touch-action: manipulation; }

/* Anmelden als: der Betrieb bedient gerade dieses Konto. */
.vertretung {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0.5rem 1rem;
    font-size: var(--t-klein);
    color: #fff;
    background: #8a3b12;
}
.vertretung button {
    min-height: 2.25rem;
    padding: 0 1rem;
    font: inherit;
    font-weight: 700;
    color: #8a3b12;
    background: #fff;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

/* Die Bestätigung nach "Jetzt zeigen", direkt am Moment. */
.meldung.am-moment { margin: 0 var(--luft) 0.875rem; }

/* Mitglied entfernen: zugeklappt, damit es niemand aus Versehen trifft. */
.entfernen { flex-basis: 100%; margin-top: 0.25rem; }
.entfernen summary { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--t-klein); font-weight: 700; color: var(--leise); cursor: pointer; }
.entfernen form { display: grid; gap: 0.75rem; margin-top: 0.25rem; }
/* Ein Haken mit Text daneben – der Text bricht neben dem Kästchen um. */
.haken { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.625rem; align-items: start; margin-bottom: 1rem; }
.haken input { width: 1.375rem; height: 1.375rem; margin: 0.15rem 0 0; }
.haken small { grid-column: 2; color: var(--leise); }
.entfernen .haken { font-size: var(--t-klein); margin-bottom: 0; }

/* Impressum und Datenschutz: ruhig, gut lesbar. */
.rechtstext { max-width: 42rem; line-height: 1.6; }
.rechtstext h1 { margin-bottom: 1rem; }
.rechtstext h2 { margin: 1.75rem 0 0.5rem; font-size: 1.125rem; }
.rechtstext ul { padding-left: 1.25rem; }
.rechtstext li { margin-bottom: 0.5rem; }
.recht-fuss {
    padding: 1.5rem var(--luft) 6rem;   /* unten Platz für die Reiter am Daumen */
    text-align: center;
    font-size: var(--t-klein);
    color: var(--leise);
}
.recht-fuss a { color: inherit; }
