/* Atarax Chat – Team-Chat (Slack-Ersatz). Farben laut brand/BRAND.md: Tinte #1F2348, Footer-Navy #1E2247, Gold #F0B856, Periwinkle #8A98DA, Grün #3FA57A */
@font-face { font-family: 'Inter Tight'; src: url('fonts/inter-tight-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Tight'; src: url('fonts/inter-tight-latin-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --tinte: #1F2348; --tinte2: #454B7C; --text2: #646A92; --navy: #1E2247; --navy2: #2B3062; --navy3: #3A4078;
  --gold: #F0B856; --gold2: #E9A944; --peri: #8A98DA; --peri2: #B4BEE4; --gruen: #3FA57A; --rot: #D4544F;
  --grund: #FFFFFF; --grund2: #F5F6FB; --linie: #E4E7F2; --hover: #F3F4FA; --mein: #EEF1FB;
  --app-h: 100dvh; --leiste: 300px; --r: 12px;
  --schrift: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--navy); overscroll-behavior: none; }
body { font-family: var(--schrift); color: var(--tinte); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: #2C5BD4; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app { height: var(--app-h); width: 100%; overflow: hidden; position: relative; }
#app.laden { display: grid; place-items: center; }
.lade-logo img { border-radius: 16px; animation: puls 1.4s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .55; transform: scale(.96); } }

/* ---------- Anmeldung ---------- */
.anmelden { min-height: var(--app-h); display: grid; place-items: center; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(120% 80% at 50% 0%, #2E3470 0%, var(--navy) 60%); color: #fff; overflow: auto; }
.anmelden form { width: min(380px, 100%); background: #fff; color: var(--tinte); border-radius: 20px; padding: 28px 24px 24px; box-shadow: 0 24px 60px rgba(5, 8, 30, .45); }
.anmelden .kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.anmelden .kopf img { width: 44px; height: 44px; border-radius: 11px; }
.anmelden h1 { font-size: 21px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.anmelden .unter { margin: 2px 0 0; color: var(--text2); font-size: 13.5px; }
.anmelden label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--tinte2); }
.anmelden input { width: 100%; height: 46px; border: 1px solid #D5DAEC; border-radius: 11px; padding: 0 14px; font-size: 16px; background: #fff; outline: none; }
.anmelden input:focus { border-color: var(--peri); box-shadow: 0 0 0 3px rgba(138, 152, 218, .25); }
.anmelden .knopf { margin-top: 20px; width: 100%; }
.anmelden .fehler { color: var(--rot); font-size: 13.5px; margin: 12px 0 0; min-height: 1em; }
.hinweis-karte { width: min(380px, 100%); margin-top: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: #E6E9F7; }
.hinweis-karte b { color: #fff; }
.anmelden-spalte { display: flex; flex-direction: column; align-items: center; }

.knopf { height: 44px; padding: 0 18px; border-radius: 11px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--tinte); color: #fff; transition: filter .15s, transform .1s; }
.knopf:hover { filter: brightness(1.15); }
.knopf:active { transform: scale(.98); }
.knopf.gold { background: linear-gradient(180deg, #F6C76E, #E9A944); color: #2A2440; }
.knopf.hell { background: var(--grund2); color: var(--tinte); border: 1px solid var(--linie); }
.knopf.klein { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.knopf:disabled { opacity: .5; cursor: default; filter: none; }

/* ---------- Grundaufbau ---------- */
.rahmen { display: grid; grid-template-columns: var(--leiste) 1fr; height: var(--app-h); }
.leiste { background: var(--navy); color: #DDE1F4; display: flex; flex-direction: column; min-width: 0; padding-top: env(safe-area-inset-top); }
.haupt { background: var(--grund); display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }

.leiste-kopf { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; }
.leiste-kopf .marke { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #fff; letter-spacing: -.01em; flex: 1; min-width: 0; }
.leiste-kopf .marke img { width: 28px; height: 28px; border-radius: 7px; }
.ich-knopf { border-radius: 50%; position: relative; }
.ich-knopf:focus-visible, .leiste button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.suche { margin: 2px 12px 10px; position: relative; }
.suche input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .07); color: #fff; padding: 0 12px 0 34px; outline: none; font-size: 14px; }
.suche input::placeholder { color: #9FA6CC; }
.suche input:focus { border-color: var(--peri); background: rgba(255, 255, 255, .1); }
.suche svg { position: absolute; left: 10px; top: 8px; width: 18px; height: 18px; color: #9FA6CC; }
.leiste-titel { font-size: 12.5px; font-weight: 600; color: #9FA6CC; padding: 10px 18px 6px; letter-spacing: .02em; }
.liste { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 0 1 auto; }
.eintrag { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: 10px; color: #DDE1F4; text-align: left; position: relative; }
.eintrag:hover { background: rgba(255, 255, 255, .06); }
.eintrag.aktiv { background: var(--navy3); color: #fff; }
.eintrag .infos { flex: 1; min-width: 0; }
.eintrag .name { display: block; font-weight: 550; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag .vorschau-text { display: block; font-size: 13px; color: #9FA6CC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.eintrag.neu .name { color: #fff; font-weight: 750; }
.eintrag.neu .vorschau-text { color: #D3D8F2; }
.zahl { min-width: 20px; height: 20px; border-radius: 10px; background: var(--gold); color: #2A2440; font-size: 12px; font-weight: 750; display: inline-grid; place-items: center; padding: 0 6px; flex: none; }
.leiste-fuss { margin-top: auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .08); display: flex; gap: 6px; }
.leiste-fuss button { flex: 1; display: flex; align-items: center; gap: 8px; color: #C3C9E8; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.leiste-fuss button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.banner { margin: 4px 12px 10px; padding: 10px 12px; border-radius: 11px; background: rgba(240, 184, 86, .14); border: 1px solid rgba(240, 184, 86, .35); color: #F9E4BC; font-size: 13px; line-height: 1.4; }
.banner button { margin-top: 8px; }
.banner .x { float: right; color: #F9E4BC; opacity: .7; margin: -2px -2px 0 6px; font-size: 16px; line-height: 1; }

/* Profilbild */
.ava { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; position: relative; background-size: cover; background-position: center; }
.ava.klein { width: 30px; height: 30px; font-size: 12.5px; }
.ava.gross { width: 40px; height: 40px; font-size: 15px; border-radius: 10px; }
.ava .punkt { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #7C82A8; border: 2.5px solid var(--navy); }
.ava .punkt.an { background: var(--gruen); }
.haupt .ava .punkt { border-color: #fff; }

/* ---------- Gespräch ---------- */
.kopfzeile { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 max(18px, calc((100% - var(--spalte)) / 2 + 16px)); border-bottom: 1px solid var(--linie); background: #fff; flex: none; padding-top: 0; }
.kopfzeile .wer { flex: 1; min-width: 0; }
.kopfzeile .wer b { display: block; font-size: 16.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopfzeile .wer span { display: block; font-size: 12.5px; color: var(--text2); }
.zurueck { display: none; width: 40px; height: 40px; margin-left: -10px; border-radius: 10px; place-items: center; color: var(--tinte); }
.zurueck .zahl { position: absolute; margin: -18px 0 0 22px; font-size: 11px; height: 18px; min-width: 18px; }
.kopf-knopf { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--tinte2); }
.kopf-knopf:hover { background: var(--hover); }

.verlauf { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0 8px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Spalte mittig und begrenzt wie der Chat in Atarax (Wunsch Nikolaus 09.11.2026); Kopfzeile, Tippen und Eingabe fluchten mit ihr */
:root { --spalte: 820px; }
.verlauf-innen { max-width: var(--spalte); margin: 0 auto; }
.mehr-laden { text-align: center; padding: 10px; color: var(--text2); font-size: 13px; }
.leer { color: var(--text2); text-align: center; padding: 48px 24px; font-size: 14.5px; }
.leer .ava { margin: 0 auto 12px; width: 64px; height: 64px; font-size: 24px; }
.leer b { display: block; color: var(--tinte); font-size: 17px; margin-bottom: 4px; }
.tag { display: flex; align-items: center; gap: 12px; margin: 16px 18px 6px; color: var(--text2); font-size: 12.5px; font-weight: 650; }
.tag::before, .tag::after { content: ''; height: 1px; background: var(--linie); flex: 1; }
.neu-linie { display: flex; align-items: center; gap: 10px; margin: 6px 18px; color: var(--rot); font-size: 12px; font-weight: 700; }
.neu-linie::before { content: ''; height: 1px; background: var(--rot); flex: 1; opacity: .7; }

.n { display: flex; gap: 10px; padding: 4px 18px 4px 16px; position: relative; }
.n.erste { margin-top: 8px; padding-top: 6px; }
.n:hover { background: var(--hover); border-radius: 10px; }
.n .seite { width: 36px; flex: none; }
.n .zeit-klein { visibility: hidden; font-size: 11px; color: var(--text2); text-align: right; padding-top: 3px; white-space: nowrap; display: block; }
.n:hover .zeit-klein { visibility: visible; }
.n .inhalt { flex: 1; min-width: 0; }
.n .meta { display: flex; align-items: baseline; gap: 8px; }
.n .meta b { font-weight: 750; font-size: 15px; }
.n .meta time { font-size: 12px; color: var(--text2); }
.n .text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.n .text.gross { font-size: 34px; line-height: 1.25; }
.n .text code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; background: #F1F2F8; border: 1px solid #E2E5F1; border-radius: 5px; padding: 1px 4px; color: #C0365B; }
.n .text pre { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; background: #F6F7FB; border: 1px solid #E2E5F1; border-radius: 8px; padding: 10px 12px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.n .text blockquote { margin: 2px 0; padding-left: 10px; border-left: 3px solid var(--peri2); color: var(--tinte2); }
.n .text .emo { font-family: var(--emoji); }
.n .zusatz { font-size: 12px; color: var(--text2); }
.n.geloescht .text { color: var(--text2); font-style: italic; }
.n.ausstehend { opacity: .55; }
.n.fehlgeschlagen .text { color: var(--rot); }
.n .nochmal { font-size: 12.5px; color: var(--rot); text-decoration: underline; margin-top: 2px; }
.n.markiert { animation: markiert 2.4s ease-out; }
@keyframes markiert { 0%, 40% { background: #FFF4D6; } 100% { background: transparent; } }
.gesehen { font-size: 11.5px; color: var(--text2); padding: 2px 18px 0 62px; }

/* Reaktionen */
.reaktionen { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.reaktion { height: 26px; padding: 0 8px; border-radius: 13px; border: 1px solid var(--linie); background: #F4F5FA; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--tinte2); }
.reaktion .emo { font-family: var(--emoji); font-size: 15px; }
.reaktion.mein { background: #E9EEFF; border-color: #A9B6EA; color: #2C3A8C; }
.reaktion:hover { border-color: var(--peri); }
.reaktion.plus { padding: 0 7px; color: var(--text2); }

/* Aktionen beim Überfahren (Desktop) */
.aktionen { position: absolute; right: 18px; top: -14px; display: none; background: #fff; border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 4px 14px rgba(20, 26, 70, .12); padding: 2px; z-index: 3; }
.n:hover .aktionen, .n:focus-within .aktionen { display: flex; }
.aktionen button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; color: var(--tinte2); }
.aktionen button:hover { background: var(--hover); }
.aktionen .emo { font-family: var(--emoji); }
.aktionen .trenn { width: 1px; background: var(--linie); margin: 5px 2px; }

/* Anhänge */
.anhaenge { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-width: 520px; }
.bild { border-radius: 10px; overflow: hidden; background: #EEF0F7; display: block; max-width: min(100%, 380px); position: relative; border: 1px solid var(--linie); }
.bild img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; object-fit: cover; cursor: zoom-in; }
.anhaenge.mehrere .bild { width: calc(50% - 3px); max-width: 230px; aspect-ratio: 1; }
.anhaenge.mehrere .bild img { width: 100%; height: 100%; max-height: none; }
.video { border-radius: 10px; overflow: hidden; background: #000; max-width: min(100%, 420px); border: 1px solid var(--linie); }
.video video { display: block; width: 100%; max-height: 420px; background: #000; }
/* Sprachnachricht abspielen */
.audio { display: flex; align-items: center; gap: 10px; border: 1px solid var(--linie); border-radius: 22px; padding: 6px 14px 6px 6px; background: #fff; width: min(100%, 340px); }
.audio .play { width: 34px; height: 34px; border-radius: 50%; background: var(--tinte); color: #fff; display: grid; place-items: center; flex: none; }
.audio .play .i { width: 16px; height: 16px; }
.audio .balken { flex: 1; height: 26px; display: flex; align-items: center; cursor: pointer; position: relative; }
.audio .balken::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: #E2E5F1; }
.audio .voll { position: relative; height: 4px; border-radius: 2px; background: var(--peri); width: 0; }
.audio .zeit { font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; flex: none; min-width: 34px; text-align: right; }
.audio .tempo { font-size: 12px; font-weight: 700; color: var(--tinte2); background: var(--grund2); border-radius: 10px; padding: 2px 7px; flex: none; }
.datei { display: flex; align-items: center; gap: 10px; border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; background: #fff; text-decoration: none; color: var(--tinte); min-width: 220px; max-width: 360px; }
.datei:hover { border-color: var(--peri); }
.datei .symbol { width: 36px; height: 36px; border-radius: 8px; background: var(--grund2); display: grid; place-items: center; color: var(--tinte2); flex: none; }
.datei .dn { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.datei .dg { font-size: 12px; color: var(--text2); }
.datei .info { min-width: 0; flex: 1; }

/* Link-Vorschau */
.link-karte { margin-top: 6px; border-left: 3px solid var(--peri2); padding: 2px 0 2px 12px; max-width: 480px; }
.link-karte .seite { font-size: 12.5px; font-weight: 700; color: var(--tinte2); }
.link-karte a.titel { display: block; font-weight: 650; color: #2C5BD4; text-decoration: none; margin: 1px 0; }
.link-karte a.titel:hover { text-decoration: underline; }
.link-karte .beschr { font-size: 13.5px; color: var(--tinte2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-karte img { margin-top: 6px; max-width: min(100%, 360px); max-height: 200px; border-radius: 8px; display: block; border: 1px solid var(--linie); object-fit: cover; }
.yt { position: relative; margin-top: 6px; max-width: 420px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; display: block; width: 100%; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .9; margin: 0; border: 0; max-height: none; max-width: none; border-radius: 0; }
.yt .play { position: absolute; inset: 0; display: grid; place-items: center; }
.yt .play span { width: 64px; height: 44px; border-radius: 12px; background: rgba(220, 30, 30, .92); display: grid; place-items: center; color: #fff; }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.knopf-link { margin-top: 8px; }

/* Tippt */
.tippt { width: 100%; max-width: var(--spalte); margin: 0 auto; height: 22px; padding: 0 18px 2px; font-size: 12.5px; color: var(--text2); flex: none; }
.tippt i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--text2); margin-right: 3px; animation: tipp 1s infinite; vertical-align: middle; }
.tippt i:nth-child(2) { animation-delay: .15s; } .tippt i:nth-child(3) { animation-delay: .3s; margin-right: 7px; }
@keyframes tipp { 50% { opacity: .2; transform: translateY(-2px); } }
.runter { position: absolute; left: 50%; transform: translateX(-50%); bottom: 120px; background: var(--tinte); color: #fff; border-radius: 18px; height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; box-shadow: 0 6px 18px rgba(20, 26, 70, .25); z-index: 4; }

/* Eingabe: rund wie bei ChatGPT (Wunsch Nikolaus 09.11.2026) – + links, Text, Emoji, Mikrofon, runder Senden-Knopf */
.eingabe { width: 100%; max-width: var(--spalte); margin: 0 auto; padding: 0 18px calc(14px + env(safe-area-inset-bottom)); flex: none; }
.eingabe-box { border: 1px solid #D9DDEE; border-radius: 28px; background: #fff; padding: 6px; box-shadow: 0 1px 2px rgba(20, 26, 70, .04), 0 6px 20px rgba(20, 26, 70, .06); transition: border-color .15s, box-shadow .15s; }
.eingabe-box:focus-within { border-color: #C3C9E8; box-shadow: 0 1px 2px rgba(20, 26, 70, .05), 0 8px 26px rgba(20, 26, 70, .10); }
.eingabe-box.ziehen { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 184, 86, .3); }
.eingabe .zeile { display: flex; align-items: flex-end; gap: 2px; }
.eingabe textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; padding: 9px 6px; max-height: 40vh; min-height: 40px; line-height: 1.45; font-size: 15.5px; background: transparent; display: block; }
.eingabe .zeile > button, .eingabe .zeile > .rund { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--tinte2); flex: none; }
.eingabe .zeile > button:hover { background: var(--hover); }
.eingabe .zeile > button .i { width: 21px; height: 21px; }
.eingabe .senden, .eingabe .ab-senden { background: var(--tinte); color: #fff !important; }
.eingabe .senden:disabled { background: #D6DAEA; color: #fff; cursor: default; }
.eingabe .senden:hover:not(:disabled), .eingabe .ab-senden:hover { background: var(--navy3) !important; }
/* Sprachnachricht aufnehmen */
.eingabe .aufnahme { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px; }
.eingabe .rec-punkt { width: 10px; height: 10px; border-radius: 50%; background: #E5484D; flex: none; animation: rec 1.2s infinite; }
@keyframes rec { 50% { opacity: .25; } }
.eingabe .rec-zeit { font-variant-numeric: tabular-nums; font-size: 14.5px; color: var(--tinte); flex: none; min-width: 38px; }
.eingabe .pegel { flex: 1; min-width: 0; height: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; }
.eingabe .pegel i { width: 3px; border-radius: 2px; background: var(--peri); flex: none; min-height: 3px; }
.eingabe .verwerfen { color: var(--rot) !important; }
.nur-lesen { padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); color: var(--text2); font-size: 13.5px; text-align: center; border-top: 1px solid var(--linie); }
.ablage { display: flex; gap: 8px; padding: 10px 10px 0; flex-wrap: wrap; }
.ablage .stueck { width: 72px; height: 72px; border-radius: 10px; background: var(--grund2); border: 1px solid var(--linie); position: relative; overflow: hidden; display: grid; place-items: center; font-size: 11px; color: var(--text2); text-align: center; padding: 4px; }
.ablage .stueck img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ablage .stueck .fort { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--gold); transition: width .2s; }
.ablage .stueck .weg { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(20, 24, 60, .75); color: #fff; display: grid; place-items: center; font-size: 13px; z-index: 2; }
.ablage .stueck.fehler { border-color: var(--rot); color: var(--rot); }
.ablage .stueck .nm { position: relative; z-index: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-all; }
.vorschlaege { position: absolute; left: 18px; right: 18px; bottom: calc(100% + 6px); background: #fff; border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 26, 70, .16); max-height: 260px; overflow-y: auto; padding: 4px; z-index: 6; }
.vorschlaege button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-align: left; font-size: 14px; }
.vorschlaege button.an, .vorschlaege button:hover { background: var(--hover); }
.vorschlaege .emo { font-family: var(--emoji); font-size: 20px; width: 26px; text-align: center; }
.eingabe { position: relative; }

/* Platzhalter rechts ohne Gespräch */
.willkommen { flex: 1; display: grid; place-items: center; color: var(--text2); text-align: center; padding: 24px; }
.willkommen img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 12px; }

/* Suche */
.treffer-liste { flex: 1; overflow-y: auto; padding: 8px 0; }
.treffer { display: flex; gap: 10px; padding: 10px 18px; width: 100%; text-align: left; border-bottom: 1px solid var(--grund2); }
.treffer:hover { background: var(--hover); }
.treffer .tt { font-size: 13px; color: var(--text2); }
.treffer .ts { margin-top: 2px; overflow-wrap: anywhere; }
.treffer mark { background: #FFE7A8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* Schichten: Menü, Emoji-Auswahl, Bildansicht, Einstellungen */
.schicht { position: fixed; inset: 0; z-index: 30; }
.schicht.dunkel { background: rgba(10, 13, 40, .55); display: grid; place-items: center; padding: 18px; }
.popup { position: fixed; z-index: 31; background: #fff; border: 1px solid var(--linie); border-radius: 14px; box-shadow: 0 16px 40px rgba(14, 18, 60, .22); }
.emoji-wahl { width: 340px; max-width: calc(100vw - 16px); height: 380px; max-height: calc(var(--app-h) - 120px); display: flex; flex-direction: column; overflow: hidden; }
.emoji-wahl input { margin: 10px 10px 6px; height: 36px; border: 1px solid var(--linie); border-radius: 9px; padding: 0 12px; outline: none; }
.emoji-wahl input:focus { border-color: var(--peri); }
.emoji-wahl .tabs { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--linie); overflow-x: auto; scrollbar-width: none; }
.emoji-wahl .tabs button { font-size: 12px; padding: 4px 8px; border-radius: 7px; color: var(--text2); white-space: nowrap; font-weight: 600; }
.emoji-wahl .tabs button.an { background: var(--grund2); color: var(--tinte); }
.emoji-wahl .gitter { flex: 1; overflow-y: auto; padding: 6px 8px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); align-content: start; }
.emoji-wahl .gitter button { height: 36px; font-size: 22px; border-radius: 8px; font-family: var(--emoji); }
.emoji-wahl .gitter button:hover { background: var(--hover); }
.emoji-wahl .gitter h4 { grid-column: 1 / -1; margin: 8px 4px 4px; font-size: 12px; color: var(--text2); font-weight: 650; }
.schnell { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--linie); }
.schnell button { flex: 1; height: 40px; font-size: 24px; border-radius: 10px; font-family: var(--emoji); }
.schnell button:hover { background: var(--hover); }

.blatt { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 10px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(14, 18, 60, .2); animation: hoch .18s ease-out; }
@keyframes hoch { from { transform: translateY(30px); opacity: .5; } }
.blatt .griff { width: 36px; height: 4px; border-radius: 2px; background: #D5D9EA; margin: 2px auto 8px; }
.blatt .zeile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border-radius: 10px; font-size: 16px; text-align: left; }
.blatt .zeile:active, .blatt .zeile:hover { background: var(--hover); }
.blatt .zeile.rot { color: var(--rot); }

.lichtbox { position: fixed; inset: 0; z-index: 40; background: rgba(6, 8, 24, .94); display: flex; flex-direction: column; }
.lichtbox .lb-kopf { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; }
.lichtbox .lb-kopf span { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.lichtbox .lb-kopf a, .lichtbox .lb-kopf button { color: #fff; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; }
.lichtbox .lb-kopf a:hover, .lichtbox .lb-kopf button:hover { background: rgba(255, 255, 255, .12); }
.lichtbox .lb-bild { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
.lichtbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.dialog { background: #fff; border-radius: 18px; width: min(460px, 100%); max-height: calc(var(--app-h) - 36px); overflow-y: auto; box-shadow: 0 24px 60px rgba(5, 8, 30, .45); }
.dialog .dk { display: flex; align-items: center; padding: 16px 18px 6px; }
.dialog .dk h2 { flex: 1; margin: 0; font-size: 18px; }
.dialog section { padding: 10px 18px 14px; border-top: 1px solid var(--grund2); }
.dialog section:first-of-type { border-top: 0; }
.dialog h3 { margin: 4px 0 8px; font-size: 13px; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.dialog p { margin: 4px 0 10px; font-size: 14px; color: var(--tinte2); }
.dialog .reihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.geraet { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grund2); font-size: 14px; }
.geraet .gi { flex: 1; min-width: 0; }
.geraet .gi small { display: block; color: var(--text2); font-size: 12px; }
.status { font-size: 13px; padding: 3px 9px; border-radius: 12px; font-weight: 600; background: var(--grund2); color: var(--tinte2); display: inline-block; }
.status.an { background: #E3F4EC; color: #23714F; }
.status.aus { background: #FBE9E8; color: #A33A36; }
.segment { display: inline-flex; background: var(--grund2); border-radius: 10px; padding: 3px; }
.segment button { padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text2); }
.segment button.an { background: #fff; color: var(--tinte); box-shadow: 0 1px 3px rgba(20, 26, 70, .12); }
.meldung { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--tinte); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px rgba(5, 8, 30, .35); max-width: calc(100vw - 32px); }
.offline { position: absolute; top: 0; left: 0; right: 0; z-index: 8; background: #FFF4D6; color: #6B4E12; text-align: center; font-size: 12.5px; padding: 4px; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  .rahmen { grid-template-columns: 1fr; }
  .rahmen .leiste, .rahmen .haupt { grid-row: 1; grid-column: 1; }
  .rahmen.im-gespraech .leiste { display: none; }
  .rahmen:not(.im-gespraech) .haupt { display: none; }
  .zurueck { display: grid; position: relative; }
  .kopfzeile { height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-left: 12px; padding-right: 12px; }
  .eintrag { padding: 11px 10px; }
  .eintrag .ava { width: 44px; height: 44px; font-size: 16px; }
  .eintrag .name { font-size: 16.5px; }
  .eintrag .vorschau-text { font-size: 14px; }
  .leiste-titel { padding-top: 6px; }
  .n { padding-left: 12px; padding-right: 12px; }
  .n .seite { width: 34px; }
  .aktionen { display: none !important; }
  .eingabe { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .eingabe textarea { font-size: 16px; }
  .gesehen { padding-left: 56px; }
  .runter { bottom: 104px; right: 14px; }
  .emoji-wahl { position: fixed; left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: 100%; max-width: none; height: 52vh; border-radius: 18px 18px 0 0; }
  .vorschlaege { left: 10px; right: 10px; }
  .n .text { -webkit-user-select: none; user-select: none; }
}
@media (hover: none) { .n:hover { background: transparent; } .n:hover .zeit-klein { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (hover: none) { .eingabe textarea { font-size: 16px; } .eingabe .emoji-knopf { display: none; } }   /* iOS zoomt sonst beim Antippen; Handys haben Emojis in der Tastatur */
