/* Praxis-Chat – Farben wie im Abwesenheitsprogramm (farben.py): Praxisgrün #3ca838, Praxisgrau #646363.
   Knöpfe/Links #2c7c29 (für Lesbarkeit abgedunkelt), Hintergrund #f0efef, Schrift #242424. */
:root {
  --gruen: #3ca838;
  --gruen-d: #2c7c29;
  --gruen-h: #e4f3e3;
  --gruen-dd: #236321;
  --gruen-reiter: #53b250;
  --fokus: #76c274;
  --grau: #646363;
  --grau-d: #4b4a4a;
  --hg: #f0efef;
  --flaeche: #ffffff;
  --text: #242424;
  --text2: #585757;
  --linie: #dadada;
  --feld-rand: #bbbaba;
  --blase: #ffffff;
  --blase-eigen: #dcefd6;
  --rot: #c62828;
  --rot-h: #fdeeee;
  --orange: #e08a00;
  --feierabend: #7b8794;
  --offline: #a8a8a8;
  --blau: #2f86d6;
  --schatten: 0 1px 2px rgba(0, 0, 0, .09);
  --app-h: 100dvh;
  --app-top: 0px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--hg); color: var(--text);
  font: 15px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
html, body { overflow: hidden; overscroll-behavior: none; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
/* iPhone/iPad zoomen beim Antippen in Felder mit weniger als 16px Schrift hinein – daher 16px */
input, textarea, select { font-size: 16px; max-width: 100%; }
button { cursor: pointer; }
a { color: var(--gruen-d); }
[hidden] { display: none !important; }
.marke { font-weight: 600; letter-spacing: -0.01em; }

/* Die App füllt genau den sichtbaren Bereich – auch wenn am iPhone die Tastatur offen ist */
#app { position: fixed; left: 0; right: 0; top: 0; height: var(--app-h); transform: translateY(var(--app-top)); display: flex; flex-direction: column; overflow: hidden; }
.layout { flex: 1; display: flex; min-height: 0; }
.seite { width: 100%; display: flex; flex-direction: column; min-height: 0; background: var(--flaeche); }
.haupt { display: none; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: var(--hg); }
.layout.haupt-offen .seite { display: none; }
.layout.haupt-offen .haupt { display: flex; }
@media (min-width: 860px) {
  .seite { width: 370px; flex: none; border-right: 1px solid var(--linie); }
  .haupt { display: flex; }
  .layout.haupt-offen .seite { display: flex; }
  .nur-mobil { display: none !important; }
}

/* ---------- Icons ---------- */
.ic { width: 22px; height: 22px; display: inline-flex; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.klein { width: 16px; height: 16px; }
.ic.mini { width: 14px; height: 14px; }
.ic.grau { color: var(--text2); }

/* ---------- Kopfzeile ---------- */
.kopf {
  background: var(--grau); color: #fff; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); min-height: 58px; flex: none;
}
.kopf h1 { font-size: 18px; margin: 0 0 0 4px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knopf-icon {
  background: none; border: 0; width: 40px; height: 40px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: inherit; flex: none; padding: 0;
}
.knopf-icon:hover { background: rgba(0, 0, 0, .06); }
.kopf .knopf-icon:hover { background: rgba(255, 255, 255, .14); }
.status-pille {
  display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .16); border: 0; color: #fff;
  border-radius: 999px; padding: 6px 10px 6px 9px; font-size: 13.5px; max-width: 60%; min-width: 0;
}
.status-pille span.text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--offline); flex: none; display: inline-block; }
.punkt.online { background: var(--gruen); }
.punkt.therapie { background: var(--orange); }
.punkt.feierabend { background: var(--feierabend); }
.status-pille .punkt { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.punkt.gross { width: 14px; height: 14px; }
.verbindung { background: #fff4d6; color: #7a5b00; font-size: 13px; text-align: center; padding: 4px; flex: none; }

/* ---------- Reiter unten ---------- */
.tabs { display: flex; border-top: 1px solid var(--linie); background: var(--flaeche); padding-bottom: env(safe-area-inset-bottom); flex: none; }
.tabs button {
  flex: 1; background: none; border: 0; padding: 7px 4px 6px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 12px; color: var(--text2); position: relative;
}
.tabs button.aktiv { color: var(--gruen-d); font-weight: 600; box-shadow: inset 0 3px 0 var(--gruen-reiter); }
.tabs .zahl { position: absolute; top: 3px; left: calc(50% + 6px); }

/* ---------- Listen ---------- */
.seiten-inhalt { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.liste { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.suchfeld { padding: 8px 10px 8px 12px; background: var(--flaeche); border-bottom: 1px solid var(--linie); display: flex; gap: 6px; align-items: center; flex: none; }
.suchfeld input { flex: 1; min-width: 0; border: 1px solid var(--linie); background: var(--hg); border-radius: 999px; padding: 8px 14px; outline: none; }
.suchfeld input:focus { border-color: var(--gruen); background: #fff; }
.suchfeld .knopf-icon { color: var(--grau); }
.eintrag { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f1f1f1; cursor: pointer; }
/* Wischen in der Chatliste */
.wisch { position: relative; overflow: hidden; }
.wisch > .eintrag { position: relative; z-index: 1; background: var(--flaeche); transition: transform .22s ease; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wisch > .eintrag.aktiv { background: var(--gruen-h); }
.wisch.offen > .eintrag { transform: translateX(calc(-1 * var(--wisch-b))); }
.wisch-aktionen { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.wisch-knopf { width: 78px; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 600; }
.wisch-knopf .ic { width: 22px; height: 22px; }
.wisch-knopf.stumm { background: #8a8a8a; }
.wisch-knopf.loeschen { background: var(--rot); }
.eintrag:hover { background: #f7f7f7; }
.eintrag.aktiv { background: var(--gruen-h); }
.eintrag .mitte { flex: 1; min-width: 0; }
.eintrag .oben, .eintrag .unten { display: flex; gap: 6px; align-items: center; }
.eintrag .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .zeit { font-size: 12px; color: var(--text2); flex: none; }
.eintrag.ungelesen .zeit { color: var(--gruen-d); font-weight: 700; }
.eintrag .vorschau { flex: 1; min-width: 0; color: var(--text2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag .vorschau.tippt { color: var(--gruen-d); font-style: italic; }
.eintrag .status-text { font-size: 13.5px; color: var(--text2); }
.eintrag .status-text.therapie { color: var(--orange); }
.eintrag .status-text.online { color: var(--gruen-d); }
.eintrag .rolle { font-size: 11.5px; color: var(--text2); border: 1px solid var(--linie); border-radius: 4px; padding: 0 5px; flex: none; }
.abschnitt { font-size: 12.5px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; padding: 12px 12px 6px; background: #fafafa; border-bottom: 1px solid #f1f1f1; }
.zahl {
  background: var(--gruen); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.zahl.stumm { background: #b8b8b8; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; flex: none; position: relative; user-select: none;
}
.avatar .ic { width: 55%; height: 55%; }
.avatar .punkt { position: absolute; right: -1px; bottom: 0; width: 14px; height: 14px; border: 2px solid #fff; }
.kopf .avatar .punkt { border-color: var(--grau); }
.banner { display: flex; gap: 10px; align-items: center; background: var(--gruen-h); padding: 10px 12px; font-size: 14px; border-bottom: 1px solid #cfe6c9; flex: none; cursor: pointer; }
.banner .ic { color: var(--gruen-d); }
.banner > div { flex: 1; }
.banner b { display: block; }
.banner .knopf-icon { width: 32px; height: 32px; color: var(--text2); }
.team-kopf { padding: 12px; font-size: 14px; color: var(--text2); border-bottom: 1px solid var(--linie); display: flex; gap: 14px; flex-wrap: wrap; flex: none; }
.team-kopf span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Leerer Zustand ---------- */
.leer { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text2); gap: 10px; text-align: center; padding: 24px; }
.leer .ic { width: 56px; height: 56px; color: #c6c6c6; }
.leer.klein { flex: none; padding: 30px 20px; font-size: 14px; }
.leer img { width: 200px; max-width: 60%; height: auto; opacity: .35; filter: grayscale(.2); }

/* ---------- Chat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-kopf { cursor: pointer; }
.chat-kopf .titel { flex: 1; min-width: 0; line-height: 1.25; }
.chat-kopf .titel b { display: block; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-kopf .titel small { display: block; font-size: 12.5px; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-kopf .avatar { width: 38px; height: 38px; font-size: 14px; }
.angeheftet-leiste { display: flex; gap: 10px; align-items: center; background: #fff; border-bottom: 1px solid var(--linie); padding: 7px 12px; cursor: pointer; font-size: 14px; flex: none; }
.angeheftet-leiste .ic { color: var(--gruen-d); }
.angeheftet-leiste > div { flex: 1; min-width: 0; }
.angeheftet-leiste b { display: block; font-size: 12px; color: var(--gruen-d); }
.angeheftet-leiste span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verlauf {
  flex: 1; overflow-y: auto; padding: 6px 10px 14px; display: flex; flex-direction: column; position: relative;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: #e9ebe6;
}
@media (pointer: coarse) { .verlauf { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.zeile { display: flex; margin-top: 7px; }
.zeile.folge { margin-top: 2px; }
.zeile.eigen { justify-content: flex-end; }
.zeile.system { justify-content: center; margin: 8px 0 2px; }
.blase {
  max-width: min(80%, 560px); background: var(--blase); border-radius: 12px; padding: 6px 9px 5px; box-shadow: var(--schatten);
  position: relative; overflow-wrap: anywhere; min-width: 70px;
}
.zeile.eigen .blase { background: var(--blase-eigen); }
.zeile.fremd:not(.folge) .blase { border-top-left-radius: 4px; }
.zeile.eigen:not(.folge) .blase { border-top-right-radius: 4px; }
.blase .name { font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.blase .text { white-space: pre-wrap; }
.blase .text a { word-break: break-all; }
.blase .fuss { float: right; margin: 6px 0 -3px 12px; font-size: 11.5px; color: var(--text2); display: inline-flex; gap: 4px; align-items: center; position: relative; top: 2px; white-space: nowrap; }
.blase .fuss .ic { width: 13px; height: 13px; }
.blase::after { content: ""; display: block; clear: both; }
.haken { display: inline-flex; align-items: center; gap: 2px; color: var(--text2); }
.haken .ic { width: 16px !important; height: 16px !important; }
.haken.gelesen { color: var(--gruen); }
.haken.gelesen svg { stroke-width: 2.6; }
.eintrag .vorschau .haken { vertical-align: -3px; margin-right: 3px; }
.blatt h3.stufe { display: flex; align-items: center; gap: 8px; }
.haken small { font-size: 10.5px; }
.blase.dringend { background: var(--rot-h) !important; box-shadow: inset 4px 0 0 var(--rot), var(--schatten); padding-left: 13px; }
.etikett { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 4px; padding: 1px 6px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.etikett.dringend { background: var(--rot); color: #fff; }
.zitat { border-left: 3px solid var(--gruen); background: rgba(0, 0, 0, .05); border-radius: 6px; padding: 4px 8px; margin: 2px 0 5px; font-size: 13.5px; cursor: pointer; }
.zitat b { display: block; color: var(--gruen-d); font-size: 12.5px; }
.zitat span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text2); }
.blase .bild { display: block; margin: 0 -5px 5px; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: #d9dcd6; }
.blase .bild img { display: block; object-fit: cover; max-width: 100%; }
.datei-karte { display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, .045); border-radius: 8px; padding: 8px 10px; margin: 0 0 5px; text-decoration: none; color: inherit; }
.datei-karte .ic { color: var(--gruen-d); width: 30px; height: 30px; }
.datei-karte b { display: block; font-size: 14px; word-break: break-all; font-weight: 600; }
.datei-karte small { color: var(--text2); }
.aufgabe-leiste { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(0, 0, 0, .18); font-size: 13px; flex-wrap: wrap; }
.aufgabe-leiste .ic { width: 17px; height: 17px; color: var(--gruen-d); }
.aufgabe-leiste > span:not(.ic) { flex: 1; font-weight: 600; color: var(--gruen-d); }
.aufgabe-leiste button { background: var(--gruen-d); color: #fff; border: 0; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.aufgabe-leiste.erledigt > span:not(.ic) { font-weight: 500; }
.aufgabe-leiste button.link { background: none; color: var(--text2); text-decoration: underline; padding: 0; font-weight: 400; font-size: 12px; }
.blase.geloescht .text { font-style: italic; color: var(--text2); display: inline-flex; gap: 6px; align-items: center; }
.zeile.system .blase { background: #dfe2dc; color: #555; font-size: 12.5px; box-shadow: none; padding: 4px 12px; text-align: center; max-width: 90%; min-width: 0; border-radius: 8px; }
.datum { align-self: center; background: #fff; color: #555; font-size: 12px; border-radius: 8px; padding: 3px 10px; margin: 12px 0 4px; box-shadow: var(--schatten); position: sticky; top: 2px; z-index: 1; }
.trenner-ungelesen { align-self: stretch; text-align: center; background: rgba(60, 168, 56, .16); color: var(--gruen-d); font-size: 12.5px; font-weight: 700; padding: 4px; margin: 10px -10px 4px; }
.markiert .blase { animation: aufblitzen 1.8s ease; }
@keyframes aufblitzen { 0%, 45% { box-shadow: 0 0 0 3px #f2c230; } 100% { box-shadow: var(--schatten); } }
.ausstehend .blase { opacity: .65; }
.lade-hinweis { align-self: center; font-size: 12.5px; color: var(--text2); padding: 8px; }
.runter {
  position: absolute; right: 14px; bottom: 84px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; color: var(--grau); z-index: 3;
}
.runter .zahl { position: absolute; top: -6px; right: -4px; }
.mehr-knopf {
  position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9);
  display: none; align-items: center; justify-content: center; color: var(--text2); padding: 0;
}
@media (hover: hover) and (pointer: fine) { .zeile:hover .mehr-knopf { display: flex; } }
.ziehen .verlauf { outline: 3px dashed var(--gruen); outline-offset: -8px; }

/* ---------- Eingabe ---------- */
.eingabe { background: #f5f5f5; border-top: 1px solid var(--linie); padding: 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); flex: none; }
.eingabe-zusatz { display: flex; align-items: center; gap: 8px; background: #fff; border-left: 3px solid var(--gruen); border-radius: 6px; padding: 6px 4px 6px 8px; margin-bottom: 6px; font-size: 13px; }
.eingabe-zusatz .ic { color: var(--gruen-d); }
.eingabe-zusatz > div { flex: 1; min-width: 0; }
.eingabe-zusatz b { display: block; color: var(--gruen-d); }
.eingabe-zusatz span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text2); }
.eingabe-zusatz .knopf-icon { width: 32px; height: 32px; color: var(--text2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips:not(:empty) { margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12.5px; font-weight: 700; border: 0; color: #fff; }
.chip .ic { width: 15px; height: 15px; }
.chip.dringend { background: var(--rot); }
.chip.aufgabe { background: var(--gruen-d); }
.chip button { background: rgba(255, 255, 255, .25); border: 0; color: #fff; border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.eingabe-zeile { display: flex; align-items: flex-end; gap: 4px; }
.eingabe textarea {
  flex: 1; min-width: 0; resize: none; border: 1px solid var(--linie); border-radius: 20px; padding: 9px 14px; max-height: 150px;
  min-height: 40px; line-height: 1.35; background: #fff; outline: none; -webkit-user-select: text; user-select: text;
}
.eingabe textarea:focus { border-color: var(--gruen); }
.eingabe .knopf-icon { color: var(--grau); }
.eingabe .senden { background: var(--gruen-d); color: #fff; margin-left: 2px; }
.eingabe .senden:hover { background: var(--gruen-dd); }
.eingabe .senden:disabled { background: #b9cdb8; cursor: default; }
.eingabe-gesperrt { text-align: center; color: var(--text2); font-size: 13.5px; padding: 10px; }

/* ---------- Blätter und Dialoge ---------- */
.hintergrund { position: fixed; inset: 0; top: var(--app-top); bottom: auto; height: var(--app-h); background: rgba(0, 0, 0, .38); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: einblenden .15s; }
.hintergrund.mitte { align-items: center; }
@keyframes einblenden { from { opacity: 0; } }
@keyframes hoch { from { transform: translateY(30px); opacity: .5; } }
.blatt {
  background: #fff; width: 100%; max-width: 520px; border-radius: 16px 16px 0 0; padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  max-height: 88%; overflow-y: auto; animation: hoch .18s ease-out;
}
@media (min-width: 860px) { .hintergrund { align-items: center; } .blatt { border-radius: 14px; } }
.blatt h3 { margin: 8px 18px 6px; font-size: 14px; color: var(--text2); font-weight: 600; }
.blatt-kopf { display: flex; gap: 12px; align-items: center; padding: 10px 18px 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; }
.blatt-kopf > div:not(.avatar) { flex: 1; min-width: 0; }
.blatt-kopf b { display: block; font-size: 16px; }
.blatt-kopf small { color: var(--text2); }
.blatt-vorschau { margin: 4px 18px 8px; padding: 8px 10px; background: #f4f4f4; border-radius: 8px; font-size: 13.5px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blatt-eintrag { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; text-align: left; padding: 12px 18px; font-size: 16px; }
.blatt-eintrag:hover { background: #f5f5f5; }
.blatt-eintrag .ic { color: var(--grau); }
.blatt-eintrag > span:not(.ic):not(.punkt) { flex: 1; }
.blatt-eintrag small { color: var(--text2); font-size: 12.5px; }
.blatt-eintrag.gefahr, .blatt-eintrag.gefahr .ic { color: var(--rot); }
.blatt-eintrag.aktiv { color: var(--gruen-d); font-weight: 600; }
.blatt-eintrag.aktiv .ic { color: var(--gruen-d); }
.blatt .person { display: flex; gap: 12px; align-items: center; padding: 7px 18px; }
.blatt .person .avatar { width: 36px; height: 36px; font-size: 13px; }
.blatt .person > div:not(.avatar) { flex: 1; min-width: 0; }
.blatt .person small { display: block; color: var(--text2); font-size: 12.5px; }
.dauer { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px 54px; }
.dauer button { border: 1px solid var(--linie); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.dauer button.aktiv { border-color: var(--orange); color: #9a5f00; background: #fff5e3; font-weight: 600; }
.blatt .hinweis { padding: 2px 18px 10px; }
.dialog { background: #fff; border-radius: 14px; width: calc(100% - 32px); max-width: 440px; padding: 18px; max-height: 90%; overflow-y: auto; animation: hoch .15s ease-out; }
.dialog h2 { margin: 0 0 12px; font-size: 18px; }
.dialog p { margin: 0 0 14px; }
.dialog .knopfreihe { justify-content: flex-end; margin-top: 16px; }
.auswahl-liste { max-height: 46vh; overflow-y: auto; border: 1px solid var(--linie); border-radius: 8px; }
.auswahl-liste label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
.auswahl-liste label:last-child { border-bottom: 0; }
.auswahl-liste input { width: 18px; height: 18px; accent-color: var(--gruen-d); }
.namen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.namen-raster button { border: 1px solid var(--linie); background: #fff; border-radius: 10px; padding: 12px 8px; font-weight: 600; }
.namen-raster button:hover { border-color: var(--gruen); background: var(--gruen-h); }

/* ---------- Seiten mit Karten ---------- */
.inhalt { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.inhalt.breit { max-width: 900px; width: 100%; margin: 0 auto; }
.karte { background: #fff; border-radius: 12px; box-shadow: var(--schatten); padding: 14px; margin-bottom: 12px; }
.karte h2 { font-size: 15px; margin: 0 0 10px; color: var(--grau-d); display: flex; align-items: center; gap: 8px; }
.karte h2 .ic { color: var(--gruen-d); width: 19px; height: 19px; }
.karte p { margin: 0 0 10px; }
.feld { display: block; margin-bottom: 10px; }
.feld > span { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.feld input:not([type=checkbox]), .feld select, .feld textarea { width: 100%; border: 1px solid var(--feld-rand); border-radius: 8px; padding: 9px 10px; background: #fff; outline: none; }
.feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--gruen); }
.felder2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.knopf { background: var(--gruen-d); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.knopf:hover { background: var(--gruen-dd); }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf .ic { width: 18px; height: 18px; }
.knopf.zweit { background: #fff; color: var(--gruen-d); border: 1px solid var(--gruen-d); }
.knopf.zweit:hover { background: var(--gruen-h); }
.knopf.gefahr { background: var(--rot); }
.knopf.grau { background: #fff; color: var(--grau-d); border: 1px solid #cfcfcf; }
.knopf.klein { padding: 6px 11px; font-size: 13.5px; }
.knopf.breit { width: 100%; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; }
.hinweis { font-size: 13px; color: var(--text2); }
.fehlertext { color: var(--rot); font-size: 14px; margin: 6px 0; }
.erfolg { color: var(--gruen-d); font-size: 14px; margin: 6px 0; }
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.schalter input {
  -webkit-appearance: none; appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #c8c8c8; position: relative;
  flex: none; transition: background .15s; margin: 0; cursor: pointer;
}
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.schalter input:checked { background: var(--gruen); }
.schalter input:checked::after { left: 21px; }
.status-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.status-wahl button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--linie); background: #fff; border-radius: 999px; padding: 7px 13px; }
.status-wahl button.aktiv { border-color: var(--gruen-d); background: var(--gruen-h); font-weight: 600; }
.segmente { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--linie); flex: none; }
.segmente button { border: 1px solid var(--linie); background: #fff; border-radius: 999px; padding: 6px 14px; white-space: nowrap; font-size: 14px; }
.segmente button.aktiv { background: var(--gruen-d); color: #fff; border-color: var(--gruen-d); }
.benutzer-karte .zeile1 { display: flex; gap: 10px; align-items: center; }
.benutzer-karte .zeile1 > div:not(.avatar) { flex: 1; min-width: 0; }
.benutzer-karte .zeile1 small { display: block; color: var(--text2); }
.benutzer-karte.inaktiv { opacity: .6; }
.geraete { margin: 10px 0; font-size: 13px; color: var(--text2); }
.geraete div { display: flex; gap: 6px; align-items: flex-start; padding: 2px 0; }
.geraete div > span:not(.ic) { flex: 1; min-width: 0; }
.geraete .ic { margin-top: 2px; }
.ok-text { color: var(--gruen-d); font-weight: 600; }
.fehler-text { color: var(--rot); font-weight: 600; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle td { padding: 6px 4px; border-bottom: 1px solid #f0f0f0; }
.tabelle td:last-child { text-align: right; font-weight: 600; }
.schnell-zeile { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.schnell-zeile input[type=text] { flex: 1; min-width: 0; border: 1px solid #cfcfcf; border-radius: 8px; padding: 8px 10px; }
.schnell-zeile label { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; white-space: nowrap; }
.aenderungen { white-space: pre-wrap; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; background: #f6f6f6; border-radius: 8px; padding: 10px; max-height: 340px; overflow: auto; }
.fortschritt { height: 6px; background: #e3e3e3; border-radius: 3px; overflow: hidden; margin: 8px 0; }
.fortschritt div { height: 100%; background: var(--gruen); width: 0; transition: width .2s; }
.unterseite-kopf { display: flex; align-items: center; gap: 8px; }

/* ---------- Anmeldung ---------- */
.anmeldung { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; padding-top: calc(20px + env(safe-area-inset-top)); background: var(--hg); overflow-y: auto; }
.anmeldung .karte { width: 100%; max-width: 380px; padding: 26px 24px; }
.anmeldung .logo-gross { display: block; width: 236px; max-width: 78%; height: auto; margin: 4px auto 18px; }
.anmeldung .logo-gross + h1 { padding-top: 16px; border-top: 1px solid #e9e9e9; }
.anmeldung .app-zeichen { display: block; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 16px; }
.anmeldung h1 { text-align: center; color: var(--text); margin: 2px 0 20px; font-size: 1.4rem; }
.anmeldung .knopf { width: 100%; padding: 11px; margin-top: 6px; }
.fusszeile { text-align: center; font-size: 12.5px; color: var(--text2); margin-top: 16px; }
.fusszeile a { color: var(--text2); }

/* ---------- Hinweise ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--app-top) + var(--app-h) - 70px - env(safe-area-inset-bottom)); transform: translate(-50%, -100%); background: #323232; color: #fff;
  padding: 10px 14px; border-radius: 10px; z-index: 100; max-width: calc(100% - 28px); width: max-content; box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  font-size: 14px; display: flex; gap: 12px; align-items: center; animation: hoch .18s ease-out;
}
.toast { pointer-events: none; }
.toast button { pointer-events: auto; }
.toast span { min-width: 0; overflow-wrap: anywhere; }
.toast button { background: none; border: 0; color: #a7e8a4; font-weight: 700; padding: 2px 4px; white-space: nowrap; }
.lightbox { position: fixed; inset: 0; top: var(--app-top); bottom: auto; height: var(--app-h); background: rgba(0, 0, 0, .94); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.lightbox .leiste { position: absolute; top: env(safe-area-inset-top); right: 0; display: flex; gap: 8px; padding: 10px; }
.lightbox .knopf-icon { color: #fff; background: rgba(255, 255, 255, .14); }

/* ---------- Bildlaufleisten (PC) ---------- */
@media (pointer: fine) {
  .liste::-webkit-scrollbar, .verlauf::-webkit-scrollbar, .inhalt::-webkit-scrollbar { width: 8px; }
  .liste::-webkit-scrollbar-thumb, .verlauf::-webkit-scrollbar-thumb, .inhalt::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); border-radius: 4px; }
}

/* Tastatur offen (iPhone): unten keinen Abstand für den Home-Balken */
.tastatur .eingabe { padding-bottom: 6px; }
.tastatur .tabs { padding-bottom: 0; }
.tastatur .toast { top: calc(var(--app-top) + var(--app-h) - 70px); }
