/* Ultracord – Discord-artiges dunkles Design */
:root {
  --panel: #232428; --link: #00a8fc;
  --bg0: #1e1f22; --bg1: #2b2d31; --bg2: #313338; --bg3: #383a40; --bg4: #404249;
  --hover: #35373c; --float: #111214;
  --text: #dbdee1; --head: #f2f3f5; --muted: #949ba4; --faint: #6d6f78;
  --accent: #5865f2; --accent-h: #4752c4;
  --green: #23a55a; --green-h: #1a8b4a; --red: #da373c; --red-h: #a12828; --yellow: #f0b232;
  font-family: "gg sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg2); color: var(--text); font-size: 15px; }
.hidden { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--bg0); border: 1px solid transparent;
  border-radius: 4px; padding: 9px 10px; outline: none; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input:disabled { opacity: .6; }
input[type=color] { padding: 2px; height: 38px; width: 70px; cursor: pointer; }
input[type=checkbox] { width: auto; }
label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; letter-spacing: .02em; }
label > input, label > select, label > textarea { margin-top: 6px; text-transform: none; font-weight: 400; font-size: 15px; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* Buttons */
.btn { background: var(--bg4); border: 0; border-radius: 4px; padding: 8px 16px; font-weight: 600; font-size: 14px; color: #fff; transition: background .15s; white-space: nowrap; }
.btn:hover { background: #4e5058; }
.btn.primary { background: var(--accent); } .btn.primary:hover { background: var(--accent-h); }
.btn.green { background: var(--green); } .btn.green:hover { background: var(--green-h); }
.btn.danger { background: var(--red); } .btn.danger:hover { background: var(--red-h); }
.btn.ghost { background: transparent; color: var(--text); } .btn.ghost:hover { text-decoration: underline; background: transparent; }
.btn.outline-danger { background: transparent; color: #f23f42; border: 1px solid var(--red); } .btn.outline-danger:hover { background: var(--red); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--bg4); color: var(--text); }
.icon-btn.off { color: #f23f42; }
.icon-btn.danger:hover { color: #f23f42; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg1); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.round-btn:hover { color: var(--text); background: var(--bg0); }
.round-btn.ok:hover { color: var(--green); }
.round-btn.no:hover { color: #f23f42; }
.i { flex-shrink: 0; display: block; }
.i-phone-off { transform: rotate(135deg); }

/* Anmeldung */
.auth { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #5865f2 0, transparent 50%), radial-gradient(circle at 80% 80%, #eb459e55 0, transparent 50%), #23272a; }
.auth-card { background: var(--bg2); padding: 32px; border-radius: 8px; width: min(460px, 92vw); box-shadow: 0 8px 32px rgba(0,0,0,.45); text-align: center; }
.auth-card form { text-align: left; margin-top: 12px; }
.auth-logo { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.auth-card h1 { margin: 6px 0 4px; color: var(--head); font-size: 24px; }
.auth-card .btn.wide { margin-top: 20px; }
.form-error { color: #fa777c; font-size: 14px; min-height: 18px; margin-top: 8px; }
.form-ok { color: #2dc770; font-size: 14px; min-height: 18px; margin-top: 8px; }

/* Grundlayout */
.app { display: flex; height: 100vh; overflow: hidden; }

/* Server-Leiste links */
.rail { width: 72px; background: var(--bg0); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 8px; overflow-y: auto; flex-shrink: 0; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; width: 72px; display: flex; justify-content: center; flex-shrink: 0; }
.rail-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg2); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text);
  transition: border-radius .15s, background .15s, color .15s; cursor: pointer; font-size: 15px; user-select: none; overflow: hidden; }
.rail-item:hover .rail-icon, .rail-item.active .rail-icon { border-radius: 16px; background: var(--c, var(--accent)); color: #fff; }
.rail-icon.add { color: var(--green); }
.rail-item:hover .rail-icon.add { background: var(--green); color: #fff; }
.rail .pill { position: absolute; left: 0; top: 50%; width: 4px; height: 0; background: #fff; border-radius: 0 4px 4px 0; transform: translateY(-50%); transition: height .15s; }
.rail-item.unread .pill { height: 8px; }
.rail-item:hover .pill { height: 20px; }
.rail-item.active .pill { height: 40px; }
.badge { position: absolute; right: 10px; bottom: -3px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 6px; border: 3px solid var(--bg0); line-height: 14px; }
.rail-sep { width: 32px; height: 2px; background: var(--bg3); border-radius: 1px; flex-shrink: 0; }

/* Seitenleiste */
.sidebar { width: 240px; background: var(--bg1); display: flex; flex-direction: column; flex-shrink: 0; min-height: 0; }
.sidebar-head { height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 2px 0 rgba(0,0,0,.05); font-weight: 700; color: var(--head); position: relative; flex-shrink: 0; z-index: 2; }
.sidebar-head.clickable { cursor: pointer; }
.sidebar-head.clickable:hover { background: var(--hover); }
.sidebar-body { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; }
.group-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px 4px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; }
.group-head .icon-btn { padding: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; color: var(--muted); cursor: pointer; margin: 1px 0; position: relative; min-height: 34px; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--bg4); color: #fff; }
.nav-item.unread { color: #fff; font-weight: 600; }
.nav-item.unread::before { content: ""; position: absolute; left: -8px; width: 4px; height: 8px; background: #fff; border-radius: 0 4px 4px 0; }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .gear { opacity: 0; padding: 2px; }
.nav-item:hover .gear, .nav-item.active .gear { opacity: 1; }
.nav-item.voice-connected { color: var(--green); }
.voice-users { padding: 0 0 4px 30px; }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 3px 6px; color: var(--muted); font-size: 14px; border-radius: 4px; cursor: pointer; }
.voice-user:hover { background: var(--hover); color: var(--text); }
.voice-user .flags { margin-left: auto; display: flex; gap: 2px; color: #f23f42; }
.menu { position: absolute; top: 52px; left: 10px; right: 10px; background: var(--float); border-radius: 6px; padding: 6px 8px; z-index: 30; box-shadow: 0 8px 16px rgba(0,0,0,.4); }
.menu-item { padding: 8px; border-radius: 3px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item.danger { color: #f23f42; }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-sep { height: 1px; background: var(--bg3); margin: 4px 0; }

/* Avatare */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; position: relative; user-select: none; transition: box-shadow .12s; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--green); }
.status { position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--bg1); box-sizing: content-box; }
.status.on { background: var(--green); }
.status.off { background: #80848e; }
.main-body .status, .friend-row .status { border-color: var(--bg2); }

/* Sprach- und Benutzerpanel unten links */
.vp { background: var(--panel); border-bottom: 1px solid #1e1f22; padding: 8px 10px; display: flex; align-items: center; gap: 6px; }
.vp-info { flex: 1; min-width: 0; }
.vp-status { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.vp-status.ok { color: #2dc770; }
.vp-status.wait { color: var(--yellow); }
.vp-status.bad { color: var(--red); }
.vp-sub { font-size: 12px; color: var(--muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-sub:hover { text-decoration: underline; }
.user-panel { background: var(--panel); height: 52px; padding: 0 8px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-panel .who { flex: 1; min-width: 0; line-height: 1.15; }
.user-panel .who b { display: block; font-size: 14px; color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel .who span { font-size: 12px; color: var(--muted); }

/* Hauptbereich */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg2); }
.main-head { height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 2px 0 rgba(0,0,0,.05); flex-shrink: 0; z-index: 1; }
.main-head .title { font-weight: 700; color: var(--head); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.main-head .title .i { color: var(--muted); }
.main-head .divider { width: 1px; height: 24px; background: var(--bg4); margin: 0 6px; }
.main-head .topic { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-row { flex: 1; display: flex; min-height: 0; }
.main-body { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tab { background: none; border: 0; padding: 3px 9px; border-radius: 4px; color: var(--muted); font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: var(--bg4); color: #fff; }
.tab.add { background: var(--green); color: #fff; }
.tab.add.active { background: transparent; color: #2dc770; }
.tab .count { background: var(--red); color: #fff; border-radius: 8px; font-size: 11px; padding: 0 5px; font-weight: 700; }

/* Freunde */
.friends { padding: 16px 20px 16px 30px; overflow-y: auto; flex: 1; }
.friends h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 8px 0 8px; letter-spacing: .02em; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-top: 1px solid var(--bg3); border-radius: 8px; cursor: pointer; }
.friend-row:hover { background: var(--hover); border-top-color: transparent; }
.friend-row:hover + .friend-row { border-top-color: transparent; }
.friend-row .info { flex: 1; min-width: 0; }
.friend-row .info b { color: var(--head); }
.friend-row .info .sub { font-size: 13px; color: var(--muted); }
.friend-row .info .uname { color: var(--muted); font-size: 13px; margin-left: 6px; opacity: 0; transition: opacity .1s; }
.friend-row:hover .info .uname { opacity: 1; }
.friend-row .actions { display: flex; gap: 8px; }
.add-friend { padding: 20px 30px; border-bottom: 1px solid var(--bg3); }
.add-friend h2 { margin: 0 0 6px; font-size: 16px; color: var(--head); text-transform: uppercase; }
.add-friend form { display: flex; gap: 10px; margin-top: 14px; background: var(--bg0); border-radius: 8px; padding: 6px 6px 6px 4px; border: 1px solid #000; }
.add-friend form:focus-within { border-color: var(--accent); }
.add-friend input { background: transparent; border: 0; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 40px; gap: 12px; }
.empty .big { font-size: 56px; }

/* Chat */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; }
.msg { position: relative; padding: 2px 48px 2px 72px; margin-top: 16px; min-height: 22px; }
.msg.grouped { margin-top: 0; }
.msg:hover { background: #2e3035; }
.msg > .avatar { position: absolute; left: 16px; top: 4px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 600; color: var(--head); cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 12px; color: var(--muted); }
.msg-side { position: absolute; left: 0; width: 64px; text-align: right; font-size: 11px; color: var(--muted); opacity: 0; top: 5px; }
.msg:hover .msg-side { opacity: 1; }
.msg-body { line-height: 1.375; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; color: var(--text); }
.msg-del { position: absolute; right: 16px; top: -14px; opacity: 0; background: var(--bg2); border: 1px solid var(--bg0); border-radius: 4px; padding: 4px; color: var(--muted); }
.msg:hover .msg-del { opacity: 1; }
.msg-del:hover { color: #f23f42; }
.day-sep { display: flex; align-items: center; margin: 24px 16px 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--bg4); }
.day-sep span { padding: 0 8px; }
.chat-start { padding: 16px 16px 0; }
.chat-start .big-ico { width: 68px; height: 68px; border-radius: 50%; background: var(--bg4); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; color: #fff; }
.chat-start h2 { margin: 8px 0 4px; color: var(--head); font-size: 28px; }
.load-older { text-align: center; padding: 8px; }
.composer { padding: 0 16px 24px; flex-shrink: 0; }
.composer-box { background: var(--bg3); border-radius: 8px; display: flex; align-items: flex-end; padding: 0 12px; }
.composer textarea { background: transparent; border: 0; resize: none; max-height: 40vh; padding: 11px 0; line-height: 1.375; }
.composer-disabled { background: var(--bg3); border-radius: 8px; padding: 11px 16px; color: var(--muted); }

/* Anrufbühne in Direktnachrichten */
.call-stage { background: #000; padding: 28px 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 18px; flex-shrink: 0; }
.call-stage .faces { display: flex; gap: 28px; }
.call-stage .face { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.call-stage .avatar.speaking { box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--green); }
.call-stage .face.waiting .avatar { opacity: .5; animation: pulse 1.4s infinite; }
.call-stage .ctrls { display: flex; gap: 12px; }
.call-stage .ctrl { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #2b2d31; color: #fff; display: flex; align-items: center; justify-content: center; }
.call-stage .ctrl:hover { background: #3a3c42; }
.call-stage .ctrl.off { background: #fff; color: #000; }
.call-stage .ctrl.hang { background: var(--red); }
.call-stage .ctrl.hang:hover { background: var(--red-h); }
.call-stage .ctrl.go { background: var(--green); }
@keyframes pulse { 50% { opacity: .9; } }

/* Mitgliederliste */
.members { width: 240px; background: var(--bg1); overflow-y: auto; padding: 8px 8px 20px; flex-shrink: 0; }
.members h4 { font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 16px 8px 4px; letter-spacing: .02em; }
.member { display: flex; align-items: center; gap: 12px; padding: 5px 8px; border-radius: 4px; cursor: pointer; }
.member:hover { background: var(--hover); }
.member.offline { opacity: .35; }
.member.offline:hover { opacity: 1; }
.member .name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown { color: var(--yellow); font-size: 12px; margin-left: 4px; }

/* Modals */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg2); border-radius: 8px; width: min(460px, 94vw); max-height: 90vh; overflow-y: auto; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,.5); position: relative; }
.modal.wide { width: min(980px, 96vw); height: min(720px, 92vh); padding: 0; display: flex; overflow: hidden; }
.modal h2 { margin: 0 0 8px; color: var(--head); font-size: 22px; }
.modal h3 { margin: 18px 0 6px; color: var(--head); font-size: 16px; }
.modal .x { position: absolute; top: 12px; right: 12px; }
.modal .row { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.modal .row.end { justify-content: flex-end; }
.or { text-align: center; color: var(--muted); margin: 18px 0 2px; font-size: 13px; text-transform: uppercase; font-weight: 700; }
.choice { display: flex; gap: 10px; margin-top: 6px; }
.choice label { flex: 1; margin: 0; display: flex; align-items: center; gap: 10px; background: var(--bg1); padding: 12px; border-radius: 6px; text-transform: none; font-size: 15px; color: var(--text); cursor: pointer; font-weight: 500; }
.choice label:has(input:checked) { background: var(--bg4); }
.copy-row { display: flex; gap: 8px; background: var(--bg0); border-radius: 4px; padding: 4px; margin-top: 6px; }
.copy-row input { background: transparent; border: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 6px; border: 2px solid transparent; }
.swatch.sel { border-color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg1); border-radius: 4px; padding: 3px 8px; font-size: 13px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip button { background: none; border: 0; color: var(--muted); padding: 0; display: inline-flex; }
.chip button:hover { color: #f23f42; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .who b { font-size: 20px; color: var(--head); display: block; }

/* Servereinstellungen */
.settings-nav { width: 220px; background: var(--bg1); padding: 24px 10px 16px; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; overflow-y: auto; }
.settings-nav .t { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-nav button { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 4px; color: var(--muted); font-size: 15px; font-weight: 500; }
.settings-nav button:hover { background: var(--hover); color: var(--text); }
.settings-nav button.active { background: var(--bg4); color: #fff; }
.settings-body { flex: 1; padding: 30px 36px; overflow-y: auto; position: relative; }
.settings-body h2 { margin-bottom: 18px; }
.roles-wrap { display: flex; gap: 20px; min-height: 0; }
.role-list { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; color: var(--text); }
.role-item:hover { background: var(--hover); }
.role-item.sel { background: var(--bg4); }
.role-item .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.role-item .arrows { display: flex; opacity: 0; }
.role-item:hover .arrows, .role-item.sel .arrows { opacity: 1; }
.role-item .arrows button { padding: 1px; }
.role-edit { flex: 1; min-width: 0; }
.perm { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bg3); cursor: pointer; text-transform: none; font-size: 15px; color: var(--text); margin: 0; font-weight: 400; }
.perm input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.perm b { display: block; color: var(--head); font-weight: 600; }
.perm small { color: var(--muted); font-size: 13px; }
.table-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--bg3); }
.table-row .grow b { color: var(--head); }
.table-row code { background: var(--bg0); padding: 2px 6px; border-radius: 3px; }
.danger-zone { margin-top: 30px; border: 1px solid var(--red); border-radius: 8px; padding: 16px; }
.danger-zone h3 { color: #f23f42; margin-top: 0; }

/* Eingehender Anruf */
.incoming-bg { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); animation: fade .15s; }
.incoming-card { background: var(--bg0); border-radius: 12px; padding: 30px 40px; width: 280px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.incoming-card .avatar { animation: ring 1.2s infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 #23a55a88; } 50% { box-shadow: 0 0 0 14px #23a55a00; } }
.incoming-card .name { font-size: 20px; font-weight: 700; color: var(--head); }
.incoming-card .ctrls { display: flex; gap: 40px; margin-top: 14px; }
.incoming-card .ctrl { width: 56px; height: 56px; border-radius: 50%; border: 0; color: #fff; display: flex; align-items: center; justify-content: center; }
.incoming-card .ctrl.go { background: var(--green); } .incoming-card .ctrl.go:hover { background: var(--green-h); }
.incoming-card .ctrl.no { background: var(--red); } .incoming-card .ctrl.no:hover { background: var(--red-h); }

/* Meldungen */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--float); color: var(--text); padding: 10px 16px; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.5); font-size: 14px; transition: opacity .4s, transform .4s; border-left: 4px solid var(--accent); max-width: 90vw; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast.out { opacity: 0; transform: translateY(10px); }
.conn-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--red); color: #fff; text-align: center; padding: 6px; font-size: 14px; font-weight: 600; z-index: 90; }
.level { height: 8px; background: var(--bg0); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.level div { height: 100%; width: 0; background: var(--green); transition: width .08s; }

@media (max-width: 1000px) { .members { display: none; } }
@media (max-width: 700px) {
  .sidebar { width: 200px; }
  .msg { padding-right: 16px; }
  .settings-nav { width: 150px; }
  .roles-wrap { flex-direction: column; }
  .role-list { width: auto; }
}

/* ---- Video & Bildschirm */
.video-stage { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: #000; justify-content: center; align-items: flex-start; align-content: flex-start; max-height: 62vh; overflow: auto; flex-shrink: 0; }
.vtile { position: relative; flex: 1 1 300px; max-width: 560px; aspect-ratio: 16 / 9; background: #111; border-radius: 8px; overflow: hidden; }
.vtile.mine:not(.screen) { flex: 0 1 240px; }
.vtile.screen { order: -1; flex: 1 1 100%; max-width: 100%; aspect-ratio: auto; height: 44vh; }
.video-stage.has-screen .vtile:not(.screen) { flex: 0 0 auto; height: 13vh; max-width: none; }
.vtile video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.vtile video.mirror { transform: scaleX(-1); }
.vtile:fullscreen { border-radius: 0; max-width: none; }
.vlabel { position: absolute; left: 8px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 4px; pointer-events: none; }
.vbig { position: absolute; right: 6px; top: 6px; border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 4px; cursor: pointer; padding: 2px 7px; font-size: 15px; opacity: 0; transition: opacity .15s; }
.vtile:hover .vbig { opacity: 1; }
.vp-media { display: flex; gap: 6px; padding: 0 10px 8px; background: var(--panel); border-bottom: 1px solid #1e1f22; }
.btn-media { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: #2b2d31; color: #dbdee1; border: 0; border-radius: 6px; padding: 7px 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-media:hover { background: #35373c; }
.btn-media.on { background: var(--green); color: #fff; }
.call-stage .ctrl.on { background: var(--green); }

/* ---- Dateien */
.attach-btn { background: #4e5058; color: var(--bg3); border: 0; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin: 10px 12px 10px 0; flex-shrink: 0; cursor: pointer; }
.attach-btn:hover { background: #dbdee1; }
.attach-btn .i { width: 16px; height: 16px; }
#upload-list { display: flex; flex-direction: column; gap: 6px; }
#upload-list:not(:empty) { margin-bottom: 8px; }
.up-row { display: flex; align-items: center; gap: 10px; background: var(--bg3); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.up-bar { width: 160px; flex-shrink: 0; }
.up-pct { min-width: 44px; text-align: right; font-size: 13px; }
.att { margin-top: 4px; max-width: 520px; display: flex; flex-direction: column; gap: 6px; }
.att-img { max-width: 100%; max-height: 350px; border-radius: 8px; display: block; cursor: zoom-in; background: var(--bg3); }
.att-video { max-width: 100%; max-height: 350px; border-radius: 8px; background: #000; }
.att-audio { width: 100%; }
.att-file { display: flex; align-items: center; gap: 10px; background: var(--bg1, #2b2d31); border: 1px solid var(--bg0, #1e1f22); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.att-file > .i { color: var(--accent); flex-shrink: 0; }
.att-name { color: var(--link); font-weight: 600; }
.chat.drop { outline: 3px dashed var(--accent); outline-offset: -10px; }

/* ---- Emojis & Auswahl */
img.emoji { height: 1.375em; width: auto; vertical-align: -0.3em; object-fit: contain; }
.msg-body.jumbo { font-size: 2.4em; line-height: 1.2; }
.msg-body.jumbo img.emoji { height: 1.6em; }
.msg-body.jumbo img.emoji.gif { height: 3.4em; vertical-align: middle; }
.ch-icon { display: inline-flex; width: 20px; justify-content: center; flex-shrink: 0; }
.ch-icon img.emoji { height: 1.15em; }
.emoji-wrap { position: relative; display: flex; align-items: center; margin-top: 6px; }
.emoji-wrap > input { margin-top: 0 !important; padding-right: 40px; }
.emoji-btn { background: none; border: 0; font-size: 18px; line-height: 1; padding: 4px 6px; cursor: pointer; opacity: .75; filter: grayscale(.4); }
.emoji-btn:hover { opacity: 1; filter: none; transform: scale(1.12); }
.emoji-wrap > .emoji-btn { position: absolute; right: 4px; }
.emoji-btn.cmp { margin: 8px 0 8px 2px; align-self: flex-end; }
#gif-btn { font-size: 11px; font-weight: 800; border: 2px solid var(--muted); color: var(--muted); border-radius: 4px; padding: 1px 4px; margin-bottom: 11px; filter: none; }
.picker { position: fixed; z-index: 120; width: 360px; height: 400px; background: var(--bg1); border: 1px solid var(--bg0); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; }
.pk-tabs { display: flex; gap: 4px; padding: 8px 8px 0; }
.pk-tabs button { flex: 1; background: var(--bg2); border: 0; border-radius: 6px 6px 0 0; padding: 7px 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.pk-tabs button.active { background: var(--bg3); color: var(--head); }
.pk-search { margin: 8px; width: auto; }
.pk-body { flex: 1; overflow-y: auto; padding: 4px 8px 10px; background: var(--bg3); }
.pk-cat { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin: 10px 2px 4px; }
.pk-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.pk-grid.big { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.pk-e { background: none; border: 0; font-size: 22px; padding: 3px 0; border-radius: 6px; }
.pk-e:hover, .pk-c:hover { background: var(--bg4); }
.pk-c { background: var(--bg2); border: 0; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; overflow: hidden; }
.pk-c img { width: 100%; height: 72px; object-fit: contain; }
.pk-c span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Design-Studio (Seitenpanel, Oberfläche bleibt sichtbar) */
#studio { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); z-index: 110; background: #1a1b1e; color: #dbdee1; border-left: 1px solid #000; box-shadow: -8px 0 30px rgba(0,0,0,.5); display: flex; flex-direction: column; font-family: "Segoe UI", system-ui, sans-serif; font-size: 14px; }
#studio input, #studio select, #studio textarea { background: #111214; color: #dbdee1; }
.st-head { display: flex; align-items: center; padding: 14px 16px; font-size: 17px; border-bottom: 1px solid #000; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; border-bottom: 1px solid #000; }
.st-tabs button { background: #2b2d31; border: 0; border-radius: 6px; padding: 6px 9px; font-size: 13px; color: #b5bac1; }
.st-tabs button.active { background: #5865f2; color: #fff; }
.st-body { flex: 1; overflow-y: auto; padding: 8px 16px 20px; }
.st-body h4 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; color: #949ba4; letter-spacing: .03em; }
.st-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.st-row > span:first-child { flex: 0 0 150px; color: #b5bac1; font-size: 13px; }
.st-row.col { flex-direction: column; align-items: stretch; }
.st-row.col > span:first-child { flex: none; }
.st-row input[type=color] { width: 46px; height: 32px; flex-shrink: 0; }
.st-row input[type=range] { flex: 1; padding: 0; }
.st-row select, .st-row .st-hex, .st-row .emoji-wrap { flex: 1; }
.st-row .emoji-wrap { margin-top: 0; }
.st-hex { width: 96px; font-family: Consolas, monospace; font-size: 13px; padding: 6px 8px; }
.st-val { min-width: 40px; text-align: right; font-weight: 600; font-size: 12px; color: #b5bac1; }
.st-row textarea { font-family: Consolas, monospace; font-size: 12px; min-height: 90px; }
.st-preview { height: 120px; border-radius: 8px; border: 1px solid #000; margin-top: 10px; }
.st-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.st-preset { display: flex; align-items: center; gap: 3px; background: #2b2d31; border: 1px solid #000; border-radius: 8px; padding: 7px; text-align: left; }
.st-preset span { width: 14px; height: 22px; border-radius: 3px; }
.st-preset b { margin-left: 6px; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-preset:hover { border-color: #5865f2; }
.st-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid #000; background: #151618; }
.em-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.em-item { background: #2b2d31; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.em-item img { height: 56px; max-width: 100%; object-fit: contain; }
.em-item code { font-size: 11px; color: #b5bac1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.em-item .icon-btn { position: absolute; top: 2px; right: 2px; }
.st-switch { display: flex; align-items: center; gap: 6px; margin: 0; text-transform: none; font-size: 13px; color: #b5bac1; }
@media (max-width: 700px) { #studio { width: 100vw; top: 40vh; border-left: 0; border-top: 1px solid #000; } }
.emoji-wrap > input { font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; }
