/* Modern, mit den Erkennungszeichen von damals: Blumen als Status, Gruppen Online/Offline, Grün. */
@font-face { font-family: 'Bricolage'; src: url('fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Onest'; src: url('fonts/onest.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --boden: #F3F6F2; --flaeche: #FFFFFF; --tinte: #16211B; --leise: #617067; --linie: #DFE6E0;
  --seite: #FFFFFF; --seite-tinte: #16211B; --seite-leise: #6B7A71; --seite-hoch: #EEF5EC; --feld: #F0F4F0;
  --gruen: #2F9E44; --gruen-tief: #237A34; --gruen-zart: #E3F4E1; --gruen-tinte: #FFFFFF;
  --kopf-a: #2F9E44; --wahl: #2F9E44; --wahl-tinte: #FFFFFF;
  --meine: #DCF3D7; --meine-tinte: #10301A; --deine: #FFFFFF;
  --hinweis: #FFF4C7; --hinweis-tinte: #4A3B00;
  --ich: #1E6FD0; --gelesen: #1E6FD0;
  --on: #58B32A; --weg: #E8A317; --nst: #D8392F; --aus: #9AA6B2; --rot: #C7362F;
  --schatten: 0 1px 2px rgba(22, 33, 27, .06), 0 14px 40px rgba(22, 33, 27, .16); --punkt: rgba(22, 33, 27, .05); --glas: rgba(255, 255, 255, .78); --weich: 0 1px 2px rgba(22, 33, 27, .07), 0 6px 18px rgba(22, 33, 27, .06);
  --kopf: 'Bricolage', 'Segoe UI', sans-serif; --lauf: 'Onest', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-design="hell"]) {
  --boden: #111714; --flaeche: #1A221D; --tinte: #E6EEE8; --leise: #93A399; --linie: #2A352E;
  --seite: #161D19; --seite-tinte: #E6EEE8; --seite-leise: #8C9C92; --seite-hoch: #212C25; --feld: #212A24;
  --gruen: #3DB455; --gruen-tief: #2F9E44; --gruen-zart: #1E3324; --kopf-a: #161D19;
  --meine: #1F5A2E; --meine-tinte: #ECF7EE; --deine: #222C26;
  --hinweis: #4A3F12; --hinweis-tinte: #FFE89A; --ich: #7FB6FF; --gelesen: #8CC4FF; --rot: #FF8A80;
  --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .55); --punkt: rgba(255, 255, 255, .035); --glas: rgba(26, 34, 29, .78); --weich: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25); color-scheme: dark;
} }
:root[data-design="dunkel"] {
  --boden: #111714; --flaeche: #1A221D; --tinte: #E6EEE8; --leise: #93A399; --linie: #2A352E;
  --seite: #161D19; --seite-tinte: #E6EEE8; --seite-leise: #8C9C92; --seite-hoch: #212C25; --feld: #212A24;
  --gruen: #3DB455; --gruen-tief: #2F9E44; --gruen-zart: #1E3324; --kopf-a: #161D19;
  --meine: #1F5A2E; --meine-tinte: #ECF7EE; --deine: #222C26;
  --hinweis: #4A3F12; --hinweis-tinte: #FFE89A; --ich: #7FB6FF; --gelesen: #8CC4FF; --rot: #FF8A80;
  --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .55); --punkt: rgba(255, 255, 255, .035); --glas: rgba(26, 34, 29, .78); --weich: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { height: var(--hoehe, 100%); margin: 0; font: 14.5px/1.45 var(--lauf); color: var(--tinte); background: var(--boden); overflow: hidden; -webkit-font-smoothing: antialiased; }
@supports (height: 100dvh) { body { height: var(--hoehe, 100dvh); } }
button, input, textarea { font: inherit; color: inherit; }
button, a, input, textarea { touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }
h1, h2 { font-family: var(--kopf); font-weight: 650; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
a { color: var(--ich); text-underline-offset: 2px; }
.nummer { font-variant-numeric: tabular-nums; }
.klein { font-size: 13px; color: var(--leise); margin: 6px 0 0; }
.fehler { color: var(--rot); min-height: 1.3em; margin: 8px 0 0; font-size: 13.5px; }
.fehler.klein { margin: 0; padding: 0 16px 6px; min-height: 0; }
.fehler.klein:empty { display: none; }

.knopf { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 10px; padding: 8px 16px; font-weight: 550; color: var(--tinte); transition: background .12s, border-color .12s, filter .12s; }
.knopf:hover { border-color: var(--leise); }
.knopf.haupt { background: var(--gruen); border-color: var(--gruen); color: var(--gruen-tinte); }
.knopf.haupt:hover { background: var(--gruen-tief); border-color: var(--gruen-tief); }
.knopf.rot, .knopf.haupt.rot { background: #C7362F; border-color: #C7362F; color: #fff; }
.knopf:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 6px 0; color: var(--leise); text-decoration: underline; text-underline-offset: 3px; }
.rund { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; font-size: 18px; line-height: 1; color: inherit; transition: background .12s; }
.rund:hover { background: var(--seite-hoch); }
.reihe { display: flex; gap: 8px; flex-wrap: wrap; }

/* Status als Punkt: Farbe und Form, damit es auch ohne Farbe lesbar bleibt */
.lampe { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--on); }
.lampe.weg { background: linear-gradient(90deg, var(--weg) 50%, transparent 50%); box-shadow: inset 0 0 0 2px var(--weg); }
.lampe.nst { background: var(--nst) linear-gradient(#fff, #fff) center / 60% 2px no-repeat; }
.lampe.aus { background: transparent; box-shadow: inset 0 0 0 2px var(--aus); }
.lampe.neu, .lampe.post { background: #F2B600; }
.bild { position: relative; width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font: 650 16px var(--kopf); color: #fff; background: hsl(calc(var(--ton, 200) * 1deg) 38% 46%); background: oklch(58% .11 calc(var(--ton, 200) * 1deg)); }
.bild .lampe { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; outline: 2.5px solid var(--seite); }
.bild .lampe.aus { background: var(--seite); }
.kontakt.aktiv .bild .lampe { outline-color: var(--gruen-zart); }
.kontakt.aktiv .bild .lampe.aus { background: var(--gruen-zart); }

/* ── Willkommen ── */
#willkommen { height: 100%; display: grid; place-items: center; overflow: auto; background: radial-gradient(circle at 80% 0%, var(--gruen-zart), transparent 55%) var(--boden); padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left)); }
.will-karte { width: min(400px, 100%); }
.marke { display: flex; align-items: center; gap: 10px; font: 600 15px var(--kopf); color: var(--leise); margin-bottom: 28px; }
.marke-zeichen { width: 34px; height: 34px; background: url('icon.png') center / contain no-repeat; }
#willkommen h1 { font-size: clamp(30px, 8vw, 40px); margin-bottom: 10px; }
.will-text { color: var(--leise); margin: 0 0 22px; }
#willkommen form { display: grid; gap: 8px; margin-bottom: 10px; }
#willkommen label { font-size: 13.5px; color: var(--leise); font-weight: 550; }
#willkommen input, #willkommen textarea { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 12px 14px; font-size: 16px; resize: none; }
#willkommen input:focus, #willkommen textarea:focus { outline: 0; border-color: var(--gruen); box-shadow: 0 0 0 3px var(--gruen-zart); }
#willkommen .knopf.haupt { padding: 12px 16px; font-size: 16px; border-radius: 12px; margin-top: 4px; }

/* ── Hauptfenster ── */
#haupt { height: 100%; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
#liste { background: var(--seite); color: var(--seite-tinte); display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; grid-template-areas: 'ich' 'neu' 'fehler' 'tipp' 'kontakte' 'fuss'; min-height: 0; border-right: 1px solid var(--linie); padding-left: env(safe-area-inset-left); }
header.ich { grid-area: ich; display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 10px 10px 16px; }
header.ich::before { content: ''; width: 40px; height: 40px; flex: none; border-radius: 11px; background: url('icon.png') center / contain no-repeat; }
.ich-karte { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; display: grid; color: inherit; }
.ich-name { font: 650 16px/1.2 var(--kopf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ich-karte .nummer { font-size: 13px; color: var(--seite-leise); }
.ich-karte .nummer::before { content: 'Nr. '; }
.ich-karte:hover .nummer { color: var(--gruen); }
.kontakt-neu { grid-area: neu; display: flex; gap: 6px; margin: 2px 12px 10px; padding: 3px 3px 3px 14px; background: var(--feld); border-radius: 999px; align-items: center; }
.kontakt-neu:focus-within { box-shadow: 0 0 0 2px var(--gruen); }
.kontakt-neu input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 7px 0; }
.kontakt-neu input::placeholder { color: var(--seite-leise); }
.rund.plus { width: 32px; height: 32px; background: var(--gruen); color: #fff; font-size: 20px; font-weight: 500; }
.rund.plus:hover { background: var(--gruen-tief); }
#kontakt-fehler { grid-area: fehler; }
#tipp { grid-area: tipp; margin: 0 12px 10px; padding: 12px 14px; border-radius: 14px; background: var(--hinweis); color: var(--hinweis-tinte); font-size: 13.5px; }
#tipp p { margin: 0 0 8px; }
#tipp .knopf { padding: 6px 14px; }
#tipp .link { color: inherit; opacity: .8; }
#kontakte { grid-area: kontakte; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding: 0 8px 8px; }
.gruppe { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 8px 4px; cursor: pointer; font-weight: 650; font-size: 12.5px; color: var(--seite-leise); }
.gruppe::before { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform .15s; margin-right: 2px; }
.gruppe.zu::before { transform: rotate(-45deg); }
.gruppe span { font-weight: 500; opacity: .8; }
.gruppe:focus-visible { outline: 2px solid var(--gruen); border-radius: 8px; }
.kontakt { width: 100%; display: flex; align-items: center; gap: 11px; padding: 7px 8px; border: 0; background: transparent; border-radius: 12px; text-align: left; color: inherit; }
.kontakt:hover { background: var(--seite-hoch); }
.kontakt.aktiv { background: var(--gruen-zart); }
.k-mitte { flex: 1; min-width: 0; display: grid; }
.k-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kontakt.fett .k-name { font-weight: 750; }
.kontakt.fern .k-name { color: var(--seite-leise); }
.k-letzte { font-size: 12.5px; color: var(--seite-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kontakt.fett .k-letzte { color: var(--seite-tinte); }
.k-rechts { display: grid; justify-items: end; gap: 3px; flex: none; }
.k-zeit { font-size: 11.5px; color: var(--seite-leise); font-variant-numeric: tabular-nums; }
.zahl { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gruen); color: #fff; font: 700 12px/20px var(--lauf); text-align: center; }
.liste-leer { color: var(--seite-leise); padding: 14px 8px; margin: 0; font-size: 13.5px; }
.fuss { grid-area: fuss; display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); position: relative; font-size: 12px; color: var(--seite-leise); }
.status-box { display: contents; }
#status-knopf { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 6px 12px 6px 8px; background: var(--feld); color: var(--tinte); font-size: 13.5px; font-weight: 550; }
#status-knopf:hover { background: var(--seite-hoch); }
#status-knopf svg { opacity: .6; transition: transform .15s; }
#status-knopf[aria-expanded="true"] svg { transform: rotate(180deg); }
#verbindung { margin-left: auto; }
#verbindung::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--weg); }
#verbindung.verbunden::before { background: var(--on); }
#verbindung.getrennt::before { background: var(--nst); }
#version { display: none; }

.menue { position: absolute; z-index: 20; color: var(--tinte); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; box-shadow: var(--schatten); padding: 6px; display: grid; min-width: 210px; }
.menue button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 9px; color: inherit; }
.menue button:hover { background: var(--seite-hoch); }
.menue .rot { color: var(--rot); }
#status-menue { left: 12px; bottom: calc(100% + 4px); }
#status-menue button { display: grid; grid-template-columns: 14px 1fr; align-items: center; column-gap: 8px; }
#status-menue small { grid-column: 2; font-size: 12px; color: var(--leise); }
#status-menue .gewaehlt { font-weight: 700; background: var(--gruen-zart); }
#chat-menue { right: 10px; top: calc(100% + 4px); }

/* ── Gespräch ── */
#chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--boden); padding-right: env(safe-area-inset-right); }
#chat.zieht::after { content: 'Loslassen zum Senden'; position: absolute; inset: 10px; border: 2px dashed var(--gruen); border-radius: 18px; display: grid; place-items: center; font: 600 18px var(--kopf); background: var(--boden); opacity: .94; pointer-events: none; z-index: 5; }
#leer { flex: 1; display: grid; place-items: center; padding: 24px; text-align: center; }
.leer-innen { max-width: 400px; }
.leer-gross { font: 600 17px var(--kopf); margin: 0 0 6px; color: var(--leise); }
.nummer.riesig { font: 700 clamp(46px, 9vw, 80px)/1 var(--kopf); letter-spacing: -.02em; margin: 0 0 20px; color: var(--gruen); }
.leer-klein { color: var(--leise); margin: 18px auto 0; max-width: 36ch; }
#gespraech { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#chat-kopf { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--linie); background: var(--flaeche); position: relative; }
#chat-kopf .bild .lampe { outline-color: var(--flaeche); }
#chat-kopf .bild .lampe.aus { background: var(--flaeche); }
#btn-zurueck { display: none; font-size: 26px; margin-left: -10px; }
.chat-wer { flex: 1; min-width: 0; display: grid; }
.chat-wer strong { font: 650 16px/1.25 var(--kopf); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-wer span { font-size: 12.5px; color: var(--leise); font-variant-numeric: tabular-nums; }
#anfrage { background: var(--hinweis); color: var(--hinweis-tinte); padding: 12px 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#anfrage p { margin: 0; font-weight: 600; }
#anfrage div { display: flex; gap: 8px; }
#verlauf { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px max(16px, calc((100% - 780px) / 2)); display: flex; flex-direction: column; outline: 0; scrollbar-width: thin; }
.verlauf-leer { margin: auto; color: var(--leise); }
.tag { align-self: center; font-size: 12px; color: var(--leise); margin: 12px 0 8px; padding: 3px 12px; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--linie); }
.zeile { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 8px; max-width: 100%; }
.zeile.ich { align-items: flex-end; }
.blase { order: 1; max-width: min(80%, 560px); background: var(--deine); border-radius: 18px 18px 18px 6px; padding: 8px 13px; box-shadow: 0 1px 1px rgba(22, 33, 27, .06); overflow-wrap: anywhere; }
.zeile.ich .blase { background: var(--meine); color: var(--meine-tinte); border-radius: 18px 18px 6px 18px; }
.z-kopf { order: 2; display: flex; gap: 5px; font-size: 11px; color: var(--leise); padding: 2px 6px 0; font-variant-numeric: tabular-nums; }
.z-wer { display: none; }
.haken.gel { color: var(--gelesen); font-weight: 700; }
.haken.fehler { color: var(--rot); font-weight: 800; }
.b-text { white-space: pre-wrap; }
.blase.nur-emoji { background: none !important; box-shadow: none; padding: 0 4px; }
.blase.nur-emoji .b-text { font-size: 42px; line-height: 1.15; }
.blase:has(.b-bild) { padding: 4px; }
.b-bild { display: block; max-width: 100%; max-height: 280px; border-radius: 14px; cursor: zoom-in; }
.b-datei { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-decoration: none; color: inherit; }
.d-zeichen { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; background: var(--gruen); color: #fff; display: grid; place-items: center; font-weight: 700; }
.d-name { font-weight: 600; }
.d-gr { font-size: 12px; opacity: .7; }
.zeile.neu .blase { animation: rein .22s cubic-bezier(.2, .9, .3, 1.15); transform-origin: bottom left; }
.zeile.ich.neu .blase { transform-origin: bottom right; }
@keyframes rein { from { opacity: 0; transform: scale(.92) translateY(6px); } }
#tippt { margin: 0; padding: 0 max(22px, calc((100% - 780px) / 2 + 6px)); height: 20px; font-size: 12.5px; color: var(--leise); }
#tippt.an::after { content: ' …'; display: inline-block; animation: punkte 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; white-space: pre; }
@keyframes punkte { from { width: 0; } to { width: 1.4em; } }
#emojis { margin: 0 14px 6px; padding: 8px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
#emojis button { border: 0; background: none; font-size: 22px; padding: 4px; border-radius: 9px; }
#emojis button:hover { background: var(--seite-hoch); }
#warte { margin: 4px 14px calc(14px + env(safe-area-inset-bottom)); padding: 12px 16px; border-radius: 16px; background: var(--hinweis); color: var(--hinweis-tinte); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#warte p { margin: 0; flex: 1 1 220px; }
#schreiben { display: flex; align-items: flex-end; gap: 2px; margin: 4px 14px calc(14px + env(safe-area-inset-bottom)); padding: 5px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 24px; transition: border-color .12s, box-shadow .12s; }
#schreiben:focus-within { border-color: var(--gruen); box-shadow: 0 0 0 3px var(--gruen-zart); }
#text { flex: 1; min-width: 0; border: 0; outline: 0; background: none; resize: none; padding: 8px 6px; max-height: 150px; line-height: 1.4; }
.rund.senden { background: var(--gruen); color: #fff; }
.rund.senden:hover { background: var(--gruen-tief); }
.rund.senden span { display: none; }
.rund.senden svg { width: 18px; height: 18px; }

/* ── Dialoge ── */
dialog { border: 0; border-radius: 20px; padding: 22px; width: min(440px, calc(100vw - 28px)); max-height: calc(100% - 20px); background: var(--flaeche); color: var(--tinte); box-shadow: var(--schatten); }
dialog::backdrop { background: rgba(17, 23, 20, .5); }
dialog h2 { font-size: 23px; margin-bottom: 10px; }
dialog p { margin: 0 0 12px; }
dialog .zu { position: absolute; right: 12px; top: 12px; font-size: 15px; }
dialog > .knopf.haupt { width: 100%; margin-top: 14px; padding: 11px; }
dialog input:not([type="checkbox"]) { flex: 1; min-width: 0; width: 100%; border: 1px solid var(--linie); background: var(--feld); border-radius: 10px; padding: 8px 12px; }
.code { display: block; font: 600 16px/1.7 var(--kopf); letter-spacing: .06em; background: var(--gruen-zart); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; user-select: all; overflow-wrap: anywhere; word-spacing: .15em; }
.feld { margin: 12px 0; display: grid; gap: 6px; }
.feld label, .feld-titel { font-size: 13px; color: var(--leise); font-weight: 600; }
.wahl { display: flex; background: var(--feld); border-radius: 10px; padding: 3px; gap: 2px; }
.wahl button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 7px; color: var(--tinte); }
.wahl button[aria-pressed="true"] { background: var(--flaeche); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); font-weight: 650; }
.schalter { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.schalter input { width: 18px; height: 18px; accent-color: var(--gruen); }
body:not(.desktop) .nur-desktop { display: none; }
#frage-text { white-space: pre-line; }
#dlg-frage .reihe { justify-content: flex-end; margin-top: 14px; }
#dlg-bild { padding: 10px; width: auto; max-width: calc(100vw - 20px); text-align: center; }
#bild-gross { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; display: block; margin-bottom: 10px; }
#meldung { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--tinte); color: var(--boden); padding: 9px 16px; border-radius: 999px; font-size: 13.5px; z-index: 50; box-shadow: var(--schatten); max-width: calc(100vw - 28px); }
#update { position: fixed; left: 12px; bottom: 60px; z-index: 40; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 12px; display: grid; gap: 8px; width: 276px; box-shadow: var(--schatten); font-weight: 550; }

@media (pointer: coarse) {
  body { font-size: 16px; }
  input, textarea, .kontakt-neu input, #text { font-size: 16px; }
  .rund { width: 44px; height: 44px; font-size: 21px; }
  .rund.plus { width: 40px; height: 40px; }
  .kontakt { padding: 9px 8px; }
  .bild { width: 42px; height: 42px; }
  .gruppe { padding: 14px 8px 6px; font-size: 13px; }
  .menue button { padding: 12px 14px; }
  #status-knopf { padding: 9px 14px 9px 10px; font-size: 15px; }
  .knopf { padding: 11px 18px; }
  #emojis { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); max-height: 34vh; overflow-y: auto; }
  #emojis button { font-size: 26px; padding: 6px; }
}
@media (max-height: 520px) {
  #liste { overflow-y: auto; display: block; }
  dialog { max-height: calc(100% - 8px); }
}

/* Desktop-Programm: die Fensterleiste gehört zum Fenster, oben bleibt ein Streifen zum Ziehen frei */
#ziehleiste { display: none; }
body.desktop #ziehleiste { display: block; position: fixed; top: 0; left: 0; right: 140px; height: 30px; z-index: 30; -webkit-app-region: drag; }
body.desktop header.ich { padding-top: 34px; }
body.desktop #chat { padding-top: 30px; }
body.desktop #chat-kopf { margin-top: -30px; padding-top: 34px; }
body.desktop #willkommen { padding-top: 44px; }
body.desktop dialog { -webkit-app-region: no-drag; }

@media (max-width: 620px) {
  #haupt { grid-template-columns: 1fr; }
  #liste { border-right: 0; padding-right: env(safe-area-inset-right); }
  #chat { display: none; padding-left: env(safe-area-inset-left); }
  body.im-chat #liste { display: none; }
  body.im-chat #chat { display: flex; }
  #btn-zurueck { display: grid; }
  #chat-kopf { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: 16px; }
  body.desktop #chat-kopf { padding-top: 34px; }
  .blase { max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Flächen: Tiefe statt flacher Farbe ── */
#chat { background:
  radial-gradient(var(--punkt) 1px, transparent 1.4px) 0 0 / 22px 22px,
  radial-gradient(900px 520px at 100% 0%, var(--gruen-zart), transparent 62%),
  radial-gradient(700px 480px at 0% 100%, var(--gruen-zart), transparent 58%),
  var(--boden); }
#liste { background: linear-gradient(180deg, var(--seite) 55%, var(--seite-hoch)); }
#chat-kopf { background: var(--glas); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); z-index: 3; }
#schreiben { background: var(--glas); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); box-shadow: var(--weich); }
.blase { box-shadow: var(--weich); position: relative; }
.zeile.ich .blase { background: linear-gradient(155deg, #3CB853, #268A3A); color: #fff; box-shadow: 0 1px 2px rgba(38, 138, 58, .3), 0 8px 20px rgba(38, 138, 58, .22); }
.zeile.ich .blase a { color: #fff; }
.zeile.ich .d-zeichen { background: #fff; color: #268A3A; }
.blase.nur-emoji { background: none !important; box-shadow: none !important; }
.bild { background-image: linear-gradient(145deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 60%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 2px 6px rgba(22, 33, 27, .16); }
.knopf.haupt, .rund.plus, .rund.senden { background-image: linear-gradient(155deg, #3CB853, #268A3A); border-color: transparent; box-shadow: 0 1px 2px rgba(38, 138, 58, .35), 0 6px 16px rgba(38, 138, 58, .25); }
.knopf.haupt:hover, .rund.plus:hover, .rund.senden:hover { filter: brightness(1.07); }
.knopf.rot, .knopf.haupt.rot { background-image: none; box-shadow: none; }
.kontakt { transition: background .12s; }
.kontakt.aktiv { background: linear-gradient(90deg, var(--gruen-zart), transparent 140%); box-shadow: inset 3px 0 0 var(--gruen); }
.tag { background: var(--glas); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--weich); border-color: transparent; }
dialog { box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
dialog::backdrop { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.menue { box-shadow: var(--schatten); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); background: var(--glas); }
header.ich::before { box-shadow: 0 4px 12px rgba(15, 14, 12, .3); }

/* ── Antworten, Reaktionen, Sprachnachricht ── */
.zitat { all: unset; box-sizing: border-box; display: grid; width: 100%; cursor: pointer; margin: 0 0 6px; padding: 5px 9px; border-left: 3px solid currentColor; border-radius: 8px; background: rgba(127, 127, 127, .16); font-size: 12.5px; line-height: 1.35; }
.zitat span { opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zeile.blitz .blase { animation: blitz 1.1s ease-out; }
@keyframes blitz { 0%, 40% { box-shadow: 0 0 0 4px var(--weg); } }
.blase.mit-rk { margin-bottom: 12px; }
.rk { position: absolute; left: 10px; bottom: -14px; display: flex; gap: 2px; padding: 1px 6px; border-radius: 999px; background: var(--flaeche); box-shadow: var(--weich); font-size: 14px; line-height: 1.5; color: var(--tinte); }
.zeile.ich .rk { left: auto; right: 10px; }
.z-uhr { opacity: .8; }
.b-ton { display: block; width: min(260px, 62vw); height: 40px; }
.blase.mit-ton { padding: 6px; }
#aktionen { position: fixed; min-width: 190px; z-index: 60; }
.rk-reihe { display: flex; gap: 2px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--linie); }
#aktionen .rk-reihe button { padding: 4px 6px; font-size: 22px; border-radius: 10px; line-height: 1.1; }
#aktionen .rk-reihe .gewaehlt { background: var(--gruen-zart); }
#antwort { display: flex; align-items: center; gap: 8px; margin: 0 14px 4px; padding: 6px 6px 6px 12px; border-left: 3px solid var(--gruen); border-radius: 12px; background: var(--glas); box-shadow: var(--weich); font-size: 13px; }
#antwort div { flex: 1; min-width: 0; display: grid; }
#antwort b { color: var(--gruen); }
#antwort span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--leise); }
#aufnahme { display: flex; align-items: center; gap: 10px; margin: 4px 14px calc(14px + env(safe-area-inset-bottom)); padding: 8px 8px 8px 16px; border-radius: 24px; background: var(--glas); border: 1px solid var(--linie); box-shadow: var(--weich); }
#aufnahme .rec-text { flex: 1; color: var(--leise); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rec-zeit { font-variant-numeric: tabular-nums; font-weight: 650; }
.rec-punkt { width: 11px; height: 11px; border-radius: 50%; background: var(--nst); animation: puls 1s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .25; } }
#schreiben.nimmt-auf { display: none; }
.wahl { flex-wrap: wrap; }

/* ── Gruppen ── */
.bild.gruppe-bild { border-radius: 50%; }
.zeile.mit-name .z-wer { display: inline; color: oklch(52% .13 calc(var(--ton, 200) * 1deg)); }
.zeile.mit-name .z-kopf { order: 0; padding: 0 6px 2px; font-size: 12px; }
.zeile.mit-name .z-zeit { opacity: .8; }
#gruppe-wahl { max-height: 40vh; overflow-y: auto; border: 1px solid var(--linie); border-radius: 12px; padding: 6px 12px; }
#form-gruppe .knopf.haupt { width: 100%; padding: 11px; }

/* ── Runde 1.3 ── */
#gespraech { position: relative; }
#btn-unten { position: absolute; right: 22px; bottom: 96px; z-index: 4; background: var(--flaeche); box-shadow: var(--schatten); width: 40px; height: 40px; }
#unten-zahl { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gruen); color: #fff; font: 700 12px/20px var(--lauf); }
.z-bearb { font-style: italic; opacity: .85; }
.rk span { white-space: nowrap; }

/* ── Kanäle, Erwähnungen, Pins ── */
#kanaele { display: flex; gap: 4px; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; background: var(--glas); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--linie); z-index: 2; }
#kanaele button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--leise); border-radius: 999px; padding: 5px 12px; font-weight: 550; font-size: 13.5px; }
#kanaele button:hover { background: var(--seite-hoch); color: var(--tinte); }
#kanaele button.aktiv { background: var(--gruen-zart); color: var(--tinte); font-weight: 700; }
#kanaele .ka-plus { font-size: 17px; padding: 3px 11px; }
.ka-neu { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gruen); color: #fff; font: 700 11px/18px var(--lauf); text-align: center; }
.erw { font-weight: 650; border-radius: 6px; padding: 0 4px; background: rgba(127, 127, 127, .18); }
.erw.mich { background: var(--weg); color: #2B2000; }
.zeile.ruf .blase { box-shadow: 0 0 0 2px var(--weg), var(--weich); }
#erw { position: static; margin: 0 14px 4px; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; }
#erw button { padding: 6px 12px; font-weight: 600; }
#btn-pins { width: auto; padding: 0 10px; font-size: 14px; border-radius: 999px; font-variant-numeric: tabular-nums; }
#pins-liste { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.pin-zeile { all: unset; box-sizing: border-box; display: grid; gap: 2px; width: 100%; cursor: pointer; padding: 10px 12px; border-radius: 12px; background: var(--feld); }
.pin-zeile:hover { background: var(--seite-hoch); }
.pin-zeile b { font-size: 12.5px; color: var(--gruen); }
.pin-zeile span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.z-pin { font-size: 10px; }

/* ── Anrufe ── */
#rufleiste { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 20px); padding: 10px 12px 10px 16px; border-radius: 22px; background: var(--tinte); color: var(--boden); box-shadow: var(--schatten); }
body.desktop #rufleiste { top: 40px; }
.ruf-wer { display: grid; min-width: 120px; }
.ruf-wer span { font-size: 12.5px; opacity: .8; font-variant-numeric: tabular-nums; }
#rufleiste .knopf { padding: 7px 14px; border-radius: 999px; }
#rufleiste .knopf:not(.haupt):not(.rot) { background: rgba(127, 127, 127, .3); border-color: transparent; color: inherit; }
#rufleiste .rec-punkt { background: var(--on); }
#btn-ruf.an { background: var(--gruen); color: #fff; }

/* ── Leiste mit anderen Diensten (nur Windows-Programm) ── */
#dienste { position: fixed; left: 0; top: 0; bottom: 0; width: 56px; z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 38px 0 10px; background: var(--seite-hoch); border-right: 1px solid var(--linie); overflow-y: auto; scrollbar-width: none; -webkit-app-region: no-drag; }
body.mit-diensten { padding-left: 56px; }
body.mit-diensten #ziehleiste { left: 56px; }
.dienst { position: relative; width: 40px; height: 40px; flex: none; border: 0; border-radius: 13px; display: grid; place-items: center; font: 700 13px var(--kopf); color: #fff; background: hsl(calc(var(--ton, 200) * 1deg) 42% 44%); background: oklch(56% .13 calc(var(--ton, 200) * 1deg)); background-image: linear-gradient(145deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 60%); transition: border-radius .15s, transform .1s; }
.dienst:hover { border-radius: 16px; transform: translateY(-1px); }
.dienst.aktiv { box-shadow: 0 0 0 2px var(--seite-hoch), 0 0 0 4px var(--gruen); }
.dienst.cito { background: url('icon.png') center / cover no-repeat; }
.dienst .zahl { position: absolute; right: -6px; top: -6px; font-style: normal; box-shadow: 0 0 0 2px var(--seite-hoch); }
#dienste-wahl { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
