/* 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; height: calc(100dvh - var(--sheet-h, 0px)); 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); padding: 8px; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.user-panel .up-card { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--bg1); cursor: pointer; min-width: 0; }
.user-panel .up-card:hover { background: var(--hover); }
.user-panel .up-btns { display: flex; align-items: center; justify-content: space-around; gap: 4px; }
.user-panel .up-btns .icon-btn { flex: 1 1 0; justify-content: center; }
.user-panel .who { flex: 1; min-width: 0; line-height: 1.2; }
.user-panel .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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; }

/* ---- Handy & Tablet */
.m-menu, .m-tools { display: none; }
#m-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.m-drawer #m-scrim { opacity: 1; pointer-events: auto; }
.app.hidden ~ #m-scrim { display: none; }
.m-tools { align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.m-live { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--green); color: #fff; animation: livepulse 2s infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 5px rgba(35,165,90,.25); } }

/* Tablet & kleiner: Mitglieder als Schublade von rechts */
@media (max-width: 1000px) {
  .m-tools { display: inline-flex; }
  .m-tools .m-live, .m-tools .m-hang { display: none; }
  .members { position: fixed; top: 0; right: 0; bottom: var(--sheet-h, 0px); z-index: 45; width: min(280px, 86vw) !important;
    transform: translateX(105%); transition: transform .22s ease; box-shadow: -8px 0 30px rgba(0,0,0,.45); padding-top: max(8px, env(safe-area-inset-top)); }
  .app.m-mem .members { transform: none; }
}

/* Handy: Server-Leiste + Kanäle als Schublade von links, Chat über die ganze Breite */
@media (max-width: 760px) {
  html, body { overscroll-behavior: none; }
  .app { height: calc(100dvh - var(--sheet-h, 0px)); }
  .m-menu { display: inline-flex; margin-left: -8px; flex-shrink: 0; }
  .m-tools .m-live, .m-tools .m-hang { display: inline-flex; }
  .rail, .sidebar { position: fixed; top: 0; bottom: var(--sheet-h, 0px); z-index: 45; transition: transform .22s ease; }
  .rail { left: 0; width: 72px !important; transform: translateX(-100%); padding-top: max(12px, env(safe-area-inset-top)); }
  .rail-item { width: 72px !important; }
  .sidebar { left: 72px; width: min(300px, calc(100vw - 72px - 40px)) !important; transform: translateX(calc(-100% - 72px)); box-shadow: 8px 0 30px rgba(0,0,0,.45); }
  .app.m-nav .rail, .app.m-nav .sidebar { transform: none; }
  .sidebar-head { padding-top: env(safe-area-inset-top); height: calc(48px + env(safe-area-inset-top)); }
  .user-panel { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .main { width: 100vw; }
  .main-head { padding: env(safe-area-inset-top) 10px 0; height: calc(52px + env(safe-area-inset-top)); gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .main-head::-webkit-scrollbar { display: none; }
  .main-head .topic, .main-head .divider { display: none; }
  .main-head .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .main-head .tab { flex-shrink: 0; padding: 6px 10px; }
  .msg { padding: 2px 12px 2px 62px; }
  .msg > .avatar { left: 12px; }
  .msg-side { width: 56px; }
  .chat-start h2 { font-size: 22px; }
  .composer { padding: 0 8px max(10px, env(safe-area-inset-bottom)); }
  .composer textarea, .modal input, .modal select, .modal textarea, .add-friend input, #studio input, #studio select, #studio textarea { font-size: 16px; }  /* sonst zoomt das iPhone rein */
  .friend-row { padding-left: 10px; padding-right: 10px; }
  .add-friend { padding: 16px; }
  .add-friend form { flex-wrap: wrap; }
  .empty { padding: 24px; }
  .video-stage { max-height: 48dvh; }
  .vtile { flex-basis: 100%; }
  .vtile.screen { height: 30dvh; }
  .video-stage.has-screen .vtile:not(.screen) { height: 11dvh; }
  #toasts { top: calc(58px + env(safe-area-inset-top)); bottom: auto; width: 92vw; flex-direction: column-reverse; }
  /* Fenster: normale als Blatt von unten, große (Servereinstellungen) als Vollbild */
  .modal-bg { align-items: flex-end; }
  .modal { width: 100vw; max-height: 94dvh; border-radius: 16px 16px 0 0; padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
  .modal.wide { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; flex-direction: column; }
  .settings-nav { width: auto; flex-direction: row; overflow-x: auto; padding: max(10px, env(safe-area-inset-top)) 50px 10px 10px; flex-shrink: 0; scrollbar-width: none; }
  .settings-nav .t { display: none; }
  .settings-nav button { white-space: nowrap; flex-shrink: 0; }
  .settings-nav .menu-sep, .settings-nav hr { display: none; }
  .settings-body { padding: 18px 16px max(24px, env(safe-area-inset-bottom)); }
  .modal.wide .x { top: max(10px, env(safe-area-inset-top)); z-index: 3; }
  .settings-nav { padding-right: 0; }
  .settings-nav .grow { display: none; }
  .settings-nav [data-act=modal-close] { position: sticky; right: 0; margin-left: auto; background: var(--bg1); box-shadow: -10px 0 10px var(--bg1); color: var(--text); }
  .roles-wrap { flex-direction: column; }
  .role-list { width: auto; }
  .choice { flex-direction: column; }
  .incoming-card { width: min(300px, 90vw); padding: 26px 20px; }
}

/* Finger statt Maus: größere Knöpfe, „drüberfahren“-Sachen sichtbar */
@media (pointer: coarse) {
  .icon-btn { min-width: 40px; min-height: 40px; justify-content: center; }
  .group-head .icon-btn { min-width: 34px; min-height: 34px; }
  .nav-item { min-height: 42px; }
  .nav-item .gear { opacity: .7; }
  .msg:hover { background: transparent; }
  .msg.tap { background: #2e3035; }
  .msg.tap .msg-side, .msg.tap .msg-del { opacity: 1; }
  .msg-del { padding: 8px; }
  .role-item .arrows { opacity: 1; }
  .vbig { opacity: 1 !important; }
  .swatch { width: 38px; height: 38px; }
  input[type=range] { height: 28px; }
  input[type=checkbox] { width: 20px; height: 20px; }
}

/* ---- 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; }
/* Studio am Handy/Tablet: Blatt von unten, Oberfläche rückt darüber */
@media (max-width: 900px) {
  #studio, #studio.left { top: auto; left: 0; right: 0; bottom: 0; width: 100vw; height: var(--sheet-h, 50dvh); border: 0; border-top: 1px solid #000; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.55); transition: height .18s ease; }
  .st-grip { flex-shrink: 0; height: 22px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: ns-resize; }
  .st-grip span { width: 44px; height: 5px; border-radius: 3px; background: #4e5058; }
  .st-head { padding: 0 10px 8px 14px; font-size: 16px; gap: 4px; }
  .st-view { display: flex; background: #111214; border-radius: 8px; padding: 2px; gap: 2px; }
  .st-view button { border: 0; background: none; color: #b5bac1; font-size: 12px; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
  .st-view button.active { background: #2de2e6; color: #111; font-weight: 700; }
  .st-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 10px; }
  .st-tabs::-webkit-scrollbar { display: none; }
  .st-tabs button { flex-shrink: 0; padding: 8px 11px; }
  .st-body { padding: 8px 12px 16px; }
  .st-foot { padding: 8px 12px max(8px, env(safe-area-inset-bottom)); }
  #studio.st-mini .st-tabs, #studio.st-mini .st-body, #studio.st-mini .st-hl { display: none; }
  #studio.st-mini .st-foot { border-top: 0; }
  .st-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) { .st-head b { display: none; } .st-head .grow { display: none; } .st-view { margin-right: auto; } }
body.layout-edit [data-lg] > [data-lk] { touch-action: none; -webkit-user-select: none; user-select: none; }
.emoji-wrap > input { font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; }

/* ---- Studio: Markieren, Verschieben, Auswählen */
.hl-box { position: fixed; z-index: 105; pointer-events: none; border: 2px dashed #ffcc00; border-radius: 6px; box-shadow: 0 0 14px 3px rgba(255,204,0,.55); background: rgba(255,204,0,.08); animation: hlpulse 1.2s ease-in-out infinite; }
.hl-box span { position: absolute; left: -2px; top: -24px; background: #ffcc00; color: #111; font: 700 12px/1 "Segoe UI", system-ui, sans-serif; padding: 4px 7px; border-radius: 4px; white-space: nowrap; }
@keyframes hlpulse { 50% { box-shadow: 0 0 22px 6px rgba(255,204,0,.75); } }
.st-hl { min-height: 18px; padding: 4px 16px; color: #ffcc00; border-bottom: 1px solid #000; }
.st-hl:empty { display: none; }
body.layout-edit [data-lg] > [data-lk] { outline: 2px dashed rgba(45,226,230,.75); outline-offset: -2px; cursor: grab; }
body.layout-edit [data-lg] > [data-lk]:hover { outline-color: #ffcc00; background-color: rgba(255,204,0,.06); }
body.layout-edit .lk-dragging { outline: 3px solid #ffcc00 !important; opacity: .85; cursor: grabbing; }
body.st-picking, body.st-picking * { cursor: crosshair !important; }
.st-mode { background: #2b2d31; border: 1px solid #000; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.st-mode.on { border-color: #2de2e6; box-shadow: 0 0 0 1px #2de2e6; }
.lay-group { background: #222327; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.lay-title { font-size: 12px; font-weight: 700; color: #949ba4; text-transform: uppercase; margin-bottom: 4px; }
.lay-item { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 4px; }
.lay-item:hover { background: #2e3035; }
.lay-item .icon-btn:disabled { opacity: .25; }
.up-av { display: flex; }
#studio.left { right: auto; left: 0; border-left: 0; border-right: 1px solid #000; box-shadow: 8px 0 30px rgba(0,0,0,.5); }

/* ---- Störgeräusche */
.fx-meter { position: relative; height: 26px; background: var(--bg0); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.fx-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #5c5f66; transition: width .06s linear; }
.fx-bar.open { background: var(--green); }
.fx-th { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #ffcc00; box-shadow: 0 0 6px #ffcc00; }
#fx-state { position: absolute; right: 8px; top: 5px; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000; }
.fx-chk { display: flex; align-items: flex-start; gap: 8px; text-transform: none; font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: 0; margin: 12px 0 0; }
.fx-chk input { margin-top: 3px; }
.fx-chk small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.m-tools .m-hang { background: var(--red); color: #fff; border-radius: 50%; width: 34px; height: 34px; min-width: 34px; min-height: 34px; }

/* Handy quer / niedrige Fenster: Anruf-Bereich kompakt, damit der Chat noch Platz hat */
@media (max-height: 560px) {
  .call-stage { flex-direction: row; justify-content: center; padding: 8px 12px; gap: 14px; }
  .call-stage .faces { gap: 12px; }
  .call-stage .face .avatar { width: 40px !important; height: 40px !important; font-size: 16px !important; }
  .call-stage .ctrl { width: 42px; height: 42px; }
  .video-stage { max-height: 52dvh; }
  .vtile { max-width: 46dvh; }
  .vtile.screen { height: 40dvh; max-width: 100%; }
}
@media (max-width: 760px) {
  .call-stage { padding: 16px 10px 12px; gap: 12px; }
  .call-stage .ctrls { gap: 8px; flex-wrap: wrap; justify-content: center; }
}
.fx-note { background: rgba(250,166,26,.12); border-left: 3px solid #faa61a; padding: 8px 10px; border-radius: 6px; font-size: 13px; line-height: 1.4; margin-top: 8px; color: var(--text); }
.fx-dim { opacity: .45; }

/* ---- Profilbilder & Profilrahmen */
.avatar .av-img { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; pointer-events: none; }
.avatar .status { z-index: 3; }
.avatar.has-img { background: transparent !important; }
.avatar .av-deco { position: absolute; z-index: 2; left: -19%; top: -19%; width: 138%; height: 138%; pointer-events: none; object-fit: contain; }
.avatar.fr { --rw: max(2px, calc(var(--s) * .075)); }
.avatar.fr::before, .avatar.fr::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.avatar.fr::before { inset: calc(var(--rw) * -1.4); }
.fr-ring::before, .avatar.fr-neon::before, .avatar.fr-rainbow::before, .avatar.fr-gold::before, .avatar.fr-ice::before, .avatar.fr-toxic::before {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--rw) - 1px), #000 calc(100% - var(--rw)));
          mask: radial-gradient(farthest-side, transparent calc(100% - var(--rw) - 1px), #000 calc(100% - var(--rw)));
}
/* Leuchten */
.avatar.fr-glow::before { inset: 0; box-shadow: 0 0 calc(var(--s) * .16) calc(var(--s) * .05) var(--fc); animation: frGlow 2.4s ease-in-out infinite; }
@keyframes frGlow { 50% { opacity: .45; } }
/* Pulsieren: Wellen nach außen */
.avatar.fr-pulse::before, .avatar.fr-pulse::after { inset: 0; border: var(--rw) solid var(--fc); animation: frPulse 2s ease-out infinite; }
.avatar.fr-pulse::after { animation-delay: 1s; }
@keyframes frPulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
/* Neon-Ring, dreht sich */
.avatar.fr-neon::before { background: conic-gradient(var(--fc), #2de2e6, #a259ff, #ff4fd8, var(--fc)); animation: frSpin 3s linear infinite; filter: drop-shadow(0 0 calc(var(--s) * .08) var(--fc)); }
@keyframes frSpin { to { transform: rotate(360deg); } }
/* Regenbogen */
.avatar.fr-rainbow::before { background: conic-gradient(#ff3b3b, #ffb000, #fff04a, #3bff6a, #2de2e6, #4c6bff, #c04bff, #ff3b3b); animation: frSpin 4s linear infinite; }
/* Feuer: flackert */
.avatar.fr-fire::before { inset: 0; animation: frFire 1.2s ease-in-out infinite alternate; }
@keyframes frFire {
  0% { box-shadow: 0 calc(var(--s) * -.06) calc(var(--s) * .12) #ffcf3b, 0 calc(var(--s) * -.12) calc(var(--s) * .2) #ff7a00, 0 calc(var(--s) * -.2) calc(var(--s) * .3) #ff2d00; }
  50% { box-shadow: 0 calc(var(--s) * -.1) calc(var(--s) * .1) #ffe066, 0 calc(var(--s) * -.16) calc(var(--s) * .26) #ff8a00, 0 calc(var(--s) * -.26) calc(var(--s) * .26) #ff3d00; }
  100% { box-shadow: 0 calc(var(--s) * -.04) calc(var(--s) * .14) #ffd84d, 0 calc(var(--s) * -.1) calc(var(--s) * .18) #ff6a00, 0 calc(var(--s) * -.16) calc(var(--s) * .34) #ff1f00; }
}
/* Eis: kühles Schimmern */
.avatar.fr-ice::before { background: conic-gradient(#e8fbff, #7fe3ff, #ffffff, #4ccfff, #e8fbff); animation: frSpin 6s linear infinite; filter: drop-shadow(0 0 calc(var(--s) * .1) #7fe3ff); }
/* Gold mit Glanz */
.avatar.fr-gold::before { background: conic-gradient(#8a6116, #f7d774, #fff4c2, #c9932b, #8a6116, #f0c75e, #8a6116); animation: frSpin 5s linear infinite; filter: drop-shadow(0 0 calc(var(--s) * .05) #f7d774); }
/* Umlaufbahn: ein Punkt kreist */
.avatar.fr-orbit::before { inset: calc(var(--rw) * -1.6); border: 1px dashed color-mix(in srgb, var(--fc) 60%, transparent); }
.avatar.fr-orbit::after { inset: calc(var(--rw) * -1.6); background: radial-gradient(circle at 50% 0, var(--fc) 0 calc(var(--rw) * 1.1), transparent calc(var(--rw) * 1.1 + 1px)); animation: frSpin 2.2s linear infinite; filter: drop-shadow(0 0 4px var(--fc)); }
/* Funkeln */
.avatar.fr-sparkle::before { inset: 0; box-shadow: 0 0 calc(var(--s) * .12) calc(var(--s) * .02) var(--fc); }
.avatar.fr-sparkle::after { content: "✦"; inset: auto; right: -8%; top: -14%; font-size: calc(var(--s) * .34); line-height: 1; color: #fff; text-shadow: 0 0 6px var(--fc), 0 0 12px var(--fc); animation: frTwinkle 1.6s ease-in-out infinite; border-radius: 0; }
@keyframes frTwinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: .2; } 50% { transform: scale(1) rotate(90deg); opacity: 1; } }
/* Giftig */
.avatar.fr-toxic::before { background: repeating-conic-gradient(#7CFF3B 0 18deg, #1f6b00 18deg 36deg); animation: frSpin 5s linear infinite reverse; filter: drop-shadow(0 0 calc(var(--s) * .1) #7CFF3B); }
@media (prefers-reduced-motion: reduce) { .avatar.fr::before, .avatar.fr::after { animation: none !important; } }
/* Auswahl in den Einstellungen */
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 6px; }
.fr-opt { background: var(--bg1); border: 2px solid transparent; border-radius: 10px; padding: 12px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.fr-opt.sel { border-color: var(--accent); color: var(--text); }
.fr-opt span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Studio: Frei-Modus, Rahmen, Trenner, Schriften, Designs */
body.free-edit #app, body.free-edit #app *, body.free-edit .modal * { cursor: crosshair !important; }
.fr-hover { position: fixed; z-index: 104; pointer-events: none; border: 1px dashed #2de2e6; background: rgba(45,226,230,.07); border-radius: 3px; }
.fr-hover::after { content: attr(data-label); position: absolute; left: -1px; bottom: 100%; background: #2de2e6; color: #111; font: 600 11px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 3px 3px 3px 0; white-space: nowrap; }
.fr-sel { position: fixed; z-index: 106; border: 2px solid #2de2e6; box-shadow: 0 0 0 1px #000, 0 0 16px rgba(45,226,230,.5); border-radius: 4px; cursor: move !important; touch-action: none; background: rgba(45,226,230,.06); }
.fr-sel .fr-lbl { position: absolute; left: -2px; top: -22px; background: #2de2e6; color: #111; font: 700 12px/1 system-ui, sans-serif; padding: 4px 7px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.fr-sel .fr-h { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; background: #2de2e6; border: 2px solid #111; border-radius: 4px; cursor: nwse-resize !important; }
@media (pointer: coarse) { .fr-sel .fr-h { width: 26px; height: 26px; right: -13px; bottom: -13px; } }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.sep-row { background: #222327; border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.sep-t { font-size: 13px; margin-bottom: 6px; }
.sep-c { display: flex; align-items: center; gap: 6px; }
.sep-c select { flex: 1; min-width: 0; }
.sep-c input[type=range] { width: 80px; }
.ft-item, .ds-item { display: flex; align-items: center; gap: 8px; background: #222327; border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.ft-prev { font-size: 20px; margin-top: 4px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-item { flex-wrap: wrap; }
.ds-item.on { box-shadow: 0 0 0 1px #2de2e6; }
.ds-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.pk-ggrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px; }
.pk-g { border: 0; padding: 0; background: var(--bg3); border-radius: 6px; overflow: hidden; height: 108px; cursor: pointer; }
.pk-g img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-g:hover { outline: 2px solid var(--accent); }
.pk-attr { font-size: 10px; color: var(--muted); text-align: right; padding: 4px 10px 8px; letter-spacing: .04em; }
/* Video: Antippen = groß */
.vtile { cursor: pointer; }
.video-stage.has-feature .vtile { flex: 0 0 auto; height: 13vh; max-width: none; aspect-ratio: 16 / 9; }
.video-stage.has-feature .vtile.featured { order: -2; flex: 1 1 100%; height: 44vh; height: 44dvh; max-width: 100%; aspect-ratio: auto; }
@media (max-width: 760px) { .video-stage.has-feature .vtile.featured { height: 32dvh; } .video-stage.has-feature .vtile:not(.featured) { height: 11dvh; } }
.btn-media.sq { flex: 0 0 auto; padding-left: 10px; padding-right: 10px; }
.ds-item > .grow { flex: 1 1 100%; }
.st-foot { flex-wrap: wrap; row-gap: 6px; }
.st-foot .st-dirty { flex: 1 1 100%; }
.st-foot .grow { display: none; }
.st-foot .btn { flex: 1 1 auto; }
/* Einrasten: Hilfslinien beim Ziehen */
.snap-guide { position: fixed; z-index: 107; pointer-events: none; background: #ff2fd1; box-shadow: 0 0 6px #ff2fd1; }
.snap-guide.snap-x { top: 0; bottom: 0; width: 1px; }
.snap-guide.snap-y { left: 0; right: 0; height: 1px; }
.snap-guide span { position: absolute; background: #ff2fd1; color: #fff; font: 700 11px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 3px; white-space: nowrap; }
.snap-guide.snap-x span { top: 8px; left: 4px; }
.snap-guide.snap-y span { left: 8px; top: 4px; }
/* Bild/GIF als Hintergrund eines Teils */
.img-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.img-pick .btn { margin: 0; }
.img-thumb { width: 54px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid var(--bg4); }
/* Server-Design (Studio im Server-Modus) */
#studio .st-modesel { margin-left: 8px; max-width: 170px; padding: 3px 6px; font-size: 12px; height: auto; }
#studio .st-srvname { color: var(--accent-h, #5865f2); }
#studio .st-srvnote { margin: 0 12px 6px; padding: 6px 10px; border-radius: 6px; background: rgba(250, 166, 26, .12); border: 1px solid rgba(250, 166, 26, .35); }
#studio.srv-mode .st-head { box-shadow: inset 0 -2px 0 #faa61a; }
/* Ultracord-Ränge */
.rank-badge { display: inline-flex; vertical-align: -2px; margin-left: 4px; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.rank-badge.rank-owner svg { filter: drop-shadow(0 0 3px rgba(245,197,66,.7)); }
.rank-badge.rank-coowner svg { filter: drop-shadow(0 0 3px rgba(227,232,239,.6)); }
.rank-label { font-weight: 600; margin-top: 2px; }
.rank-label.rank-owner { color: #f5c542; } .rank-label.rank-coowner { color: #c9d1dc; }
.rank-label.rank-admin { color: #5aa9ff; } .rank-label.rank-mod { color: #3ddc84; }
.rank-legend { display: grid; gap: 4px; margin-bottom: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.adm-row { gap: 8px; align-items: center; }
.adm-row select { width: auto; min-width: 110px; }
.adm-row.is-banned { opacity: .65; }
.ban-tag { font-size: 11px; color: #fff; background: var(--red, #da373c); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.rank-fix { font-weight: 700; color: #f5c542; min-width: 110px; }
.mod-row { border-top: 1px solid var(--bg4); padding-top: 10px; margin-top: 10px; }
/* Anmeldeseite: Logo-Bild, Vorschau im Studio */
.auth-logo-img { display: block; margin: 0 auto 8px; object-fit: contain; }
.auth.auth-preview { z-index: 105; }
.auth.auth-preview form, .auth.auth-preview #auth-switch { pointer-events: none; }
/* App-Symbol-Vorschau */
.ap-prev { display: flex; align-items: center; gap: 14px; margin: 10px 0; padding: 12px; border-radius: 10px; background: linear-gradient(135deg, #3b3f6b, #191a2e); }
.ap-prev canvas { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 4px 12px rgba(0,0,0,.4); background: transparent; }
.ap-prev b { color: #fff; font-size: 13px; }
/* Fernzugriff: Kopplungs-Karten */
#remote-pair { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.rp-card { background: #1e1f22; color: #dbdee1; border: 1px solid #5865f2; border-radius: 10px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.rp-card.live { border-color: #da373c; background: #2b1416; }
.rp-code-label { margin-top: 4px; color: #b5bac1; font-size: 12px; }
.rp-code { font: 700 30px/1.1 ui-monospace, Consolas, monospace; letter-spacing: 3px; color: #fff; text-align: center; padding: 6px 0; background: #111214; border-radius: 8px; user-select: all; }
.rp-in { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #b5bac1; }
.rp-in input { font: 600 20px ui-monospace, Consolas, monospace; letter-spacing: 2px; text-align: center; }
.rp-ok { color: #3ba55d; font-size: 13px; } .rp-wait { color: #faa61a; font-size: 13px; }
.rp-agent { font-size: 12px; color: #f0b232; } .rp-agent.ok { color: #3ba55d; }
.rp-card .row { margin-top: 4px; }
/* Fernzugriff: Zuschauer-Fenster */
#remote-view { position: fixed; inset: 0; z-index: 130; background: #000; display: flex; flex-direction: column; outline: none; }
#remote-view .rv-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #1e1f22; color: #dbdee1; flex-wrap: wrap; }
#remote-view .rv-bar select { width: auto; padding: 3px 6px; }
#remote-view .rv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#remote-view .rv-img { width: 100%; height: 100%; object-fit: contain; touch-action: none; user-select: none; cursor: crosshair; }
#remote-view:not(.has-img) .rv-img { visibility: hidden; }
#remote-view .rv-wait { position: absolute; color: #b5bac1; font-size: 16px; text-align: center; padding: 20px; }
#remote-view.has-img .rv-wait { display: none; }
#remote-view .rv-text { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(420px, 90vw); display: none; }
#remote-view.kb .rv-text { display: block; }
/* Plugins in den Einstellungen */
.pl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pl-item { display: flex; gap: 10px; padding: 10px; border-radius: 8px; background: var(--bg1); }
.pl-ic { font-size: 26px; line-height: 1; }
.pl-admin { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px dashed var(--bg4); border-radius: 8px; }
/* Live-Zahlen in der Server-Übersicht */
.live-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.ls-tile { background: var(--bg1); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ls-tile span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.ls-tile b { font-size: 18px; color: var(--head, #fff); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ls-tile b.good { color: #3ba55d; } .ls-tile b.mid { color: #faa61a; } .ls-tile b.bad { color: #f23f43; }
.ls-tile canvas { width: 100%; height: 26px; }
.ls-tile em { font-style: normal; }
@media (max-width: 760px) { .live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Musik-Bot „DJ Ultra“ ---- */
.bot-tag { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; vertical-align: 2px; letter-spacing: .03em; }
.msg-body code { background: var(--bg0); padding: 1px 5px; border-radius: 4px; font-size: 90%; font-family: Consolas, "Courier New", monospace; }
.music-btn { font-size: 18px; }
.music-btn.live { color: #eb459e; animation: md-pulse 1.6s ease-in-out infinite; }
@keyframes md-pulse { 50% { transform: scale(1.15); } }
.music-add { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 2px; padding: 3px 10px; border-radius: 12px; border: 1px solid #eb459e66; background: #eb459e1a; color: #f7a5d0; font-size: 12.5px; font-weight: 600; }
.music-add:hover { background: #eb459e33; }
.mdock { position: fixed; right: 16px; bottom: 86px; z-index: 110; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 110px); display: flex; flex-direction: column; background: var(--float); color: var(--text); border: 1px solid #eb459e88; border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.55); overflow: hidden; font-size: 14px; }
.md-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: linear-gradient(90deg, #eb459e33, transparent); }
.md-logo { font-size: 20px; }
.md-who { display: flex; flex-direction: column; line-height: 1.15; }
.md-who b { color: var(--head); }
.md-ch { color: var(--muted); font-size: 12px; }
.md-listen { border: 0; border-radius: 14px; padding: 4px 10px; background: #eb459e; color: #fff; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.md-listen.on { background: var(--green); }
.md-stage { position: relative; background: #000; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.md-player { position: absolute; inset: 0; display: none; }
.mdock.has-player .md-player { display: block; }
.mdock.has-player .md-cover { display: none; }
.md-player iframe, .md-player video, .md-player > div { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.md-player.kind-spotify, .md-player.kind-soundcloud, .md-player.kind-deezer, .md-player.kind-apple { background: var(--bg1); }
.md-player.audio-only video { opacity: 0; }
.md-player.audio-only::after { content: "🎶"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; pointer-events: none; animation: md-pulse 1.6s ease-in-out infinite; }
.md-cover { font-size: 56px; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #eb459e44, #000 70%); }
.md-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.md-tap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 0; border-radius: 22px; padding: 10px 18px; background: #eb459e; color: #fff; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.6); z-index: 2; }
.md-err { position: absolute; inset: auto 0 0 0; padding: 10px; background: #000c; color: #fff; text-align: center; font-size: 13px; }
.md-stage:fullscreen { aspect-ratio: auto; }
.md-now { padding: 8px 12px 0; }
.md-title { color: var(--head); font-weight: 700; }
.md-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.md-prog { flex: 1; height: 6px; border-radius: 3px; background: var(--bg4); cursor: pointer; overflow: hidden; }
.md-fill { height: 100%; width: 0; background: #eb459e; transition: width 1s linear; }
.md-ctl { display: flex; align-items: center; gap: 2px; padding: 4px 8px; }
.md-ctl .icon-btn { font-size: 18px; min-width: 34px; }
.md-vol { display: flex; align-items: center; gap: 4px; }
.md-vol input { width: 80px; padding: 0; accent-color: #eb459e; }
.md-add { display: flex; gap: 6px; padding: 4px 12px 8px; }
.md-add input { padding: 7px 9px; font-size: 13px; }
.md-queue { overflow: auto; max-height: 180px; border-top: 1px solid var(--bg3); }
.md-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; cursor: pointer; }
.md-item:hover { background: var(--hover); }
.md-item.cur { background: #eb459e22; }
.md-item.done { opacity: .5; }
.md-item b { font-weight: 600; color: var(--text); }
.md-n { width: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.md-empty { padding: 10px 12px; }
.md-foot { padding: 6px 12px 8px; border-top: 1px solid var(--bg3); }
.mdock.min { width: min(300px, calc(100vw - 32px)); }
.mdock.min .md-stage { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mdock.min .md-add, .mdock.min .md-queue, .mdock.min .md-foot, .mdock.min .md-bar, .mdock.min .md-sub { display: none; }
@media (max-width: 760px) {
  .mdock { left: 8px; right: 8px; width: auto; top: calc(56px + env(safe-area-inset-top)); bottom: auto; max-height: calc(100vh - 140px); }
  .mdock.min { width: auto; }
  .md-queue { max-height: 120px; }
}
