/* RSGCChat – eigenes Design (Mint/Lagune wie das Logo) */
:root {
  --bg: #0a1311;
  --rail: #0d1816;
  --panel: #101c19;
  --panel2: #15231f;
  --hover: #1a2a26;
  --active: #1f332e;
  --line: #1d2d29;
  --text: #e6efec;
  --muted: #8aa29a;
  --faint: #5f7770;
  --accent: #1cc59c;
  --accent-ink: #04140f;
  --accent-soft: rgba(28, 197, 156, .14);
  --lagoon: #1884e6;
  --out: #0e4d40;
  --in: #172420;
  --chat: #08100e;
  --pattern: rgba(255, 255, 255, .025);
  --tick: #53bdf5;
  --danger: #f0596b;
  --warn: #f2b84b;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Color Emoji", "Segoe UI Emoji", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e9efed;
  --rail: #f3f6f5;
  --panel: #ffffff;
  --panel2: #f4f7f6;
  --hover: #f0f4f3;
  --active: #e3ece9;
  --line: #e2e9e6;
  --text: #0f1c19;
  --muted: #5c706a;
  --faint: #8c9d98;
  --accent: #0fa883;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 168, 131, .12);
  --out: #d2f4e7;
  --in: #ffffff;
  --chat: #e7eeea;
  --pattern: rgba(0, 40, 30, .035);
  --tick: #1a95e0;
  --shadow: 0 10px 40px rgba(10, 40, 30, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 14.5px/1.4 var(--font);
  overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.fs-small { font-size: 13.5px; } body.fs-large { font-size: 16px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
svg.i { width: 22px; height: 22px; fill: currentColor; flex: none; display: block; }
svg.i.s { width: 18px; height: 18px; }
svg.i.xs { width: 15px; height: 15px; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(127, 150, 140, .28); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

#boot { position: fixed; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
#boot img { width: 84px; height: 84px; margin: auto; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------------------------------------------------------------- Anmeldung */
.auth { position: fixed; inset: 0; overflow: auto; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(28, 197, 156, .18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(24, 132, 230, .18), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 30px 28px; box-shadow: var(--shadow); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-logo img { width: 48px; height: 48px; }
.auth-logo b { font-size: 22px; letter-spacing: .2px; }
.auth-logo small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.auth h2 { margin: 6px 0 4px; font-size: 19px; }
.auth p.sub { margin: 0 0 18px; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 80px; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { width: 112px; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); transition: filter .15s, transform .05s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.auth .switch { margin-top: 16px; text-align: center; color: var(--muted); }
.auth .switch button { color: var(--accent); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check input { margin-top: 2px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.err { background: rgba(240, 89, 107, .12); color: var(--danger); border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; font-size: 13.5px; }
.note { background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; font-size: 13px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--faint); }
.auth-foot a { color: var(--faint); margin: 0 6px; }
.pw-meter { height: 4px; border-radius: 4px; background: var(--line); margin-top: 6px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }

/* ---------------------------------------------------------------- Grundgerüst */
.shell { position: fixed; inset: 0; display: grid; grid-template-columns: 68px minmax(320px, 410px) 1fr; background: var(--bg); }
.shell.info-open { grid-template-columns: 68px minmax(320px, 410px) 1fr minmax(320px, 390px); }
.rail { background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; }
.rail .logo { width: 38px; height: 38px; margin-bottom: 10px; }
.rail-btn { position: relative; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.rail-btn:hover { background: var(--hover); color: var(--text); }
.rail-btn.on { background: var(--accent-soft); color: var(--accent); }
.rail-btn .badge { position: absolute; top: 4px; right: 2px; }
.rail .grow { flex: 1; }
.rail .me-av { margin-top: 4px; }

.pane { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-head { height: 62px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; }
.pane-head h1 { font-size: 21px; margin: 0; flex: 1; font-weight: 700; letter-spacing: .1px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; transition: background .15s, color .15s; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); }
.search { margin: 0 12px 8px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { width: 100%; background: var(--panel2); border: 1px solid transparent; border-radius: 10px; padding: 9px 12px 9px 40px; outline: none; }
.search input:focus { border-color: var(--accent); }
.chips { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 6px 13px; border-radius: 20px; background: var(--panel2); color: var(--muted); font-size: 13.5px; white-space: nowrap; transition: background .15s; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.list { flex: 1; overflow-y: auto; min-height: 0; }
.empty { padding: 40px 26px; text-align: center; color: var(--muted); }
.empty svg { width: 54px; height: 54px; margin: 0 auto 12px; opacity: .55; }

.row { display: flex; align-items: center; gap: 13px; padding: 9px 14px 9px 16px; cursor: pointer; position: relative; transition: background .12s; }
.row:hover { background: var(--hover); }
.row.on { background: var(--active); }
.row .body { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding: 3px 0 10px; margin-bottom: -10px; }
.row:last-child .body { border-bottom-color: transparent; }
.row .top, .row .bot { display: flex; align-items: center; gap: 6px; }
.row .name { flex: 1; min-width: 0; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .time { font-size: 12px; color: var(--faint); flex: none; }
.row.unread .time { color: var(--accent); font-weight: 600; }
.row .prev { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.row .prev .txt { overflow: hidden; text-overflow: ellipsis; }
.row .prev.typing { color: var(--accent); font-weight: 500; }
.row .meta { display: flex; gap: 4px; align-items: center; color: var(--faint); flex: none; }
.row .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.compact { padding-top: 7px; padding-bottom: 7px; }
.row .act { opacity: 0; transition: opacity .15s; }
.row:hover .act { opacity: 1; }
.row.archive-row { color: var(--accent); font-weight: 600; }
.row.archive-row .ic { width: 50px; display: grid; place-items: center; }
.sec-title { padding: 14px 18px 6px; color: var(--accent); font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: .2px; }
.badge { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.muted { background: var(--faint); color: var(--panel); }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; }

.av { width: 50px; height: 50px; border-radius: 50%; flex: none; background: var(--panel2); display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 700; font-size: 18px; position: relative; user-select: none; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 40px; height: 40px; font-size: 15px; }
.av.xs { width: 30px; height: 30px; font-size: 12px; }
.av.lg { width: 140px; height: 140px; font-size: 48px; }
.av.xl { width: 200px; height: 200px; font-size: 68px; }
.av svg { width: 60%; height: 60%; opacity: .9; }
.av-wrap { position: relative; flex: none; }
.av-wrap .online { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2.5px solid var(--panel); }
.ring { padding: 3px; border-radius: 50%; background: conic-gradient(var(--accent), var(--lagoon), var(--accent)); }
.ring.seen { background: var(--faint); }
.ring > .av { border: 2.5px solid var(--panel); }

/* ---------------------------------------------------------------- Chat */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat); position: relative; }
.chat::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 1;
  background-image: radial-gradient(var(--pattern) 1.2px, transparent 1.3px), radial-gradient(var(--pattern) 1.2px, transparent 1.3px);
  background-size: 26px 26px; background-position: 0 0, 13px 13px; }
.chat-head { height: 62px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 2; }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.chat-head .who .t { min-width: 0; }
.chat-head .nm { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.chat-head .st { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .st.typing { color: var(--accent); }
.chat-head .back { display: none; }
.lock { color: var(--accent); }
.row .name .lock svg { display: inline-block; vertical-align: -2px; }
.chat-head .nm .lock svg { display: block; }
.welcome { flex: 1; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 30px; position: relative; z-index: 1; }
.welcome img { width: 110px; height: 110px; margin: 0 auto 18px; opacity: .95; }
.welcome h2 { color: var(--text); margin: 0 0 8px; font-weight: 600; font-size: 26px; }
.welcome p { max-width: 460px; margin: 0 auto 6px; }
.welcome .e2e-note { margin-top: 26px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--faint); }

.msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 6% 8px; position: relative; z-index: 1; overscroll-behavior: contain; }
.day { text-align: center; margin: 12px 0 10px; position: sticky; top: 4px; z-index: 3; }
.day span { display: inline-block; background: var(--panel); color: var(--muted); font-size: 12.5px; padding: 5px 12px; border-radius: 9px; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.unread-sep { text-align: center; margin: 10px -6%; background: rgba(127, 150, 140, .1); color: var(--accent); padding: 5px; font-size: 13px; font-weight: 600; }
.sys { text-align: center; margin: 8px 0; }
.sys span { display: inline-block; background: var(--panel); color: var(--muted); font-size: 12.5px; padding: 6px 12px; border-radius: 9px; max-width: 85%; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.sys.e2e span { background: rgba(242, 184, 75, .12); color: var(--warn); display: inline-flex; gap: 6px; align-items: flex-start; text-align: left; cursor: pointer; }
.m { display: flex; margin: 2px 0; position: relative; }
.m.out { justify-content: flex-end; }
.m.first { margin-top: 8px; }
.m .av-g { width: 32px; margin-right: 6px; flex: none; align-self: flex-start; }
.bub { position: relative; max-width: 100%; background: var(--in); border-radius: 10px; padding: 6px 9px 7px; box-shadow: 0 1px 1px rgba(0, 0, 0, .14); word-wrap: break-word; overflow-wrap: anywhere; min-width: 80px; }
.m.out .bub { background: var(--out); }
.m.first.in .bub { border-top-left-radius: 3px; }
.m.first.out .bub { border-top-right-radius: 3px; }
.m.hl .bub { animation: hl 1.6s ease; }
@keyframes hl { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } }
.bub .sender { font-size: 13px; font-weight: 600; margin-bottom: 2px; display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.bub .sender small { color: var(--faint); font-weight: 400; font-size: 12px; }
.bub .text { white-space: pre-wrap; }
.bub .text.big { font-size: 40px; line-height: 1.15; }
.bub .text code { font-family: ui-monospace, Consolas, monospace; background: rgba(127, 127, 127, .16); padding: 1px 4px; border-radius: 4px; font-size: .92em; }
.bub .text pre { font-family: ui-monospace, Consolas, monospace; background: rgba(0, 0, 0, .18); padding: 8px; border-radius: 6px; margin: 4px 0; white-space: pre-wrap; font-size: .9em; }
.bub .foot { float: right; margin: 6px 0 -4px 10px; font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; position: relative; top: 2px; white-space: nowrap; }
.bub .foot .tk { color: var(--faint); }
.bub .foot .tk.read { color: var(--tick); }
.bub .foot .edited { font-style: italic; }
.bub.media { padding: 3px; }
.bub.media .foot.over { position: absolute; right: 8px; bottom: 7px; background: rgba(0, 0, 0, .45); color: #fff; padding: 2px 6px; border-radius: 8px; margin: 0; float: none; top: auto; }
.bub.media .foot.over .tk { color: #fff; } .bub.media .foot.over .tk.read { color: #7fd3ff; }
.bub.media .cap { padding: 4px 6px 2px; }
.bub img.pic, .bub video.pic { display: block; max-width: 100%; width: 330px; max-height: 420px; object-fit: cover; border-radius: 8px; cursor: pointer; background: rgba(0, 0, 0, .2); }
.bub .sticker { width: 160px; height: 160px; object-fit: contain; }
.bub.sticker-b { background: transparent !important; box-shadow: none; }
.bub .fwd { font-size: 12.5px; color: var(--muted); font-style: italic; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.bub .deleted { color: var(--muted); font-style: italic; display: flex; gap: 6px; align-items: center; }
.quote { background: rgba(0, 0, 0, .16); border-left: 4px solid var(--accent); border-radius: 7px; padding: 5px 9px; margin: 0 0 5px; cursor: pointer; font-size: 13.5px; display: flex; gap: 8px; align-items: center; overflow: hidden; }
:root[data-theme="light"] .quote { background: rgba(0, 0, 0, .05); }
.quote .q { flex: 1; min-width: 0; }
.quote b { display: block; font-size: 13px; color: var(--accent); }
.quote .qt { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.quote img { width: 44px; height: 44px; object-fit: cover; border-radius: 5px; flex: none; }
.filecard { display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, .14); border-radius: 8px; padding: 9px 10px; min-width: 230px; text-decoration: none; color: inherit; cursor: pointer; }
.filecard .ext { width: 38px; height: 46px; border-radius: 6px; background: var(--lagoon); color: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; text-transform: uppercase; }
.filecard .fn { flex: 1; min-width: 0; }
.filecard .fn b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.filecard .fn small { color: var(--muted); }
.voice { display: flex; align-items: center; gap: 10px; min-width: 250px; padding: 2px 0; }
.voice .play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.voice .play:hover { color: var(--text); }
.voice .track { flex: 1; position: relative; height: 26px; cursor: pointer; display: flex; align-items: center; gap: 2px; }
.voice .track i { flex: 1; background: var(--faint); border-radius: 2px; min-height: 3px; opacity: .7; }
.voice .track i.done { background: var(--accent); opacity: 1; }
.voice .vmeta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.voice .speed { font-size: 11.5px; font-weight: 700; background: rgba(127, 127, 127, .2); padding: 2px 6px; border-radius: 10px; flex: none; }
.voice .vav { position: relative; }
.voice .vav .mic { position: absolute; right: -4px; bottom: -2px; color: var(--accent); }
.loc { display: block; width: 280px; border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; background: rgba(0, 0, 0, .14); }
.loc .map { height: 120px; display: grid; place-items: center; background: linear-gradient(135deg, #1b4a40, #164a6e); color: #fff; }
.loc .map svg { width: 40px; height: 40px; }
.loc .ll { padding: 8px 10px; font-size: 13px; }
.ccard { display: flex; gap: 10px; align-items: center; min-width: 230px; padding: 4px 2px 8px; border-bottom: 1px solid rgba(127, 127, 127, .2); }
.ccard-act { display: flex; justify-content: center; padding-top: 6px; }
.ccard-act button { color: var(--accent); font-weight: 600; padding: 4px 10px; }
.callrow { display: flex; gap: 10px; align-items: center; min-width: 210px; padding: 2px 2px; }
.callrow .cic { width: 38px; height: 38px; border-radius: 50%; background: rgba(127, 127, 127, .18); display: grid; place-items: center; flex: none; }
.callrow .cic.miss { color: var(--danger); }
.callrow small { color: var(--muted); display: block; }
.reacts { display: flex; gap: 3px; flex-wrap: wrap; margin: -6px 8px 2px; position: relative; z-index: 2; }
.m.out .reacts { justify-content: flex-end; }
.react { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 1px 7px; font-size: 13.5px; display: inline-flex; gap: 4px; align-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.react.mine { border-color: var(--accent); }
.react small { color: var(--muted); font-size: 11.5px; }
.m-col { display: flex; flex-direction: column; max-width: min(72%, 620px); min-width: 0; }
.m.out .m-col { align-items: flex-end; }
.m .tools { position: absolute; top: 4px; display: none; gap: 2px; z-index: 4; }
.m.in .tools { right: auto; }
.m:hover .tools { display: flex; }
.m .tools button { width: 30px; height: 30px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; color: var(--muted); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.m .tools button:hover { color: var(--text); }
.star-ic { color: var(--muted); }
.bub .e2e-fail { color: var(--muted); font-style: italic; display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.jump { position: absolute; right: 22px; bottom: 82px; width: 44px; height: 44px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 5; color: var(--muted); }
.jump .badge { position: absolute; top: -6px; right: -4px; }

.composer { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 8px 12px; background: var(--panel); z-index: 2; position: relative; }
.composer .box { flex: 1; min-width: 0; background: var(--panel2); border-radius: 22px; display: flex; align-items: flex-end; padding: 2px 4px; border: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; resize: none; padding: 10px 6px; max-height: 160px; min-height: 42px; line-height: 1.35; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .1s; }
.composer .send:active { transform: scale(.94); }
.composer-note { flex: none; padding: 16px; background: var(--panel); text-align: center; color: var(--muted); z-index: 2; }
.composer-note button { color: var(--accent); font-weight: 600; }
.bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 6px; background: var(--panel); z-index: 2; border-top: 1px solid var(--line); }
.bar .quote { flex: 1; margin: 0; }
.rec { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 8px; height: 46px; }
.rec .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
.rec .tm { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec .lvl { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; overflow: hidden; justify-content: flex-end; }
.rec .lvl i { width: 3px; background: var(--accent); border-radius: 2px; flex: none; }
.banner { flex: none; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.banner .t { flex: 1; min-width: 200px; color: var(--muted); }
.e2e-banner { margin: 6px auto 12px; max-width: 520px; background: rgba(242, 184, 75, .12); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; gap: 8px; text-align: left; cursor: pointer; }
:root[data-theme="light"] .e2e-banner, :root[data-theme="light"] .sys.e2e span { background: #fdf3d8; color: #7a5b12; }
.drop-hint { position: absolute; inset: 0; z-index: 20; background: rgba(28, 197, 156, .12); border: 3px dashed var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 700; color: var(--accent); pointer-events: none; }

/* ---------------------------------------------------------------- Info-Spalte */
.info { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.info .pane-head h1 { font-size: 17px; font-weight: 600; }
.info-body { flex: 1; overflow-y: auto; background: var(--bg); }
.card { background: var(--panel); padding: 16px 20px; margin-bottom: 8px; }
.card.center { text-align: center; padding: 26px 20px 20px; }
.card.center .av { margin: 0 auto 14px; cursor: pointer; }
.card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.card .phone { color: var(--muted); font-size: 15px; }
.card h3 { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.card .about { white-space: pre-wrap; }
.quick { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.quick button { min-width: 82px; padding: 12px 8px 10px; border-radius: 12px; border: 1px solid var(--line); display: grid; justify-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 500; }
.quick button:hover { background: var(--hover); }
.opt { display: flex; align-items: center; gap: 16px; padding: 13px 20px; cursor: pointer; background: var(--panel); transition: background .12s; width: 100%; text-align: left; }
.opt:hover { background: var(--hover); }
.opt .ic { color: var(--muted); }
.opt .ot { flex: 1; min-width: 0; }
.opt .ot small { display: block; color: var(--muted); font-size: 12.5px; }
.opt.red { color: var(--danger); } .opt.red .ic { color: var(--danger); }
.opt .chev { color: var(--faint); }
.media-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.media-strip > * { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 6px; cursor: pointer; background: var(--panel2); display: grid; place-items: center; color: var(--muted); }
.role-tag { font-size: 11.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; font-weight: 600; flex: none; }
.toggle { position: relative; width: 42px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: var(--faint); border-radius: 12px; transition: background .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); }
.safety { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: 1px; text-align: center; padding: 16px; background: var(--panel2); border-radius: 12px; margin: 14px 0; }

/* ---------------------------------------------------------------- Status */
.status-me { display: flex; gap: 14px; align-items: center; padding: 10px 16px; cursor: pointer; }
.status-me:hover { background: var(--hover); }
.status-me .plus { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 2px solid var(--panel); }
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; color: #fff; }
.viewer .bars { display: flex; gap: 4px; padding: 10px 12px 0; }
.viewer .bars i { flex: 1; height: 3px; background: rgba(255, 255, 255, .3); border-radius: 2px; overflow: hidden; }
.viewer .bars i b { display: block; height: 100%; width: 0; background: #fff; }
.viewer .vhead { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.viewer .vhead .t { flex: 1; } .viewer .vhead small { display: block; opacity: .7; }
.viewer .vhead .icon-btn { color: #fff; } .viewer .vhead .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.viewer .stage { flex: 1; display: grid; place-items: center; position: relative; min-height: 0; overflow: hidden; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .stage .txt { font-size: clamp(22px, 4vw, 38px); text-align: center; padding: 40px; white-space: pre-wrap; word-break: break-word; width: 100%; height: 100%; display: grid; place-items: center; font-weight: 600; }
.viewer .nav-l, .viewer .nav-r { position: absolute; top: 0; bottom: 0; width: 35%; z-index: 2; }
.viewer .nav-l { left: 0; } .viewer .nav-r { right: 0; }
.viewer .cap { text-align: center; padding: 12px 16px 22px; font-size: 16px; }
.viewer .vfoot { display: flex; justify-content: center; padding: 10px 16px 24px; gap: 10px; }
.viewer .vfoot button { color: #fff; display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .12); padding: 8px 14px; border-radius: 20px; }
.status-compose { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; color: #fff; }
.status-compose textarea { flex: 1; background: transparent; border: 0; outline: none; color: #fff; font-size: clamp(24px, 4vw, 38px); text-align: center; padding: 60px 30px; resize: none; font-weight: 600; }
.status-compose textarea::placeholder { color: rgba(255, 255, 255, .6); }
.status-compose .bar2 { display: flex; gap: 10px; padding: 14px 18px 22px; align-items: center; }
.status-compose .bar2 .sp { flex: 1; }
.status-compose .icon-btn { color: #fff; background: rgba(0, 0, 0, .2); }
.swatches { display: flex; gap: 6px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); }

/* ---------------------------------------------------------------- Ebenen: Menüs, Dialoge, Toasts */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#layer > * { pointer-events: auto; }
.menu { position: fixed; min-width: 210px; max-width: 300px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 6px 0; border: 1px solid var(--line); animation: pop .12s ease-out; z-index: 70; max-height: 80vh; overflow-y: auto; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 18px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.red { color: var(--danger); }
.menu button .ic { color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .react-bar { display: flex; gap: 2px; padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .react-bar button { width: 38px; height: 38px; padding: 0; justify-content: center; font-size: 22px; border-radius: 50%; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; z-index: 55; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: pop .15s ease-out; }
.modal.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 20px; }
.modal-head h3 { margin: 0; flex: 1; font-size: 18px; font-weight: 600; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; flex: 1; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
.modal p { color: var(--muted); margin: 0 0 12px; }
.sel-row { display: flex; align-items: center; gap: 12px; padding: 8px 20px; cursor: pointer; }
.sel-row:hover { background: var(--hover); }
.sel-row .nm { flex: 1; min-width: 0; }
.sel-row .nm b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-row .nm small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-row .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--faint); display: grid; place-items: center; flex: none; }
.sel-row.on .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.picked { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 10px; }
.picked span { background: var(--panel2); border-radius: 16px; padding: 4px 6px 4px 4px; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.picked span button { color: var(--muted); }
.radio { display: flex; gap: 12px; align-items: center; padding: 11px 4px; cursor: pointer; }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; }
.emoji-pop { position: fixed; width: 340px; height: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 70; animation: pop .12s; }
.emoji-pop .tabs { display: flex; border-bottom: 1px solid var(--line); padding: 4px; }
.emoji-pop .tabs button { flex: 1; padding: 6px 0; border-radius: 8px; font-size: 18px; opacity: .6; }
.emoji-pop .tabs button.on { opacity: 1; background: var(--hover); }
.emoji-pop .grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); padding: 6px; align-content: start; }
.emoji-pop .grid button { font-size: 24px; height: 38px; border-radius: 8px; }
.emoji-pop .grid button:hover { background: var(--hover); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; }
.lightbox .lhead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; }
.lightbox .lhead .t { flex: 1; } .lightbox .lhead small { display: block; opacity: .7; }
.lightbox .lhead .icon-btn { color: #fff; } .lightbox .lhead .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.lightbox .lstage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 10px 20px; }
.lightbox .lstage img, .lightbox .lstage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.preview-send .pv { max-height: 50vh; display: grid; place-items: center; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.preview-send .pv img, .preview-send .pv video { max-width: 100%; max-height: 50vh; }
#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 90vw; font-weight: 500; animation: pop .15s; }
.notif { position: fixed; top: 14px; right: 14px; z-index: 85; width: 340px; max-width: calc(100vw - 28px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; gap: 12px; padding: 12px; cursor: pointer; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateY(-16px); opacity: 0; } }
.notif .nt { flex: 1; min-width: 0; } .notif b { display: block; } .notif span { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-bar { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 86; background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 8px 10px 8px 16px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); font-weight: 600; }
.update-bar button { background: rgba(0, 0, 0, .15); padding: 5px 12px; border-radius: 8px; }

/* ---------------------------------------------------------------- Anruf */
.call { position: fixed; inset: 0; z-index: 80; background: radial-gradient(900px 600px at 50% 0%, #144a3f, #071311 70%); color: #fff; display: flex; flex-direction: column; align-items: center; }
.call.mini { inset: auto 16px 16px auto; width: 300px; height: auto; border-radius: 18px; box-shadow: var(--shadow); padding-bottom: 12px; }
.call .remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.call .remote.contain { object-fit: contain; }
.call .local { position: absolute; right: 16px; top: 16px; width: 26%; max-width: 220px; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; background: #111; z-index: 3; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); transform: scaleX(-1); }
.call .ctop { position: relative; z-index: 2; text-align: center; padding-top: 12vh; }
.call.has-video .ctop { padding-top: 24px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.call .ctop .av { margin: 0 auto 18px; }
.call.has-video .ctop .av { display: none; }
.call .ctop h2 { margin: 0 0 6px; font-size: 26px; font-weight: 600; }
.call .ctop .cs { opacity: .8; font-size: 15px; }
.call .cbtns { position: absolute; bottom: 7vh; left: 0; right: 0; display: flex; justify-content: center; gap: 18px; z-index: 4; flex-wrap: wrap; }
.call .cbtns button { width: 60px; height: 60px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; color: #fff; backdrop-filter: blur(8px); transition: transform .1s, background .15s; }
.call .cbtns button:hover { background: rgba(255, 255, 255, .26); }
.call .cbtns button.off { background: #fff; color: #111; }
.call .cbtns button.end { background: var(--danger); }
.call .cbtns button.ok { background: #19b67f; }
.call .cbtns button svg { width: 26px; height: 26px; }
.call .cbtns label { display: grid; justify-items: center; gap: 6px; font-size: 12.5px; opacity: .9; }
.call .peer-muted { position: relative; z-index: 2; margin-top: 10px; background: rgba(0, 0, 0, .35); padding: 4px 12px; border-radius: 12px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.call .shrink { position: absolute; left: 14px; top: 14px; z-index: 5; color: #fff; background: rgba(0, 0, 0, .25); }

/* ---------------------------------------------------------------- Handy */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .shell.info-open { grid-template-columns: 68px minmax(300px, 360px) 1fr; }
  .shell.info-open .info { position: fixed; right: 0; top: 0; bottom: 0; width: min(390px, 100%); z-index: 40; box-shadow: var(--shadow); }
}
@media (max-width: 820px) {
  .shell, .shell.info-open { grid-template-columns: 1fr; }
  .rail { display: none; }
  .pane { border-right: 0; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .chat { position: fixed; inset: 0; z-index: 30; transform: translateX(100%); transition: transform .22s ease; visibility: hidden; }
  .shell.chat-open .chat { transform: none; visibility: visible; }
  .chat-head .back { display: grid; }
  .msgs { padding: 10px 10px 8px; }
  .unread-sep { margin: 10px -10px; }
  .m-col { max-width: 86%; }
  .m .tools { display: none !important; }
  .shell.info-open .info { position: fixed; inset: 0; width: 100%; z-index: 40; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar button { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; }
  .tabbar button .pill { width: 58px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .15s; }
  .tabbar button.on { color: var(--text); }
  .tabbar button.on .pill { background: var(--accent-soft); color: var(--accent); }
  .tabbar .badge { position: absolute; top: 4px; left: calc(50% + 8px); }
  .shell.chat-open ~ .tabbar, .shell.chat-open ~ .fab, .shell.info-open ~ .tabbar, .shell.info-open ~ .fab { display: none; }
  .voice { min-width: 0; width: min(270px, 64vw); }
  .filecard, .ccard, .loc { min-width: 0; max-width: 100%; }
  .fab { position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 17px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow); z-index: 21; }
  .modal { max-height: calc(100vh - 20px); }
  .scrim.sheet { place-items: end center; padding: 0; }
  .scrim.sheet .modal { border-radius: 18px 18px 0 0; max-width: 100%; padding-bottom: env(safe-area-inset-bottom); }
  .call.mini { width: calc(100% - 32px); }
  .call .local { width: 30%; }
  .emoji-pop { left: 6px !important; right: 6px; width: auto; bottom: 70px; top: auto !important; }
  .chat-head .hide-m { display: none; }
}
@media (min-width: 821px) { .fab { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
