/* Vorschau auf den neuen Aufbau. Nutzt ausschließlich Tokens aus tokens.css.
   Läuft getrennt von style.css, damit die bestehende Oberfläche unberührt bleibt. */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--schrift);
    color: var(--text);
    background: var(--grund);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--schrift-zahlen); }

/* ═══ Grundgerüst ═════════════════════════════════════════════════════════
   Nach MediFlow (20.10.26): links die Seitenleiste über die volle Höhe,
   rechts oben die Kopfleiste, darunter Liste und Inhalt wie in Outlook. */

.rahmen {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.arbeitsbereich {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
}

.spalten { flex: 1; min-height: 0; display: flex; }

.symbol { width: 18px; height: 18px; flex: none; }

/* ── Scrollleisten (20.10.26) ──
   Schmal, ohne Laufschiene, und erst sichtbar, wenn die Maus über dem
   Bereich ist. Ganz weg wäre falsch: Dann sieht man nicht, dass die Liste
   weitergeht. Safari und Chrome lesen ::-webkit-scrollbar — aber nur, solange
   scrollbar-width/-color NICHT gesetzt sind; die stehen deshalb nur im Zweig
   für Firefox. */
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
    border: 3px solid transparent; border-radius: 10px;
    background-color: transparent; background-clip: padding-box;
}
:hover::-webkit-scrollbar-thumb { background-color: var(--rahmen-kraeftig); }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-schwach); }
.seitenleiste:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .18); }

@supports (-moz-appearance: none) {
    * { scrollbar-width: thin; scrollbar-color: transparent transparent; }
    :hover { scrollbar-color: var(--rahmen-kraeftig) transparent; }
}

/* ═══ Seitenleiste ════════════════════════════════════════════════════════
   Dunkel wie die Bühne der Anmeldung und der Startbildschirm der App
   (Sergiu, 20.10.26) — Aufbau mit Gruppen und Symbolen nach MediFlow. */

.seitenleiste {
    width: var(--seitenleiste);
    flex-shrink: 0;
    background: var(--dunkel);
    color: var(--text-auf-farbe);
    border-right: 1px solid rgba(255, 255, 255, .06);
    /* Wirft einen weichen Schatten auf die Liste — trennt Dunkel und Petrol
       der gewählten Zeile (Sergiu, 21.10.26). */
    position: relative; z-index: 3;
    box-shadow: 3px 0 14px rgba(0, 0, 0, .16);
    padding: 0 var(--a5) var(--a8);
    display: flex;
    flex-direction: column;
    gap: var(--a8);
    overflow-y: auto;
}

/* Gleich hoch wie die Kopfleiste, damit die Trennlinien durchlaufen. */
.marke {
    display: flex; align-items: center; gap: var(--a4);
    height: 64px; flex: none;
    margin: 0 calc(-1 * var(--a5));
    padding: 0 var(--a8);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: inherit; text-decoration: none;
}

/* Ganz unten in der Seitenleiste, leise wie „bald“ (Sergiu, 26.10.26). */
.seitenleiste-fuss {
    margin-top: auto; padding: 0 var(--a5);
    display: flex; flex-direction: column; gap: var(--a1);
    font-size: 11px; color: #6B7B80; white-space: nowrap;
}

/* Impressum · Datenschutz (templates/_rechtliches.html) — leise, unten. */
.rechtliches {
    display: flex; justify-content: center; gap: var(--a2);
    margin-top: var(--a7); font-size: 12px; color: var(--text-tertiaer);
}
.rechtliches a { color: inherit; text-decoration: none; }
@media (hover: hover) { .rechtliches a:hover { text-decoration: underline; } }
.seitenleiste-fuss .rechtliches { justify-content: flex-start; margin-top: 0; font-size: 11px; color: inherit; }

/* Markenzeichen nach dem App-Icon, gleiche Familie wie auf dem Handy. */
.marke-zeichen { width: 32px; height: 32px; display: block; flex: none; }

.marke-text { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-eintrag {
    display: flex; align-items: center; gap: var(--a5);
    padding: var(--a3) var(--a5);
    border-radius: var(--r-mittel);
    font-size: 14px; font-weight: 500;
    color: #C3CDD0;
    transition: background .15s ease-out, color .15s ease-out;
}

.nav-eintrag .symbol { color: var(--text-auf-dunkel); transition: color .15s ease-out; }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* „Mit anderen Gewerken“ einzeilig */
/* Punkt hinter der Zahl, fester Platz auch ohne Punkt (Sergiu, 22.10.26). */
.nav-ampel { flex: none; width: 8px; display: inline-flex; margin-left: calc(var(--a2) - var(--a5)); }
.nav-eintrag [class^="ampel-"] { display: inline-flex; }

/* Titel oben mit dem Farbpunkt der Ansicht — der eine Akzent je Ansicht. */
.kopfleiste-titel { display: flex; align-items: center; gap: var(--a4); }
.kopfleiste-titel .ampel-punkt { width: 10px; height: 10px; }
.kopfleiste-zahl { font-weight: 500; color: var(--text-tertiaer); }

@media (hover: hover) { .nav-eintrag:hover { background: rgba(255, 255, 255, .06); color: var(--text-auf-farbe); } }
@media (hover: hover) { .nav-eintrag:hover .symbol { color: #C3CDD0; } }

.nav-eintrag.aktiv { background: rgba(255, 255, 255, .1); color: var(--text-auf-farbe); }
.nav-eintrag.aktiv .symbol { color: #5FC4C4; }

.nav-eintrag.gesperrt { color: #5E6D72; cursor: default; }
.nav-eintrag.gesperrt .symbol { color: #4A585C; }
@media (hover: hover) { .nav-eintrag.gesperrt:hover { background: none; } }
.aufklapp-eintrag.gesperrt { color: var(--text-schwach); cursor: default; }

.nav-zahl {
    font-family: var(--schrift-zahlen); font-weight: 600; font-size: 12px;
    color: var(--text-auf-dunkel);
}
.nav-eintrag.aktiv .nav-zahl { color: var(--text-auf-farbe); }

.bald {
    margin-left: auto;
    padding: 1px var(--a2);
    border-radius: var(--r-klein);
    background: var(--flaeche);
    font-size: 10px; font-weight: 600; color: var(--text-schwach);
}
.seitenleiste .bald { background: rgba(255, 255, 255, .06); color: #6B7B80; }

.abschnitt-label {
    padding: 0 var(--a5);
    font-size: 11px; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    color: #6B7B80;
    margin-bottom: var(--a3);
}

/* „+ Neu" — die eine kräftige Fläche in der Leiste. */
.neu-menue { position: relative; }

.neu-knopf {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: center; gap: var(--a3);
    height: 40px;
    border-radius: var(--r-mittel);
    background: var(--petrol); color: var(--text-auf-farbe);
    font-size: 14px; font-weight: 600;
    transition: background .15s ease-out;
}
.neu-knopf::-webkit-details-marker { display: none; }
@media (hover: hover) { .neu-knopf:hover { background: var(--petrol-dunkel); } }

/* ═══ Kopfleiste ══════════════════════════════════════════════════════════ */

.kopfleiste {
    height: 64px; flex: none;
    display: flex; align-items: center; justify-content: space-between; gap: var(--a7);
    padding: 0 var(--a9);
    background: var(--grund);
    border-bottom: 1px solid var(--linie);
    /* Weicher Schatten nach unten, wie an der Seitenleiste (21.10.26). */
    position: relative; z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
}

.kopfleiste-titel { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }

.kopfleiste-rechts { display: flex; align-items: center; gap: var(--a5); }

.kopf-trenner { width: 1px; height: 24px; background: var(--linie); }

.kopf-menue { position: relative; }
.kopf-menue > summary { list-style: none; cursor: pointer; user-select: none; }
.kopf-menue > summary::-webkit-details-marker { display: none; }

.glocke {
    position: relative;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: var(--r-mittel);
    color: var(--text-tertiaer);
    transition: background .15s ease-out;
}
@media (hover: hover) { .glocke:hover { background: var(--flaeche); color: var(--text); } }
.kopf-menue[open] .glocke { background: var(--flaeche); color: var(--text); }
.glocke .symbol { width: 20px; height: 20px; }

.glocke-punkt {
    position: absolute; top: 8px; right: 9px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--fehler);
    box-shadow: 0 0 0 2px var(--grund);
}

.benutzer {
    display: flex; align-items: center; gap: var(--a4);
    padding: var(--a1) var(--a2) var(--a1) var(--a4);
    border-radius: var(--r-mittel);
    color: var(--text-tertiaer);
    transition: background .15s ease-out;
}
@media (hover: hover) { .benutzer:hover { background: var(--flaeche); } }
.kopf-menue[open] .benutzer { background: var(--flaeche); }
.benutzer .symbol { width: 14px; height: 14px; }

.benutzer-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.benutzer-name { font-size: 14px; font-weight: 600; color: var(--text); }
.benutzer-rolle { font-size: 12px; color: var(--text-tertiaer); }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--petrol); color: var(--text-auf-farbe);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}

/* ── Aufklappmenüs (Neu, Glocke, Benutzer) ── */

.aufklapp {
    position: absolute; right: 0; top: calc(100% + var(--a2)); z-index: 50;
    min-width: 240px;
    padding: var(--a2) 0;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-radius: var(--r-gross);
    box-shadow: var(--schatten-hoch);
}
.aufklapp-links { left: 0; right: 0; min-width: 0; }
.aufklapp-breit { width: 340px; max-height: 420px; overflow-y: auto; }

.aufklapp-eintrag {
    display: flex; align-items: center; gap: var(--a5);
    width: 100%;
    padding: var(--a4) var(--a6);
    border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
    font-size: 14px; color: var(--text);
}
.aufklapp-eintrag .symbol { color: var(--text-tertiaer); }
@media (hover: hover) { .aufklapp-eintrag:hover { background: var(--flaeche); } }
@media (hover: hover) { .aufklapp-eintrag.gesperrt:hover { background: none; } }

.aufklapp-kopf {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--a4) var(--a6) var(--a5);
    margin-bottom: var(--a2);
    border-bottom: 1px solid var(--linie);
    font-size: 14px; font-weight: 600;
}
.aufklapp-kopf-person { flex-direction: column; align-items: flex-start; font-weight: 400; }
.aufklapp-zahl {
    padding: 1px var(--a3); border-radius: var(--r-pille);
    background: var(--flaeche); font-size: 12px; color: var(--text-tertiaer);
}

.glocke-eintrag {
    display: flex; flex-direction: column; gap: 2px;
    padding: var(--a4) var(--a6);
}
@media (hover: hover) { .glocke-eintrag:hover { background: var(--flaeche); } }
.glocke-titel { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glocke-meta { font-size: 12px; color: var(--text-tertiaer); }
/* Erst zeigen, wenn der Browser noch nicht gefragt hat (data-mitteilung am <html>). */
.glocke-erlauben {
    display: none; width: 100%; margin-top: var(--a2); padding: var(--a3) var(--a4);
    border: 0; border-top: 1px solid var(--linie); background: none;
    font: inherit; font-size: 13px; color: var(--petrol); text-align: left; cursor: pointer;
}
html[data-mitteilung="default"] .glocke-erlauben { display: block; }
@media (hover: hover) { .glocke-erlauben:hover { background: var(--flaeche); } }

.aufklapp-leer { padding: var(--a9) var(--a6); text-align: center; font-size: 14px; color: var(--text-schwach); }

/* ═══ Ticketliste ═════════════════════════════════════════════════════════ */

.liste {
    width: var(--listenspalte);
    flex-shrink: 0;
    border-right: 1px solid var(--linie);
    position: relative; z-index: 1;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .07);
    display: flex; flex-direction: column;
    background: var(--grund);
}

.listen-kopf {
    padding: var(--a7);
    border-bottom: 1px solid var(--linie);
    display: flex; flex-direction: column; gap: var(--a5);
}

.suche {
    display: flex; align-items: center; gap: var(--a3);
    height: 38px; padding: 0 var(--a5);
    border-radius: var(--r-mittel);
    background: var(--flaeche);
    color: var(--text-tertiaer);
    font-size: 13px;
    border: 1px solid transparent;
    transition: border-color .15s ease-out, background .15s ease-out;
}
.suche:focus-within { background: var(--grund); border-color: var(--petrol); }
.suche .symbol { width: 16px; height: 16px; }
.suche input {
    flex: 1; min-width: 0; height: 100%;
    border: 0; outline: 0; background: none;
    font: inherit; font-size: 14px; color: var(--text);
}
.suche input::placeholder { color: var(--text-tertiaer); }

.chips { display: flex; gap: var(--a3); flex-wrap: wrap; }

.chip {
    height: 28px; padding: 0 var(--a5);
    display: inline-flex; align-items: center;
    border-radius: var(--r-pille);
    background: var(--flaeche); color: var(--text);
    font-size: 12px; font-weight: 500;
    white-space: nowrap;
    transition: background .15s ease-out;
}

@media (hover: hover) { .chip:hover { background: var(--rahmen); } }
.chip.aktiv { background: var(--dunkel); color: var(--text-auf-farbe); }
@media (hover: hover) { .chip.aktiv:hover { background: var(--dunkel); } }

/* Unten Luft und eine Schlusslinie — sonst lief die Liste bündig in den
   Fensterrand, als ginge sie unter der Taskleiste weiter (21.10.26). */
.listen-koerper { flex: 1; overflow-y: auto; padding-bottom: var(--a10); }
.listen-koerper > .zeile:last-of-type { border-bottom: 1px solid var(--linie); }

.zeile {
    position: relative;
    display: flex; flex-direction: column; gap: 3px;
    padding: var(--a5) var(--a7);
    border-top: 1px solid var(--linie);
    transition: background .15s ease-out;
}

/* Nur mit Maus — am Touchscreen bliebe er nach dem Tippen hängen. */
@media (hover: hover) { .zeile:hover { background: var(--flaeche); } }

/* Ampel (20.10.26): einmal je Ansicht statt an jedem Ticket. In der Liste
   nur als Punkt vor dem Zustandswort, und nur in gemischten Ansichten. */
.ampel-punkt {
    display: inline-block; flex: none;
    width: 8px; height: 8px; border-radius: 50%;
    background: currentColor;
}
.ampel-neu            { color: var(--ampel-neu-text); --ampel: var(--ampel-neu); }
.ampel-in_bearbeitung { color: var(--bearbeitung-text); --ampel: var(--ampel-arbeit); }
.ampel-geparkt        { color: var(--geparkt-text); --ampel: var(--ampel-wartet); }
.ampel-erledigt       { color: var(--erledigt-text); --ampel: var(--ampel-erledigt); }
.ampel-neu .ampel-punkt, .ampel-in_bearbeitung .ampel-punkt,
.ampel-geparkt .ampel-punkt, .ampel-erledigt .ampel-punkt { background: var(--ampel); }

.zeile-zustand { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.zeile-hervor  { font-weight: 600; color: var(--text); }
.zeile-dringend { font-weight: 700; color: var(--ampel-neu-text); }
.zeile-wiedervorlage { font-weight: 600; color: var(--petrol); }
/* Wie lange es liegt (services/alter.py): grau, ab der Schwelle in Warnfarbe. */
.zeile-alter { color: var(--text-tertiaer); }
.zeile-alter.zeile-warnen { font-weight: 600; color: var(--warnung-text); }

/* Petrol-Streifen mit Abstand zum Rand und runden Enden — ganz am Rand
   stieß er direkt an die dunkle Seitenleiste (Sergiu, 21.10.26). */
.zeile.gewaehlt { background: var(--petrol-flaeche); }
.zeile.gewaehlt::before {
    content: ""; position: absolute;
    left: 4px; top: 7px; bottom: 7px; width: 5px;
    border-radius: 3px;
    background: var(--petrol);
}

.zeile-oben { display: flex; align-items: baseline; gap: var(--a5); }

.zeile-titel {
    flex: 1; min-width: 0;
    font-size: 15px; font-weight: 600; line-height: 1.35;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.zeile-zeit { flex: none; font-size: 13px; color: var(--text-tertiaer); }

/* Ungelesene Nachricht des Melders: Titel kräftiger, Zahl als Pille vor der Zeit. */
.zeile-ungelesen .zeile-titel { font-weight: 700; }
.zeile-ungelesen .zeile-zeit { color: var(--petrol); font-weight: 600; }
.zeile-neu-nachricht {
    flex: none; align-self: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--petrol); color: #fff;
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Ticketnummer im Kopf der Inhaltsspalte. */
.zeile-nr {
    font-family: var(--schrift-zahlen);
    font-size: 13px; font-weight: 600;
    color: var(--text-tertiaer);
}

.zeile-kontext {
    font-size: 14px; line-height: 1.35;
    color: var(--text-sekundaer);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.leer {
    padding: var(--a10) var(--a7);
    text-align: center;
    color: var(--text-tertiaer);
    font-size: 14px;
}

/* ═══ Archiv ══════════════════════════════════════════════════════════════
   Umschalter Erledigt / Verworfen unter der Suche, Monate als stehende
   Zwischenüberschriften, unten „Ältere laden“. */

.umschalter {
    display: flex; gap: 2px; padding: 3px;
    border-radius: var(--r-mittel);
    background: var(--flaeche);
}
.umschalter-feld {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--a3);
    height: 32px;
    border-radius: 7px;
    font-size: 14px; font-weight: 500; color: var(--text-sekundaer);
    transition: background .15s ease-out, color .15s ease-out;
}
@media (hover: hover) { .umschalter-feld:hover { color: var(--text); } }
.umschalter-feld.aktiv {
    background: var(--grund); color: var(--text); font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.umschalter-zahl { font-size: 13px; font-weight: 500; color: var(--text-tertiaer); }

.liste-monat {
    position: sticky; top: 0; z-index: 1;
    padding: var(--a4) var(--a7) var(--a2);
    background: var(--grund);
    font-size: 13px; font-weight: 600; color: var(--text-tertiaer);
}
.liste-monat + .zeile { border-top-color: transparent; }

.liste-mehr {
    display: flex; align-items: center; justify-content: center; gap: var(--a3);
    margin: var(--a7) var(--a7) 0;
    height: 40px;
    border-radius: var(--r-mittel);
    background: var(--flaeche);
    font-size: 14px; font-weight: 600; color: var(--petrol);
    transition: background .15s ease-out;
}
@media (hover: hover) { .liste-mehr:hover { background: var(--flaeche-kraeftig); } }
.liste-mehr-zahl { font-weight: 500; color: var(--text-tertiaer); }
.listen-koerper > .zeile:has(+ .liste-mehr) { border-bottom: 1px solid var(--linie); }

/* ═══ Zustands-Plaketten ══════════════════════════════════════════════════ */

.plakette {
    display: inline-flex; align-items: center;
    height: 22px; padding: 0 var(--a3);
    border-radius: var(--r-klein);
    font-size: 11px; font-weight: 600;
    white-space: nowrap;
}

.plakette-neu            { background: var(--neu-flaeche);          color: var(--neu-text); }
.plakette-in_bearbeitung { background: var(--bearbeitung-flaeche);  color: var(--bearbeitung-text); }
.plakette-geparkt        { background: var(--geparkt-flaeche);      color: var(--geparkt-text); }
.plakette-erledigt       { background: var(--erledigt-flaeche);     color: var(--erledigt-text); }
.plakette-verworfen      { background: var(--verworfen-flaeche);    color: var(--verworfen-text); }

.abt {
    display: inline-flex; align-items: center;
    height: 20px; padding: 0 var(--a2);
    border-radius: var(--r-klein);
    font-size: 11px; font-weight: 700; letter-spacing: .03em;
    color: var(--text-auf-farbe);
}

.abt-TD   { background: var(--abt-td); }
.abt-IT   { background: var(--abt-it); }
.abt-HD   { background: var(--abt-hd); }
.abt-MT   { background: var(--abt-mt); }
.abt-TODO { background: var(--abt-todo); }

/* ═══ Ticketansicht (Teil A, 20.10.26) ════════════════════════════════════
   docs/KONZEPT_TICKETANSICHT.md. Links Kopf, Knöpfe, Reiter; rechts die
   Infospalte über die volle Höhe. Nichts unter 13 px. */

.tk-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.tk-kopf {
    padding: var(--a8) var(--a9) var(--a7);
    display: flex; flex-direction: column; gap: var(--a2);
}

.tk-meta {
    display: flex; align-items: center; gap: var(--a3);
    font-size: 13px; color: var(--text-tertiaer);
}

.tk-titel {
    margin: 0; max-width: var(--lesebreite);
    font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em;
}

.tk-herkunft { font-size: 15px; color: var(--text-sekundaer); }

.tk-aktionen { display: flex; flex-wrap: wrap; gap: var(--a3); margin-top: var(--a5); }
.tk-aktionen .knopf { height: 40px; font-size: 14px; }
/* Das Formular des Hauptknopfs soll im Fluss der Reihe stehen, nicht als Block. */
.tk-aktionsform { display: contents; }
.tk-hinweis { margin: var(--a3) 0 0; font-size: 13px; color: var(--text-sekundaer); }
.tk-aktionen .tk-hinweis { margin: 0; align-self: center; }

/* Parken und Wiedervorlage: Datumswahl unter dem Knopf. */
.tk-menue { position: relative; }
.tk-menue > summary { list-style: none; user-select: none; }
.tk-menue > summary::-webkit-details-marker { display: none; }
.tk-menue[open] > summary { border-color: var(--text-tertiaer); background: var(--flaeche); }

.tk-park {
    left: 0; right: auto; width: 320px;
    padding: var(--a5);
    display: flex; flex-direction: column; gap: var(--a4);
}
.tk-park-titel { font-size: 12px; font-weight: 500; color: var(--text-sekundaer); }
.tk-park-hinweis { margin-top: calc(-1 * var(--a2)); font-size: 13px; color: var(--text-tertiaer); line-height: 1.4; }
.tk-park-vorschlaege { display: flex; flex-direction: column; gap: var(--a1); }
.tk-park-vorschlag {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--a3) var(--a4);
    border: 0; border-radius: var(--r-mittel); background: none;
    font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer;
}
.tk-park-vorschlag span { font-size: 13px; color: var(--text-tertiaer); }
@media (hover: hover) { .tk-park-vorschlag:hover { background: var(--flaeche); } }
.tk-park-eigenes { display: flex; gap: var(--a3); padding-top: var(--a4); border-top: 1px solid var(--linie); }
.tk-park-eigenes input[type="date"] {
    flex: 1; min-width: 0; height: 40px;
    padding: 0 var(--a4);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift); font-size: 14px;
    outline: none;
}
.tk-park-eigenes input[type="date"]:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-flaeche); }
.tk-park-eigenes .knopf { flex-shrink: 0; }

/* Verwerfen: ganz rechts in der Reihe, klappt deshalb nach links auf. */
.tk-verwerfen { left: auto; right: 0; }
.tk-verwerfen .tk-park-eigenes { justify-content: flex-end; }
.tk-verwerfen-gruende { display: flex; flex-direction: column; gap: var(--a1); }
.tk-verwerfen-grund {
    display: flex; align-items: center; gap: var(--a3);
    min-height: 40px; padding: 0 var(--a4);
    border-radius: var(--r-mittel);
    font-size: 14px; color: var(--text); cursor: pointer;
}
@media (hover: hover) { .tk-verwerfen-grund:hover { background: var(--flaeche); } }
.tk-verwerfen-grund input[type="radio"] { margin: 0; accent-color: var(--petrol); }
.tk-verwerfen-grund input[type="text"] {
    flex: 1; min-width: 0; height: 32px; margin-left: auto;
    padding: 0 var(--a3);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift); font-size: 14px;
    outline: none;
}
/* Weiterleiten: Gewerke mit zwei Knöpfen je Zeile, Kollegen als Liste. */
.tk-weiter { width: 360px; max-height: 480px; overflow-y: auto; }
.tk-weiter-abschnitt { padding-top: var(--a4); border-top: 1px solid var(--linie); }
.tk-weiter-liste { display: flex; flex-direction: column; gap: var(--a1); }
.tk-weiter-zeile {
    display: flex; align-items: center; gap: var(--a2);
    min-height: 40px; padding-left: var(--a4);
    font-size: 14px; color: var(--text);
}
.tk-weiter-zeile span { flex: 1; min-width: 0; }
.tk-weiter-knopf {
    flex-shrink: 0; height: 32px; padding: 0 var(--a3);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel); background: var(--grund);
    font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
@media (hover: hover) { .tk-weiter-knopf:hover { background: var(--flaeche); border-color: var(--text-tertiaer); } }
.tk-verwerfen-grund input[type="text"]:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-flaeche); }

.tk-reiter {
    display: flex; gap: var(--a7);
    padding: 0 var(--a9);
    border-bottom: 1px solid var(--linie);
}

.tk-reiter-feld {
    display: inline-flex; align-items: center; gap: var(--a3);
    padding: var(--a4) 0 var(--a5);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    font-size: 14px; font-weight: 600; color: var(--text-tertiaer);
    transition: color .15s ease-out, border-color .15s ease-out;
}
@media (hover: hover) { .tk-reiter-feld:hover { color: var(--text); } }
.tk-reiter-feld.aktiv { color: var(--petrol); border-bottom-color: var(--petrol); }

.tk-reiter-zahl {
    min-width: 20px; height: 20px; padding: 0 var(--a2);
    display: inline-grid; place-items: center;
    border-radius: var(--r-pille);
    background: var(--flaeche); color: var(--text-tertiaer);
    font-size: 12px;
}
/* Ungelesenes vom Melder: rot wie die Glocke. */
.tk-reiter-zahl-neu { background: var(--fehler); color: var(--text-auf-farbe); font-weight: 600; }
.tk-reiter-zahl[hidden] { display: none; }

.tk-inhalt { flex: 1; min-height: 0; overflow-y: auto; padding: var(--a8) var(--a9); }

.tk-leerseite { padding: var(--a10) 0; text-align: center; font-size: 15px; color: var(--text-schwach); }

/* Gespräch */
/* Im Chat rollt nur der Verlauf; das Schreibfeld steht fest unten. */
.tk-inhalt:has(> .tk-gespraech) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: var(--a9); }
.tk-gespraech {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; gap: var(--a5);
}
.tk-chat-verlauf {
    flex: 1; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; gap: var(--a8);
    padding-right: var(--a2);
}
.tk-gespraech > .tk-schreiben, .tk-gespraech > .tk-hinweis {
    flex: none; padding-top: var(--a5); border-top: 1px solid var(--linie);
}
/* Statt des Schreibfelds bei erledigten und verworfenen Tickets. */
.tk-hinweis.tk-hinweis-abgeschlossen,
.tk-gespraech > .tk-hinweis.tk-hinweis-abgeschlossen {
    flex: none; margin: 0 0 var(--a5); padding: var(--a5) var(--a7);
    border: 0; border-radius: var(--r-mittel);
    background: var(--flaeche);
    font-size: 14px; text-align: center;
}
.tk-gespraech > .tk-hinweis.tk-hinweis-abgeschlossen { margin: 0; }
.tk-nachricht { display: flex; gap: var(--a5); }
.tk-nachricht-rumpf { flex: 1; min-width: 0; }
.tk-nachricht-kopf { font-size: 14px; font-weight: 600; margin-bottom: var(--a2); }
.tk-nachricht-kopf span { font-weight: 400; color: var(--text-tertiaer); }

/* Unter der Meldung: „bearbeitet von …“ und der Weg zum Bearbeiten
   (Johannes, 28.10.26). Klein und ruhig — die Meldung bleibt die Hauptsache. */
.tk-meldung-fuss {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--a2) var(--a4);
    margin-top: var(--a2);
    font-size: 12px; font-style: italic; color: var(--text-tertiaer);
}
.tk-meldung-bearbeiten {
    padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-style: normal; font-weight: 600; color: var(--petrol);
}
@media (hover: hover) { .tk-meldung-bearbeiten:hover { color: var(--petrol-dunkel); } }

/* Fenster dazu: dieselbe Hülle wie der Volltext (.meldung-voll). */
.tk-bearbeiten-form {
    display: flex; flex-direction: column; gap: var(--a6);
    padding: var(--a8); overflow-y: auto;
}
.tk-bearbeiten-hinweis { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-tertiaer); }
.tk-bearbeiten-knoepfe { display: flex; justify-content: flex-end; gap: var(--a4); }
/* Notiz bearbeiten (13.11.26): Löschen steht links, abgesetzt von Speichern;
   die Rückfrage ist ein kleineres Fenster derselben Art. */
.tk-notiz-loeschen { margin-right: auto; }
.tk-notiz-weg { width: min(420px, calc(100vw - 32px)); }
.tk-notiz-weg-frage { margin: 0; font-size: 15px; font-weight: 600; }
.tk-notizen .tk-meldung-fuss { margin-top: var(--a3); }

.tk-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--flaeche-kraeftig); color: var(--text-sekundaer);
    font-size: 13px; font-weight: 700;
}
.tk-avatar-dienst { background: var(--petrol); color: var(--text-auf-farbe); }

/* Chat: der Melder links, der Dienst rechts — gespiegelt, Blase in Petrol. */
.tk-nachricht-dienst { flex-direction: row-reverse; }
.tk-nachricht-dienst .tk-nachricht-rumpf { display: flex; flex-direction: column; align-items: flex-end; }
.tk-nachricht-dienst .tk-blase { background: var(--petrol-flaeche); }
.tk-nachricht .tk-blase { max-width: min(85%, var(--lesebreite)); width: fit-content; }

.tk-blase {
    padding: var(--a6) var(--a7);
    border-radius: var(--r-gross);
    background: var(--flaeche);
    font-size: 15px; line-height: 1.55;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.tk-blase-notiz { background: var(--notiz-flaeche); border: 1px solid var(--notiz-rahmen); }

/* Schreibfeld: im Gespräch unten (Verlauf läuft nach unten), in Notizen
   oben (neueste oben). */
.tk-schreiben { display: flex; flex-direction: column; gap: var(--a3); }
.tk-gespraech .tk-schreiben textarea { min-height: 64px; }
.tk-schreiben + .tk-notizen, .tk-schreiben + .tk-leerseite { margin-top: var(--a8); }
.tk-schreiben textarea { min-height: 88px; }
.tk-schreiben-fuss { display: flex; align-items: center; justify-content: space-between; gap: var(--a4); }
.tk-schreiben-fuss span { font-size: 13px; color: var(--text-tertiaer); }
.tk-schreiben-fuss .tk-schreiben-erfolg { color: var(--petrol); font-weight: 500; }
.tk-schreiben-fuss .knopf { flex-shrink: 0; height: 40px; font-size: 14px; }
.tk-park-nachricht { min-height: 64px; font-size: 14px; }

/* Linie über der ersten ungelesenen Nachricht. */
.tk-chat-neu { display: flex; align-items: center; gap: var(--a4); font-size: 12px; font-weight: 600; color: var(--fehler-text); }
.tk-chat-neu::before, .tk-chat-neu::after { content: ""; flex: 1; height: 1px; background: var(--fehler); opacity: .4; }
/* Gelesen-Vermerk unter der Blase. */
.tk-gelesen { margin-top: var(--a2); font-size: 12px; color: var(--text-tertiaer); }

/* Protokoll — eine Zeile je Handlung, neueste oben. */
.tk-protokoll { list-style: none; margin: 0; padding: 0; }
.tk-protokoll li {
    display: grid; grid-template-columns: 150px 170px 1fr 56px; gap: var(--a6);
    padding: var(--a4) 0;
    border-bottom: 1px solid var(--linie);
    font-size: 14px;
}
.tk-protokoll-zeit { color: var(--text-tertiaer); font-variant-numeric: tabular-nums; }
.tk-protokoll-wer  { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-protokoll-wechsel { display: block; margin-top: 2px; font-size: 13px; color: var(--text-tertiaer); }
.tk-protokoll-gewerk  { font-size: 13px; color: var(--text-tertiaer); text-align: right; }
.tk-protokoll-wer-gewerk { display: none; font-weight: 400; color: var(--text-tertiaer); }

/* Notizen */
.tk-notizen { list-style: none; margin: 0; padding: 0; }
.tk-notizen li { padding: var(--a5) 0; border-bottom: 1px solid var(--linie); }
.tk-notizen li:first-child { padding-top: 0; }
.tk-notiz-kopf { font-size: 13px; font-weight: 600; }
.tk-notiz-kopf span { font-weight: 400; color: var(--text-tertiaer); }
.tk-notiz-text { max-width: var(--lesebreite); margin-top: var(--a2); font-size: 14px; line-height: 1.5; white-space: pre-line; }

/* Fotos */
.tk-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--a6); }
.tk-foto { display: flex; flex-direction: column; gap: var(--a2); font-size: 13px; color: var(--text-tertiaer); }
.tk-foto img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: var(--r-gross); background: var(--flaeche);
}

/* Infospalte rechts */
.tk-info {
    width: var(--kontextspalte); flex: none;
    border-left: 1px solid var(--linie);
    position: relative;
    box-shadow: -2px 0 10px rgba(0, 0, 0, .06);
    background: var(--flaeche);
    padding: var(--a8) var(--a8);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: var(--a9);
}
.tk-gruppe { margin: 0; display: flex; flex-direction: column; gap: var(--a4); }
.tk-label { padding: 0; margin-bottom: 0; }
.tk-paar { display: flex; justify-content: space-between; align-items: baseline; gap: var(--a5); font-size: 14px; }
.tk-paar dt { color: var(--text-tertiaer); flex: none; }
.tk-paar dd { margin: 0; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.tk-paar-block { flex-direction: column; align-items: stretch; gap: var(--a2); }
.tk-paar-block dd { text-align: left; display: flex; flex-direction: column; gap: var(--a2); }
/* Melder (26.10.26): Bezeichnung über dem Wert, eine Zeile mit „…“,
   Kopierknopf daneben; „…“-Menü neben der Überschrift. */
.tk-paar-unter { flex-direction: column; align-items: stretch; gap: 2px; }
.tk-paar-unter dd { text-align: left; }
.tk-kopierbar { display: flex; align-items: center; gap: var(--a2); text-align: left; }
.tk-kopier-wert { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-kopieren {
    flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -6px -4px 0;
    border: 0; border-radius: 8px; background: none; color: var(--text-tertiaer); cursor: pointer;
    transition: background .15s ease-out, color .15s ease-out;
}
.tk-kopieren svg { width: 15px; height: 15px; grid-area: 1 / 1; transition: opacity .15s ease-out, transform .2s ease-out; }
.tk-kopiert-zeichen { opacity: 0; transform: scale(.6); }
.tk-kopieren.kopiert { color: var(--ampel-erledigt); }
.tk-kopieren.kopiert .tk-kopieren-zeichen { opacity: 0; }
.tk-kopieren.kopiert .tk-kopiert-zeichen { opacity: 1; transform: none; }
@media (hover: hover) { .tk-kopieren:hover { background: var(--flaeche); color: var(--text); } }
/* Das Menü klappt über die volle Spaltenbreite auf — rechtsbündig am „…“
   ragte es links aus der schmalen Spalte. */
.tk-label-zeile { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.tk-melder-menue { position: static; }
.tk-punkte {
    display: grid; place-items: center; width: 28px; height: 24px; margin-right: -6px;
    border-radius: 8px; color: var(--text-tertiaer); cursor: pointer; list-style: none;
}
.tk-punkte::-webkit-details-marker { display: none; }
.tk-punkte svg { width: 18px; height: 18px; }
@media (hover: hover) { .tk-punkte:hover { background: var(--flaeche); color: var(--text); } }
.tk-melder-menue[open] > .tk-punkte { background: var(--flaeche); color: var(--text); }
.tk-melder-aufklapp { left: 0; right: 0; min-width: 0; width: auto; }
.tk-melder-sperren > summary { list-style: none; color: var(--fehler-text); }
.tk-melder-sperren > summary::-webkit-details-marker { display: none; }
.tk-melder-sperren[open] > summary { display: none; }
.tk-melder-sperren .tk-park { width: auto; display: flex; flex-direction: column; gap: var(--a3); padding: var(--a3) var(--a5) var(--a4); overflow-wrap: anywhere; }
.tk-melder-sperren .knopf { align-self: flex-end; }
.tk-gewerk { display: flex; justify-content: space-between; gap: var(--a4); font-weight: 500; }
.tk-gewerk .zeile-zustand { font-size: 13px; }
.tk-leer { color: var(--text-schwach); font-weight: 400 !important; }
.tk-link { color: var(--petrol); }
@media (hover: hover) { .tk-link:hover { text-decoration: underline; } }

/* Große Monitore (ab 22″, Sergiu 21.10.26): eine Stufe größer. Der Mac
   (1512 px) bleibt bei den Grundgrößen. */
@media (min-width: 1700px) {
    .nav-eintrag { font-size: 15px; }
    .abschnitt-label { font-size: 12px; }
    .kopfleiste-titel { font-size: 20px; }
    .zeile { padding-top: var(--a6); padding-bottom: var(--a6); }
    .zeile-titel { font-size: 16px; }
    .zeile-kontext { font-size: 15px; }
    .zeile-zeit, .zeile-nr { font-size: 14px; }
    .suche { font-size: 14px; }
    .tk-meta { font-size: 14px; }
    .tk-titel { font-size: 25px; }
    .tk-herkunft { font-size: 16px; }
    .tk-aktionen .knopf { height: 42px; font-size: 15px; }
    .tk-reiter-feld { font-size: 15px; }
    .tk-nachricht-kopf { font-size: 15px; }
    .tk-blase { font-size: 16px; }
    .tk-gelesen { font-size: 13px; }
    .tk-protokoll li, .tk-notiz-text { font-size: 15px; }
    .tk-protokoll-wechsel, .tk-protokoll-gewerk, .tk-notiz-kopf { font-size: 14px; }
    .tk-paar { font-size: 15px; }
    .tk-gewerk .zeile-zustand { font-size: 14px; }
}

/* ═══ Detailspalte ════════════════════════════════════════════════════════ */

.detail {
    flex: 1; min-width: 0; min-height: 0;
    display: flex; flex-direction: row;   /* Ticket links, Infospalte rechts */
    background: var(--grund);
}

.detail-kopf {
    padding: var(--a8) var(--a9);
    border-bottom: 1px solid var(--linie);
    display: flex; flex-direction: column; gap: var(--a6);
}

.detail-kopfzeile {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--a7);
}

.detail-titel {
    font-size: 24px; font-weight: 600; line-height: 1.25;
    letter-spacing: -.01em;
    margin: var(--a2) 0 var(--a1);
}

.detail-herkunft { font-size: 13px; color: var(--text-sekundaer); }

.knopf {
    display: inline-flex; align-items: center; gap: var(--a2);
    height: 38px; padding: 0 var(--a6);
    border-radius: var(--r-mittel);
    font-family: var(--schrift);
    font-size: 13px; font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease-out, border-color .15s ease-out;
}

.knopf-primaer { background: var(--petrol); color: var(--text-auf-farbe); }
@media (hover: hover) { .knopf-primaer:hover { background: var(--petrol-dunkel); } }

.knopf-zweit {
    background: transparent; color: var(--text);
    border-color: var(--rahmen); font-weight: 500;
}
@media (hover: hover) { .knopf-zweit:hover { border-color: var(--text-tertiaer); } }
/* Nicht umkehrbar (Verwerfen): rot umrandet, die Bestätigung rot gefüllt —
   am PC und im Handy-Blatt gleich (Sergiu, 26.10.26). */
.knopf-zweit.knopf-gefahr { color: var(--fehler-text); border-color: color-mix(in srgb, var(--fehler) 45%, transparent); }
@media (hover: hover) { .knopf-zweit.knopf-gefahr:hover { border-color: var(--fehler); background: var(--fehler-flaeche); } }
.knopf-gefahr-voll { background: var(--fehler); color: #fff; }
@media (hover: hover) { .knopf-gefahr-voll:hover { background: color-mix(in srgb, var(--fehler) 85%, #000); } }
/* Noch ohne Funktion: sichtbar, aber erkennbar nicht bedienbar. */
.knopf:disabled, .knopf:disabled:hover {
    color: var(--text-tertiaer); border-color: var(--linie);
    cursor: not-allowed; opacity: .6;
}

/* Zustandswähler */
.wahl {
    display: inline-flex; padding: var(--a1);
    border-radius: var(--r-gross);
    background: var(--flaeche);
    gap: 2px;
}

.wahl-feld {
    padding: var(--a3) var(--a6);
    border-radius: var(--r-mittel);
    font-size: 13px; font-weight: 500;
    color: var(--text-sekundaer);
    transition: background .15s ease-out;
}

.wahl-feld.aktiv {
    background: var(--grund);
    box-shadow: var(--schatten-segment);
    font-weight: 600; color: var(--text);
}

.detail-unten { flex: 1; display: flex; min-height: 0; }

.verlauf {
    flex: 1; min-width: 0; min-height: 0;
    padding: 22px var(--a9);
    overflow-y: auto;
    border-right: 1px solid var(--linie);
    display: flex; flex-direction: column; gap: 18px;
}

.eintrag { display: flex; gap: var(--a5); }

.eintrag-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--petrol); color: var(--text-auf-farbe);
    display: grid; place-items: center;
    font-size: 12px; font-weight: 600; flex-shrink: 0;
}

.eintrag-kopf {
    font-size: 13px; font-weight: 500;
    margin-bottom: var(--a2);
}

.eintrag-zeit { color: var(--text-tertiaer); font-weight: 400; }

.blase {
    padding: var(--a6) var(--a7);
    border-radius: var(--r-gross);
    background: var(--flaeche);
    font-size: 14px; line-height: 1.6;
    white-space: pre-wrap;
}

.blase-notiz {
    background: var(--notiz-flaeche);
    border: 1px solid var(--notiz-rahmen);
}

.system {
    display: flex; gap: var(--a5);
    font-size: 12px; line-height: 1.4;
    color: var(--text-tertiaer);
}

.system-pfeil { width: 32px; text-align: center; flex-shrink: 0; }

.kontext {
    width: var(--kontextspalte); flex-shrink: 0;
    background: var(--flaeche);
    padding: 22px var(--a8);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 18px;
}

.kontext-paar {
    display: flex; justify-content: space-between; gap: var(--a5);
    font-size: 13px;
}

.kontext-paar dt { color: var(--text-sekundaer); }
.kontext-paar dd { margin: 0; font-weight: 500; text-align: right; }

/* ═══ Handy ═══════════════════════════════════════════════════════════════ */

@media (max-width: 899px) {
    .seitenleiste, .kontext, .kopfleiste { display: none; }
    .rahmen { flex-direction: column; height: auto; }
    .spalten { flex-direction: column; }
    .liste { width: 100%; border-right: none; }
    .detail { display: none; }
    .handy-kopf {
        padding: var(--a4) var(--a8) var(--a6);
        border-bottom: 1px solid var(--linie);
        display: flex; align-items: center; justify-content: space-between;
    }
    .handy-label { font-size: 12px; color: var(--text-sekundaer); }
    .handy-zahl { font-size: 22px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
    .zeile { padding: var(--a6) var(--a8); }
    .zeile-titel { font-size: 16px; line-height: 1.35; }
    .zeile-kontext { font-size: 13px; }
}

@media (min-width: 900px) {
    .handy-kopf { display: none; }
    /* Am PC stehen die Ansichten in der Seitenleiste — die Filterknöpfe über
       der Liste wären doppelt. Am Handy bleiben sie, bis es dort ein eigenes
       Menü gibt. */
    .chips { display: none; }
}

/* ═══ Formular-Grundlagen ═════════════════════════════════════════════════
   Feldrahmen und Beschriftungen, die mehrere Seiten benutzen — Anmeldung wie
   Meldeformular. Lagen ursprünglich im Formular-Abschnitt und sind beim Umbau
   auf den neuen Entwurf verloren gegangen. */

label.feld { display: block; }

.feld-name {
    display: block;
    font-size: 12px; font-weight: 500;
    color: var(--text-sekundaer);
    margin-bottom: var(--a2);
}

select, input[type="text"], textarea {
    width: 100%;
    min-height: var(--touchziel);
    padding: var(--a4) var(--a5);
    border: 1px solid var(--rahmen);
    border-radius: var(--r-gross);
    background: var(--grund);
    color: var(--text);
    font-family: var(--schrift);
    font-size: 15px;
    outline: none;
}

textarea { min-height: 110px; resize: vertical; line-height: 1.5; }

select:focus, input[type="text"]:focus, textarea:focus {
    border-color: var(--petrol);
    box-shadow: 0 0 0 3px var(--petrol-flaeche);
}

/* ═══ Meldeformular ══════════════════════════════════════════════════════
   Aufbau nach Entwurf 14a: Formular in einer Karte, rechts eine Leiste mit
   Status, Rückfragen, Hilfe und Bereitschaftsnummern.

   Was für Ruhe sorgt, und warum es so gebaut ist:
   — **Eine Feldhöhe: 48 px.** Eingaben, Erkanntes, Fotozeile, Absenden —
     alles gleich hoch.
   — **Ein Radius: 10 px** im Formular, 12 px für die
     umschließenden Karten. Rund sind nur Punkte und Marken.
   — **Ein Akzent:** Petrol für Aktion, Fokus und Links. Grau trägt die
     Struktur. Drei begründete Ausnahmen: Sand für den Duplikat-Hinweis,
     Magenta für die Psychotraumatologie.

   — **Lesbar auf den ersten Blick** (19.10.2026): Eingaben 19 px,
     Beschriftungen 18 px kräftig, Hilfetexte 17 px in Sekundärgrau statt
     Blassgrau. Blass bleibt nur, was gesperrt ist.

   Farben kommen aus tokens.css. */

.melden-kopfzeile {
    display: flex; align-items: center; gap: var(--a5);
    min-height: 60px;
    padding: calc(var(--a6) + var(--rand-oben)) var(--a10) var(--a6);
    background: var(--grund);
    border-bottom: 1px solid var(--linie);
}

.kopfzeile-logo   { height: 32px; width: auto; filter: invert(1); }
/* Das Logo ist weiß; auf der hellen Kopfzeile am PC wird es schwarz gedreht.
   Im dunklen Modus ist die Kopfzeile dunkel — dann bleibt es weiß (27.10.26). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="hell"]) .kopfzeile-logo { filter: none; }
}
.kopfzeile-name   { font-size: 18px; font-weight: 600; }

.melden-flaeche {
    display: flex; align-items: stretch; gap: var(--a10);
    padding: var(--a9) var(--a10) var(--a10);
    background: var(--flaeche);
    min-height: calc(100dvh - 61px);
}

/* Nur das Formular, über die volle Breite — bündig mit der Kopfzeile. */

/* Die Karte wächst mit ihrem Inhalt, nicht mit dem Fenster — sonst stünde
   zwischen letztem Feld und Absenden eine Lücke. */
.melden-spalte {
    flex: 1; min-width: 0;
    align-self: flex-start;
    display: flex; flex-direction: column; gap: var(--a8);
}

.melden-spalte .melden-karte { flex: none; }

.melden-karte {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: var(--a9);
    background: var(--grund);
    border: 1px solid var(--linie); border-radius: var(--r-gross);
    padding: var(--a10) var(--a10) var(--a9);
}

.karte-kopf h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.karte-kopf p  { margin: var(--a2) 0 0; font-size: 17px; color: var(--text-sekundaer); }

/* ── Feldgruppen ───────────────────────────────────────────────────────── */

.feldgruppe { display: flex; flex-direction: column; gap: var(--a3); }

.feld-label { font-size: 17px; font-weight: 600; color: var(--text); }
.feld-label small { font-weight: 400; color: var(--text-sekundaer); }
.feld-hilfe { font-size: 16px; line-height: 1.5; color: var(--text-sekundaer); }

.feldtrenner { height: 1px; background: var(--linie); }

.melden-text,
.melden-feld {
    width: 100%;
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift); font-size: 18px; line-height: 1.5;
    outline: none;
}

.melden-text { min-height: 96px; padding: var(--a5) var(--a6); resize: vertical; }
.melden-feld { min-height: 48px; padding: 0 var(--a6); }

.melden-text:focus,
.melden-feld:focus,
.raumsuche:focus {
    border-color: var(--petrol);
    box-shadow: 0 0 0 3px rgba(0, 119, 122, .10);
}

/* ── Psychotraumatologie ───────────────────────────────────────────────────
   Erscheint, sobald ein Raum 13xx/14xx erkannt ist, und lässt sich nicht
   wegklicken: Wer dort ohne Absprache hineingeht, steht vor einer Tür, die er
   nicht öffnen darf. */

.psycho-hinweis {
    display: flex; gap: var(--a4);
    padding: var(--a4) var(--a5);
    border: 1px solid transparent; border-radius: var(--r-mittel);
    background: var(--psycho-flaeche);
}

.psycho-hinweis::before {
    content: "";
    flex: 0 0 auto;
    width: 6px; height: 6px; margin-top: 7px;
    border-radius: 50%;
    background: var(--psycho-punkt);
}

.psycho-hinweis p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--psycho-text); }
.psycho-akut { border-color: var(--psycho-rand); }
/* Leerer Platzhalter darf in der Spalte keinen Abstand erzeugen. */
#psycho:empty { display: none; }

/* ── Erkannte Angaben ──────────────────────────────────────────────────────
   Bewusst als Feld gestaltet, nicht als Extra-Block: Sie stehen in derselben
   Reihe wie alles andere und gehören sichtbar zum Formular. */

.erkanntreihe { display: flex; gap: var(--a5); flex-wrap: wrap; }

.erkanntfeld {
    flex: 1 1 240px;
    display: flex; align-items: center; justify-content: space-between; gap: var(--a4);
    min-height: 48px; padding: 0 var(--a6);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--petrol-flaeche);
    font-size: 18px; font-weight: 500; color: var(--petrol-dunkel);
}

.erkanntfeld .nummer { font-family: var(--schrift-zahlen); }

.feld-aendern {
    flex: 0 0 auto;
    border: none; background: none; cursor: pointer; padding: var(--a2);
    color: var(--petrol);
    font-family: var(--schrift); font-size: 16px; font-weight: 500;
}

/* ── Auswahl der Art ───────────────────────────────────────────────────── */

.wahlreihe { display: flex; flex-wrap: wrap; gap: var(--a4); }

.wahlfeld {
    position: relative;
    flex: 1 1 200px;
    display: flex; align-items: center;
    min-height: 48px; padding: 0 var(--a6);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund);
    font-size: 18px; cursor: pointer;
    transition: border-color .15s ease-out, background .15s ease-out;
}

@media (hover: hover) { .wahlfeld:hover { border-color: var(--rahmen-kraeftig); } }
.wahlfeld input { position: absolute; opacity: 0; pointer-events: none; }

.wahlfeld:has(input:checked) {
    border-color: var(--petrol); background: var(--petrol-flaeche);
    color: var(--petrol-dunkel); font-weight: 600;
}

.wahlfeld-unsicher { border-style: dashed; color: var(--text-sekundaer); }

/* ── Raumnummer ────────────────────────────────────────────────────────── */

.raumzeile { display: flex; gap: var(--a5); align-items: flex-start; }

.raumsuche {
    flex: 0 0 190px;
    min-height: 48px; padding: 0 var(--a6);
    border: 1px solid var(--petrol); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift-zahlen); font-size: 21px; font-weight: 600;
    letter-spacing: .06em; outline: none;
}

.raumspalte { flex: 1 1 0; min-width: 0; }

.raumliste {
    list-style: none; margin: 0; padding: 0;
    border: 1px solid var(--linie); border-radius: var(--r-mittel);
    background: var(--grund); overflow: hidden;
}

.raumtreffer {
    display: flex; align-items: center; gap: var(--a5);
    width: 100%; min-height: 42px; padding: 0 var(--a5);
    border: none; border-bottom: 1px solid var(--linie);
    background: none; cursor: pointer; text-align: left;
    font-family: var(--schrift); font-size: 17px; color: var(--text);
}

.raumliste li:first-child .raumtreffer { background: var(--petrol-flaeche); }
.raumliste li:last-child .raumtreffer { border-bottom: none; }
@media (hover: hover) { .raumtreffer:hover { background: var(--petrol-flaeche); } }

.raumtreffer-nummer  { font-family: var(--schrift-zahlen); font-weight: 600; }
.raumtreffer-ort     { color: var(--text-sekundaer); }
.raumtreffer-bereich { margin-left: auto; color: var(--text-sekundaer); font-size: 16px; }
.raumliste-leer      { margin: 0; font-size: 16px; color: var(--text-sekundaer); }

/* ── Fotos ─────────────────────────────────────────────────────────────── */

.fotoreihe { display: flex; gap: var(--a5); }

.fotoablage {
    position: relative;
    flex: 1 1 0;
    display: flex; align-items: center; gap: var(--a4);
    min-height: 48px; padding: 0 var(--a6);
    border: 1px dashed var(--rahmen-kraeftig); border-radius: var(--r-mittel);
    cursor: pointer;
}

.fotoablage input { position: absolute; opacity: 0; pointer-events: none; }
.fotoablage-text  { font-size: 17px; font-weight: 500; color: var(--text-sekundaer); }
.fotoablage-unter { font-size: 16px; color: var(--text-sekundaer); }

/* Schritt 2 liegt in einem gemeinsamen HTMX-Ziel — es gibt den Abstand der
   Karte an seine Feldgruppen weiter, sonst kleben sie aneinander. */
#erkannt { display: flex; flex-direction: column; gap: var(--a9); }

/* ── Mögliche Doppelmeldung ────────────────────────────────────────────── */

.aehnliche-liste { display: flex; flex-direction: column; gap: var(--a3); }

.aehnliche {
    display: flex; align-items: center; gap: var(--a4);
    padding: var(--a4) var(--a5);
    border: 1px solid var(--notiz-rahmen); border-radius: var(--r-mittel);
    background: var(--notiz-flaeche);
    font-size: 17px; color: var(--warnung-text);
}

.aehnliche::before {
    content: "";
    flex: 0 0 auto;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--warnung-text);
}

.aehnliche-titel { flex: 1; }
.aehnliche-nr    { font-family: var(--schrift-zahlen); }

.aehnliche-anhaengen {
    border: none; background: none; cursor: pointer; padding: var(--a2);
    color: var(--petrol);
    font-family: var(--schrift); font-size: 16px; font-weight: 600;
}

/* ── Name und Adresse ──────────────────────────────────────────────────── */

.melderfeld:empty { display: none; }

.melder-treffer {
    display: flex; align-items: center; gap: var(--a4);
    min-height: 48px; padding: 0 var(--a6);
    border-radius: var(--r-mittel);
    background: var(--petrol-flaeche);
    font-size: 18px; color: var(--petrol-dunkel);
    overflow-wrap: anywhere;
}

.melder-haken {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--petrol); color: var(--text-auf-farbe);
    font-size: 15px; font-weight: 700;
}

.melder-geraten { background: var(--flaeche); color: var(--text-sekundaer); }
.melder-geraten .melder-haken { background: var(--text-schwach); }

.melder-rueckfrage {
    background: var(--fehler-flaeche); border: 1px solid var(--notiz-rahmen);
    border-radius: var(--r-mittel);
    padding: var(--a5);
}

.melder-frage { font-size: 16px; color: var(--fehler-text); margin-bottom: var(--a4); }

.melder-vorschlag {
    display: block; width: 100%;
    min-height: 48px; padding: var(--a3) var(--a5); margin-top: var(--a2);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); cursor: pointer; text-align: left;
    font-family: var(--schrift); font-size: 17px; color: var(--text);
}

@media (hover: hover) { .melder-vorschlag:hover { border-color: var(--petrol); } }
.melder-hinweis-text { margin: var(--a3) 0 0; font-size: 16px; color: var(--text-sekundaer); }

/* ── Schritt für Schritt ───────────────────────────────────────────────
   Erst nur der Text. Dann, was erkannt wurde oder fehlt. Erst wenn darin
   nichts mehr offen ist, Foto, Name und Absenden. Rein über CSS: Der Server
   liefert mit Schritt 2 eine Marke (.schritt-bereit), den Rest erledigt die
   Gültigkeit der Pflichtfelder. Eingeblendet wird nur Schritt 3 und nur mit
   Deckkraft, damit nichts verrutscht. Schritt 2 bekommt keine Animation: Er
   wird beim Tippen laufend ausgetauscht und würde sonst flackern. */

.schritt-abschluss { display: none; flex-direction: column; gap: var(--a9); }

#meldeformular:has(.schritt-bereit):not(:has(#erkannt :required:invalid)) .schritt-abschluss {
    display: flex;
    animation: schritt-ein .25s ease-out;
}

@keyframes schritt-ein { from { opacity: 0; } to { opacity: 1; } }

/* Absicherung: Ein Browser ohne :has (z. B. Firefox ESR 115) könnte Schritt 3
   nie einblenden — Name und Absenden blieben unerreichbar. Dort steht einfach
   alles auf einmal da. Absenden ist trotzdem sicher, die Pflichtfelder prüft
   der Browser und danach der Server. */
@supports not selector(:has(*)) {
    .schritt-abschluss { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .schritt-abschluss { animation: none !important; }
}

/* ── Abschluss ─────────────────────────────────────────────────────────── */

.karte-fuss {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between; gap: var(--a8);
    padding-top: var(--a7);
}

.melden-absenden {
    min-height: 48px; padding: 0 var(--a9);
    border: none; border-radius: var(--r-mittel);
    background: var(--petrol); color: var(--text-auf-farbe);
    font-family: var(--schrift); font-size: 19px; font-weight: 600;
    cursor: pointer;
    transition: background .15s ease-out;
}

@media (hover: hover) { .melden-absenden:hover { background: var(--petrol-dunkel); } }

/* Solange eine Rückfrage offen ist, führt Absenden zu nichts — das soll man
   sehen, bevor man klickt. Ohne JavaScript, allein über den Inhalt. */
#meldeformular:has(#erkannt :required:invalid) .melden-absenden {
    background: var(--flaeche-kraeftig); color: var(--text-schwach);
    cursor: not-allowed;
}

/* ── Schmale Fenster ───────────────────────────────────────────────────── */

@media (max-width: 899px) {
    /* Am Handy Petrol (dunkler Modus: Kopfleisten-Dunkel), Logo und Schrift
       weiß — weiß wirkte dort steril (19.10.26). Am PC bleibt die Kopfzeile
       hell. --rand-oben: In App und PWA reicht die Farbe bis unter die
       Dynamic Island. */
    .melden-kopfzeile {
        padding: calc(var(--a5) + var(--rand-oben)) var(--a8) var(--a5);
        background: var(--melden-kopf);
        border-bottom-color: var(--melden-kopf);
        color: #fff;
    }
    .kopfzeile-logo   { filter: none; }
    .melden-flaeche { flex-direction: column; padding: var(--a8); gap: var(--a7); }
    /* Kopfzeile ist am Handy um den Sicherheitsrand höher (App/PWA) — sonst
       ragt die Fläche genau um die Dynamic Island hinaus und die Seite scrollt. */
    .melden-flaeche { min-height: calc(100dvh - 61px - var(--rand-oben)); }
    .melden-spalte { flex: none; align-self: stretch; }
    .melden-karte { padding: var(--a8); }
    .raumzeile, .fotoreihe { flex-direction: column; }
    .raumsuche { flex: 1 1 auto; }
    .karte-fuss { flex-direction: column-reverse; align-items: stretch; gap: var(--a5); }
    .melden-absenden { width: 100%; min-height: 60px; font-size: 16px; }
}

/* ═══ Bestätigung ════════════════════════════════════════════════════════
   Nach Entwurf 9b. Der Erfolg ist die Hauptsache auf der Seite; das Angebot
   „Meine Meldungen" ordnet sich unter — es ist eine Bequemlichkeit, keine
   Bedingung. */

/* Linke Spalte: die Meldung als schmale Karte. Rechts füllt der Verlauf den
   Rest — er ist das, weswegen jemand später auf die Seite zurückkommt. */
.danke {
    flex: none; width: 400px;
    /* So hoch wie der Verlauf daneben — die Kachel behält ihre Größe, egal
       wie viel darin steht. */
    align-self: stretch;
    display: flex; flex-direction: column;
    background: var(--grund);
    border: 1px solid var(--linie); border-radius: var(--r-gross);
    padding: var(--a8);
    overflow-y: auto;
}
/* Dank ohne Anmeldung: allein, mittig, so hoch wie der Inhalt. */
.danke.danke-allein { margin: 0 auto; align-self: flex-start; width: min(440px, 100%); }

/* Melder-Seite (Bestätigung + Verlauf) bewusst eine Stufe kleiner als das
   Meldeformular — hier wird gelesen, nicht eingegeben. Ausnahme: das
   Schreibfeld bleibt bei 16 px, sonst zoomt das iPhone beim Antippen hinein. */
.danke-haken {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--petrol-flaeche); color: var(--petrol-dunkel);
    font-size: 19px;
    flex: none;
}

.zustand-in_bearbeitung { background: var(--bearbeitung-flaeche); color: var(--bearbeitung-text); }
.zustand-geparkt        { background: var(--geparkt-flaeche);     color: var(--geparkt-text); font-size: 14px; letter-spacing: -2px; }
.zustand-erledigt       { background: var(--erledigt-flaeche);    color: var(--erledigt-text); }
.zustand-verworfen      { background: var(--flaeche-kraeftig);    color: var(--text-tertiaer); }

.danke-zurueck {
    display: inline-flex; align-items: center;
    min-height: 44px; margin: calc(-1 * var(--a5)) 0 var(--a5);
    font-size: 13px; font-weight: 500; color: var(--petrol-dunkel);
}

.danke-kopf { display: flex; align-items: center; gap: var(--a5); margin-bottom: var(--a4); }
.danke-kopf .danke-titel { margin: 0; }
.danke-titel { margin: 0 0 var(--a3); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }

.danke-text {
    margin: 0 0 var(--a7);
    max-width: 52ch;
    font-size: calc(var(--text-normal) - 1px); line-height: 1.5;
    color: var(--text-sekundaer);
}

/* Fortschritt in drei Schritten und wer sich kümmert (Skizze 27.10.26). */
.melden-schritte {
    list-style: none; margin: var(--a2) 0 var(--a7); padding: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--a2);
    font-size: var(--text-meta); color: var(--text-schwach);
}
.melden-schritte li::before {
    content: ""; display: block; height: 5px; margin-bottom: var(--a2);
    border-radius: var(--r-pille); background: var(--flaeche-kraeftig);
}
.melden-schritte .schritt-ok { color: var(--text-sekundaer); }
.melden-schritte .schritt-ok::before { background: var(--ampel-erledigt); }
.melden-schritte .schritt-jetzt { color: var(--bearbeitung-text); font-weight: 600; }
.melden-schritte .schritt-jetzt::before { background: var(--ampel-arbeit); }
.melden-wer {
    display: flex; align-items: center; gap: var(--a5);
    margin: 0 0 var(--a7);
    font-size: var(--text-normal); line-height: 1.3;
}
.melden-wer small { display: block; font-size: var(--text-klein); color: var(--text-tertiaer); }
.melden-wer-zeichen {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--petrol); color: var(--text-auf-farbe);
    font-size: 14px; font-weight: 700; text-transform: uppercase;
}

.danke-meldung { margin: 0 0 var(--a7); }
.danke-meldung blockquote {
    /* Kein Innenabstand oben/unten: line-clamp schneidet nur den Text, ein
       Abstand darunter zeigte die Spitze der dritten Zeile. */
    margin: var(--a3) 0 0;
    padding: 0 var(--a6);
    border-left: 3px solid var(--petrol-flaeche);
    font-size: calc(var(--text-normal) - 1px); line-height: 1.5;
    color: var(--text);
    white-space: pre-line; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

.danke-meldung-mehr {
    display: block; margin: var(--a2) 0 0 auto; padding: 0;
    border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--petrol);
}
@media (hover: hover) { .danke-meldung-mehr:hover { color: var(--petrol-dunkel); } }

/* Volltext über der Seite. Breit genug zum Lesen, nie höher als das Fenster —
   dann scrollt der Text darin. */
.meldung-voll {
    width: min(640px, calc(100vw - 32px)); max-height: min(70vh, 640px);
    padding: 0; margin: auto;
    border: 1px solid var(--linie); border-radius: var(--r-gross);
    background: var(--grund); color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
    overflow: hidden;
}
.meldung-voll:popover-open { display: flex; flex-direction: column; }
.meldung-voll::backdrop { background: rgba(10, 16, 18, .45); }
.meldung-voll-kopf {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--a6) var(--a8);
    border-bottom: 1px solid var(--linie);
    font-size: 15px; font-weight: 600;
}
.meldung-voll-kopf button {
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: var(--flaeche); color: var(--text-sekundaer);
    font-size: 20px; line-height: 1; cursor: pointer;
}
.meldung-voll-text {
    padding: var(--a8);
    overflow-y: auto;
    font-size: 15px; line-height: 1.6;
    white-space: pre-line; overflow-wrap: anywhere;
}

.danke-eckdaten {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--linie);
    border: 1px solid var(--linie); border-radius: var(--r-gross);
    overflow: hidden;
    margin-bottom: var(--a7);
}

.danke-eckdaten > div {
    background: var(--grund);
    padding: var(--a3) var(--a6);
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    min-width: 0;
}

.danke-label  { font-size: calc(var(--text-klein) - 1px); color: var(--text-tertiaer); }
.danke-wert   { font-size: calc(var(--text-normal) - 1px); }
.danke-nummer { font-family: var(--schrift-zahlen); font-weight: 600; }

.chip {
    display: inline-flex; align-items: center;
    height: 24px; padding: 0 var(--a4);
    border-radius: var(--r-pille);
    font-size: var(--text-meta); font-weight: 600;
}

.chip-neu            { background: var(--neu-flaeche);         color: var(--neu-text); }
.chip-in_bearbeitung { background: var(--bearbeitung-flaeche); color: var(--bearbeitung-text); }
.chip-geparkt        { background: var(--geparkt-flaeche);     color: var(--geparkt-text); }
.chip-erledigt       { background: var(--erledigt-flaeche);    color: var(--erledigt-text); }
.chip-verworfen      { background: var(--verworfen-flaeche);   color: var(--verworfen-text); }

.danke-uebersicht {
    background: var(--petrol-flaeche);
    border-radius: var(--r-karte);
    padding: var(--a6);
    margin-bottom: var(--a7);
}

.danke-uebersicht-titel { font-size: 15px; font-weight: 600; color: var(--petrol-dunkel); }
.danke-uebersicht p { margin: var(--a2) 0 var(--a5); font-size: 13px; line-height: 1.5; color: var(--petrol-dunkel); }

.danke-uebersicht-knopf {
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 var(--a7);
    border-radius: var(--r-gross);
    background: var(--petrol); color: var(--text-auf-farbe);
    font-size: 13px; font-weight: 600;
}

.danke-abschluss { margin-top: auto; display: flex; align-items: stretch; gap: var(--a4); flex-wrap: wrap; }
.danke-abschluss > a { flex: 1 1 auto; justify-content: center; min-height: 44px; white-space: nowrap; }

.danke-weiter {
    display: inline-flex; align-items: center;
    min-height: 44px; padding: 0 var(--a8);
    border: 1px solid var(--rahmen); border-radius: var(--r-gross);
    color: var(--text); font-size: 14px; font-weight: 500;
}

@media (hover: hover) { .danke-weiter:hover { border-color: var(--rahmen-kraeftig); } }
.danke-fuss { font-size: calc(var(--text-klein) - 1px); color: var(--text-tertiaer); }

/* ── Verlauf ──────────────────────────────────────────────────────────── */

.verlauf {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    background: var(--grund);
    border: 1px solid var(--linie); border-radius: var(--r-gross);
    overflow: hidden;
    /* Gleichnamige Regel der Bearbeiteransicht weiter oben setzt Innenabstand
       und Lücken — hier soll es eine durchgehende Chatfläche sein. */
    padding: 0; gap: 0;
}

.verlauf-kopf {
    display: flex; align-items: baseline; gap: var(--a5); flex-wrap: wrap;
    padding: var(--a8) var(--a9);
    border-bottom: 1px solid var(--linie);
}

.verlauf-kopf h2 { margin: 0; font-size: 17px; font-weight: 600; }
.verlauf-kopf span { font-size: 13px; color: var(--text-tertiaer); }
/* Erst zeigen, wenn der Browser noch nicht gefragt hat (data-mitteilung am <html>). */
.verlauf-mitteilung {
    display: none; margin-left: auto; padding: 0;
    border: 0; background: none;
    font: inherit; font-size: 13px; color: var(--petrol); cursor: pointer;
}
html[data-mitteilung="default"] .verlauf-mitteilung { display: inline; }
@media (hover: hover) { .verlauf-mitteilung:hover { text-decoration: underline; } }

.verlauf-liste {
    flex: 1;
    list-style: none; margin: 0;
    padding: var(--a8) var(--a9);
    display: flex; flex-direction: column; gap: var(--a5);
    background: var(--grund);
    overflow-y: auto;
}

/* .blase gibt es auch in der Bearbeiteransicht (weiter oben, mit Fläche,
   Innenabstand und pre-wrap). Hier ist sie nur der Rahmen um Kopf und Text —
   pre-wrap machte aus den Zeilenumbrüchen der Vorlage große Lücken. */
.verlauf-liste .blase {
    display: flex; gap: var(--a3); max-width: min(560px, 80%);
    padding: 0; background: none; border-radius: 0;
    white-space: normal; line-height: normal;
}
.blase-ich { align-self: flex-end; flex-direction: column; }
.blase-dienst { align-self: flex-start; }

.blase-kopf { font-size: calc(var(--text-klein) - 1px); color: var(--text-tertiaer); margin-bottom: var(--a1); }
.blase-ich .blase-kopf { text-align: right; }
.blase-bearbeitet { margin-top: var(--a1); font-size: calc(var(--text-klein) - 1px); font-style: italic; color: var(--text-tertiaer); text-align: right; }

.blase-text {
    padding: var(--a3) var(--a6);
    border-radius: var(--r-gross);
    font-size: 14px; line-height: 1.55;
    white-space: pre-line; overflow-wrap: anywhere;
}

.blase-ich .blase-text {
    background: var(--petrol-flaeche); color: var(--petrol-dunkel);
    border-top-right-radius: 4px;
}

.blase-dienst .blase-text {
    background: var(--flaeche); color: var(--text);
    border: 1px solid var(--linie);
    border-top-left-radius: 4px;
}

.blase-kuerzel {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--flaeche-kraeftig);
    font-size: 11px; font-weight: 600; color: var(--text-tertiaer);
}

.verlauf-anker { height: 0; margin-top: calc(-1 * var(--a5)); }

/* Steht allein in der leeren Nachrichtenfläche, waagrecht und senkrecht
   mittig — so sieht ein Chat aus, in dem noch niemand geschrieben hat. */
.verlauf-leer {
    margin: auto;
    max-width: 440px;
    font-size: 14px; line-height: 1.55; color: var(--text-tertiaer);
    text-align: center;
}

/* Systemhinweis im Chat: zentriert, mit Strich links und rechts. Steht er
   allein (noch niemand hat geschrieben), sitzt er mittig in der Fläche. */
.verlauf-marke {
    display: flex; align-items: center; gap: var(--a5);
    font-size: 12px; color: var(--text-tertiaer);
}
.verlauf-marke::before, .verlauf-marke::after {
    content: ""; flex: 1; height: 1px; background: var(--linie);
}
.verlauf-marke span {
    padding: var(--a1) var(--a5);
    border-radius: var(--r-pille);
    background: var(--erledigt-flaeche); color: var(--erledigt-text);
    font-weight: 600; white-space: nowrap;
}
.verlauf-marke-allein { margin: auto 0; }

.verlauf-leer strong {
    display: block; margin-bottom: var(--a2);
    font-weight: 600; color: var(--text-sekundaer);
}

.verlauf-fuss {
    padding: var(--a7) var(--a9);
    border-top: 1px solid var(--linie);
    font-size: 13px; line-height: 1.5; color: var(--text-sekundaer);
}

.verlauf-schreiben {
    display: flex; flex-direction: column; gap: var(--a2);
    padding: var(--a5) var(--a9) var(--a4);
    border-top: 1px solid var(--linie);
    background: var(--grund);
}

.verlauf-schreiben-zeile { display: flex; align-items: flex-end; gap: var(--a4); }

.verlauf-schreiben textarea {
    flex: 1; min-width: 0; box-sizing: border-box;
    field-sizing: content; min-height: 46px; max-height: 180px;
    resize: none;
    padding: 11px var(--a7);
    border: 1px solid var(--linie); border-radius: 23px;
    background: var(--flaeche); color: var(--text);
    font: inherit; font-size: 16px; line-height: 1.5;
}

.verlauf-schreiben textarea:focus { outline: 2px solid var(--petrol); outline-offset: 1px; border-color: transparent; }

.verlauf-schreiben button {
    flex: 0 0 auto;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: var(--petrol); color: #fff;
    cursor: pointer;
}

@media (hover: hover) { .verlauf-schreiben button:hover { background: var(--petrol-dunkel); } }

.verlauf-schreiben-hinweis {
    padding-left: var(--a7);
    font-size: 12px; color: var(--text-tertiaer);
}

/* Am Rechner passt die Seite genau ins Fenster: Sie selbst scrollt nicht,
   nur der Chat in sich — wie in einem Messenger. 61 px = Kopfzeile. */
@media (min-width: 900px) {
    .melden-flaeche-verlauf {
        height: calc(100dvh - 61px); min-height: 520px;
        box-sizing: border-box;
        padding-top: var(--a8); padding-bottom: var(--a10);
    }
    .melden-flaeche-verlauf .verlauf { min-height: 0; }
    .verlauf-kopf { padding: var(--a6) var(--a9); }
}


@media (max-width: 899px) {
    .danke { width: auto; align-self: stretch; padding: var(--a8); }
    .verlauf { min-height: 360px; }
    .verlauf-liste { padding: var(--a8); }
    .verlauf-liste .blase { max-width: 92%; }
}

@media (max-width: 599px) {
    .danke-weiter { width: 100%; justify-content: center; min-height: 56px; }
}

/* ═══ Anmeldeseite ════════════════════════════════════════════════════════ */

.anmelden-seite { display: flex; min-height: 100vh; background: var(--grund); }

.anmelden-buehne {
    display: none;
    width: 52%;
    background: var(--dunkel);
    color: var(--text-auf-farbe);
    padding: var(--a10);
    flex-direction: column;
    justify-content: space-between;
    gap: var(--a10);
}

/* Erst das Haus, dann die Anwendung — durch einen feinen Strich getrennt.
   Beide Bilddateien sind weiß auf durchsichtigem Grund und deshalb nur auf
   der dunklen Fläche verwendbar. */
.marke-logo { height: 46px; width: auto; display: block; }

.marke-logo + .marke-text {
    padding-left: var(--a7);
    margin-left: var(--a3);
    border-left: 1px solid rgba(255, 255, 255, .22);
    font-size: 17px; font-weight: 500;
    color: var(--text-auf-dunkel);
}

/* Am Telefon dasselbe Bild wie auf der Bühne am PC: volles Logo, Trennstrich,
   Name der Anwendung — darunter, was sie tut. `flex-wrap` als Rückfall für
   sehr schmale Geräte, dort rutscht der Name unter das Logo. */
.kopf-marke {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: var(--a3) var(--a5);
}

/* Der Trennstrich gehört jetzt an die Textspalte, nicht mehr an die
   Überschrift — sonst stünde die Unterzeile links davon. */
.kopf-text {
    min-width: 0;
    padding-left: var(--a5);
    border-left: 1px solid rgba(255, 255, 255, .22);
}

.kopf-logo { height: 34px; width: auto; display: block; }

.buehne-titel {
    font-size: 40px; font-weight: 600; line-height: 1.15;
    letter-spacing: -.02em; margin: 0 0 var(--a7);
}

.buehne-text {
    font-size: 16px; line-height: 1.6;
    color: var(--text-auf-dunkel);
    max-width: 380px; margin: 0;
}

.buehne-fuss {
    display: flex; gap: var(--a10);
    padding-top: var(--a8);
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.buehne-fuss-text { font-size: 13px; color: var(--text-auf-dunkel); margin-top: var(--a1); }

/* ── Begrüßung nach Tageszeit ─────────────────────────────────────────────
   Unten links steht der Gruß mit dem Datum, und ein weicher Lichtschein aus
   der oberen Ecke nimmt die Farbe der Tageszeit an: morgens kühl und wach,
   abends warm, nachts fast nichts — wer um drei anfängt, soll keine helle
   Fläche ins Gesicht bekommen. */

.anmelden-buehne { position: relative; overflow: hidden; }
.anmelden-buehne > * { position: relative; z-index: 1; }

.anmelden-buehne::before {
    content: "";
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(115% 85% at 12% 0%, var(--schein), transparent 62%);
    pointer-events: none;
}

.zeit-morgen { --schein: rgba(22, 165, 165, .34); }
.zeit-tag    { --schein: rgba(22, 165, 165, .20); }
.zeit-abend  { --schein: rgba(196, 124, 44, .26); }
.zeit-nacht  { --schein: rgba(29, 91, 150, .16); }

.buehne-gruss { font-size: 26px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }

/* Einmal beim Laden, gestaffelt von oben nach unten. Danach steht alles still
   — diese Seite sieht dieselbe Mannschaft jeden Tag. */
@keyframes buehne-auf {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.anmelden-buehne > * { animation: buehne-auf .5s ease-out both; }
.anmelden-buehne > *:nth-child(2) { animation-delay: .10s; }
.anmelden-buehne > *:nth-child(3) { animation-delay: .20s; }

/* Kommt man von einer anderen Zugangsseite, steht die Bühne schon
   (Klasse gesetzt in _zugang.html). */
.buehne-steht .anmelden-buehne > * { animation: none; }

@media (prefers-reduced-motion: reduce) {
    .anmelden-buehne > * { animation: none; opacity: 1; transform: none; }
}

.anmelden-spalte {
    flex: 1; min-width: 0;
    display: flex; align-items: flex-start; justify-content: center;
}

/* min-width: 0 ist nötig, damit sich die Karte am Handy unter die Breite
   ihres Inhalts stauchen lässt — sonst hält das lange Beispiel im
   E-Mail-Feld die ganze Seite auf. */
.anmelden-karte { width: 100%; max-width: 420px; min-width: 0; }

/* Der dunkle Kopf reicht am Handy bis an beide Ränder — deshalb trägt nicht
   die Karte den Innenabstand, sondern der Bereich darunter. */
.anmelden-inhalt { padding: var(--a8); }

.anmelden-kopf-handy {
    background: var(--dunkel);
    color: var(--text-auf-farbe);
    /* Oben zusätzlich der Sicherheitsrand: in der installierten App reicht die
       dunkle Fläche damit bis unter die Dynamic Island, der Text aber nicht.
       Dazu etwas Luft, damit der Inhalt nicht an der Oberkante klebt. */
    padding: calc(var(--a10) + var(--a5) + var(--rand-oben)) var(--a8) var(--a8);
}

.anmelden-titel-handy {
    margin: 0;
    font-size: 20px; font-weight: 600;
    letter-spacing: -.01em;
}

/* Rutscht der Text um, ergibt der Trennstrich links keinen Sinn mehr. */
@media (max-width: 359px) {
    .kopf-text { padding-left: 0; border-left: none; }
}
/* Name und Unterzeile gehören zusammen — enger als zum Rest. */
.anmelden-kopf-handy .anmelden-unter { color: var(--text-auf-dunkel); margin-top: var(--a1); }
.anmelden-kopf-desktop { display: none; margin-bottom: var(--a8); }
.anmelden-titel { font-size: 28px; font-weight: 600; margin: 0 0 var(--a2); letter-spacing: -.01em; }
.anmelden-unter { font-size: 14px; color: var(--text-tertiaer); margin: 0; }

.stoerung {
    display: flex; gap: var(--a4);
    background: var(--fehler-flaeche);
    border-radius: var(--r-gross);
    padding: var(--a5) var(--a6);
    margin-bottom: var(--a7);
}

.stoerung-zeichen {
    width: 20px; height: 20px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--fehler); color: #fff;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 700;
}

.stoerung-titel { font-size: 15px; font-weight: 600; color: var(--fehler-text); margin-bottom: var(--a1); }
.stoerung-text  { font-size: 13px; line-height: 1.5; color: var(--fehler-text); }

input[type="email"], input[type="password"] {
    width: 100%;
    min-height: var(--touchziel);
    padding: var(--a4) var(--a5);
    border: 1px solid var(--rahmen);
    border-radius: var(--r-gross);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift); font-size: 15px;
    outline: none;
}

input[type="email"]:focus, input[type="password"]:focus {
    border-color: var(--petrol);
    box-shadow: 0 0 0 3px var(--petrol-flaeche);
}

input.fehlerhaft { border-color: var(--fehler); }

.passwortfeld { position: relative; display: block; }
.passwortfeld input { padding-right: 86px; }

.zeigen {
    position: absolute; right: var(--a5); top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--petrol);
    font-family: var(--schrift); font-size: 14px; font-weight: 600;
    cursor: pointer; padding: var(--a2);
}

.bleiben {
    display: flex; align-items: center; gap: var(--a3);
    min-height: var(--touchziel);
    font-size: 15px;
    margin-bottom: var(--a5);
    cursor: pointer;
}

.bleiben input { width: 20px; height: 20px; accent-color: var(--petrol); }
.bleiben[hidden] { display: none; }   /* in der installierten App, siehe anmelden.html */

.anmelden-link {
    display: block; text-align: center;
    margin-top: var(--a6);
    color: var(--petrol); font-size: 16px; font-weight: 600;   /* 19.10.26: war 14 px, zu klein am Handy */
}

/* Die Hauptaktion der Anmeldeseite. Lag ursprünglich im Formular-Abschnitt
   und ist beim Umbau auf den neuen Entwurf verloren gegangen — ohne sie wird
   der Knopf als grauer Standardknopf des Browsers gezeichnet. */
.absenden {
    width: 100%;
    min-height: 52px;
    border: none; border-radius: var(--r-gross);
    background: var(--petrol); color: var(--text-auf-farbe);
    font-family: var(--schrift); font-size: 16px; font-weight: 600;
    cursor: pointer;
    transition: background .15s ease-out;
}

@media (hover: hover) { .absenden:hover { background: var(--petrol-dunkel); } }

/* ── Passwort vergessen / neues Passwort ─────────────────────────────────
   Gleicher Rahmen wie die Anmeldung (`_zugang.html`). Anders als dort steht
   die Überschrift auch am Handy — der dunkle Kopf sagt nur „Ticketsystem",
   nicht, was auf dieser Seite zu tun ist. */
.zugang-kopf { margin-bottom: var(--a8); }
.zugang-kopf .anmelden-unter { font-size: 15px; line-height: 1.5; color: var(--text-sekundaer); }
@media (max-width: 899px) {
    .zugang-kopf .anmelden-titel { font-size: 22px; }
}
.feld-hilfe { display: block; margin-top: var(--a2); font-size: 13px; color: var(--text-tertiaer); }

/* Dieselbe Form wie `.stoerung`, aber für gute Nachrichten. */
.stoerung.gut { background: var(--erledigt-flaeche); }
.stoerung.gut .stoerung-zeichen { background: var(--erledigt-text); }
.stoerung.gut .stoerung-titel,
.stoerung.gut .stoerung-text { color: var(--erledigt-text); }

/* Knopf als Link („Zurück zur Anmeldung", „Neuen Link anfordern"). */
a.absenden {
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
}

/* ── Was auf welchem Gerät steht ──────────────────────────────────────────
   Der Einrichtungshinweis lautet je Gerät anders: am Telefon heißt der
   Menüpunkt nicht wie am PC, und der QR-Code ergibt nur am PC Sinn. Vorgabe
   ist der PC-Text, das Telefon tauscht ihn — gleiche Grenze wie in tokens.css.

   Ohne diese beiden Regeln erscheint beides gleichzeitig, und die Seite wird
   doppelt so lang. */


/* ── Die zweite Tür ───────────────────────────────────────────────────────
   Anmelden ist für die elf Bearbeiter, Melden für alle anderen. Deshalb steht
   der zweite Weg gleichwertig sichtbar da — dunkel wie die Kopfleiste und
   bewusst nicht rot: Rot heißt in dieser Oberfläche „hier stimmt etwas
   nicht", und Melden ist der Normalfall. */

.tuer-trenner {
    display: flex; align-items: center; gap: var(--a5);
    margin: var(--a8) 0 var(--a7);
    color: var(--text-tertiaer); font-size: 13px;
}

.tuer-trenner::before,
.tuer-trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }

.melden-knopf {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 52px;
    border: none; border-radius: var(--r-gross);
    background: var(--melden); color: var(--text-auf-farbe);
    font-size: 16px; font-weight: 600;
    transition: background .15s ease-out;
}

@media (hover: hover) { .melden-knopf:hover { background: var(--melden-schweben); } }
/* „Meine Meldungen“ unter „Störung melden“, wenn das Gerät schon gemeldet hat. */
.meine-knopf {
    margin-top: var(--a4);
    background: var(--grund); color: var(--petrol);
    border: 1px solid var(--rahmen);
}
@media (hover: hover) { .meine-knopf:hover { background: var(--petrol-flaeche); } }
.nicht-sie { color: var(--petrol); text-decoration: underline; text-underline-offset: 2px; }

.melden-hinweis {
    margin: var(--a4) 0 0;
    text-align: center;
    font-size: 13px; line-height: 1.5;
    color: var(--text-tertiaer);
}

@media (max-width: 899px) {
    .melden-knopf { min-height: var(--touchziel); }
}

/* Der Einrichtungshinweis erklärt erst den Nutzen, dann die Schritte —
   „Als App einrichten" allein sagt niemandem, warum er das tun sollte.
   Am Telefon steht er zugeklappt da, damit die Seite ohne Scrollen passt. */
.fuss-nutzen { margin: var(--a4) 0; }
.fuss-schritt { margin: 0; }
/* In der iOS-App (die Hülle setzt <html class="in-app">) ist man schon in der App. */
.in-app .anmelden-fuss.nur-handy { display: none; }   /* muss .anmelden-fuss.nur-handy im Handy-Block unten schlagen */
/* Die App lässt die Statusleiste frei — der Kopf braucht oben keinen Platz für
   die Dynamic Island. Kopf höher, Formular etwas tiefer (19.10.26 abgestimmt). */
.in-app .anmelden-kopf-handy { padding-top: calc(var(--a8) + var(--rand-oben)); }
.in-app .anmelden-inhalt     { padding-top: calc(var(--a10) + var(--a3)); }

details.anmelden-fuss > summary {
    display: flex; align-items: center; gap: var(--a3);
    min-height: 26px;
    font-weight: 600;
    color: var(--text-sekundaer);
    cursor: pointer;
    list-style: none;
}

details.anmelden-fuss > summary::-webkit-details-marker { display: none; }

details.anmelden-fuss > summary::after {
    content: "";
    margin-left: auto;
    width: 7px; height: 7px;
    border-right: 2px solid var(--text-tertiaer);
    border-bottom: 2px solid var(--text-tertiaer);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .15s ease-out;
}

details.anmelden-fuss[open] > summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* ── Kurze Bildschirme ────────────────────────────────────────────────────
   Ziel: Die Anmeldung passt am Telefon ohne Scrollen auf einen Bildschirm.
   Gekürzt wird nur an den Abständen, nicht an den Tippzielen. */
@media (max-width: 899px) and (max-height: 780px) {
    .anmelden-kopf-handy { padding-top: calc(var(--a9) + var(--rand-oben)); padding-bottom: var(--a6); }
    .anmelden-inhalt     { padding-top: var(--a6); padding-bottom: var(--a6); }
    .anmelden-fuss       { margin-top: var(--a5); }
    .tuer-trenner        { margin: var(--a6) 0 var(--a5); }
    .melden-hinweis      { margin-top: var(--a3); }
    .anmelden-link       { margin-top: var(--a5); }
    .kopf-logo           { height: 30px; }
    .anmelden-titel-handy { font-size: 18px; }
}

.anmelden-fuss {
    display: block;
    background: var(--flaeche);
    border-radius: var(--r-gross);
    padding: var(--a5) var(--a6);
    margin-top: var(--a7);
    font-size: 13px; line-height: 1.5;
    color: var(--text-sekundaer);
}

@media (min-width: 900px) {
    .anmelden-buehne { display: flex; }
    .anmelden-kopf-handy { display: none; }
    .anmelden-kopf-desktop { display: block; }
    /* Feste Oberkante statt Mitte: Die Zugangsseiten sind verschieden lang,
       mittig gesetzt sprang das Formular beim Wechsel auf und ab. Der Abstand
       ist so gewählt, dass die Anmeldung (gemessen 536 px) mittig steht. */
    .anmelden-spalte {
        align-items: flex-start;
        padding: var(--a8);
        padding-top: max(var(--a8), calc(50vh - 268px));
    }
    .anmelden-inhalt { padding: 0; }
}

/* ── Was auf welchem Gerät steht ──────────────────────────────────────────
   Der Einrichtungshinweis lautet je Gerät anders: am Telefon heißt der
   Menüpunkt nicht wie am PC, und der QR-Code ergibt nur am PC Sinn.

   Steht bewusst am Ende des Abschnitts: `.anmelden-fuss` setzt weiter oben
   `display: block`, und bei gleicher Gewichtung gewinnt die spätere Regel.
   Andersherum erschienen beide Fassungen gleichzeitig. */
.anmelden-fuss.nur-handy,
.nur-handy { display: none; }

@media (max-width: 899px) {
    .nur-pc { display: none; }
    .anmelden-fuss.nur-handy,
    .nur-handy { display: block; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   App-Gefühl am Telefon — Vorgaben aus Entwurf v5 (5a)

   Drei Kleinigkeiten trennen „Website im Browser" von „App":
   Eingabefelder unter 17 px lassen Safari beim Antippen hineinzoomen, die
   Seite darf nicht gummiband-artig überscrollen, und beim Tippen darf kein
   blauer Kasten aufblitzen.
   ═══════════════════════════════════════════════════════════════════════════ */

html {
    -webkit-text-size-adjust: 100%;   /* Safari soll nicht selbst skalieren */
    overscroll-behavior-y: none;      /* kein Gummiband über die ganze Seite */
}

body { touch-action: manipulation; }  /* keine 300-ms-Wartezeit beim Antippen */

button, a, label, select, input, textarea {
    -webkit-tap-highlight-color: transparent;
}

/* Sofortige Rückmeldung: der Knopf drückt sich ein, bevor HTMX antwortet. */
button:active, .knopf:active, .absenden:active, .knopf-block:active {
    transform: scale(.985);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    button:active, .knopf:active, .absenden:active { transform: none; }
}

@media (max-width: 899px) {

    /* ── Schrift eine Stufe größer ── */
    .zeile-titel      { font-size: var(--text-normal); line-height: 1.35; }
    .zeile-kontext    { font-size: var(--text-klein); }
    .zeile-nr,
    .zeile-zeit       { font-size: var(--text-meta); }
    .melden-kopf h1   { font-size: var(--text-titel); }
    .melden-kopf p    { font-size: var(--text-klein); }
    .schritt-titel    { font-size: var(--text-normal); }
    .hinweis          { font-size: var(--text-klein); }
    .kategorie-name   { font-size: var(--text-normal); }
    .kategorie-gewerk { font-size: var(--text-klein); }
    .schalter-text    { font-size: var(--text-normal); }
    .anmelden-unter   { font-size: var(--text-klein); }
    .stoerung-text    { font-size: var(--text-klein); }
    .feld-name        { font-size: var(--text-klein); }
    .plakette         { font-size: var(--text-meta); height: 24px; }
    .seitenkarte-label,
    .abschnitt-label  { font-size: var(--text-meta); }

    /* ── Tippziele üppiger ── */
    select,
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        min-height: 60px;
        font-size: var(--text-normal);   /* nie unter 17 px */
        border-radius: var(--r-gross);
    }

    textarea {
        font-size: var(--text-normal);
        min-height: 130px;
        border-radius: var(--r-gross);
    }

    .absenden    { min-height: 60px; font-size: 17px; border-radius: var(--r-gross); }
    .knopf-block { min-height: 60px; line-height: 58px; font-size: var(--text-normal); }
    .schalter    { min-height: 60px; }
    .zeile       { padding: var(--a6) var(--a8); min-height: 56px; }

    /* Ankreuzfelder größer, Zeile vollflächig antippbar */
    .schalter input,
    .bleiben input { width: 30px; height: 30px; }
    .bleiben       { min-height: 56px; font-size: var(--text-normal); }

    /* ── Karten weicher ── */
    .karte, .seitenkarte, .anmelden-karte { border-radius: var(--r-karte); }

    /* ── Rand unten: Platz für den Home-Indikator ── */
    .melden-koerper,
    .anmelden-inhalt { padding-bottom: var(--rand-unten); }
    .listen-koerper  { padding-bottom: var(--rand-unten); }

    /* ── Kategorien: zwei je Zeile, nie abgeschnittener Text ── */
    .kategorien { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kategorie  { min-height: 76px; }

    /* Ortsfelder untereinander statt gequetscht nebeneinander */
    .feldreihe { flex-direction: column; gap: var(--a5); }
    .feldreihe > * { flex: 1 1 auto; width: 100%; }
    #ort-rest { display: contents; }
}

/* ── Fotos: Kachel statt rohem Bedienelement ─────────────────────────────── */

.fotofeld {
    display: flex; align-items: center; gap: var(--a5);
    min-height: 76px;
    padding: var(--a5) var(--a6);
    border: 1px dashed var(--rahmen-kraeftig);
    border-radius: var(--r-gross);
    background: var(--grund);
    cursor: pointer;
    transition: border-color .15s ease-out, background .15s ease-out;
}

@media (hover: hover) { .fotofeld:hover { border-color: var(--petrol); background: var(--petrol-flaeche); } }
.fotofeld input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.fotofeld-zeichen {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: var(--r-gross);
    background: var(--flaeche);
    display: grid; place-items: center;
    font-size: 22px; color: var(--petrol);
}

.fotofeld-text  { display: block; font-size: var(--text-normal); font-weight: 500; }
.fotofeld-unter { display: block; font-size: var(--text-klein); color: var(--text-tertiaer); margin-top: 2px; }

/* Sehr schmale Geräte: dann doch untereinander */
@media (max-width: 380px) {
    .kategorien { grid-template-columns: minmax(0, 1fr); }
}

/* ═══ Große Monitore ══════════════════════════════════════════════════════
   Früher (v5) wurde die Anwendung ab 2300 px bei 2100 px gedeckelt und
   mittig gesetzt — am 32-Zöller blieben links und rechts breite leere
   Streifen. Seit 20.10.26 füllt sie wie MediFlow immer die ganze Breite.
   Dass nichts endlos breit wird, regeln stattdessen die Spaltengrenzen
   (tokens.css) und die Lesebreite für Fließtext. Die Schrift wächst nicht
   mit — das übernimmt die Skalierung des Betriebssystems. */

.detail .blase, .detail-titel, .detail-herkunft { max-width: var(--lesebreite); }

/* ═══════════════════════════════════════════════════════════════════════════
   Seitenübergänge (19.10.26) — View Transitions zwischen ganzen Seiten.

   Der Kopf (dunkel bzw. Petrol) bleibt stehen, nur der Inhalt darunter
   wechselt: alt raus nach links, neu rein von rechts; zurück zur Anmeldung
   spiegelverkehrt (Typ „zurueck“, gesetzt in _zugang.html). Browser ohne
   View Transitions wechseln wie bisher — es geht nichts verloren.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Nur ab PC-Breite: Am iPhone ließ WebKit nach View Transitions alte Bilder
   stehen, die App nahm dann keine Berührung mehr an (24.10.26, uebersicht.html). */
@media (min-width: 900px) { @view-transition { navigation: auto; } }

.anmelden-kopf-handy,
.melden-kopfzeile { view-transition-name: kopf; }
.anmelden-inhalt  { view-transition-name: inhalt; }

/* Die Bühne links (PC) ist auf allen Zugangsseiten dieselbe: sie bleibt
   reglos stehen, statt mit dem Rest der Seite überzublenden. */
.anmelden-buehne  { view-transition-name: buehne; }
::view-transition-old(buehne),
::view-transition-new(buehne) { animation: none; }

::view-transition-group(*) {
    animation-duration: .22s;
    animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}
::view-transition-old(inhalt) { animation: .22s cubic-bezier(.2, .8, .2, 1) both inhalt-raus; }
::view-transition-new(inhalt) { animation: .22s cubic-bezier(.2, .8, .2, 1) both inhalt-rein; }
html:active-view-transition-type(zurueck)::view-transition-old(inhalt) { animation-name: inhalt-raus-zurueck; }
html:active-view-transition-type(zurueck)::view-transition-new(inhalt) { animation-name: inhalt-rein-zurueck; }

@keyframes inhalt-raus         { to   { opacity: 0; transform: translateX(-8px); } }
@keyframes inhalt-rein         { from { opacity: 0; transform: translateX(8px); } }
@keyframes inhalt-raus-zurueck { to   { opacity: 0; transform: translateX(8px); } }
@keyframes inhalt-rein-zurueck { from { opacity: 0; transform: translateX(-8px); } }

/* „Bewegung reduzieren“: nur überblenden, nichts gleitet. */
@media (prefers-reduced-motion: reduce) {
    @keyframes inhalt-raus         { to   { opacity: 0; } }
    @keyframes inhalt-rein         { from { opacity: 0; } }
    @keyframes inhalt-raus-zurueck { to   { opacity: 0; } }
    @keyframes inhalt-rein-zurueck { from { opacity: 0; } }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Animationen der Ticketansicht (Teil F, 21.10.26). Kurz (< 0,3 s; nur das
   Hinausgleiten 0,4 s, sonst zu schnell — Sergiu, 21.10.), nur bei
   Handlungen. Bei „Bewegung reduzieren“ greift die Regel weiter oben
   (Dauer .01ms) bzw. bleibt bei den Seitenübergängen nur das Überblenden.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Aktion → die Zeile des Tickets gleitet aus der Liste, wenn sie dort nicht
   mehr hingehört. Steht sie auch auf der neuen Seite, bleibt sie still. */
::view-transition-old(zeile-weg):only-child {
    animation: .4s cubic-bezier(.4, 0, .2, 1) both zeile-raus;
}
@keyframes zeile-raus { to { opacity: 0; transform: translateX(-24px); } }

/* Erledigt → der Haken zeichnet sich. */
.tk-haken {
    display: inline-flex; align-items: center; gap: var(--a2);
    align-self: center; font-size: 14px; font-weight: 600; color: var(--erledigt-text);
}
.tk-haken svg { width: 18px; height: 18px; }
.tk-haken path {
    fill: none; stroke: var(--ampel-erledigt); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 16; stroke-dashoffset: 16;
    animation: haken-zeichnen .28s ease-out .05s forwards;
}
@keyframes haken-zeichnen { to { stroke-dashoffset: 0; } }

/* Großes Häkchen mittig nach einer Aktion am Handy (uebersicht.html,
   tkHaekchen) — wie die Einblendung in iOS nach dem Kopieren. */
.tk-hud {
    position: fixed; left: 50%; top: 45%; z-index: 1000;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    min-width: 148px; padding: 24px 22px 18px;
    border-radius: 18px; background: rgba(28, 34, 37, .84); color: #fff;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    font-size: 17px; font-weight: 600; text-align: center;
    pointer-events: none;
    animation: tk-hud 1.3s ease both;
}
.tk-hud svg { width: 54px; height: 54px; }
.tk-hud path {
    fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 22; stroke-dashoffset: 22;
    animation: haken-zeichnen .35s ease-out .12s forwards;
}
@keyframes tk-hud {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
    15%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    78%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .tk-hud { animation-name: tk-hud-ruhig; }
    .tk-hud path { stroke-dashoffset: 0; animation: none; }
}
/* „Erledigt“ am Handy: Vollbild in Grün, weißer Haken, „Erledigt!“
   (uebersicht.html, tkErledigtFeier). */
.tk-feier {
    position: fixed; inset: 0; z-index: 1001;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    background: radial-gradient(circle at 50% 42%, #2DB86A 0%, #1A9150 70%, #157A43 100%);
    color: #fff; pointer-events: none;
    animation: tk-feier 1.7s ease both;
}
.tk-feier-kreis {
    display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .9);
    animation: tk-feier-kreis .5s cubic-bezier(.3, 1.5, .5, 1) .05s both;
}
.tk-feier-kreis svg { width: 84px; height: 84px; }
.tk-feier-kreis path {
    fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 22; stroke-dashoffset: 22;
    animation: haken-zeichnen .4s ease-out .3s forwards;
}
.tk-feier-text {
    font-size: 30px; font-weight: 700; letter-spacing: .01em;
    animation: tk-feier-text .45s ease-out .35s both;
}
@keyframes tk-feier      { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tk-feier-kreis { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes tk-feier-text  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .tk-feier-kreis, .tk-feier-text { animation: none; }
    .tk-feier-kreis path { stroke-dashoffset: 0; animation: none; }
}
/* Foto groß in der Seite (uebersicht.html, tkBildZu) — statt die Bilddatei
   anstelle der Seite zu laden. Seite dahinter scrollt nicht mit. */
.tk-bild-ansicht {
    position: fixed; inset: 0; z-index: 1100;
    display: flex; align-items: center; justify-content: center;
    padding: calc(56px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
    background: rgba(12, 16, 18, .94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    overscroll-behavior: contain; cursor: zoom-out;
    touch-action: none;   /* Zoomen und Ziehen macht tkBildGesten selbst */
    -webkit-user-select: none; user-select: none;
    animation: tk-bild-ein .25s ease-out backwards;
}
.tk-bild-ansicht img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    transform-origin: center; will-change: transform;
    -webkit-user-drag: none; -webkit-touch-callout: none; pointer-events: none;
    border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
    /* backwards, nicht both: ein festgehaltener Endzustand (transform: none)
       schlägt den Zoom aus tkBildGesten — am iPhone zoomte darum nichts. */
    animation: tk-bild-gross .3s cubic-bezier(.25, .75, .3, 1) backwards;
}
.tk-bild-zu {
    position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 20px; line-height: 44px;
    cursor: pointer;
}
html:has(.tk-bild-ansicht) { overflow: hidden; }
@keyframes tk-bild-ein   { from { opacity: 0; } to { opacity: 1; } }
@keyframes tk-bild-gross { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .tk-bild-ansicht, .tk-bild-ansicht img { animation: none; }
}

@keyframes tk-hud-ruhig {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%); }
    15%, 78% { opacity: 1; transform: translate(-50%, -50%); }
}

/* Neue Nachricht im Chat blendet ein; Reiterwechsel überblendet. Die
   Klassen setzt das Skript in uebersicht.html — nur an Neuem. */
.tk-nachricht-neu { animation: nachricht-ein .25s ease-out; }
@keyframes nachricht-ein { from { opacity: 0; transform: translateY(6px); } }
.tk-ueberblenden  { animation: ueberblenden .18s ease-out; }
@keyframes ueberblenden { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    @keyframes zeile-raus { to { opacity: 0; } }
    .tk-haken path { stroke-dashoffset: 0; animation: none; }
}

/* ═══ Statistik ═══════════════════════════════════════════════════════════
   Ersetzt Liste und Ticket. Farben mit dem Prüfskript (dataviz) bestätigt:
   Eingang Petrol, Erledigt Kupfer — für Farbenblinde unterscheidbar, beide
   ≥ 3:1 zur Fläche. Das reine Petrol (#00777A) ist zu grau dafür; Ampel-
   farben sind Zuständen vorbehalten und bleiben hier draußen. */

:root {
    --stat-eingang:  #009096;
    --stat-erledigt: #B5651D;
    --stat-seite: var(--flaeche);
    --stat-karte: var(--grund);
}
/* Dunkel: Karten heller als die Seite, sonst wirken sie eingesunken. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="hell"]) {
        --stat-eingang:  #16A5A5;
        --stat-erledigt: #C77B3A;
        --stat-seite: var(--grund);
        --stat-karte: var(--flaeche);
    }
}

.statistik {
    flex: 1; min-width: 0; min-height: 0;
    overflow-y: auto;
    background: var(--stat-seite);
}
.stat-innen {
    max-width: 1500px; margin: 0 auto;
    padding: var(--a8) var(--a8) var(--a10);
    display: flex; flex-direction: column; gap: var(--a7);
}

.stat-filter { display: flex; align-items: center; gap: var(--a5); flex-wrap: wrap; }
.stat-filter .umschalter { background: var(--stat-karte); }
.stat-filter .umschalter-feld { flex: none; padding: 0 var(--a6); }
.stat-filter .umschalter-feld.aktiv { background: var(--flaeche-kraeftig); box-shadow: none; }
.stat-umfang { font-size: 14px; color: var(--text-tertiaer); }
.stat-filter .stat-umfang { margin-left: auto; }

.stat-kacheln { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--a7); }   /* immer eine Reihe — 4 + 1 ließ eine Lücke */
.stat-kachel, .stat-karte {
    background: var(--stat-karte);
    border-radius: var(--r-gross);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.stat-kachel { padding: var(--a7) var(--a8); display: flex; flex-direction: column; gap: var(--a2); }
.stat-label { font-size: 14px; font-weight: 600; color: var(--text-sekundaer); }
.stat-wert  { font-size: 32px; font-weight: 600; line-height: 1.15; color: var(--text); }
.stat-fuss  { font-size: 13px; color: var(--text-tertiaer); }

.stat-karte { padding: var(--a8); min-width: 0; }
.stat-karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--a5); flex-wrap: wrap; margin-bottom: var(--a7); }
.stat-titel { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.stat-legende { display: flex; gap: var(--a7); font-size: 13px; color: var(--text-sekundaer); }
.stat-legende span { display: inline-flex; align-items: center; gap: var(--a3); }
.stat-farbe { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.stat-farbe-eingang  { background: var(--stat-eingang); }
.stat-farbe-erledigt { background: var(--stat-erledigt); }

/* Säulen: Höhe als Anteil (--h) am oberen Skalenwert, Gitter je Viertel. */
.stat-saeulen { display: flex; gap: var(--a4); height: 240px; }
.stat-achse { position: relative; width: 32px; flex: none; margin-bottom: 24px; }
.stat-achse span {
    position: absolute; right: 0; bottom: calc(var(--y) * 100%);
    transform: translateY(50%);
    font-size: 12px; color: var(--text-tertiaer); font-variant-numeric: tabular-nums;
}
.stat-flaeche { position: relative; flex: 1; min-width: 0; display: flex; }
.stat-gitter {
    position: absolute; left: 0; right: 0; bottom: calc(24px + var(--y) * (100% - 24px));
    border-top: 1px solid var(--linie);
}
.stat-gruppe { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (hover: hover) { .stat-gruppe:hover { background: color-mix(in oklab, var(--flaeche-kraeftig) 60%, transparent); border-radius: 6px; } }
.stat-paar { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.stat-saeule {
    width: min(18px, 36%);
    height: calc(var(--h) * 100%);
    border-radius: 4px 4px 0 0;
}
.stat-x {
    height: 24px; line-height: 24px; text-align: center;
    font-size: 12px; color: var(--text-tertiaer);
    overflow: hidden; white-space: nowrap; text-overflow: clip;
}

.stat-tabelle { margin-top: var(--a5); font-size: 13px; }
.stat-tabelle summary { cursor: pointer; color: var(--text-tertiaer); width: max-content; }
.stat-tabelle table { margin-top: var(--a4); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stat-tabelle th, .stat-tabelle td { padding: 4px 16px 4px 0; text-align: right; border-bottom: 1px solid var(--linie); }
.stat-tabelle th:first-child, .stat-tabelle td:first-child { text-align: left; }
.stat-tabelle th { font-weight: 600; color: var(--text-sekundaer); }

.stat-zweier { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--a7); }
@media (max-width: 1200px) { .stat-zweier { grid-template-columns: minmax(0, 1fr); } }

/* Wärmebild: eine Farbe, hell → dunkel (Stufe 0 = nichts). */
.stat-waerme { display: flex; flex-direction: column; gap: 3px; }
.stat-waerme-zeile { display: grid; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.stat-waerme-tag { font-size: 12px; color: var(--text-tertiaer); }
.stat-waerme-stunden span { font-size: 11px; color: var(--text-tertiaer); }
.stat-zelle { display: block; aspect-ratio: 1; min-height: 10px; border-radius: 3px; }
.stat-legende-stufen { align-items: center; gap: 3px; }
.stat-legende-stufen .stat-zelle { width: 12px; min-height: 12px; }
.stat-stufe-0 { background: var(--flaeche-kraeftig); }
.stat-stufe-1 { background: color-mix(in oklab, var(--stat-eingang) 22%, var(--stat-karte)); }
.stat-stufe-2 { background: color-mix(in oklab, var(--stat-eingang) 45%, var(--stat-karte)); }
.stat-stufe-3 { background: color-mix(in oklab, var(--stat-eingang) 72%, var(--stat-karte)); }
.stat-stufe-4 { background: var(--stat-eingang); }

/* Waagerechte Balken: Name · Spur · Wert am Ende. */
.stat-balken { display: flex; flex-direction: column; gap: var(--a4); }
.stat-balken-zeile { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 72px; align-items: center; gap: var(--a5); font-size: 14px; }
.stat-balken-name { color: var(--text-sekundaer); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-balken-spur { height: 14px; }
.stat-balken-spur i { display: block; height: 100%; width: max(2px, calc(var(--b) * 100%)); border-radius: 0 4px 4px 0; background: var(--stat-eingang); }
.stat-balken-wert { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-balken-wert small { margin-left: var(--a3); font-size: 12px; font-weight: 400; color: var(--text-tertiaer); }

.stat-liegen { list-style: none; margin: 0; padding: 0; }
.stat-liegen a {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: baseline; gap: var(--a5);
    padding: var(--a4) var(--a3); border-top: 1px solid var(--linie);
    font-size: 14px; border-radius: 6px;
}
.stat-liegen li:first-child a { border-top: 0; }
@media (hover: hover) { .stat-liegen a:hover { background: var(--flaeche-kraeftig); } }
.stat-liegen-titel { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-liegen-seit { color: var(--text-tertiaer); white-space: nowrap; }

.stat-hinweis { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-tertiaer); }

/* Statistik in Bewegung (Sergiu 25.10.26, nach der Passwort-Seite: „modernes
   App-Gefühl“). Einmal beim Öffnen: Karten gleiten gestaffelt herein, Zahlen
   zählen hoch (tkStatistikZeigen), Säulen wachsen von unten, Balken von
   links, das Wärmebild blendet stundenweise ein. Danach steht alles still. */
.statistik {
    --stat-feder: cubic-bezier(.25, .75, .3, 1);
    background:
        radial-gradient(1100px 460px at 50% -160px, color-mix(in srgb, var(--petrol-ci) 11%, transparent), transparent 70%),
        var(--stat-seite);
}
.stat-kachel, .stat-karte {
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 40, 45, .05), 0 8px 28px rgba(0, 40, 45, .07);
}
.stat-kachel-kopf { display: flex; align-items: center; gap: var(--a4); margin-bottom: var(--a3); }
.stat-zeichen {
    flex: none; width: 34px; height: 34px; border-radius: 11px;
    display: grid; place-items: center;
    color: var(--ton); background: color-mix(in srgb, var(--ton) 13%, transparent);
}
.stat-zeichen .symbol { width: 19px; height: 19px; }
.stat-ton-eingang     { --ton: var(--stat-eingang); }
.stat-ton-erledigt    { --ton: var(--stat-erledigt); }   /* wie die Säulen im Diagramm */
.stat-ton-offen       { --ton: var(--text-sekundaer); }
.stat-ton-offen-lange { --ton: var(--ampel-arbeit); }
.stat-ton-zeit        { --ton: var(--petrol); }
.stat-wert { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.stat-kacheln > .stat-kachel, .stat-innen > .stat-karte, .stat-zweier > .stat-karte {
    animation: stat-ein .55s var(--stat-feder) both;
    animation-delay: calc(var(--i, 0) * 55ms);
}
.stat-saeule {
    transform-origin: bottom;
    animation: stat-wachsen .7s var(--stat-feder) both;
    animation-delay: calc(350ms + var(--i, 0) * 45ms);
}
.stat-saeule + .stat-saeule { animation-delay: calc(400ms + var(--i, 0) * 45ms); }
.stat-balken-spur i {
    transform-origin: left;
    animation: stat-strecken .7s var(--stat-feder) both;
    animation-delay: calc(500ms + var(--i, 0) * 60ms);
}
.stat-waerme .stat-zelle { animation: stat-blenden .45s ease-out both; animation-delay: calc(450ms + var(--s, 0) * 18ms); }
.stat-liegen li { animation: stat-ein .45s var(--stat-feder) both; animation-delay: calc(600ms + var(--i, 0) * 50ms); }

@keyframes stat-ein      { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stat-wachsen  { from { transform: scaleY(0); } to { transform: none; } }
@keyframes stat-strecken { from { transform: scaleX(0); } to { transform: none; } }
@keyframes stat-blenden  { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .stat-kacheln > .stat-kachel, .stat-innen > .stat-karte, .stat-zweier > .stat-karte,
    .stat-saeule, .stat-balken-spur i, .stat-waerme .stat-zelle, .stat-liegen li { animation: none; }
}

/* Passwort ändern (_passwort.html) — Sergiu 25.10.26: „schick, nicht 0815“.
   Einmal beim Öffnen: Karte gleitet herein, Schloss zeichnet sich ein, Bügel
   rastet zu. Danach steht alles still. Nach dem Speichern grüner Haken. */
.konto {
    --konto-gruen: #1A9150;
    --konto-feder: cubic-bezier(.25, .75, .3, 1);
    flex: 1; min-width: 0; min-height: 0;
    overflow-y: auto;
    background:
        radial-gradient(900px 420px at 50% -120px, color-mix(in srgb, var(--petrol-ci) 13%, transparent), transparent 70%),
        var(--stat-seite);
}
.konto-innen { max-width: 460px; margin: 0 auto; padding: 80px var(--a8) var(--a10); }
.konto-karte {
    position: relative;
    padding: 64px var(--a9) var(--a9);
    background: var(--stat-karte);
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(0, 40, 45, .05), 0 12px 40px rgba(0, 40, 45, .09);
    text-align: center;
    animation: konto-ein .55s var(--konto-feder) both;
}

/* Zeichen: Petrol-Kreis mit weichem Schein, ragt oben aus der Karte. */
.konto-zeichen {
    position: absolute; left: 50%; top: -42px;
    width: 84px; height: 84px; margin-left: -42px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--petrol-ci), var(--petrol) 70%);
    box-shadow: 0 0 0 7px var(--stat-karte), 0 10px 30px color-mix(in srgb, var(--petrol-ci) 45%, transparent);
    animation: konto-zeichen-ein .6s var(--konto-feder) .1s both;
}
.konto-zeichen svg { width: 46px; height: 46px; overflow: visible; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.konto-koerper, .konto-buegel, .konto-haken { stroke-dasharray: 1; stroke-dashoffset: 1; }
.konto-koerper { animation: konto-zeichnen .55s ease-out .3s forwards; }
.konto-buegel  { animation: konto-zeichnen .45s ease-out .5s forwards, konto-einrasten .35s var(--konto-feder) .95s both; }
.konto-loch    { fill: #fff; stroke: none; opacity: 0; animation: konto-ein-blenden .25s ease-out .85s forwards; }
.konto-fertig .konto-zeichen {
    background: linear-gradient(150deg, #2DB86A, var(--konto-gruen) 70%);
    box-shadow: 0 0 0 7px var(--stat-karte), 0 10px 30px rgba(26, 145, 80, .4);
    animation: konto-feier .7s cubic-bezier(.3, 1.4, .5, 1) .1s both;
}
.konto-haken { stroke-width: 3.4; animation: konto-zeichnen .45s ease-out .45s forwards; }

.konto-titel { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.konto-unter { margin: var(--a2) 0 var(--a9); font-size: 14px; color: var(--text-tertiaer); overflow-wrap: anywhere; }

/* Felder: Symbol links im Feld, Petrol-Schein beim Hineintippen. */
.konto-form { display: flex; flex-direction: column; gap: var(--a7); text-align: left; }
.konto-feld { display: block; }
.konto-eingabe { position: relative; display: block; }
.konto-eingabe > .symbol {
    position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px;
    color: var(--text-tertiaer); pointer-events: none; transition: color .2s ease-out;
}
.konto-eingabe input {
    width: 100%; height: 48px; padding: 0 var(--a5) 0 44px;
    border-radius: 12px; font-size: 16px;
    transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
.konto-eingabe input#konto-neu { padding-right: 96px; }
.konto-eingabe input::-ms-reveal { display: none; }   /* eigenes „Zeigen“ statt Browser-Auge */
.konto-eingabe input:focus { border-color: var(--petrol); box-shadow: 0 0 0 4px var(--petrol-flaeche); }
.konto-eingabe:focus-within > .symbol { color: var(--petrol); }
.konto-feld.hat-fehler input { border-color: var(--fehler); box-shadow: 0 0 0 4px var(--fehler-flaeche); }
.konto-feld.hat-fehler .symbol { color: var(--fehler-text); }
.konto-fehler {
    display: block; margin-top: var(--a2); font-size: 13px; font-weight: 500; color: var(--fehler-text);
    animation: konto-ein-blenden .25s ease-out both;
}
.konto-feld:not(.hat-fehler) .konto-fehler { display: none; }

/* Prüfliste: grauer Ring → grüner Punkt mit Haken, federnd. */
.konto-regeln { list-style: none; margin: calc(-1 * var(--a2)) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--a3); }
.konto-regeln li { display: flex; align-items: center; gap: var(--a3); font-size: 14px; color: var(--text-tertiaer); transition: color .25s ease-out; }
.konto-regel-zeichen {
    position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid var(--rahmen);
    transition: background .25s ease-out, border-color .25s ease-out, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.konto-regel-zeichen::after {
    content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
    transition: transform .25s cubic-bezier(.3, 1.6, .5, 1) .05s;
}
.konto-regeln li.erfuellt { color: var(--text); }
.konto-regeln li.erfuellt .konto-regel-zeichen { background: var(--konto-gruen); border-color: var(--konto-gruen); transform: scale(1.08); }
.konto-regeln li.erfuellt .konto-regel-zeichen::after { transform: rotate(45deg) scale(1); }

/* Knopf: zurückhaltend, bis alles passt — bleibt aber drückbar, der Server entscheidet. */
.konto-speichern, .konto-knoepfe .knopf { height: 50px; border-radius: 14px; font-size: 16px; font-weight: 600; text-decoration: none; }
.konto-speichern { margin-top: var(--a3); justify-content: center; text-align: center; transition: opacity .25s ease-out, box-shadow .25s ease-out, transform .12s ease-out; }
.konto-pruefung:not(.konto-bereit) .konto-speichern { opacity: .45; }
.konto-bereit .konto-speichern { box-shadow: 0 8px 22px color-mix(in srgb, var(--petrol) 35%, transparent); }
.konto-speichern:active { transform: scale(.98); }
.konto-knoepfe { display: flex; flex-direction: column; gap: var(--a3); }
.konto-knoepfe .knopf { display: flex; align-items: center; justify-content: center; }

@keyframes konto-ein          { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes konto-zeichen-ein  { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes konto-zeichnen     { to { stroke-dashoffset: 0; } }
@keyframes konto-einrasten    { from { transform: translateY(-5px); } to { transform: none; } }
@keyframes konto-ein-blenden  { from { opacity: 0; } to { opacity: 1; } }
@keyframes konto-feier        { 0% { transform: scale(.5); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .konto-karte, .konto-zeichen, .konto-fertig .konto-zeichen, .konto-loch, .konto-fehler { animation: none; opacity: 1; }
    .konto-koerper, .konto-buegel, .konto-haken { animation: none; stroke-dashoffset: 0; }
}

/* Statistik am Handy (Sergiu, 24.10.26): fünf Kacheln in einer Reihe waren je
   57 px schmal. Jetzt 2 + 1 + 2 bündig, Filter je eine volle Zeile, Titel der
   liegengebliebenen Tickets brechen um statt abgeschnitten zu werden. */
@media (max-width: 899px) {
    .stat-innen {
        padding: var(--a5) var(--a5) calc(var(--leiste-hoehe) + var(--leiste-unten) + var(--a8));
        gap: var(--a5);
    }
    .konto { min-height: 100dvh; }   /* sonst endet die Fläche unter kurzen Karten */
    /* Muss am iPhone samt Notch und Home-Balken ohne Scrollen passen
       (Sergiu 25.10.26: „muss leicht scrollen“ — waren ~50 px zu viel). */
    .konto-innen { padding: 44px var(--a5) calc(var(--leiste-hoehe) + var(--leiste-unten) + var(--a3)); }
    .konto-karte { padding: 50px var(--a7) var(--a7); }
    .konto-zeichen { width: 70px; height: 70px; top: -35px; margin-left: -35px; }
    .konto-zeichen svg { width: 38px; height: 38px; }
    .konto-titel { font-size: 21px; }
    .konto-karte:not(.konto-fertig) .konto-unter { display: none; }   /* Name/Mail steht schon im Kopf */
    .konto-form { gap: var(--a5); margin-top: var(--a7); }
    .konto-eingabe input { height: 46px; }
    .konto-speichern { margin-top: 0; }

    .stat-filter { flex-direction: column; align-items: stretch; gap: var(--a4); }
    .stat-filter .umschalter { display: flex; }
    .stat-filter .umschalter-feld { flex: 1; padding: 0 var(--a3); }
    .stat-filter .stat-umfang { margin-left: 0; padding: 0 var(--a2); }

    .stat-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a5); }
    .stat-kachel:nth-child(3) { grid-column: 1 / -1; }
    .stat-kachel { padding: var(--a6) var(--a7); }
    .stat-wert { font-size: 28px; }

    .stat-karte { padding: var(--a7); }
    .stat-zweier { gap: var(--a5); }
    .stat-saeulen { height: 190px; }
    .stat-achse { width: 26px; }
    .stat-x { font-size: 11px; }

    .stat-waerme, .stat-waerme-zeile { gap: 2px; }
    .stat-waerme-zeile { grid-template-columns: 24px repeat(24, minmax(0, 1fr)); }
    .stat-zelle { min-height: 0; border-radius: 2px; }

    .stat-balken-zeile { grid-template-columns: minmax(0, 128px) minmax(0, 1fr) auto; gap: var(--a4); }

    .stat-liegen a {
        grid-template-columns: auto minmax(0, 1fr); row-gap: var(--a1);
        padding: var(--a5) var(--a2);
    }
    .stat-liegen-titel { white-space: normal; line-height: 1.35; }
    .stat-liegen .zeile-zustand { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
    .stat-liegen-seit { grid-column: 1 / -1; grid-row: 2; justify-self: end; font-size: 13px; }
}

/* ═══ Neues Ticket (21.10.26) ═════════════════════════════════════════════
   Rechts an der Stelle des Tickets. Was gerade nicht gebraucht wird, blendet
   `:has` aus — ohne JavaScript, ohne Schritt-für-Schritt. */

/* Volle Breite wie Chat und Notizen — rechts gibt es hier keine Infospalte
   (Sergiu, 22.10.26). */
.neu-form {
    display: flex; flex-direction: column; gap: var(--a8);
    padding-bottom: var(--a10);
}
.neu-gruppe { margin: 0; padding: 0; border: 0; min-width: 0; }
.neu-gruppe > legend { padding: 0; }
.neu-text { display: flex; flex-direction: column; gap: var(--a8); }

.neu-fehler {
    margin: 0; padding: var(--a5) var(--a7);
    border-radius: var(--r-mittel);
    background: var(--fehler-flaeche); color: var(--fehler-text);
    font-size: 14px; font-weight: 500;
}

/* Auswahlfelder als Knöpfe — Radio wie Checkbox. */
.neu-wahl { display: flex; flex-wrap: wrap; gap: var(--a3); }
.neu-chip {
    position: relative;
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 var(--a6);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund);
    font-size: 14px; color: var(--text); cursor: pointer; user-select: none;
    transition: border-color .15s ease-out, background .15s ease-out;
}
@media (hover: hover) { .neu-chip:hover { border-color: var(--rahmen-kraeftig); } }
.neu-chip input { position: absolute; opacity: 0; pointer-events: none; }
.neu-chip:has(input:checked) {
    border-color: var(--petrol); background: var(--petrol-flaeche);
    color: var(--petrol-dunkel); font-weight: 600;
}
.neu-chip:has(input:focus-visible) { outline: 2px solid var(--petrol); outline-offset: 2px; }

/* Auftrag: Kontaktart und Melder nur, wenn „Im Auftrag“ gewählt ist. */
.neu-auftrag { display: none; flex-direction: column; gap: var(--a8); }
.neu-form:has([name="art"][value="auftrag"]:checked) .neu-auftrag { display: flex; }
.neu-melder:empty { display: none; }
.neu-melder .melder-treffer { margin-top: calc(-1 * var(--a5)); font-size: 14px; }
.neu-melder .melder-hinweis-text { margin: var(--a2) 0 0; font-size: 13px; color: var(--text-tertiaer); }

/* Zuständig: eigene Meldung, und nur das eigene Gewerk angehakt — auch für
   Admins (Sergiu, 28.10.26): Fürs fremde Gewerk stand sonst „Ich“ da, obwohl
   das Ticket dort ohne Bearbeiter landet (services/ticket_anlegen.py). */
/* `.neu-form` davor: am PC ist das Feld ein `label.feld`, und dessen
   display:block war sonst stärker — das Feld stand immer da. */
.neu-form .neu-zustaendig { display: none; }
.neu-form:has([name="art"][value="eigen"]:checked):has(.neu-eigenes input:checked):not(:has(.neu-fremdes input:checked)) .neu-zustaendig { display: block; }
.neu-zustaendig select { max-width: 360px; }

/* Raum: dieselbe Suche wie im Meldeformular, in Bürogröße. */
.neu-form .raumzeile { margin-top: var(--a2); }
.neu-form .raumsuche {
    flex-basis: 150px; min-height: 44px;
    border-color: var(--rahmen); border-radius: var(--r-gross);
    font-size: 17px;
}
.neu-form .raumsuche:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-flaeche); }
.neu-form .raumtreffer { min-height: 38px; font-size: 14px; }
.neu-form .raumtreffer-bereich, .neu-form .raumliste-leer { font-size: 13px; }

.neu-fotos { position: relative; min-height: 64px; margin-top: var(--a2); }

/* Erst später bearbeiten: Datum erst nach dem Haken. */
.neu-haken {
    display: inline-flex; align-items: center; gap: var(--a3);
    font-size: 14px; color: var(--text); cursor: pointer;
}
.neu-haken input { width: 18px; height: 18px; margin: 0; accent-color: var(--petrol); }
.neu-spaeter { display: none; margin-top: var(--a5); max-width: 240px; }
.neu-form:has([name="spaeter"]:checked) .neu-spaeter { display: block; }
.neu-form input[type="date"], .neu-form input[type="datetime-local"] {
    width: 100%; min-height: 44px; padding: 0 var(--a5);
    border: 1px solid var(--rahmen); border-radius: var(--r-gross);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift); font-size: 15px; outline: none;
}
.neu-form input[type="date"]:focus, .neu-form input[type="datetime-local"]:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-flaeche); }

.neu-knoepfe {
    display: flex; gap: var(--a3);
    padding-top: var(--a7); border-top: 1px solid var(--linie);
}
.neu-knoepfe .knopf { height: 40px; font-size: 14px; text-decoration: none; }

/* To-Do: Erinnerung mit zwei schnellen Vorschlägen darunter. */
.neu-erinnerung { max-width: 280px; }
.neu-vorschlaege { margin-top: var(--a4); }
.neu-vorschlaege .neu-chip { font-family: var(--schrift); }
.neu-chip-leise { color: var(--text-sekundaer); }

/* ═══ Vorlagen: Regal (Sergiu, 25.10.26) ═════════════════════════════════
   Entwurf A der Skizze static/skizzen/vorlagen.html. Links das Regal: je
   Gewerk und Kategorie ein Fach, darin gleich große Kacheln mit Nutzung
   (Balken wie „Auslastung je Gewerk“, Entwurf 2d). Rechts das Blatt —
   Schalter statt Felder (Segment, Chips). Am Handy zwei Kacheln je Zeile,
   das Blatt kommt von unten. */

.vl-regal {
    flex: 1; min-width: 0; min-height: 0;
    display: flex; flex-direction: column;
    background: var(--flaeche);
}
.vl-gw-td { --gw: var(--abt-td); }
.vl-gw-it { --gw: var(--abt-it); }
.vl-gw-hd { --gw: var(--abt-hd); }
.vl-gw-mt { --gw: var(--abt-mt); }
.vl-gw-allg { --gw: var(--text-tertiaer); }

.vl-kopf {
    padding: var(--a7) var(--a9) var(--a6);
    background: var(--grund); box-shadow: 0 1px 0 var(--linie);
    display: flex; flex-direction: column; gap: var(--a5);
    position: relative; z-index: 1;
}
.vl-kopf-zeile { display: flex; align-items: center; gap: var(--a7); }
.vl-kopf-text { flex: 1; min-width: 0; }
.vl-unter { font-size: 13px; color: var(--text-tertiaer); }
.vl-werkzeuge { display: flex; align-items: center; gap: var(--a4); flex: none; }
.vl-suche { width: 200px; }
.vl-neu { text-decoration: none; }
.vl-neu .symbol { width: 16px; height: 16px; }

/* Segmentschalter (Entwurf 2b/2c) — echte Radioknöpfe, das Häkchen färbt. */
.vl-segment {
    display: inline-flex; gap: 2px; padding: 4px;
    border-radius: 10px; background: var(--flaeche);
}
.vl-segment label { position: relative; flex: 1; display: flex; }
.vl-segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vl-segment span {
    flex: 1; text-align: center; white-space: nowrap;
    padding: 7px 13px; border-radius: 7px;
    font-size: 13px; font-weight: 500; color: var(--text-sekundaer);
    transition: background .15s ease-out, color .15s ease-out, box-shadow .15s ease-out;
}
.vl-segment input:checked + span {
    background: var(--grund); color: var(--text); font-weight: 600;
    box-shadow: var(--schatten-segment);
}
.vl-segment input:focus-visible + span { outline: 2px solid var(--petrol); outline-offset: 1px; }

.vl-einsicht {
    display: flex; align-items: center; gap: var(--a6);
    padding: var(--a4) var(--a6); border-radius: var(--r-gross);
    background: var(--petrol-flaeche); color: var(--petrol-dunkel); font-size: 13px;
}
.vl-stapel {
    display: flex; flex: none; width: 160px; height: 8px; overflow: hidden;
    border-radius: 4px; background: color-mix(in srgb, var(--petrol) 15%, transparent);
}
.vl-stapel i { display: block; height: 100%; background: var(--petrol); }
.vl-stapel i:nth-child(2) { background: var(--petrol-ci); }
.vl-stapel i:nth-child(3) { background: color-mix(in srgb, var(--petrol-ci) 55%, var(--grund)); }
.vl-hinweis {
    margin: 0; padding: var(--a4) var(--a6); border-radius: var(--r-gross);
    background: var(--erledigt-flaeche); color: var(--erledigt-text); font-size: 13px; font-weight: 500;
}

.vl-inhalt {
    flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable;
    padding: var(--a2) var(--a9) var(--a9);
}
.vl-fach { margin-top: var(--a8); scroll-margin-top: var(--a5); }
.vl-fach-kopf { display: flex; align-items: center; gap: var(--a4); margin-bottom: var(--a4); }
.vl-ikon {
    width: 30px; height: 30px; flex: none; border-radius: 9px;
    display: grid; place-items: center; color: #fff; background: var(--gw);
}
.vl-ikon svg { width: 17px; height: 17px; }
.vl-fach-kopf h2 { margin: 0; font-size: 15px; font-weight: 600; }
.vl-fach-kopf .mono { font-size: 12px; color: var(--text-schwach); }
.vl-fach-gewerk { margin-left: auto; font-size: 12px; color: var(--text-tertiaer); }

.vl-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--a4); }
.vl-kachel {
    height: 88px; padding: var(--a5) var(--a6) 11px;
    display: flex; flex-direction: column; justify-content: space-between;
    border-radius: var(--r-gross); background: var(--grund);
    color: var(--text); text-decoration: none;
    box-shadow: 0 1px 2px rgba(17, 26, 29, .05), 0 0 0 1px rgba(17, 26, 29, .04);
    transition: box-shadow .15s ease-out, transform .15s ease-out;
    scroll-margin: var(--a8);
}
@media (hover: hover) {
    .vl-kachel:hover { box-shadow: var(--schatten-karte), 0 0 0 1px rgba(17, 26, 29, .06); transform: translateY(-1px); }
}
.vl-kachel:active { transform: scale(.98); }
.vl-kachel:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
.vl-kachel.gewaehlt { box-shadow: 0 0 0 2px var(--petrol), var(--schatten-karte); }
.vl-kachel-name {
    font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vl-kachel-fuss { display: flex; align-items: center; gap: var(--a3); }
.vl-balken { flex: 1; height: 4px; border-radius: 2px; background: var(--flaeche-kraeftig); overflow: hidden; }
.vl-balken i { display: block; height: 100%; border-radius: 2px; background: var(--gw); }
.vl-kachel-fuss .mono { min-width: 30px; text-align: right; font-size: 11px; color: var(--text-tertiaer); }
.vl-nie { font-size: 12px; color: var(--text-schwach); }
.vl-kachel.vl-aus { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rahmen-kraeftig); }
.vl-kachel.vl-aus .vl-kachel-name { color: var(--text-tertiaer); }
.vl-kachel.vl-aus.gewaehlt { box-shadow: 0 0 0 2px var(--petrol); }
/* Am Handy ist „gewählt“ nur sinnvoll, solange das Blatt offen ist. */
@media (max-width: 899px) {
    .rahmen:not(.handy-detail) .vl-kachel.gewaehlt { box-shadow: var(--schatten-karte); }
    .rahmen:not(.handy-detail) .vl-kachel.vl-aus.gewaehlt { box-shadow: inset 0 0 0 1.5px var(--rahmen-kraeftig); }
}
.vl-fach-neu {
    width: 30px; height: 30px; flex: none; border-radius: 9px;
    display: grid; place-items: center; color: var(--text-tertiaer);
    box-shadow: inset 0 0 0 1.5px var(--rahmen);
    transition: color .15s ease-out, box-shadow .15s ease-out;
}
.vl-fach-neu .symbol { width: 16px; height: 16px; }
.vl-fach-kopf h2 + .mono + .vl-fach-neu { margin-left: auto; }   /* ohne Gewerk-Angabe */
@media (hover: hover) { .vl-fach-neu:hover { color: var(--petrol); box-shadow: inset 0 0 0 1.5px var(--petrol); } }

/* ── Blatt ── */
.vl-blatt {
    width: clamp(340px, 24vw, 420px); flex: none; min-height: 0;
    display: flex; flex-direction: column;
    background: var(--grund);
    box-shadow: -1px 0 0 var(--linie), -12px 0 30px rgba(17, 26, 29, .05);
    position: relative; z-index: 2;
    animation: vl-blatt-rein .22s ease-out backwards;
}
.vl-blatt-leer { display: none; }
@keyframes vl-blatt-rein { from { opacity: 0; transform: translateX(16px); } }
.vl-blatt-kopf { display: flex; align-items: center; gap: var(--a3); padding: var(--a7) var(--a8) 0; }
.vl-blatt-kopf .vl-label { flex: 1; }
.vl-label {
    font: 600 11px/1 var(--schrift-zahlen); letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-schwach);
}
.vl-x {
    width: 32px; height: 32px; border-radius: 8px; flex: none;
    display: grid; place-items: center; color: var(--text-tertiaer); background: var(--flaeche);
}
.vl-x svg { width: 16px; height: 16px; }
@media (hover: hover) { .vl-x:hover { color: var(--text); background: var(--flaeche-kraeftig); } }
.vl-abbrechen, .vl-fertig { display: none; }

.vl-blatt-inhalt {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: var(--a3) var(--a8) var(--a8);
    display: flex; flex-direction: column; gap: var(--a7);
}
.vl-form { display: flex; flex-direction: column; gap: var(--a7); }
.vl-blatt .vl-name {
    width: 100%; resize: none; border-radius: 0; box-shadow: none; field-sizing: content; min-height: 1.25em;
    padding: var(--a1) 0 var(--a3); border: 0; border-bottom: 1.5px solid var(--linie);
    background: none; color: var(--text);
    font: 600 22px/1.25 var(--schrift); letter-spacing: -.01em;
    transition: border-color .15s ease-out;
}
.vl-blatt .vl-name:focus { outline: none; border-color: var(--petrol); }
.vl-name::placeholder { color: var(--text-schwach); font-weight: 500; }
.vl-gruppe { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.vl-feld-t { padding: 0; font-size: 12px; font-weight: 500; color: var(--text-tertiaer); }
/* Gesperrtes Feld (Mailadresse für Gewerk-Admins, Paket 5): ruhig, nicht ausgegraut. */
.vl-eingabe[readonly] { color: var(--text-tertiaer); }
.vl-feld-hinweis { font-size: 12px; color: var(--text-tertiaer); }
.vl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vl-chip {
    position: relative; height: 32px; padding: 0 13px; border-radius: 16px;
    display: inline-flex; align-items: center;
    background: var(--flaeche); color: var(--text-sekundaer); font-size: 13px; font-weight: 500;
    transition: background .15s ease-out, color .15s ease-out;
    cursor: pointer;
}
.vl-chip input[type=radio] { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vl-chip:has(input:checked) { background: var(--petrol); color: #fff; }
.vl-chip:has(input:focus-visible) { outline: 2px solid var(--petrol); outline-offset: 2px; }
.vl-chips input.vl-chip-neu {
    width: 120px; height: 32px; min-height: 0; padding: 0 13px; margin: 0;
    border: 0; border-radius: 16px; font: 500 13px var(--schrift); color: var(--text); cursor: text;
    background: transparent; box-shadow: inset 0 0 0 1px var(--rahmen-kraeftig);
}
.vl-chips input.vl-chip-neu::placeholder { color: var(--text-tertiaer); }
.vl-chips input.vl-chip-neu:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--petrol); }
.vl-chips input.vl-chip-neu:not(:placeholder-shown) { background: var(--petrol); color: #fff; box-shadow: none; }
/* Wer eine neue tippt, hat keinen der Chips gewählt. */
.vl-chips:has(.vl-chip-neu:not(:placeholder-shown)) .vl-chip:has(input:checked) { background: var(--flaeche); color: var(--text-sekundaer); }
.vl-blatt .vl-eingabe {
    width: 100%; min-height: 42px; box-shadow: none; padding: 10px 13px;
    border: 1px solid transparent; border-radius: 10px;
    background: var(--flaeche); color: var(--text);
    font: 15px/1.45 var(--schrift); resize: vertical;
    transition: border-color .15s ease-out, background .15s ease-out;
}
.vl-blatt .vl-eingabe:focus { outline: none; background: var(--grund); border-color: var(--petrol); }
.vl-eingabe::placeholder { color: var(--text-schwach); }

.vl-schalter-zeile {
    display: flex; align-items: center; gap: var(--a5);
    padding: var(--a5) var(--a6); border-radius: var(--r-gross); background: var(--flaeche);
}
.vl-schalter-zeile div { flex: 1; font-size: 14px; font-weight: 500; }
.vl-schalter-zeile small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-tertiaer); }
.vl-schalter {
    position: relative; flex: none; width: 46px; height: 28px; padding: 0;
    border: 0; border-radius: 14px; background: var(--rahmen-kraeftig); cursor: pointer;
    transition: background .2s ease-out;
}
.vl-schalter::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s ease-out;
}
.vl-schalter[aria-checked="true"] { background: var(--ampel-erledigt); }
.vl-schalter[aria-checked="true"]::after { transform: translateX(18px); }
.vl-schalter:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }

.vl-abschnitt { display: flex; flex-direction: column; gap: var(--a4); }
.vl-nutzung { display: flex; align-items: baseline; gap: var(--a3); font-size: 13px; color: var(--text-tertiaer); }
.vl-zahl { font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--text); }
.vl-monate { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: var(--a3); }
.vl-monate i { flex: 1; border-radius: 3px 3px 1px 1px; background: color-mix(in srgb, var(--petrol) 70%, var(--grund)); }
.vl-monate i.vl-monat-leer { background: var(--flaeche-kraeftig); }
.vl-monate-achse { display: flex; gap: 4px; margin-top: -4px; }
.vl-monate-achse span { flex: 1; text-align: center; font: 500 10px var(--schrift-zahlen); color: var(--text-schwach); }
.vl-klein { margin: 0; font-size: 12px; color: var(--text-schwach); }

.vl-vorschau { padding: var(--a5); border-radius: 16px; background: var(--flaeche); }
.vl-vorschau-zeile {
    display: flex; align-items: center; gap: var(--a4);
    padding: 8px 10px; border-radius: 10px; background: var(--grund); font-size: 14px;
}
.vl-vorschau .nh-kachel {
    flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
    color: #fff; background: var(--abt-it);
}
.vl-vorschau .nh-kachel svg { width: 16px; height: 16px; }
.vl-vorschau-zeile b { font-weight: 500; }
.vl-vorschau-wahl {
    margin-left: auto; min-width: 0; max-width: 60%;
    color: var(--petrol); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vl-vorschau-liste { margin-top: var(--a3); border-radius: 10px; overflow: hidden; background: var(--grund); font-size: 13px; }
.vl-vorschau-liste div { padding: 8px 10px; box-shadow: inset 0 -1px 0 var(--linie); }
.vl-vorschau-liste div:last-child { box-shadow: none; }
.vl-vorschau-gruppe {
    padding-bottom: 4px !important; box-shadow: none !important;
    font: 600 10px var(--schrift-zahlen); letter-spacing: .1em; text-transform: uppercase; color: var(--text-schwach);
}
.vl-vorschau-liste .an { background: var(--petrol-flaeche); color: var(--petrol-dunkel); font-weight: 600; }
.vl-vorschau-aus { opacity: .4; transition: opacity .2s ease-out; }

.vl-blatt-fuss {
    display: flex; align-items: center; gap: var(--a4);
    padding: var(--a6) var(--a8) var(--a7); box-shadow: 0 -1px 0 var(--linie);
}
.vl-stand { flex: 1; font-size: 12px; color: var(--text-tertiaer); }
.vl-blatt-fuss .knopf { height: 40px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
    .vl-blatt, .vl-kachel, .vl-schalter, .vl-schalter::after { animation: none; transition: none; }
}

/* ── Handy ── */
@media (max-width: 899px) {
    .vl-regal { background: var(--flaeche); }
    .vl-regal .handy-kopf { background: var(--grund); border-bottom: 0; }
    .vl-kopf { padding: 0 var(--a8) var(--a6); box-shadow: 0 1px 0 var(--linie); }
    .vl-kopf-zeile { flex-direction: column; align-items: stretch; gap: var(--a5); }
    .vl-kopf-text { display: none; }
    .vl-werkzeuge { flex-wrap: wrap; }
    .vl-filter { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
    .vl-filter::-webkit-scrollbar { display: none; }
    .vl-suche { flex: 1; width: auto; height: 40px; }
    .vl-neu { height: 40px; }
    .vl-einsicht { align-items: flex-start; flex-direction: column; gap: var(--a3); }
    .vl-stapel { width: 100%; }
    .vl-inhalt { overflow: visible; padding: 0 var(--a7) calc(110px + var(--leiste-unten)); }
    .vl-fach { margin-top: var(--a8); }
    .vl-kacheln { grid-template-columns: 1fr 1fr; gap: var(--a3); }
    .vl-kachel { height: 84px; padding: 11px var(--a5) 10px; }

    /* Blatt von unten, der Rest abgedunkelt (Schatten über die ganze Seite). */
    .vl-blatt {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        width: auto; height: min(88dvh, 760px);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 0 0 100vmax rgba(17, 26, 29, .32), 0 -10px 30px rgba(0, 0, 0, .12);
        animation: vl-blatt-hoch .32s cubic-bezier(.2, .9, .3, 1.04) backwards;
    }
    @keyframes vl-blatt-hoch { from { transform: translateY(100%); } }
    html:has(.vl-blatt:not(.vl-blatt-leer)) { overflow: hidden; }
    .vl-blatt::before {
        content: ""; width: 38px; height: 5px; border-radius: 3px; flex: none;
        margin: var(--a3) auto 0; background: var(--rahmen-kraeftig);
    }
    .vl-blatt-kopf { padding: var(--a3) var(--a8) var(--a2); }
    .vl-blatt-kopf .vl-label { text-align: center; }
    .vl-x, .vl-blatt-fuss { display: none; }
    .vl-abbrechen, .vl-fertig {
        display: inline-flex; align-items: center; min-height: 44px;
        font-size: 16px; text-decoration: none;
    }
    .vl-abbrechen { color: var(--text-tertiaer); }
    .vl-fertig { padding: 0; border: 0; background: none; color: var(--petrol); font: 600 16px var(--schrift); cursor: pointer; }
    .vl-blatt-inhalt { padding: var(--a3) var(--a8) calc(var(--a9) + var(--leiste-unten)); }
    .vl-segment span { padding: 9px 6px; }
}

/* ═══ Benutzer: Mannschaft (Sergiu, 25.10.26) ════════════════════════════
   Entwurf A der Skizze static/skizzen/benutzer.html, gebaut aus den
   Bausteinen des Regals (vl-…): je Gewerk ein Fach, Personenkarten mit
   Initialen in der Gewerkfarbe, ohne Aktivität je Person. Das Blatt rechts
   wie bei den Vorlagen, Rolle als Segment, Zugang als Zeilen. */

.bn-ikon { font: 600 11px/1 var(--schrift-zahlen); letter-spacing: .04em; }
.bn-fach-gesperrt .bn-ikon { background: var(--rahmen-kraeftig); }

.bn-karten { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.vl-kachel.bn-karte {
    height: 72px; display: grid; grid-template-columns: 40px minmax(0, 1fr);
    gap: var(--a5); align-items: center;
}
.bn-ini {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gw, var(--text-tertiaer)); color: #fff;
    font-size: 14px; font-weight: 600; letter-spacing: .02em;
}
.bn-karte-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bn-karte-name { display: flex; align-items: center; gap: var(--a2); min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.bn-karte-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-karte-zeile { font-size: 12px; color: var(--text-tertiaer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-karte-zeile .mono { font-size: 11px; }
.bn-offen { color: var(--bearbeitung-text); font-weight: 500; }
.bn-einladung { color: var(--petrol); font-weight: 500; }
.bn-karte.vl-aus .bn-ini { background: var(--rahmen-kraeftig); }
.bn-rolle {
    flex: none; height: 18px; padding: 0 6px; border-radius: 4px;
    background: var(--petrol-flaeche); color: var(--petrol-dunkel);
    font-size: 10px; font-weight: 600; line-height: 18px; letter-spacing: .02em;
}


/* ── Blatt ── */
.bn-person { display: flex; align-items: center; gap: var(--a6); }
.bn-person .bn-ini { width: 52px; height: 52px; font-size: 18px; }
.bn-blatt .vl-name { field-sizing: fixed; min-width: 0; height: auto; }
.bn-rollen .vl-segment { display: flex; }
.bn-erklaer { display: none; }
.bn-rollen:has(input[value="mitglied"]:checked) .bn-erklaer[data-rolle="mitglied"],
.bn-rollen:has(input[value="gewerk_admin"]:checked) .bn-erklaer[data-rolle="gewerk_admin"],
.bn-rollen:has(input[value="admin"]:checked) .bn-erklaer[data-rolle="admin"] { display: block; }
.bn-rollen input:disabled + span { cursor: default; }

.bn-zugang { border-radius: var(--r-gross); background: var(--flaeche); overflow: hidden; }
.bn-zugang .vl-schalter-zeile { flex-wrap: wrap; border-radius: 0; background: none; }
.bn-zugang > * + * { box-shadow: inset 0 1px 0 var(--grund); }
.bn-zeile { display: flex; align-items: center; gap: var(--a5); padding: var(--a5) var(--a6); }
.bn-zeile > div { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; }
.bn-zeile small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-tertiaer); }
.bn-haken {
    width: 22px; height: 22px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--erledigt-flaeche); color: var(--erledigt-text);
}
.bn-haken .symbol { width: 13px; height: 13px; stroke-width: 2.6; }
.bn-haken-offen { background: none; box-shadow: inset 0 0 0 1.5px var(--rahmen-kraeftig); }
.bn-aktion {
    flex: none; min-height: 36px; padding: 0 var(--a2); border: 0; background: none; cursor: pointer;
    font: 600 13px var(--schrift); color: var(--petrol);
}
@media (hover: hover) { .bn-aktion:hover { color: var(--petrol-dunkel); text-decoration: underline; } }
.vl-schalter:disabled { opacity: .5; cursor: default; }

/* Sperren fragt nach — in der Zeile, ohne Browser-Dialog (die App-Hülle
   kennt keinen). */
.bn-frage { display: none; flex: 1 1 100%; align-items: center; flex-wrap: wrap; gap: var(--a3); font-size: 13px; color: var(--fehler-text); }
.bn-frage span { flex: 1 1 100%; }
.bn-frage .knopf { height: 36px; font-size: 13px; }
.bn-frage-ja { background: var(--fehler); color: #fff; border-color: var(--fehler); }
.bn-fragt .bn-frage { display: flex; animation: vl-blatt-rein .18s ease-out backwards; }

.bn-link {
    display: flex; flex-direction: column; gap: var(--a3);
    padding: var(--a6) var(--a7); border-radius: var(--r-gross);
    box-shadow: inset 0 0 0 1px var(--petrol); background: var(--petrol-flaeche);
}
.bn-link input {
    width: 100%; min-height: 40px; padding: 0 var(--a5);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text);
    font-family: var(--schrift-zahlen); font-size: 13px;
}

@media (max-width: 899px) {
    .bn-karten { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .bn-fragt .bn-frage { animation: none; } }

/* ═══ Handy: feste Leiste, „+“, Karten von unten (22.10.26) ═══════════════
   Sergiu: „wie eine echte App“. Unten fest die Leiste wie in der Vorlage 2a
   (Neu · Meine · + · In Arbeit · Mehr) — schwebend probiert, fest gewählt:
   nichts scrollt dahinter durch. „Mehr“ und „+“ öffnen eine Karte, die von
   unten aufgeht und leicht nachfedert. Ein Ticket steht am Handy allein
   (`.handy-detail`), dann ohne Leiste — die Knöpfe des Tickets brauchen den
   Platz unten. Am PC ist von alldem nichts zu sehen. */

.handy-leiste, .handy-zurueck { display: none; }
/* Messenger-Teile des Tickets — nur am Handy (unten), am PC unsichtbar. */
.tk-kachel, .tk-weiter-avatar { display: none; }
.tk-handy-kopf, .tk-chat-tag, .tk-blase-name, .tk-blase-zeit, .tk-foto-nachricht { display: none; }

@media (max-width: 899px) {
    :root {
        --leiste-hoehe: 64px;
        --leiste-unten: env(safe-area-inset-bottom, 0px);
    }

    /* Abschneiden ja, aber ohne eigenen Scrollbereich — sonst bleibt die
       Zurück-Leiste (sticky) nicht oben stehen. */
    .rahmen { overflow: clip; }

    /* Nur als Home-Bildschirm-App (PWA), nicht Safari, nicht Hülle — 28.10.26:
       Mit durchsichtiger Statusleiste rechnet iOS die Höhe einer kurzen Seite
       um die Statusleiste zu klein, die Leiste unten schwebte dann mit Lücke
       darunter (leere Liste „Neu“). Seite mindestens bildschirmhoch hält sie
       unten. Dazu rückt der Kopf aus dem Unschärfe-Saum, den iOS unter die
       Statusleiste legt — „IT-Abteilung“ lag verwischt darin. */
    @media (display-mode: standalone) {
        body { min-height: calc(100vh + var(--rand-oben)); }
        /* `html` davor: Die allgemeine .handy-kopf-Regel steht weiter unten. */
        html .handy-kopf { padding-top: calc(var(--a5) + var(--rand-oben) + 10px); }
    }

    /* Kopf: Gewerk klein, Ansicht groß, Kürzel rechts öffnet „Mehr“. */
    .handy-kopf { padding: calc(var(--a5) + var(--rand-oben)) var(--a8) var(--a5); border-bottom: none; }
    .handy-zahl { margin: 2px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
    .handy-anzahl { color: var(--text-tertiaer); font-weight: 500; }
    /* Ampelpunkt vor Neu / In Arbeit / Wartet — wie am PC in der Kopfleiste. */
    .handy-zahl { display: flex; align-items: center; gap: var(--a4); }
    .handy-zahl .ampel-punkt { width: 12px; height: 12px; }
    .handy-kopf .avatar { width: 42px; height: 42px; font-size: 14px; border: 0; font-family: inherit; cursor: pointer; }
    /* Kürzel im selben Glanz wie das „+“, dazu ein heller Ring mit feinem
       Petrol-Rand — wirkt wie ein Profilbild statt wie ein Farbklecks. */
    .handy-kopf .avatar, .handy-blatt-person .avatar {
        background:
            radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .28), transparent 60%),
            linear-gradient(180deg, color-mix(in srgb, var(--petrol-ci) 80%, #fff), var(--petrol-ci) 45%, var(--petrol-dunkel));
        letter-spacing: .04em;
        text-shadow: 0 1px 1px rgba(0, 40, 45, .25);
        box-shadow:
            inset 0 1.5px 0 rgba(255, 255, 255, .45),
            inset 0 -2px 4px rgba(0, 40, 45, .18),
            0 0 0 2px var(--grund),
            0 0 0 3.5px color-mix(in srgb, var(--petrol-ci) 45%, transparent),
            0 4px 12px color-mix(in srgb, var(--petrol-ci) 35%, transparent);
    }
    .listen-kopf { padding: 0 var(--a8) var(--a5); }
    .chips { display: none; }   /* ersetzt durch die Leiste */
    .listen-koerper { padding-bottom: calc(var(--leiste-hoehe) + var(--leiste-unten) + var(--a5)); }
    /* Am Handy steht nie ein Ticket neben der Liste — eine markierte Zeile
       hieße nichts (Sergiu, 22.10.26). */
    .zeile.gewaehlt { background: none; }
    .zeile.gewaehlt::before { content: none; }

    /* ── Die Leiste ── */
    .handy-leiste {
        position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
        height: calc(var(--leiste-hoehe) + var(--leiste-unten));
        padding: 2px var(--a3) var(--leiste-unten);
        display: flex; align-items: center; gap: 2px;
        /* Keine Linie, sondern Schatten nach oben und runde Ecken — hebt sich
           von der weißen Liste ab, ohne Weiß auf Weiß (Sergiu). */
        /* Milchglas wie bei iOS (Sergiu, 25.10.26): die Liste schimmert beim
           Scrollen verschwommen durch, helle Kante oben innen. */
        background: color-mix(in srgb, var(--grund) 70%, transparent);
        -webkit-backdrop-filter: blur(22px) saturate(180%);
        backdrop-filter: blur(22px) saturate(180%);
        border-radius: 22px 22px 0 0;
        box-shadow:
            inset 0 1px 0 var(--glas-kante),
            0 -6px 24px rgba(0, 40, 45, .10), 0 -1px 4px rgba(0, 40, 45, .05);
    }
    /* Die helle Kante ist auf dunklem Grund ein harter weißer Rahmen
       (Sergiu, 25.10.26: „was ist da los, diese Umrandung“). */
    :root { --glas-kante: color-mix(in srgb, #fff 70%, transparent); }
    @media (prefers-color-scheme: dark) {
        :root:not([data-theme="hell"]) { --glas-kante: rgba(255, 255, 255, .07); }
    }
    .handy-leiste-eintrag {
        flex: 1; min-width: 0; height: 100%;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        border: 0; background: none; font: inherit;
        border-radius: 12px;
        font-size: 12px; font-weight: 600; color: var(--text-tertiaer);
        text-decoration: none; white-space: nowrap;
        transition: background .15s ease-out, color .15s ease-out, transform .12s ease-out;
        -webkit-tap-highlight-color: transparent;
    }
    .handy-leiste-eintrag .symbol {
        width: 26px; height: 26px;
        transition: transform .22s cubic-bezier(.3, 1.4, .5, 1);
    }
    /* Die gewählte Ansicht etwas größer — das Symbol wächst federnd mit. */
    .handy-leiste-eintrag.aktiv { color: var(--petrol); font-weight: 700; }
    .handy-leiste-eintrag.aktiv .symbol { stroke-width: 2.2; transform: scale(1.14); }
    /* Ampelfarben für die gewählte Ansicht probiert und verworfen (Sergiu,
       22.10.: „davor besser“) — Farbe trägt nur der Punkt im Titel. */
    .handy-leiste-eintrag:active { transform: scale(.92); }
    .handy-leiste-symbol { position: relative; display: grid; }
    .handy-leiste-zahl {
        position: absolute; top: -5px; left: 17px;
        min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
        background: var(--text-tertiaer); color: var(--grund);
        font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
        font-variant-numeric: tabular-nums;
    }
    .handy-leiste-zahl.rot { background: var(--ampel-neu); color: #fff; }
    /* „Meine“ in Ampel-Orange (In Arbeit); dunkle Schrift, weil Weiß auf
       Orange bei 11 px nicht lesbar ist. Rot und Orange pulsieren als
       Lichthof — das Bläschen selbst steht still, die Leiste bleibt ruhig
       (Sergiu, 25.10.26: „rot und orange pulsierend“). */
    .handy-leiste-zahl.orange { background: var(--ampel-arbeit); color: #2A1A00; }
    .handy-leiste-zahl.rot, .handy-leiste-zahl.orange {
        --puls: var(--ampel-neu);
        /* Glasperle: obere Hälfte hell gespiegelt, heller Rand innen. */
        --glas: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 0 0 .5px rgba(255, 255, 255, .35);
        background-image: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .12) 48%, transparent 52%);
        box-shadow: var(--glas);
        animation: zahl-puls 2.4s ease-out infinite;
    }
    .handy-leiste-zahl.orange { --puls: var(--ampel-arbeit); animation-delay: 1.2s; }
    @keyframes zahl-puls {
        0%   { box-shadow: var(--glas), 0 0 0 0 color-mix(in srgb, var(--puls) 55%, transparent); }
        70%  { box-shadow: var(--glas), 0 0 0 7px color-mix(in srgb, var(--puls) 0%, transparent); }
        100% { box-shadow: var(--glas), 0 0 0 0 transparent; }
    }
    @media (prefers-reduced-motion: reduce) { .handy-leiste-zahl { animation: none; } }

    /* „+“ ragt rund über die Leiste hinaus; der Ring in Hintergrundfarbe
       trennt ihn sauber von Leiste und Liste. */
    .handy-plus {
        flex: none; width: 60px; height: 60px; margin: 0 var(--a2);
        transform: translateY(-16px);
        display: grid; place-items: center;
        border: 4px solid var(--grund); border-radius: 50%;
        /* Verlauf von hellem CI-Petrol oben zum Arbeitston unten, Glanzkante
           oben innen, weicher farbiger Schein darunter (Sergiu, 25.10.26). */
        background:
            radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .28), transparent 60%),
            linear-gradient(180deg, color-mix(in srgb, var(--petrol-ci) 80%, #fff), var(--petrol-ci) 45%, var(--petrol-dunkel));
        color: var(--text-auf-farbe);
        box-shadow:
            inset 0 1.5px 0 rgba(255, 255, 255, .45),
            inset 0 -2px 4px rgba(0, 40, 45, .18),
            0 8px 20px color-mix(in srgb, var(--petrol-ci) 45%, transparent),
            0 2px 5px rgba(0, 40, 45, .18);
        transition: transform .12s ease-out;
        -webkit-tap-highlight-color: transparent;
    }
    .handy-plus:active { transform: translateY(-16px) scale(.92); }
    .handy-plus .symbol {
        width: 28px; height: 28px; stroke-width: 2.6;
        filter: drop-shadow(0 1px 1px rgba(0, 40, 45, .25));
        transition: rotate .3s cubic-bezier(.3, 1.3, .5, 1);
    }
    /* Solange das „+“-Blatt offen ist, steht das Plus als ×. */
    html:has(#handy-neu:popover-open) .handy-plus .symbol { rotate: 45deg; }
    @media (prefers-reduced-motion: reduce) { .handy-plus .symbol { transition: none; } }

    /* ── Karten von unten (Popover) ──
       Öffnen: von unten herein mit kleinem Überschwingen; Schließen: zurück
       nach unten. @starting-style liefert den Anfangszustand beim Öffnen. */
    /* Solange eine Karte offen ist, steht die Seite dahinter still — sonst
       scrollte iOS den Chat mit, sobald die Karte nicht (mehr) scrollen
       kann (Sergiu 24.10.26). */
    html:has(.handy-blatt:popover-open), html:has(.handy-blatt:popover-open) body { overflow: hidden; }
    .handy-blatt {
        /* Bündig am unteren Rand, ohne Lücke darunter (Sergiu, 22.10.26);
           der Home-Balken liegt im Innenabstand. */
        position: fixed; inset: auto 0 0 0;
        width: auto; max-width: none; max-height: 85dvh; margin: 0; overflow-y: auto;
        overscroll-behavior: contain;   /* am Ende nicht an die Seite dahinter weiterreichen */
        padding: var(--a3) var(--a5) calc(var(--a5) + env(safe-area-inset-bottom, 0px));
        border: 0; border-radius: 24px 24px 0 0;
        background: var(--grund); color: var(--text);
        box-shadow: 0 -6px 40px rgba(0, 30, 35, .22);
        transform: translateY(0);
        transition: transform .42s cubic-bezier(.3, 1.3, .5, 1), display .42s allow-discrete, overlay .42s allow-discrete;
    }
    .handy-blatt:not(:popover-open) {
        transform: translateY(100%);
        transition: transform .24s cubic-bezier(.4, 0, 1, 1), display .24s allow-discrete, overlay .24s allow-discrete;
    }
    @starting-style { .handy-blatt:popover-open { transform: translateY(100%); } }
    .handy-blatt.wird-gezogen { transition: none; }
    .handy-blatt::backdrop {
        background: rgba(10, 20, 22, .32);
        transition: background .3s ease-out, display .3s allow-discrete, overlay .3s allow-discrete;
    }
    .handy-blatt:not(:popover-open)::backdrop { background: rgba(10, 20, 22, 0); }
    @starting-style { .handy-blatt:popover-open::backdrop { background: rgba(10, 20, 22, 0); } }

    .handy-blatt-griff { width: 38px; height: 5px; border-radius: 3px; margin: 2px auto var(--a4); background: var(--flaeche-kraeftig); }
    .handy-blatt-titel { padding: var(--a2) var(--a5) var(--a3); font-size: 13px; font-weight: 600; color: var(--text-tertiaer); }
    .handy-blatt-person { display: flex; align-items: center; gap: var(--a5); padding: var(--a3) var(--a5) var(--a5); }
    .handy-blatt-person > span:last-child { display: flex; flex-direction: column; }
    .handy-blatt-eintrag {
        width: 100%; min-height: 52px;
        display: flex; align-items: center; gap: var(--a6);
        padding: 0 var(--a5); border: 0; border-radius: 14px;
        background: none; font: inherit; font-size: 17px; color: var(--text);
        text-decoration: none; text-align: left;
        -webkit-tap-highlight-color: transparent;
    }
    .handy-blatt-eintrag .symbol { width: 22px; height: 22px; color: var(--text-tertiaer); }
    .handy-blatt-eintrag:active { background: var(--flaeche); }
    .handy-blatt-eintrag.aktiv { color: var(--petrol); background: var(--petrol-flaeche); }
    .handy-blatt-eintrag.aktiv .symbol { color: var(--petrol); }
    .handy-blatt-zahl { margin-left: auto; font-size: 15px; color: var(--text-tertiaer); font-variant-numeric: tabular-nums; }
    .handy-blatt-trenner { height: 1px; margin: var(--a3) var(--a5); background: var(--linie); }

    /* ── Ticket allein (Tipp auf eine Zeile, „+“) ── */
    .handy-detail .liste { display: none; }
    .handy-detail .detail { display: flex; flex-direction: column; min-height: 100dvh; }
    /* Im Formular (Neues Ticket/To-Do) keine Leiste — im Ticket steuert sie
       ist sie das Nachrichtenfeld (.tk-schreibleiste, unten). */
    .handy-detail ~ .handy-leiste:not(.tk-schreibleiste) { display: none; }
    .handy-zurueck {
        display: flex; align-items: center; gap: var(--a1);
        position: sticky; top: 0; z-index: 5;
        padding: calc(var(--a5) + var(--rand-oben)) var(--a7) var(--a5);
        background: color-mix(in srgb, var(--grund) 85%, transparent);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--linie);
        color: var(--petrol); font-size: 17px; font-weight: 500; text-decoration: none;
    }
    .handy-zurueck .symbol { width: 22px; height: 22px; transform: rotate(90deg); }
}

/* ── Ticket am Handy wie ein Messenger (22.10.26) ──
   Sergiu nach Schritt 2a („zu unruhig, zu überfüllt“): Der Chat ist das
   Wichtigste und muss sitzen. Oben nur Titel und Raum (Tipp → Ticketdetails
   als Karte), rechts der Hauptschritt; Blasen mit Name und Uhrzeit, Fotos im
   Chat, unten fest das Nachrichtenfeld. Reiter, Kopf und Infospalte des PCs
   entfallen; Protokoll und Notizen stehen in den Ticketdetails. */
@media (max-width: 899px) {
    .handy-detail .tk-kopf,
    .handy-detail .tk-reiter,
    .handy-detail .tk-info { display: none; }
    /* Die Schreibleiste ist unterschiedlich hoch (Schieber, wachsendes
       Feld) — ihre Höhe misst das Skript nach (--schreib-hoehe). */
    .handy-detail .detail {
        background: var(--flaeche);
        padding-bottom: calc(var(--schreib-hoehe, calc(var(--leiste-hoehe) + var(--leiste-unten))) + var(--a3));
    }

    /* Kopf */
    .tk-handy-kopf {
        display: flex; align-items: center; gap: var(--a2);
        position: sticky; top: 0; z-index: 5;
        padding: calc(var(--a3) + var(--rand-oben)) var(--a5) var(--a3) var(--a1);
        background: color-mix(in srgb, var(--grund) 88%, transparent);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--linie);
        box-shadow: 0 2px 10px rgba(0, 30, 35, .08);
    }
    .tk-handy-kopf .handy-zurueck {
        position: static; flex: none; width: 40px; height: 44px; padding: 0;
        justify-content: center;
        border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .tk-handy-kopf .handy-zurueck .symbol { width: 26px; height: 26px; transform: none; }
    .tk-handy-titel {
        flex: 1; min-width: 0; padding: 2px 0;
        display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
        border: 0; background: none; font: inherit; color: var(--text); text-align: left;
        -webkit-tap-highlight-color: transparent;
    }
    .tk-handy-titel-text { max-width: 100%; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tk-handy-titel-ort { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-sekundaer); white-space: nowrap; }
    .tk-handy-titel-ort > span { display: inline-flex; }
    .tk-handy-titel-ort .ampel-punkt { width: 8px; height: 8px; }

    /* Chat: die Seite scrollt, nicht ein Kasten darin. */
    .handy-detail .tk-inhalt,
    .handy-detail .tk-inhalt:has(> .tk-gespraech) { overflow: visible; padding: var(--a3) var(--a4) 0; }
    .handy-detail .tk-gespraech { display: block; }
    .handy-detail .tk-chat-verlauf { overflow: visible; flex: none; gap: 12px; padding: 0; }
    .handy-detail .tk-gespraech > .tk-schreiben,
    .handy-detail .tk-gespraech > .tk-hinweis,
    .handy-detail .tk-avatar,
    .handy-detail .tk-nachricht-kopf,
    .handy-detail .tk-gelesen { display: none; }

    .handy-detail .tk-nachricht .tk-blase {
        max-width: 82%; padding: 6px 10px 7px;
        border-radius: 16px 16px 16px 4px;
        background: var(--grund);
        font-size: 16px; line-height: 1.4;
        box-shadow: 0 1px 2px rgba(0, 30, 35, .14), 0 3px 8px rgba(0, 30, 35, .07);
    }
    .handy-detail .tk-nachricht-dienst .tk-blase { background: var(--petrol-flaeche); border-radius: 16px 16px 4px 16px; }
    .handy-detail .tk-blase-name { display: block; margin-bottom: 1px; font-size: 13px; font-weight: 600; color: var(--petrol); white-space: normal; }
    /* Uhrzeit unten rechts in der Blase: schwimmt rechts, rutscht unter
       die letzte Zeile, wenn sie nicht mehr daneben passt. */
    .handy-detail .tk-blase-zeit {
        display: inline-flex; gap: 2px; float: right;
        margin: 10px 0 -4px 16px;   /* Luft zum Text (Sergiu 24.10.26: „klebt zu sehr“) */
        font-size: 11px; line-height: 1; color: var(--text-tertiaer); white-space: nowrap;
    }
    .tk-haken-zeichen { letter-spacing: -.25em; margin-left: 2px; }
    .tk-haken-zeichen.gelesen { color: var(--petrol); font-weight: 700; }

    .handy-detail .tk-chat-tag { display: flex; justify-content: center; margin: var(--a4) 0 var(--a2); }
    .tk-chat-tag span {
        padding: 3px 10px; border-radius: 8px;
        background: var(--grund); box-shadow: 0 1px 2px rgba(0, 30, 35, .12), 0 2px 6px rgba(0, 30, 35, .06);
        font-size: 12px; font-weight: 600; color: var(--text-sekundaer);
    }

    .handy-detail .tk-foto-nachricht { display: flex; }
    /* white-space: normal — die Blase erhält sonst Zeilenumbrüche (für Text),
       und die Leerzeilen um das Bild im HTML standen als Rand ober- und
       unterhalb des Fotos (Sergiu, 26.10.26). */
    .handy-detail .tk-blase.tk-blase-foto { display: block; position: relative; padding: 3px; white-space: normal; line-height: 0; }
    .handy-detail .tk-blase-foto .tk-blase-zeit { line-height: 1.4; }
    /* Das Foto behält sein Format (Hochformat nicht mehr auf 4:3 gestutzt),
       höchstens 320 px hoch; bis es geladen ist, eine ruhige Fläche. Die
       Uhrzeit liegt auf einer dunklen Pille — auf hellen Fotos war weiße
       Schrift mit Schatten kaum lesbar (Sergiu, 26.10.26). */
    .tk-blase-foto img {
        display: block; width: 230px; max-width: 100%; height: auto; min-height: 90px; max-height: 320px;
        object-fit: cover; border-radius: 13px; background: var(--flaeche);
    }
    .handy-detail .tk-blase-foto .tk-blase-zeit {
        position: absolute; right: 9px; bottom: 9px; float: none; margin: 0;
        padding: 2px 7px; border-radius: 10px; line-height: 1.4;
        background: rgba(0, 0, 0, .5); color: #fff; text-shadow: none;
        -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    }

    /* ── Chat aufgefrischt (Sergiu, 25.10.26, Skizze C/D) ──
       Petrol-Hauch von oben, Kürzel am Melder, Blasen mit Schweif-Ecke,
       eigene Nachrichten im Petrol-Verlauf, Datum als Glas-Pille. */
    .handy-detail .detail {
        background:
            radial-gradient(130% 380px at 50% 0, color-mix(in srgb, var(--petrol-ci) 11%, transparent), transparent 75%),
            var(--flaeche);
    }
    .handy-detail .tk-nachricht { gap: 8px; align-items: flex-end; }
    .handy-detail .tk-nachricht:not(.tk-nachricht-dienst) > .tk-avatar {
        display: grid; width: 30px; height: 30px; font-size: 11px;
        background: linear-gradient(180deg, var(--grund), var(--flaeche-kraeftig));
        color: var(--petrol-dunkel);
        box-shadow: inset 0 0 0 1px rgba(0, 40, 45, .08), 0 1px 2px rgba(0, 40, 45, .1);
    }
    /* Fotos des Melders haben kein Kürzel — bündig unter dessen Blasen. */
    .handy-detail .tk-foto-nachricht:not(.tk-nachricht-dienst) { padding-left: 38px; }
    .handy-detail .tk-nachricht .tk-blase {
        display: flow-root;   /* hält die schwimmende Uhrzeit in der Blase */
        border-radius: 18px 18px 18px 6px;
        box-shadow: 0 1px 2px rgba(0, 40, 45, .08), 0 4px 14px rgba(0, 40, 45, .06);
    }
    .handy-detail .tk-nachricht-dienst .tk-blase { border-radius: 18px 18px 6px 18px; }
    .handy-detail .tk-nachricht-eigen .tk-blase {
        background: linear-gradient(180deg, color-mix(in srgb, var(--petrol-ci) 88%, #fff), var(--petrol) 75%);
        color: var(--text-auf-farbe);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px color-mix(in srgb, var(--petrol-ci) 25%, transparent);
    }
    .handy-detail .tk-nachricht-eigen .tk-blase a { color: inherit; }
    .handy-detail .tk-nachricht-eigen .tk-blase-zeit,
    .handy-detail .tk-nachricht-eigen .tk-haken-zeichen.gelesen { color: rgba(255, 255, 255, .8); }
    .tk-chat-tag span {
        border-radius: 999px; padding: 4px 12px;
        background: color-mix(in srgb, var(--grund) 72%, transparent);
        -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
        box-shadow: inset 0 1px 0 var(--glas-kante), 0 1px 3px rgba(0, 40, 45, .08);
    }

    /* Nachrichtenfeld: dieselbe Leiste, gleiche Form — kommt mit dem
       Ticket von rechts herein. */
    .tk-schreibleiste {
        height: auto; min-height: calc(var(--leiste-hoehe) + var(--leiste-unten));
        padding: 10px 10px calc(10px + var(--leiste-unten));
        flex-direction: column; align-items: stretch; gap: 8px;
    }
    /* Beim Tippen liegt die Tastatur über dem Home-Balken — dessen
       Freiraum unten wäre dann nur eine Lücke zur Tastatur. */
    .tk-schreibleiste:focus-within { min-height: 0; padding-bottom: 8px; }
    /* Großes Feld wie im Claude-Chat (Sergiu, 25.10.26): weiße Karte, Text
       oben, darunter links Platz fürs „+“ (Fotos), rechts Senden. */
    .tk-schreibleiste-form {
        display: flex; flex-direction: column;
        padding: 10px 8px 8px 16px; border-radius: 24px;
        background: var(--grund);
        box-shadow: 0 0 0 1px var(--linie), 0 2px 8px rgba(0, 40, 45, .06);
        transition: box-shadow .15s ease-out;
    }
    .tk-schreibleiste-form:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--petrol) 70%, transparent), 0 2px 8px rgba(0, 40, 45, .08); }
    /* Nur der äußere Rahmen: die allgemeine Regel textarea:focus legte beim
       Antippen einen eigenen Ring mit runden Ecken innen hinein (iPhone:
       Kasten im Kasten). */
    .tk-schreibleiste textarea, .tk-schreibleiste textarea:focus {
        width: 100%; height: 48px; min-height: 48px; max-height: 152px;
        padding: 2px 8px 0 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; outline: none; background: none;
        color: var(--text); font: inherit; font-size: 17px; line-height: 22px; resize: none;
    }
    .tk-feld-fuss { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-left: -6px; }
    /* „+“ für Fotos: das Dateifeld liegt unsichtbar darüber, der Tipp
       öffnet das iOS-Menü (Mediathek, Kamera, Datei). */
    .tk-anhang {
        position: relative; width: 36px; height: 36px; flex: none;
        display: grid; place-items: center; border-radius: 50%;
        background: var(--flaeche); color: var(--text);
        transition: transform .12s ease-out, opacity .15s;
        -webkit-tap-highlight-color: transparent;
    }
    .tk-anhang svg { width: 20px; height: 20px; }
    .tk-anhang input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
    .tk-anhang:active { transform: scale(.9); }
    .tk-anhang.voll { opacity: .35; pointer-events: none; }   /* schon drei Fotos */
    .tk-anhaenge { display: flex; gap: 10px; padding: 4px 0 10px; }
    .tk-anhaenge[hidden] { display: none; }
    .tk-anhang-bild { position: relative; width: 64px; height: 64px; flex: none; }
    .tk-anhang-bild img {
        width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
        box-shadow: 0 0 0 1px rgba(0, 40, 45, .08);
        animation: anhang-ein .25s cubic-bezier(.3, 1.3, .5, 1);
    }
    @keyframes anhang-ein { from { transform: scale(.6); opacity: 0; } }
    .tk-anhang-weg {
        position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; padding: 0;
        border: 2px solid var(--grund); border-radius: 50%;
        background: var(--text); color: var(--grund);
        font: inherit; font-size: 15px; font-weight: 700; line-height: 18px;
        -webkit-tap-highlight-color: transparent;
    }
    @media (prefers-reduced-motion: reduce) { .tk-anhang-bild img { animation: none; } }
    /* Senden im Glanz des „+“. */
    .tk-senden {
        flex: none; width: 36px; height: 36px;
        display: grid; place-items: center;
        border: 0; border-radius: 50%;
        background:
            radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .28), transparent 60%),
            linear-gradient(180deg, color-mix(in srgb, var(--petrol-ci) 80%, #fff), var(--petrol-ci) 45%, var(--petrol-dunkel));
        color: var(--text-auf-farbe);
        box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .45), 0 3px 8px color-mix(in srgb, var(--petrol-ci) 35%, transparent);
        transition: transform .12s ease-out;
        -webkit-tap-highlight-color: transparent;
    }
    .tk-senden svg { width: 18px; height: 18px; }
    .tk-senden:active { transform: scale(.92); }
    .tk-senden:disabled { opacity: .5; }
    .tk-schreibleiste-hinweis { margin: 0; padding: 12px 0; text-align: center; font-size: 14px; color: var(--text-tertiaer); }

    /* Schieber für den Hauptschritt (Skizze C): Griff nach rechts ziehen.
       Allein (Neu, Abgeschlossen) 66 px hoch, über dem Feld 58 px
       (Sergiu, 25.10.26: „größer und dicker“). */
    .tk-schieber {
        position: relative; height: 66px; margin: 0; border-radius: 33px; overflow: hidden;
        display: grid; place-items: center;
        background: color-mix(in srgb, var(--petrol-ci) 13%, var(--grund));
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--petrol-ci) 28%, transparent);
        touch-action: none; user-select: none; -webkit-user-select: none;
        transition: background .25s ease-out;
    }
    .tk-schieber.schmal { height: 58px; border-radius: 29px; }
    .tk-schieber-text {
        padding-left: 48px; font-size: 18px; font-weight: 700;
        background: linear-gradient(90deg, var(--petrol-dunkel) 40%, color-mix(in srgb, var(--petrol-ci) 25%, #fff) 50%, var(--petrol-dunkel) 60%);
        background-size: 250% 100%;
        -webkit-background-clip: text; background-clip: text; color: transparent;
        animation: schieber-schimmer 2.6s linear infinite;
        transition: opacity .15s;
    }
    .tk-schieber.schmal .tk-schieber-text { font-size: 17px; }
    @keyframes schieber-schimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
    .tk-schieber-griff {
        position: absolute; left: 5px; top: 5px; width: 56px; height: 56px;
        display: grid; place-items: center; padding: 0;
        border: 0; border-radius: 50%; cursor: grab;
        background:
            radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .28), transparent 60%),
            linear-gradient(180deg, color-mix(in srgb, var(--petrol-ci) 80%, #fff), var(--petrol-ci) 45%, var(--petrol-dunkel));
        color: var(--text-auf-farbe);
        box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .45), 0 3px 8px color-mix(in srgb, var(--petrol-ci) 40%, transparent);
        -webkit-tap-highlight-color: transparent;
    }
    .tk-schieber.schmal .tk-schieber-griff { left: 4px; top: 4px; width: 50px; height: 50px; }
    .tk-schieber-griff svg { width: 26px; height: 26px; }
    .tk-schieber.schmal .tk-schieber-griff svg { width: 23px; height: 23px; }
    .tk-schieber.fertig { background: linear-gradient(180deg, #4CC07A, #22995A); }
    .tk-schieber.fertig .tk-schieber-text { opacity: 0; }
    @media (prefers-reduced-motion: reduce) { .tk-schieber-text { animation: none; color: var(--petrol-dunkel); background: none; } }

    /* Ticketdetails (Karte): grauer Grund, darauf weiße Gruppen wie in den
       iPhone-Einstellungen; jede Aktion mit farbiger Symbolkachel. */
    .tk-blatt { background: var(--flaeche); padding-left: 0; padding-right: 0; }
    .tk-blatt .handy-blatt-griff { background: var(--rahmen-kraeftig); }
    .tk-blatt-kopf { padding: 0 var(--a5) var(--a4); }
    .tk-blatt-kopf .handy-blatt-titel { display: flex; align-items: center; gap: 6px; padding: 0 0 var(--a1); }
    .tk-blatt-ueberschrift { font-size: 20px; font-weight: 700; line-height: 1.3; }
    .tk-felder {
        display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
        margin: 0 var(--a5) var(--a5);
        border-radius: 14px; overflow: hidden;
        background: var(--linie);
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
    }
    .tk-felder > div { background: var(--grund); padding: 11px 14px; min-width: 0; }
    .tk-felder dt { font-size: 12px; color: var(--text-tertiaer); margin-bottom: 3px; }
    .tk-felder dd { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
    .tk-felder-zusatz { display: block; font-size: 13px; font-weight: 400; color: var(--text-sekundaer); }

    .tk-blatt-gruppe {
        margin: 0 var(--a5) var(--a5);
        background: var(--grund); border-radius: 14px; overflow: hidden;
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
    }
    .tk-blatt-gruppe > * + * { border-top: 1px solid var(--linie); }
    .tk-blatt-gruppe > form { margin: 0; }
    .tk-blatt .handy-blatt-eintrag,
    .tk-blatt .tk-menue > summary {
        width: 100%; min-height: 54px; height: auto;
        display: flex; align-items: center; gap: 14px;
        padding: 0 14px; border: 0; border-radius: 0;
        background: none; font-size: 17px; font-weight: 500; color: var(--text);
        list-style: none; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .tk-blatt .tk-menue > summary::-webkit-details-marker { display: none; }
    .tk-blatt .handy-blatt-eintrag::after,
    .tk-blatt .tk-menue > summary::after {
        content: "›"; margin-left: auto; padding-left: var(--a2);
        color: var(--text-schwach); font-size: 24px; font-weight: 400; line-height: 1;
        transition: transform .2s ease-out;
    }
    .tk-blatt .handy-blatt-eintrag:has(.handy-blatt-zahl)::after { margin-left: 0; }
    .tk-blatt .handy-blatt-eintrag:active,
    .tk-blatt .tk-menue > summary:active,
    .tk-blatt .tk-menue[open] > summary { background: var(--flaeche); }
    .tk-blatt .tk-menue[open] > summary::after { transform: rotate(90deg); }
    .tk-blatt .tk-menue > summary:has(.tk-kachel-verwerfen) { color: var(--fehler-text); }
    .tk-blatt .aufklapp {
        position: static; min-width: 0; width: auto;
        border: 0; border-top: 1px solid var(--linie); border-radius: 0;
        box-shadow: none; background: none;
        padding: var(--a3) 14px var(--a4);
    }
    .tk-blatt .handy-blatt-eintrag .handy-blatt-zahl { font-size: 15px; }

    /* Untermenü statt Aufklappen (Sergiu, 22.10.26): Ist Weiterleiten,
       Parken oder Verwerfen offen, zeigt die Karte nur noch dieses; der
       Eintrag wird zur Kopfzeile „‹ Weiterleiten“, ein Tipp darauf geht zurück. */
    .tk-blatt:has(.tk-menue[open]) { min-height: 70dvh; }
    .tk-blatt:has(.tk-menue[open]) > :not(.handy-blatt-griff):not(:has(.tk-menue[open])),
    .tk-blatt-gruppe:has(.tk-menue[open]) > :not(.tk-menue[open]) { display: none; }
    .tk-blatt-gruppe:has(.tk-menue[open]) > * { border-top: 0; }
    .tk-blatt-gruppe:has(.tk-menue[open]) { margin: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
    .tk-blatt .tk-menue[open] > summary {
        position: sticky; top: calc(-1 * var(--a3)); z-index: 1;
        justify-content: center; min-height: 48px; padding: 0 56px;
        background: var(--flaeche); font-size: 17px; font-weight: 700;
    }
    .tk-blatt .tk-menue[open] > summary .tk-kachel { display: none; }
    .tk-blatt .tk-menue[open] > summary::after { content: none; }
    .tk-blatt .tk-menue[open] > summary::before {
        content: "‹"; position: absolute; left: 14px; top: 50%; transform: translateY(-54%);
        font-size: 34px; font-weight: 400; line-height: 1; color: var(--petrol);
    }
    .tk-blatt .tk-menue[open] > summary:has(.tk-kachel-verwerfen) { color: var(--text); }
    /* Gleitet sanft herein, Karte bleibt gleich hoch (uebersicht.html); langsamer und weicher als die Feder — Sergiu 24.10.26: „echt alles smooth“. */
    .tk-blatt .tk-menue[open] > .aufklapp { border-top: 0; padding-top: 0; animation: .7s cubic-bezier(.25, .75, .3, 1) both tk-unter-ein; }
    @keyframes tk-unter-ein { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }

    /* Aufgeklappte Formulare in den Ticketdetails: groß und mit dem Finger
       gut zu treffen (Sergiu, 22.10.26: „zu unübersichtlich und klein“). */
    .tk-blatt .tk-park { width: auto; max-height: none; gap: var(--a3); padding: var(--a4) var(--a5) var(--a5); background: none; }
    .tk-blatt .tk-park-titel {
        margin-top: var(--a2);
        font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-tertiaer);
    }
    .tk-blatt .tk-park-hinweis { margin-top: calc(-1 * var(--a2)); font-size: 14px; line-height: 1.45; color: var(--text-sekundaer); }
    .tk-blatt .tk-weiter-abschnitt { padding-top: 0; border-top: 0; }
    .tk-blatt .tk-weiter-liste,
    .tk-blatt .tk-park-vorschlaege,
    .tk-blatt .tk-verwerfen-gruende {
        gap: 0; background: var(--grund); border-radius: 12px; overflow: hidden;
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
    }
    .tk-blatt .tk-weiter-liste > * + *,
    .tk-blatt .tk-park-vorschlaege > * + *,
    .tk-blatt .tk-verwerfen-gruende > * + * { border-top: 1px solid var(--linie); }
    .tk-blatt .tk-weiter-liste > .tk-park-hinweis { margin: 0; padding: 14px; }

    /* Gewerk: Name, darunter zwei breite Knöpfe. */
    .tk-blatt .tk-weiter-zeile {
        display: grid; grid-template-columns: 1fr 1fr; gap: var(--a2);
        padding: 12px 14px 14px; font-size: 17px; font-weight: 600;
    }
    .tk-blatt .tk-weiter-zeile > span { grid-column: 1 / -1; }
    .tk-blatt .tk-weiter-knopf {
        height: 44px; padding: 0; border-radius: 12px;
        font-size: 15px; font-weight: 600;
        border: 1.5px solid var(--rahmen-kraeftig); background: var(--grund); color: var(--text);
    }
    .tk-blatt .tk-weiter-knopf[value^="gewerk:"] { border-color: var(--petrol); background: var(--petrol); color: var(--text-auf-farbe); }
    .tk-blatt .tk-weiter-knopf:active { transform: scale(.97); }

    /* Kollegen, Parkvorschläge, Verwerfgründe: große Zeilen wie eine Liste. */
    .tk-blatt .tk-park-vorschlag,
    .tk-blatt .tk-verwerfen-grund {
        min-height: 52px; padding: 0 14px; border-radius: 0;
        font-size: 17px; -webkit-tap-highlight-color: transparent;
    }
    .tk-blatt .tk-park-vorschlag span { font-size: 15px; }
    .tk-blatt .tk-park-vorschlag:active, .tk-blatt .tk-verwerfen-grund:active { background: var(--flaeche); }
    .tk-blatt .tk-weiter-kollege { justify-content: flex-start; gap: 12px; }
    .tk-blatt .tk-weiter-kollege::after { content: "›"; margin-left: auto; color: var(--text-schwach); font-size: 24px; line-height: 1; }
    .tk-blatt .tk-weiter-avatar {
        display: inline-flex; align-items: center; justify-content: center; flex: none;
        width: 34px; height: 34px; border-radius: 50%;
        background: var(--petrol-flaeche); color: var(--petrol);
        font-size: 13px; font-weight: 700;
    }
    .tk-blatt .tk-verwerfen-grund input[type="radio"] { width: 20px; height: 20px; }
    .tk-blatt .tk-verwerfen-grund input[type="text"] { height: 40px; font-size: 16px; }
    .tk-blatt .tk-park-nachricht, .tk-blatt .tk-park-eigenes input[type="date"] { font-size: 16px; }
    .tk-blatt .tk-park-eigenes { padding-top: var(--a2); border-top: 0; }
    .tk-blatt .tk-park-eigenes input[type="date"], .tk-blatt .tk-park-eigenes .knopf { height: 48px; border-radius: 12px; }

    .tk-kachel {
        flex: none; display: inline-flex; align-items: center; justify-content: center;
        width: 32px; height: 32px; border-radius: 9px;
        color: #fff; background: var(--petrol-ci);
    }
    .tk-kachel svg { width: 19px; height: 19px; }
    .tk-kachel-parken    { background: var(--ampel-wartet); }
    .tk-kachel-abgeben   { background: var(--ampel-arbeit); }
    .tk-kachel-verwerfen { background: var(--fehler); }
    .tk-kachel-notizen   { background: #C99A06; }
    .tk-kachel-protokoll { background: var(--text-tertiaer); }
    .tk-kachel-termin    { background: #2F7FD1; }
    .tk-blatt .tk-termin-nur { cursor: default; }
    .tk-blatt .tk-termin-nur::after { content: none; }
    .tk-termin-unterseite { display: flex; flex-direction: column; gap: var(--a4); }
    /* Abstand zur Kopfzeile „‹ Termin“ (Sergiu, 27.10.26: klebte oben). */
    .tk-blatt .tk-menue[open] > .aufklapp.tk-termin-unterseite { padding-top: var(--a5); }
    .tk-termin-unterseite .tk-termin-zusatz { margin-top: 0; font-size: 15px; }
    .tk-blatt .tk-termin-unterseite .tk-park { position: static; width: auto; padding: 0; border: 0; box-shadow: none; background: none; }
    .tk-blatt .tk-menue > summary:has(.handy-blatt-zahl)::after { margin-left: 0; }
    .tk-blatt .tk-menue > summary .handy-blatt-zahl { margin-left: auto; font-size: 15px; font-weight: 400; color: var(--text-tertiaer); }
    .tk-blatt .tk-menue[open] > summary .handy-blatt-zahl { display: none; }
    .tk-blatt-unterseite { padding: var(--a3) var(--a5) var(--a5); }
    .tk-blatt-unterseite .tk-leerseite { padding: var(--a6) 0; text-align: center; font-size: 15px; color: var(--text-tertiaer); }

    /* Protokoll am Handy: untereinander statt vier Spalten — oben wer und
       wann, darunter was (Sergiu, 22.10.26: „viel zu breit“). */
    .tk-blatt .tk-protokoll,
    .tk-blatt .tk-notizen {
        background: var(--grund); border-radius: 12px; overflow: hidden;
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
    }
    .tk-blatt .tk-protokoll li {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--a3);
        padding: 12px 14px; font-size: 15px; line-height: 1.4;
    }
    .tk-blatt .tk-protokoll li:last-child,
    .tk-blatt .tk-notizen li:last-child { border-bottom: 0; }
    .tk-blatt .tk-protokoll-wer  { grid-row: 1; grid-column: 1; }
    .tk-blatt .tk-protokoll-zeit { grid-row: 1; grid-column: 2; font-size: 13px; }
    .tk-blatt .tk-protokoll-was  { grid-column: 1 / -1; color: var(--text-sekundaer); }
    .tk-blatt .tk-protokoll-gewerk { display: none; }
    .tk-blatt .tk-protokoll-wer-gewerk { display: inline; }
    .tk-blatt .tk-notizen { margin-top: var(--a4); }
    .tk-blatt .tk-notizen li { padding: 12px 14px; }
    .tk-blatt .tk-schreiben textarea { font-size: 16px; border-radius: 12px; }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
    .handy-blatt, .handy-blatt:not(:popover-open) {
        transition: opacity .2s ease-out, display .2s allow-discrete, overlay .2s allow-discrete;
        transform: none;
    }
    .handy-blatt:not(:popover-open) { opacity: 0; }
    @starting-style { .handy-blatt:popover-open { opacity: 0; transform: none; } }
}

/* ── Seitenwechsel am Handy (22.10.26) ──
   Richtung setzt das Skript (uebersicht.html, tkHandyWechseln) in
   html[data-richtung]. Leiste: tauscht ohne Bewegung (kein Eintrag hier);
   Ticket öffnen: schiebt sich von rechts über die Liste, die ein Stück nach
   links weicht — wie bei iOS; Zurück: umgekehrt.

   Seit 23.10.26 mit der Feder der Patientenruf-App (SwiftUI `.spring`,
   response .45), aber ohne Überschwingen wie die iOS-Navigation — sonst
   blitzte am rechten Rand kurz die Liste durch. Seit 24.10.26 als
   Bézier-Kurve, an die Feder angepasst (höchstens 2 % daneben), statt
   `linear()` mit 37 Punkten, und ohne Abdunkeln (`filter`): Sergiu sah das
   Ticket nach längerer Pause auf halbem Weg stehen bleiben. Bézier +
   reines Verschieben spielt iOS auf dem Grafikchip ab, unabhängig davon,
   wie beschäftigt die Seite gerade ist. Die Leiste hat keinen eigenen Namen mehr: Sie gleitet mit der Liste
   hinaus, das Nachrichtenfeld kommt mit dem Ticket herein — wie die
   Tab-Leiste in iPhone-Apps. */
@media (max-width: 899px) {
    :root { --tk-feder: cubic-bezier(.28, .42, .1, 1); --tk-feder-dauer: .6s; }

    /* Fester Untergrund: Die App-Hülle ist darunter dunkel (#111A1D) — eine
       Lücke im Übergang darf nie als dunkler Blitz durchscheinen. */
    html, body { background: var(--grund); }

    html[data-richtung]::view-transition-old(root),
    html[data-richtung]::view-transition-new(root) { mix-blend-mode: normal; }

    html[data-richtung="vor"]::view-transition-old(root)     { animation: var(--tk-feder-dauer) var(--tk-feder) both tk-weicht; }
    html[data-richtung="vor"]::view-transition-new(root)     { animation: var(--tk-feder-dauer) var(--tk-feder) both tk-von-rechts;
                                                              box-shadow: -10px 0 30px rgba(0, 30, 35, .14); }
    html[data-richtung="zurueck"]::view-transition-old(root) { animation: var(--tk-feder-dauer) var(--tk-feder) both tk-nach-rechts;
                                                              z-index: 1; box-shadow: -10px 0 30px rgba(0, 30, 35, .14); }
    html[data-richtung="zurueck"]::view-transition-new(root) { animation: var(--tk-feder-dauer) var(--tk-feder) both tk-kehrt; }
}
@media (prefers-reduced-motion: reduce) { .tk-blatt .tk-menue[open] > .aufklapp { animation: none; } }
@keyframes tk-von-rechts  { from { transform: translateX(100%); } }
@keyframes tk-weicht      { to   { transform: translateX(-30%); } }
@keyframes tk-nach-rechts { to   { transform: translateX(100%); } }
@keyframes tk-kehrt       { from { transform: translateX(-30%); } }

/* ── Antippen wie in einer App (23.10.26) ──
   Sergiu: „alles noch zu unapp-like“. Was am Telefon nach Webseite aussieht:
   Zeilen reagieren erst, wenn die neue Seite da ist; langes Drücken öffnet
   das Link-Menü oder markiert Text; Mausreaktionen bleiben nach dem Tippen
   grau hängen (deshalb stehen alle :hover-Regeln unter `hover: hover`). */
@media (max-width: 899px) {
    /* Kein grauer Safari-Kasten — vererbt sich, gilt also auch für summary
       und Zeilen. Rückmeldung geben die :active-Regeln. */
    html { -webkit-tap-highlight-color: transparent; }

    /* Langes Drücken auf Bedienelemente: kein Link-Menü, keine Vorschau,
       keine Markierung. Chat, Notizen, Protokoll und Eingabefelder bleiben
       markierbar (Kopieren); Fotos und Links in Blasen und Ticketfeldern
       (Mail, Telefon) behalten ihr Menü. Labels nicht, weil sie teils
       Eingabefelder umschließen. */
    a:not(.tk-blase-foto):not(.tk-blase a):not(.tk-felder a), button, summary,
    .handy-leiste:not(.tk-schreibleiste), .handy-kopf, .tk-handy-kopf, .listen-kopf {
        -webkit-touch-callout: none;
        -webkit-user-select: none; user-select: none;
    }
    input, textarea, select { -webkit-user-select: text; user-select: text; }

    /* Ticketzeile: wird grau, sobald der Finger liegt — mit kurzer
       Verzögerung, damit beim Scrollen nicht jede überstrichene Zeile
       aufblitzt (wie iOS-Listen). Nach dem Tippen bleibt sie grau, bis das
       Ticket da ist (`.angetippt` setzt das Skript in uebersicht.html). */
    .zeile { transition: background .25s ease-out; }
    .zeile:active { background: var(--flaeche-kraeftig); transition: background 0s linear .1s; }
    .zeile.angetippt { background: var(--flaeche-kraeftig); transition: none; }

    /* Zurück, Ticket-Titel und Kürzel verhalten sich wie Knöpfe in einer
       iOS-Kopfleiste: beim Drücken blasser, nicht kleiner. */
    .handy-zurueck, .tk-handy-titel, .handy-kopf .avatar { transition: opacity .2s ease-out; }
    .handy-zurueck:active, .tk-handy-titel:active, .handy-kopf .avatar:active { opacity: .4; transform: none; transition: none; }

    .liste-mehr:active { background: var(--flaeche-kraeftig); }
}

/* Nach dem Gerüst (uebersicht.html, tkGeruestZeigen) kommen Chat und
   Hauptknopf nach — kurz einblenden statt hinspringen (24.10.26). */
@media (max-width: 899px) {
    .tk-nachgeladen .tk-inhalt,
}
@keyframes tk-nachladen { from { opacity: 0; } }

/* ═══ Neues Ticket am Handy (25.10.26) ════════════════════════════════════
   Sergiu: „Modernes, Schönes, nicht 0815“. Grauer Grund mit weißen Karten wie
   die Ticketdetails; Wer meldet als Schieberegler, Betreff + Text als ein
   Schreibfeld, darunter was der Server daraus liest; Gewerke als Kacheln;
   unten fest ein Knopf, der sagt, was noch fehlt. Bewegung nur einmal beim
   Öffnen oder als Antwort aufs Tippen — keine Schleife, nichts wackelt.
   Schriftgrößen in Feldern ≥ 16 px, sonst zoomt iOS beim Antippen. */
.nh { --nh-feder: cubic-bezier(.25, .75, .3, 1); --nh-gruen: #1A9150; }
@media (max-width: 899px) {
    .handy-detail .detail:has(.nh) { background: var(--flaeche); }
    .nh { display: flex; flex-direction: column; min-height: 100dvh; background: var(--flaeche); }

    .nh-kopf {
        position: sticky; top: 0; z-index: 5;
        display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
        padding: calc(var(--a5) + var(--rand-oben)) var(--a7) var(--a5);
        background: color-mix(in srgb, var(--flaeche) 82%, transparent);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    }
    .nh-kopf .handy-zurueck.nh-abbrechen {
        position: static; justify-self: start; padding: 0; border: 0;
        background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
        font-size: 17px; font-weight: 500; color: var(--petrol);
    }
    .nh-titel { margin: 0; font-size: 17px; font-weight: 700; }

    .nh-form {
        display: flex; flex-direction: column; gap: var(--a7);
        padding: var(--a3) var(--a7) calc(110px + env(safe-area-inset-bottom, 0px));
    }
    /* Beim Öffnen gleiten die Teile gestaffelt herein — einmal. */
    .nh-form > * { animation: nh-ein .5s var(--nh-feder) both; }
    .nh-form > :nth-child(3) { animation-delay: .03s; }
    .nh-form > :nth-child(5) { animation-delay: .07s; }
    .nh-form > :nth-child(7) { animation-delay: .11s; }
    .nh-form > :nth-child(8) { animation-delay: .15s; }
    .nh-form > :nth-child(9) { animation-delay: .19s; }
    .nh-form > :nth-child(10) { animation-delay: .23s; }
    .nh-fehler { margin: 0; }

    /* ── Wer meldet: Schieberegler, der Knauf gleitet zur Wahl ── */
    .nh-umschalter {
        position: relative; display: grid; grid-template-columns: 1fr 1fr;
        padding: 3px; border-radius: 13px;
        background: color-mix(in srgb, var(--text) 8%, transparent);
    }
    .nh-umschalter label {
        position: relative; z-index: 1; height: 42px;
        display: grid; place-items: center;
        font-size: 15px; font-weight: 600; color: var(--text-sekundaer);
        transition: color .25s ease-out; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .nh-umschalter input { position: absolute; opacity: 0; pointer-events: none; }
    .nh-umschalter label:has(input:checked) { color: var(--text); }
    .nh-umschalter label:has(input:focus-visible) { outline: 2px solid var(--petrol); outline-offset: -2px; border-radius: 10px; }
    .nh-knauf {
        position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: calc(100% - 6px);
        border-radius: 10px; background: var(--grund);
        box-shadow: 0 1px 3px rgba(0, 30, 35, .14), 0 2px 8px rgba(0, 30, 35, .06);
        opacity: 0; transform: scale(.9);
        transition: transform .38s var(--nh-feder), opacity .2s ease-out;
    }
    .nh-umschalter:has([value="eigen"]:checked) .nh-knauf { opacity: 1; transform: none; }
    .nh-umschalter:has([value="auftrag"]:checked) .nh-knauf { opacity: 1; transform: translateX(100%); }

    /* ── Im Auftrag: klappt weich auf ── */
    .nh-form:has([name="art"][value="auftrag"]:checked) .nh-auftrag { animation: nh-auf .4s var(--nh-feder) both; gap: var(--a5); }
    .nh-kontakt { display: flex; flex-wrap: wrap; gap: var(--a3); }
    .nh-kontakt .neu-chip { background: var(--grund); }
    .nh-feld { position: relative; display: block; }
    .nh-feld > .symbol {
        position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
        color: var(--text-tertiaer); pointer-events: none; transition: color .2s ease-out;
    }
    .nh-feld input {
        width: 100%; height: 50px; padding: 0 14px 0 44px;
        border: 1px solid transparent; border-radius: 14px;
        background: var(--grund); box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
        font: inherit; font-size: 17px; color: var(--text); outline: none;
        transition: box-shadow .2s ease-out, border-color .2s ease-out;
    }
    .nh-feld input:focus { border-color: var(--petrol); box-shadow: 0 0 0 4px var(--petrol-flaeche); }
    .nh-feld:focus-within > .symbol { color: var(--petrol); }

    /* ── Schreibfeld: Betreff fett oben, Text darunter, eine Karte ── */
    .nh-text-karte {
        border-radius: 16px; background: var(--grund);
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
        transition: box-shadow .2s ease-out;
    }
    .nh-text-karte:focus-within { box-shadow: 0 0 0 2px var(--petrol), 0 6px 20px color-mix(in srgb, var(--petrol) 14%, transparent); }
    .nh-schreiben { gap: 0; padding: 0 var(--a7); }
    .nh-betreff, .nh-beschreibung {
        display: block; width: 100%; border: 0; background: none; outline: none;
        font: inherit; color: var(--text);
    }
    .nh-form .nh-schreiben .nh-betreff {
        height: 52px; padding: 0; border: 0; border-bottom: 1px solid var(--linie); border-radius: 0;
        box-shadow: none; font-size: 18px; font-weight: 600;
    }
    .nh-form .nh-schreiben .nh-beschreibung { border: 0; border-radius: 0; box-shadow: none; }
    .nh-beschreibung { min-height: 92px; padding: 12px 0 14px; font-size: 16px; line-height: 1.5; resize: none; }
    .nh-betreff::placeholder, .nh-beschreibung::placeholder { color: var(--text-schwach); font-weight: 400; }

    /* ── Erkannt: erscheint unter dem Text, sobald etwas feststeht ── */
    .nh-erkannt { display: flex; flex-direction: column; gap: var(--a4); margin-top: calc(-1 * var(--a3)); }
    .nh-erkannt:empty { display: none; }
    /* Erkanntes steht direkt in Gewerk-Kachel und Raum-Zeile (tkNeuErkannt). */
    .nh-gewerk-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .nh-gewerk-marke {
        display: none; font-size: 12px; font-weight: 600; letter-spacing: .01em;
        color: color-mix(in srgb, var(--text-auf-farbe) 82%, transparent);
    }
    .nh-gewerk.erkannt .nh-gewerk-marke { display: block; animation: nh-auf .35s var(--nh-feder) both; }
    .nh-raum-marke {
        display: block; margin-top: 1px;
        font-size: 13px; font-weight: 600; color: var(--petrol);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        animation: nh-auf .35s var(--nh-feder) both;
    }
    .nh-raum-marke[hidden] { display: none; }
    /* Vier Ziffern brauchen keine 120 px — Platz für den Hausnamen. */
    .nh-form .nh-zeile:has(.nh-raum-marke:not([hidden])) .nh-raum { width: 64px; }
    .nh-aehnlich {
        display: flex; flex-direction: column; gap: 3px; padding: 10px 14px;
        border-radius: 14px; background: color-mix(in srgb, var(--ampel-arbeit) 13%, var(--grund));
        animation: nh-auf .35s var(--nh-feder) both;
    }
    .nh-aehnlich-titel { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--ampel-arbeit) 60%, var(--text)); }
    .nh-aehnlich-eintrag { font-size: 14px; line-height: 1.4; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nh-aehnlich-eintrag b { font-weight: 600; color: var(--text-sekundaer); font-variant-numeric: tabular-nums; }

    /* ── Abschnitte und Gewerke als Kacheln ── */
    .nh-abschnitt { display: flex; flex-direction: column; gap: var(--a3); }
    .nh-abschnitt-name { padding: 0 var(--a2); font-size: 13px; font-weight: 600; color: var(--text-tertiaer); }
    .nh-abschnitt-name small { font-weight: 500; color: var(--text-schwach); margin-left: 4px; }
    .nh-gewerke { display: grid; grid-template-columns: 1fr 1fr; gap: var(--a4); }
    .nh-gewerk {
        position: relative; display: flex; align-items: center; gap: var(--a4);
        min-height: 60px; padding: var(--a3) var(--a5);
        border-radius: 16px; background: var(--grund);
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
        font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--text);
        cursor: pointer; -webkit-tap-highlight-color: transparent;
        animation: nh-ein .45s var(--nh-feder) calc(.12s + var(--i, 0) * .04s) both;
        transition: background .25s ease-out, color .25s ease-out, box-shadow .25s ease-out, transform .12s ease-out;
    }
    .nh-gewerk:active { transform: scale(.97); }
    .nh-gewerk input { position: absolute; opacity: 0; pointer-events: none; }
    .nh-gewerk-zeichen {
        flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 11px;
        background: var(--flaeche); color: var(--text-sekundaer);
        transition: background .25s ease-out, color .25s ease-out;
    }
    .nh-gewerk-name { min-width: 0; overflow-wrap: anywhere; }
    .nh-gewerk:has(input:checked) {
        background: var(--petrol); color: var(--text-auf-farbe);
        box-shadow: 0 6px 16px color-mix(in srgb, var(--petrol) 30%, transparent);
    }
    .nh-gewerk:has(input:checked) .nh-gewerk-zeichen { background: rgba(255, 255, 255, .18); color: #fff; }
    .nh-gewerk:has(input:focus-visible) { outline: 2px solid var(--petrol); outline-offset: 2px; }
    .nh-gewerk-haken {
        position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%;
        background: #fff; transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1);
    }
    .nh-gewerk-haken::after {
        content: ""; position: absolute; left: 6.5px; top: 3.5px; width: 4px; height: 8px;
        border: solid var(--petrol); border-width: 0 2.2px 2.2px 0; transform: rotate(45deg);
    }
    .nh-gewerk:has(input:checked) .nh-gewerk-haken { transform: scale(1); }

    /* ── Karte wie in den Ticketdetails ── */
    .nh-karte {
        border-radius: 16px; background: var(--grund); overflow: hidden;
        box-shadow: 0 1px 2px rgba(0, 30, 35, .08);
    }
    .nh-karte > * + *, .nh-zeile-block > * + * { border-top: 1px solid var(--linie); }
    .nh-zeile {
        display: flex; align-items: center; gap: var(--a5);
        min-height: 54px; padding: 0 14px;
        font-size: 17px; color: var(--text);
        -webkit-tap-highlight-color: transparent;
    }
    .nh-zeile-name { flex: 1; min-width: 0; white-space: nowrap; }
    .nh-kachel {
        flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
        color: #fff; background: var(--petrol);
    }
    .nh-kachel svg { width: 18px; height: 18px; }
    .nh-kachel-raum       { background: var(--ampel-arbeit); }
    .nh-kachel-zustaendig { background: #2F7FD1; }
    .nh-kachel-spaeter    { background: var(--ampel-wartet); }
    .nh-wahl { position: relative; display: flex; align-items: center; max-width: 58%; min-width: 0; }
    .nh-wahl select {
        min-width: 0; max-width: 100%; height: 54px; padding: 0 20px 0 0;
        border: 0; background: none; -webkit-appearance: none; appearance: none;
        font: inherit; font-size: 17px; color: var(--text-sekundaer);
        text-align: right; text-align-last: right; text-overflow: ellipsis; outline: none;
    }
    .nh-form .nh-wahl select:focus { border: 0; box-shadow: none; outline: none; color: var(--text); }
    .nh-wahl::after {
        content: "›"; position: absolute; right: 0; top: 50%; transform: translateY(-54%);
        font-size: 24px; color: var(--text-schwach); pointer-events: none;
    }
    .nh-form .raumzeile.nh-raumblock { display: block; margin: 0; }
    .nh-form .nh-raum {
        flex: none; width: 120px; min-height: 0; height: 54px; padding: 0;
        border: 0; border-radius: 0; background: none; box-shadow: none;
        font: inherit; font-size: 17px; color: var(--text-sekundaer); text-align: right; outline: none;
        caret-color: var(--petrol); letter-spacing: normal;
    }
    .nh-form .nh-raum:focus { border: 0; box-shadow: none; color: var(--text); }
    .nh-form .nh-raum::placeholder { color: var(--text-schwach); }
    .nh-raumvorschlaege:not(:has(*)) { display: none; }   /* auch nach Löschen der Eingabe */
    .nh-raumvorschlaege { padding: var(--a2) var(--a3) var(--a3); }
    .nh-raumvorschlaege .raumliste { border: 0; box-shadow: none; }
    .nh-zeile.nh-frisch { animation: nh-frisch 1.1s ease-out; }

    .nh-schalter {
        flex: none; position: relative; width: 51px; height: 31px; margin: 0;
        border-radius: 16px; background: color-mix(in srgb, var(--text) 14%, transparent);
        -webkit-appearance: none; appearance: none; cursor: pointer;
        transition: background .25s ease-out;
    }
    .nh-schalter::before {
        content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
        background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
        transition: transform .3s var(--nh-feder);
    }
    .nh-schalter:checked { background: var(--petrol); }
    .nh-schalter:checked::before { transform: translateX(20px); }
    .nh-schalter:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
    .nh-form .neu-spaeter.nh-spaeter { margin: 0; max-width: none; }
    .nh-form:has([name="spaeter"]:checked) .nh-spaeter { animation: nh-auf .35s var(--nh-feder) both; }
    .nh-spaeter .nh-zeile { padding-left: calc(14px + 30px + var(--a5)); }
    /* iOS gibt dem Datumsfeld eine eigene Breite und ignoriert text-align —
       deshalb fest rechts, ohne eigene Gestalt (sonst überlappt es die
       Beschriftung, Sergiu 25.10.26). */
    .nh-form .nh-spaeter input[type="date"] {
        flex: none; width: auto; min-width: 7.5em; height: 54px; margin-left: auto; padding: 0;
        border: 0; background: none; box-shadow: none; -webkit-appearance: none; appearance: none;
        font: inherit; font-size: 17px; color: var(--petrol); text-align: right;
    }
    .nh-form .nh-spaeter input[type="date"]:focus { border: 0; box-shadow: none; outline: none; }
    .nh-spaeter input[type="date"]::-webkit-date-and-time-value { text-align: right; }

    /* ── To-Do: Erinnerung als Kacheln, „Eigene Zeit“ klappt auf ── */
    .nh-eigene-zeit { display: none; margin-top: var(--a2); }
    .nh-todo:has([name="nh_erinnerung"][value="eigene"]:checked) .nh-eigene-zeit { display: block; animation: nh-auf .35s var(--nh-feder) both; }
    .nh-form input.nh-zeitfeld[type="datetime-local"] {
        flex: none; width: auto; min-width: 10em; border-radius: 0; height: 54px; margin-left: auto; padding: 0;
        border: 0; background: none; box-shadow: none; -webkit-appearance: none; appearance: none;
        font: inherit; font-size: 17px; color: var(--petrol); text-align: right;
    }
    .nh-form input.nh-zeitfeld[type="datetime-local"]:focus { border: 0; box-shadow: none; outline: none; }
    .nh-zeitfeld::-webkit-date-and-time-value { text-align: right; }

    /* ── Fotos: Zeile der Karte, gewählte als Vorschaubilder darunter ── */
    .nh-kachel-fotos { background: #2E9C66; }
    .nh-fotozeile { position: relative; cursor: pointer; }
    .nh-fotozeile::after { content: "›"; font-size: 24px; color: var(--text-schwach); margin-top: -2px; }
    .nh-fotozeile:active { background: var(--flaeche); }
    .nh-zeile-wert { color: var(--text-sekundaer); white-space: nowrap; }
    .nh-datei { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
    .nh-foto-vorschau { display: flex; flex-wrap: wrap; gap: var(--a4); padding: var(--a5) 14px; }
    .nh-foto-vorschau:not(:has(*)) { display: none; }
    .nh-foto {
        width: 78px; height: 78px; border-radius: 16px; object-fit: cover;
        box-shadow: 0 1px 3px rgba(0, 30, 35, .16);
        animation: nh-foto-ein .45s cubic-bezier(.3, 1.3, .5, 1) calc(var(--i, 0) * .06s) both;
    }
    .nh-foto-mehr { flex-basis: 100%; font-size: 13px; color: var(--text-tertiaer); }

    /* ── Unten fest: Anlegen ── */
    .nh-fuss {
        position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
        padding: var(--a5) var(--a7) calc(var(--a5) + env(safe-area-inset-bottom, 0px));
        background: color-mix(in srgb, var(--flaeche) 86%, transparent);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        animation: none !important;
    }
    .nh-anlegen {
        width: 100%; min-height: 54px; padding: var(--a3) var(--a7);
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
        border: 0; border-radius: 16px;
        background: var(--petrol); color: var(--text-auf-farbe);
        font: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
        opacity: .5;
        transition: opacity .25s ease-out, box-shadow .25s ease-out, transform .12s ease-out;
        -webkit-tap-highlight-color: transparent;
    }
    .nh-bereit .nh-anlegen { opacity: 1; box-shadow: 0 8px 22px color-mix(in srgb, var(--petrol) 35%, transparent); }
    .nh-anlegen:active { transform: scale(.98); }
    .nh-anlegen-fehlt { font-size: 12px; font-weight: 500; opacity: .9; }
    .nh-anlegen-fehlt:empty { display: none; }
    .nh-sendet .nh-anlegen { opacity: .75; pointer-events: none; }

    /* Fehlt beim Antippen noch etwas: die Stelle bekommt einmal einen
       sanften Petrol-Ring — kein Rot, kein Wackeln. */
    .nh-fehlt { animation: nh-hinweis .9s ease-out; border-radius: 14px; }

    /* ── Angelegt: Haken zeichnet sich ein, dann gibt die Ebene frei ── */
    .nh-angelegt {
        position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
        background: rgba(10, 20, 22, .16); pointer-events: none;
        animation: nh-angelegt-ebene 1.9s ease-out forwards;
    }
    .nh-angelegt-karte {
        display: flex; flex-direction: column; align-items: center; gap: var(--a5);
        padding: var(--a9) var(--a10); border-radius: 24px; background: var(--grund);
        box-shadow: 0 18px 50px rgba(0, 30, 35, .22);
        animation: nh-angelegt-karte .55s cubic-bezier(.3, 1.3, .5, 1) both;
    }
    .nh-angelegt-zeichen {
        display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
        background: linear-gradient(150deg, #2DB86A, var(--nh-gruen, #1A9150) 70%);
        box-shadow: 0 8px 22px rgba(26, 145, 80, .35);
    }
    .nh-angelegt-zeichen svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
    .nh-angelegt-zeichen path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: konto-zeichnen .45s ease-out .3s forwards; }
    .nh-angelegt-text { font-size: 17px; font-weight: 600; color: var(--text); }
}
@media (min-width: 900px) { .nh-angelegt { display: none; } }

@keyframes nh-ein    { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nh-auf    { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes nh-foto-ein    { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes nh-frisch { from { background: var(--petrol-flaeche); } to { background: transparent; } }
@keyframes nh-hinweis {
    from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--petrol) 45%, transparent); }
    to   { box-shadow: 0 0 0 12px transparent; }
}
@keyframes nh-angelegt-ebene { 0% { opacity: 0; } 12% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes nh-angelegt-karte { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .nh-form > *, .nh-gewerk, .nh-gewerk-marke, .nh-raum-marke, .nh-foto, .nh-aehnlich, .nh-angelegt-karte { animation: none !important; }
    .nh-knauf, .nh-schalter::before { transition: none; }
}

/* „+“-Blatt am Handy: farbige Kacheln wie in den Formularen (25.10.26). */
@media (max-width: 899px) {
    .neu-blatt-eintrag { min-height: 68px; gap: var(--a6); }
    .neu-blatt-kachel {
        flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
        color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--kachel) 30%, transparent);
        background: var(--kachel);
    }
    .neu-blatt-ticket { --kachel: var(--petrol); }
    .neu-blatt-todo   { --kachel: var(--ampel-wartet); }
    .neu-blatt-termin { --kachel: var(--abt-it); }
    .handy-blatt-eintrag .neu-blatt-kachel .symbol { width: 22px; height: 22px; color: #fff; stroke-width: 2; }
    .neu-blatt-text { display: flex; flex-direction: column; gap: 1px; font-size: 17px; font-weight: 600; }
    .neu-blatt-text small { font-size: 13px; font-weight: 400; color: var(--text-tertiaer); }
}

/* „+“-Fächer am Handy (25.10.26): zwei Kacheln springen aus dem Knopf, an
   seiner Stelle ein ×. Das Fenster deckt den Schirm (durchsichtig); Lage des
   „+“ setzt das Skript (--plus-oben, left/top des ×). */
@media (max-width: 899px) {
    .handy-blatt.neu-faecher {
        inset: 0; width: 100%; height: 100%; max-height: none; overflow: visible;
        padding: 0; border-radius: 0; background: transparent; box-shadow: none;
        transform: none; opacity: 1;
        transition: opacity .2s ease-out, display .2s allow-discrete, overlay .2s allow-discrete;
    }
    .handy-blatt.neu-faecher:not(:popover-open) { transform: none; opacity: 0; }
    @starting-style { .handy-blatt.neu-faecher:popover-open { transform: none; opacity: 1; } }
    .handy-blatt.neu-faecher::backdrop {
        background: rgba(10, 20, 22, .42);
        -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    }
    .handy-blatt.neu-faecher:not(:popover-open)::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }

    .neu-faecher-reihe {
        position: absolute; left: var(--a5); right: var(--a5);
        bottom: calc(100% - var(--plus-oben, 85%) + 18px);
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--a3);
    }
    .neu-faecher-kachel {
        display: flex; flex-direction: column; align-items: flex-start; gap: var(--a4);
        padding: var(--a5); border-radius: 20px;
        background: var(--grund); color: var(--text); text-decoration: none;
        box-shadow: 0 10px 30px rgba(0, 30, 35, .22), 0 2px 6px rgba(0, 30, 35, .10);
        transition: transform .12s ease-out;
        -webkit-tap-highlight-color: transparent;
    }
    .neu-faecher-kachel:active { transform: scale(.95); }
    /* Drei Kacheln nebeneinander (26.10.26): etwas knapper als zu zweit. */
    .neu-faecher-kachel { padding: var(--a4); gap: var(--a3); }
    .neu-faecher-kachel .neu-blatt-text { font-size: 16px; }
    .neu-faecher-kachel .neu-blatt-text small { font-size: 12px; line-height: 1.3; }
    .neu-faecher-kachel .neu-blatt-kachel .symbol { width: 22px; height: 22px; color: #fff; stroke-width: 2; }

    /* Das × liegt genau über dem „+“ der Leiste. */
    .handy-plus.neu-faecher-zu { position: fixed; margin: 0; transform: none; }
    .handy-plus.neu-faecher-zu:active { transform: scale(.92); }
    .neu-faecher-zu .symbol { rotate: 45deg; }
}

/* ── Wischen zum Übernehmen (Handy-Liste, 26.10.26) ──
   Die Zeile gleitet nach links, darunter liegt der Grund (uebersicht.html,
   tkWischGrund): erst hell, ab der Schwelle Petrol mit weißem Haken — so
   sieht man, dass Loslassen jetzt übernimmt. Fremde Tickets: grau mit Schloss. */
@media (max-width: 899px) {
    .listen-koerper { position: relative; }
    .listen-koerper a.zeile[data-wisch], .listen-koerper a.zeile[data-wisch-fremd] { touch-action: pan-y; }
    .listen-koerper .zeile.wird-gewischt {
        z-index: 1; overflow: hidden;
        background: var(--grund);
        transition: none;
    }
    .listen-koerper .zeile.wird-gewischt.federt { transition: transform .34s cubic-bezier(.3, 1.2, .5, 1); }
    .zeile-wisch-grund {
        position: absolute; left: 0; right: 0; z-index: 0;
        display: flex; align-items: center; justify-content: flex-end; gap: var(--a3);
        padding-right: var(--a8);
        background: var(--petrol-flaeche); color: var(--petrol);
        font-size: 15px; font-weight: 600;
        transition: background .18s ease-out, color .18s ease-out;
        pointer-events: none;
    }
    .zeile-wisch-grund svg {
        width: 24px; height: 24px; flex: none;
        fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
        transform: scale(.85);
        transition: transform .22s cubic-bezier(.3, 1.6, .5, 1);
    }
    .zeile-wisch-grund.bereit { background: var(--petrol); color: var(--text-auf-farbe); }
    .zeile-wisch-grund.bereit svg { transform: scale(1.12); }
    .zeile-wisch-grund.fremd { background: var(--flaeche-kraeftig); color: var(--text-tertiaer); font-size: 13px; padding-right: var(--a5); }
    .zeile-wisch-grund.fremd svg { width: 18px; height: 18px; stroke-width: 2; transform: none; }

    /* „Übernommen · Rückgängig“ über der Leiste, wie in Outlook und Gmail. */
    .tk-wisch-hinweis {
        position: fixed; z-index: 1000;
        left: var(--a5); right: var(--a5);
        bottom: calc(var(--leiste-hoehe) + var(--leiste-unten) + var(--a4));
        display: flex; align-items: center; gap: var(--a3);
        min-height: 52px; padding: 0 var(--a3) 0 var(--a6);
        border-radius: 16px; background: rgba(28, 34, 37, .92); color: #fff;
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        box-shadow: 0 8px 24px rgba(0, 20, 25, .25);
        font-size: 15px; font-weight: 600;
        animation: tk-wisch-hinweis .26s cubic-bezier(.3, 1.2, .5, 1) both;
    }
    .tk-wisch-hinweis.geht { animation: tk-wisch-hinweis-weg .22s ease-in both; }
    .tk-wisch-hinweis.warnung { padding-right: var(--a6); }
    .tk-wisch-hinweis svg {
        width: 20px; height: 20px; flex: none;
        fill: none; stroke: #5FD3D3; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
    }
    .tk-wisch-hinweis span { flex: 1; }
    .tk-wisch-hinweis button {
        min-height: 44px; padding: 0 var(--a5);
        border: 0; border-radius: 12px; background: none;
        color: #5FD3D3; font: inherit; font-weight: 700;
        -webkit-tap-highlight-color: transparent;
    }
    .tk-wisch-hinweis button:active { background: rgba(255, 255, 255, .1); }
}
@keyframes tk-wisch-hinweis { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes tk-wisch-hinweis-weg { to { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
    .tk-wisch-hinweis, .tk-wisch-hinweis.geht { animation-duration: .01s; }
}

/* App-Einträge im Menü (uebersicht.html, Skript „Als App“): erst sichtbar,
   wenn der Browser es kann — `display: flex` der Einträge überstimmt sonst
   `hidden`. */
[data-pwa][hidden] { display: none; }
[data-pwa]:disabled { color: var(--text-schwach); cursor: default; }

/* ═══ Kalender (Sergiu, 26.10.26) ═════════════════════════════════════════
   Skizze static/skizzen/kalender-v3.html, Variante C: eine Karte über die
   volle Breite auf der Fläche der Statistik — oben 14 Tage als Streifen,
   darunter die Liste nach Wochen, rechts schmal „Eintragen“ und „Wartet
   ohne Datum“. Farbe nur als Punkt oder Strich (Fassung 1 war „zu grell,
   lose“). */

.kalender {
    flex: 1; min-width: 0; min-height: 0; overflow-y: auto;
    background:
        radial-gradient(1100px 460px at 50% -160px, color-mix(in srgb, var(--petrol-ci) 11%, transparent), transparent 70%),
        var(--stat-seite, var(--flaeche));
}
/* Blöcke mit eigenem `display` sollen `hidden` trotzdem befolgen. */
.kalender [hidden] { display: none !important; }
/* Zahlen in der App-Schrift, aber gleich breit — Spalten stehen ruhig
   (Sergiu, 26.10.26: keine Monospace-Schrift im Kalender). */
.kalender, .kl-blatt { font-variant-numeric: tabular-nums; }
.kalender .mono { font-family: var(--schrift); }
.kl-p-it { --gw: var(--abt-it); } .kl-p-td { --gw: var(--abt-td); }
.kl-p-hd { --gw: var(--abt-hd); } .kl-p-mt { --gw: var(--abt-mt); }
.kl-p-todo, .kl-p-keins { --gw: var(--petrol); }
.kl-p-warten { --gw: var(--geparkt-text); }

.kl-innen { max-width: 1500px; margin: 0 auto; padding: var(--a8) var(--a8) var(--a10); }
.kl-karte {
    background: var(--grund); border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 40, 45, .05), 0 8px 28px rgba(0, 40, 45, .07);
}
.kl-karte-kopf { display: flex; align-items: center; gap: var(--a4); padding: var(--a7) var(--a7) var(--a5); }
.kl-karte-kopf h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.kl-karte-kopf h2 span { font-weight: 400; color: var(--text-tertiaer); }
.kl-kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: var(--a3); }
.kl-kopf-rechts .umschalter-feld { flex: none; padding: 0 var(--a5); font-size: 13px; height: 30px; }
.kl-zeichen {
    flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
    color: var(--petrol); background: color-mix(in srgb, var(--petrol) 12%, transparent);
}
.kl-zeichen .symbol { width: 19px; height: 19px; }
.kl-rund, .kl-heute-knopf {
    display: inline-grid; place-items: center; height: 30px; min-width: 30px;
    border-radius: 9px; background: var(--flaeche); color: var(--text-sekundaer);
}
.kl-rund .symbol { transform: rotate(90deg); }
.kl-rund.kl-vor .symbol { transform: rotate(-90deg); }
.kl-heute-knopf { padding: 0 var(--a5); font-size: 13px; font-weight: 500; }
@media (hover: hover) { .kl-rund:hover, .kl-heute-knopf:hover { background: var(--flaeche-kraeftig); color: var(--text); } }

/* ── Streifen: 14 Tage ── */
.kl-streifen {
    display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px;
    padding: 2px var(--a7) var(--a6); border-bottom: 1px solid var(--linie);
}
.kl-st {
    position: relative; padding: var(--a3) 0 var(--a6); border-radius: 12px; text-align: center;
    background: var(--flaeche); transition: background .12s ease-out, box-shadow .12s ease-out;
}
.kl-st small { display: block; font: 600 10.5px/1 var(--schrift); letter-spacing: .08em; text-transform: uppercase; color: var(--text-schwach); }
.kl-st > b { display: block; margin-top: 5px; font: 600 17px/1 var(--schrift); color: var(--text-sekundaer); }
.kl-st.kl-we { background: transparent; }
.kl-st.kl-we > b { color: var(--text-schwach); }
.kl-st.kl-bereich { background: var(--petrol-flaeche); }
.kl-st.kl-bereich > b { color: var(--petrol-dunkel); }
.kl-st.kl-heute { background: var(--petrol); }
.kl-st.kl-heute small, .kl-st.kl-heute > b { color: #fff; }
.kl-st.kl-gewaehlt { box-shadow: inset 0 0 0 2px var(--petrol); }
.kl-st.kl-heute.kl-gewaehlt { box-shadow: 0 0 0 2px var(--grund), 0 0 0 4px var(--petrol); }
@media (hover: hover) { .kl-st:not(.kl-heute):hover { background: var(--flaeche-kraeftig); } }
.kl-st i { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
.kl-st i b { width: 5px; height: 5px; border-radius: 50%; background: var(--gw); }
.kl-st.kl-heute i b { background: #fff; }

/* ── Liste nach Wochen ── */
.kl-unten { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.kl-liste { padding: var(--a2) var(--a7) var(--a7); min-width: 0; }
.kl-woche-kopf { display: flex; align-items: baseline; gap: var(--a3); padding: var(--a7) var(--a2) var(--a3); font-size: 13px; font-weight: 600; }
.kl-woche-kopf span { font: 500 12px/1 var(--schrift); color: var(--text-schwach); }
.kl-zeile {
    display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--a4); align-items: start;
    margin: 0 calc(-1 * var(--a3)); padding: var(--a2) var(--a3); border-radius: 12px; scroll-margin: var(--a8);
    transition: background .2s ease-out;
}
.kl-zeile.kl-gewaehlt { background: color-mix(in srgb, var(--petrol) 6%, transparent); }
.kl-zeile-datum { padding-top: 10px; font: 600 13px/1.3 var(--schrift); color: var(--text-sekundaer); white-space: nowrap; }
.kl-zeile-datum small { display: block; font-weight: 500; color: var(--petrol); }
.kl-zeile-eintraege { display: flex; flex-direction: column; gap: var(--a2); }
.kl-ein {
    display: flex; align-items: center; gap: var(--a4); min-width: 0;
    padding: var(--a3) var(--a5); border-radius: 10px; background: var(--grund); box-shadow: 0 0 0 1px var(--rahmen);
}
@media (hover: hover) { .kl-ein:hover { box-shadow: 0 0 0 1px var(--rahmen-kraeftig), 0 2px 8px rgba(0, 0, 0, .06); } }
.kl-strich { flex: none; width: 3px; align-self: stretch; min-height: 18px; border-radius: 2px; background: var(--gw); }
.kl-ein b { min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-ein small { margin-left: auto; flex: none; max-width: 55%; font-size: 12.5px; color: var(--text-tertiaer); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* To-do leiser: Kästchen statt vollem Strich. */
.kl-ein.kl-todo { background: transparent; box-shadow: inset 0 0 0 1px var(--rahmen); }
.kl-ein.kl-todo b { font-weight: 500; color: var(--text-sekundaer); }
.kl-ein.kl-todo .kl-strich { width: 10px; min-height: 10px; height: 10px; align-self: center; border-radius: 3px; background: transparent; box-shadow: inset 0 0 0 1.6px var(--petrol); }
.kl-leer { margin: 0; padding: 10px 2px 0; font-size: 13px; color: var(--text-schwach); }

/* ── Rand: Eintragen und Wartet ohne Datum ── */
.kl-rand {
    display: flex; flex-direction: column; gap: var(--a8); padding: var(--a7) var(--a6);
    border-left: 1px solid var(--linie); border-radius: 0 0 18px 0;
    background: color-mix(in srgb, var(--flaeche) 45%, var(--grund));
}
.kl-rand-titel { margin: 0; font-size: 14px; font-weight: 600; }
.kl-rand-titel span { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--text-tertiaer); }
.kl-ohne .kl-rand-titel span { display: inline; }
.kl-eintragen, .kl-eintragen-felder { display: flex; flex-direction: column; gap: var(--a4); }
.vl-hinweis.kl-fehler { background: var(--fehler-flaeche); color: var(--fehler-text); }
.kl-vorbei { margin: 0; font-size: 13px; color: var(--text-tertiaer); }
.kl-art .umschalter-feld { height: 30px; font-size: 13px; cursor: pointer; }
.kl-art input { position: absolute; opacity: 0; pointer-events: none; }
.kl-art .umschalter-feld:has(input:checked) { background: var(--grund); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.kl-art .umschalter-feld:has(input:focus-visible) { outline: 2px solid var(--petrol); outline-offset: 1px; }
.kl-eintragen-felder > label { display: flex; flex-direction: column; gap: var(--a1); font-size: 12px; color: var(--text-tertiaer); }
.kl-feld {
    width: 100%; min-width: 0; height: 40px; padding: 0 var(--a4);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 14px; outline: none;
}
/* iOS zeichnet Datum und Uhrzeit sonst in eigener Breite und Höhe. */
.kl-feld[type="date"], .kl-feld[type="time"] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.kl-feld::-webkit-date-and-time-value { text-align: left; }
.kl-feld:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-flaeche); }
.kl-eintragen .knopf { align-self: flex-end; }
.kl-eintragen:has(input[value="todo"]:checked) .kl-nur-termin,
.kl-eintragen:not(:has(input[value="todo"]:checked)) .kl-nur-todo { display: none; }
.kl-ohne { display: flex; flex-direction: column; gap: var(--a2); padding-top: var(--a6); border-top: 1px solid var(--linie); }
.kl-ohne-zeile {
    display: flex; align-items: center; gap: var(--a3); padding: var(--a3) var(--a4); border-radius: 10px;
    background: var(--grund); box-shadow: 0 0 0 1px var(--rahmen); font-size: 13.5px;
}
.kl-ohne-zeile::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.6px var(--geparkt-text); }
@media (hover: hover) { .kl-ohne-zeile:hover { box-shadow: 0 0 0 1px var(--rahmen-kraeftig); } }
.kl-ohne-titel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-sekundaer); }
.kl-ohne .mono { flex: none; font-size: 12px; color: var(--text-schwach); }

.kl-info { border-top: 1px solid var(--linie); padding-top: var(--a5); font-size: 13px; color: var(--text-sekundaer); }
.kl-info summary {
    display: flex; align-items: center; gap: var(--a3); cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 500; color: var(--text-tertiaer);
}
.kl-info summary::-webkit-details-marker { display: none; }
.kl-info summary::before {
    content: "i"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
    font: 600 11px/1 var(--schrift); color: var(--petrol); background: var(--petrol-flaeche);
}
@media (hover: hover) { .kl-info summary:hover { color: var(--text); } }
.kl-info ul { margin: var(--a4) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--a3); line-height: 1.45; }
.kl-info b { font-weight: 600; color: var(--text); }

/* ── PC: die Karte füllt genau den Schirm, Liste und Rand scrollen für sich
   (Sergiu, 26.10.26: „Seite ist voll, aber ich kann noch scrollen“). ── */
@media (min-width: 900px) {
    .kalender { overflow: hidden; display: flex; }
    .kl-innen { flex: 1; min-width: 0; min-height: 0; display: flex; padding-bottom: var(--a8); }
    .kl-haupt { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
    .kl-unten { flex: 1; min-height: 0; }
    .kl-liste, .kl-rand { min-height: 0; overflow-y: auto; }
}
@media (max-width: 1199px) and (min-width: 900px) {
    .kl-unten { grid-template-columns: minmax(0, 1fr) 280px; }
    .kl-kopf-rechts .umschalter { display: none; }
}

/* ── Handy: Streifen zweizeilig (je eine Woche) ── */
@media (max-width: 899px) {
    .kl-innen { padding: var(--a5) var(--a5) calc(var(--leiste-hoehe) + var(--leiste-unten) + var(--a8)); }
    .kl-kopf-rechts .umschalter { display: none; }
    .kl-karte-kopf { padding: var(--a6) var(--a5) var(--a4); }
    .kl-karte-kopf h2 { font-size: 15px; }
    .kl-streifen { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 2px var(--a4) var(--a5); }
    .kl-liste { padding: var(--a2) var(--a5) var(--a6); }
    .kl-zeile { grid-template-columns: minmax(0, 1fr); gap: var(--a2); }
    .kl-zeile-datum { padding-top: var(--a2); }
    .kl-zeile-datum small { display: inline; }
    /* Strich links über die volle Höhe, Titel und Zusatz bündig daneben —
       mit flex-wrap rutschte ein langer Titel unter den Strich (27.10.26). */
    .kl-ein { display: grid; grid-template-columns: 3px minmax(0, 1fr); column-gap: var(--a4); row-gap: 2px; align-items: center; }
    .kl-ein .kl-strich { grid-row: 1 / span 2; }
    .kl-ein b, .kl-ein small { grid-column: 2; margin-left: 0; max-width: 100%; }
    .kl-ein.kl-todo { grid-template-columns: 10px minmax(0, 1fr); }
    .kl-ein.kl-todo .kl-strich { grid-row: 1; }
    .kl-unten { grid-template-columns: minmax(0, 1fr); }
    .kl-rand { padding: var(--a6) var(--a5); border-left: 0; border-top: 1px solid var(--linie); border-radius: 0 0 18px 18px; }

    /* Eintragen als Blatt von unten (26.10.26), geöffnet über den Knopf
       unter dem Streifen oder „+ → Termin“. */
    .kl-handy-eintragen { display: flex; flex-direction: column; gap: var(--a3); padding: var(--a4) var(--a4) var(--a5); }
    .kl-eintragen-knopf {
        display: flex; align-items: center; justify-content: center; gap: var(--a3);
        height: 44px; border: 1px dashed var(--rahmen-kraeftig); border-radius: var(--r-mittel);
        background: transparent; color: var(--petrol); font: 500 14px/1 var(--schrift); cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .kl-eintragen-knopf:active { background: var(--petrol-flaeche); }
    .kl-eintragen-knopf .symbol { width: 18px; height: 18px; }
    .kl-eintragen-knopf > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .kl-rand:has(.kl-blatt) { padding-top: var(--a2); }
    .kl-rand:has(.kl-blatt):not(:has(.kl-ohne)) .kl-info { border-top: 0; padding-top: 0; }
    .kl-blatt { padding-left: var(--a6); padding-right: var(--a6); }
    .kl-blatt .kl-eintragen { padding-top: var(--a3); }
    .kl-blatt .kl-eintragen .knopf { align-self: stretch; justify-content: center; height: 46px; }
}

/* ── Termin am Ticket (Kalender, 26.10.26) ── */
.tk-termin { display: flex; flex-direction: column; gap: var(--a4); }
.tk-termin-wann { font-size: 15px; font-weight: 600; }
.tk-termin-zusatz { margin-top: calc(-1 * var(--a3)); font-size: 13px; color: var(--geparkt-text); }
.tk-termin-vorschlag {
    display: flex; align-items: center; gap: var(--a4);
    padding: var(--a4) var(--a5); border-radius: var(--r-gross); background: var(--petrol-flaeche);
}
.tk-termin-frage { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--text-tertiaer); }
.tk-termin-frage b { font-size: 14px; color: var(--text); font-weight: 600; }
.tk-termin-frage small { font-size: 12px; color: var(--text-tertiaer); }
.tk-termin .tk-menue { align-self: flex-start; }
/* In der schmalen Infospalte rechts bündig aufklappen. */
.tk-info .tk-termin .tk-park { left: auto; right: 0; }
.tk-termin-felder { display: flex; gap: var(--a3); }
.tk-termin-felder label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--a1); font-size: 12px; color: var(--text-tertiaer); }
.tk-termin-felder input[type="date"] {
    height: 40px; padding: 0 var(--a3);
    border: 1px solid var(--rahmen); border-radius: var(--r-mittel);
    background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 14px; outline: none;
}
.tk-termin-felder input[type="date"]:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-flaeche); }
.tk-termin-knoepfe { display: flex; justify-content: flex-end; gap: var(--a3); padding-top: var(--a4); border-top: 1px solid var(--linie); }
