/* ═══════════════════════════════════════════════════════════
   Nexus – Design-System v2  ·  schwebende Panels, Linien-Icons
   ═══════════════════════════════════════════════════════════ */
:root {
  --accent: #8b5cf6;
  --accent-2: color-mix(in srgb, var(--accent) 70%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-fg: #fff;

  --bg: #050506;
  --bg-image: radial-gradient(1200px 700px at 0% 0%, rgba(255,255,255,.025), transparent 60%);
  --panel: #0d0d10;
  --panel-2: #141417;
  --panel-3: #1b1b1f;
  --float: #141417;
  --line: rgba(255, 255, 255, .065);
  --line-2: rgba(255, 255, 255, .11);
  --hover: rgba(255, 255, 255, .045);
  --active: rgba(255, 255, 255, .085);
  --text: #e4e4e9;
  --text-strong: #fafafa;
  --muted: #9b9ba6;
  --faint: #66666f;
  --green: #22c55e;
  --yellow: #f5b544;
  --red: #f43f5e;
  --link: #7cc4ff;
  --mention-bg: color-mix(in srgb, var(--accent) 8%, transparent);
  --mention-bar: var(--accent);
  --code-bg: #0a0a0c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0,0,0,.4);
  --r-panel: 18px;
  --r: 10px;
  --blur: none;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --fs: 15px;
  color-scheme: dark;
}
:root[data-theme="midnight"] {
  --bg: #04060c; --panel: #0a0f1d; --panel-2: #10172a; --panel-3: #172038; --float: #10172a; --code-bg: #060a14;
  --bg-image: radial-gradient(900px 600px at 100% 0%, rgba(59,130,246,.10), transparent 60%);
}
:root[data-theme="aurora"] {
  --bg: #07050f; --panel: rgba(16, 12, 30, .72); --panel-2: rgba(30, 22, 54, .7); --panel-3: rgba(42, 30, 72, .7); --float: #1a1330; --code-bg: rgba(0,0,0,.35);
  --bg-image: radial-gradient(800px 600px at 10% 10%, rgba(139,92,246,.35), transparent 60%), radial-gradient(700px 600px at 90% 80%, rgba(20,184,166,.25), transparent 60%), radial-gradient(600px 400px at 60% 0%, rgba(236,72,153,.18), transparent 60%);
  --blur: blur(22px) saturate(140%);
}
:root[data-theme="forest"] {
  --bg: #040806; --panel: #0a120e; --panel-2: #101b15; --panel-3: #16241c; --float: #101b15; --code-bg: #060b08;
  --bg-image: radial-gradient(900px 600px at 0% 100%, rgba(34,197,94,.10), transparent 60%);
}
:root[data-theme="sunset"] {
  --bg: #0b0505; --panel: #140b0b; --panel-2: #1e1110; --panel-3: #2a1716; --float: #1e1110; --code-bg: #0c0606;
  --bg-image: radial-gradient(900px 600px at 100% 100%, rgba(249,115,22,.14), transparent 60%), radial-gradient(700px 500px at 0% 0%, rgba(236,72,153,.10), transparent 60%);
}
:root[data-theme="light"] {
  --bg: #e9e9ee; --panel: #ffffff; --panel-2: #f4f4f6; --panel-3: #ebebef; --float: #ffffff; --code-bg: #f4f4f6;
  --bg-image: none;
  --line: rgba(0, 0, 0, .07); --line-2: rgba(0, 0, 0, .12);
  --hover: rgba(0, 0, 0, .04); --active: rgba(0, 0, 0, .07);
  --text: #26262c; --text-strong: #09090b; --muted: #61616b; --faint: #94949e;
  --link: #2563eb;
  --shadow: 0 18px 50px rgba(0, 0, 0, .12), 0 2px 8px rgba(0,0,0,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
body {
  background: var(--bg-image), var(--bg); background-attachment: fixed; color: var(--text); font-family: var(--font); font-size: var(--fs);
  overflow: hidden; -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; }
svg.i.s14 { width: 14px; height: 14px; }
svg.i.s16 { width: 16px; height: 16px; }
svg.i.s18 { width: 18px; height: 18px; }
svg.i.s24 { width: 24px; height: 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.scroll { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
.scroll::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.scroll.thin::-webkit-scrollbar { width: 6px; }
.scroll.none { scrollbar-width: none; }
.scroll.none::-webkit-scrollbar { display: none; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  min-width: 0; min-height: 0;
}
:root[data-theme="light"] .panel { box-shadow: 0 1px 2px rgba(0,0,0,.04); }

/* ─────────────── Auth ─────────────── */
.auth {
  height: 100%; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden;
  background: radial-gradient(900px 600px at 15% 20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
              radial-gradient(800px 600px at 85% 85%, rgba(20,184,166,.18), transparent 60%), #050506;
}
.auth::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-card {
  position: relative; width: 100%; max-width: 440px; background: rgba(13,13,16,.82); border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px; padding: 36px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.6); backdrop-filter: blur(20px); animation: pop .3s ease; color-scheme: dark; color: #e4e4e9;
}
.auth-card .logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.auth-card .logo img { width: 48px; height: 48px; }
.auth-card .logo span { font-size: 26px; font-weight: 800; letter-spacing: -.04em; color: #fff; }
.auth-card h1 { text-align: center; margin: 0 0 6px; font-size: 24px; color: #fff; letter-spacing: -.03em; }
.auth-card p.sub { text-align: center; margin: 0 0 24px; color: #9b9ba6; }
.auth-card .switch { margin-top: 16px; font-size: 14px; color: #9b9ba6; text-align: center; }
.auth-card .switch a { cursor: pointer; color: #fff; font-weight: 600; }
.auth-card .error { color: var(--red); font-size: 13px; margin-bottom: 10px; }
.auth-card .input { background: #0a0a0c; border-color: rgba(255,255,255,.08); }

/* ─────────────── Formulare ─────────────── */
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.field label .req { color: var(--red); }
.input, textarea.input, select.input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 84px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 12px;
  background: var(--text-strong); color: var(--panel); font-weight: 600; font-size: 14px; transition: transform .1s, background .15s, opacity .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 20px rgba(0,0,0,.3); background: color-mix(in srgb, var(--text-strong) 88%, var(--accent)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; height: 46px; font-size: 15px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.accent { background: var(--accent); color: var(--accent-fg); }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn.secondary { background: var(--panel-3); color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--active); box-shadow: none; }
.btn.green { background: var(--green); color: #04130a; }
.btn.danger { background: var(--red); color: #fff; }
.btn.link { background: none; color: var(--muted); }
.btn.link:hover { color: var(--text); box-shadow: none; background: none; }
.btn.outline-danger { background: none; border: 1px solid color-mix(in srgb, var(--red) 60%, transparent); color: var(--red); }
.btn.outline-danger:hover { background: var(--red); color: #fff; }
.auth-card .btn { background: #fafafa; color: #0d0d10; }

.toggle { position: relative; width: 42px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 12px; transition: .2s; cursor: pointer; }
.toggle span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--muted); border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--accent); border-color: transparent; }
.toggle input:checked + span::before { transform: translateX(18px); background: #fff; }

/* ─────────────── Grundlayout ─────────────── */
.shell {
  display: grid; height: 100%; padding: 8px; gap: 8px;
  grid-template-columns: 64px 268px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
}
.rail { grid-column: 1; grid-row: 1; }
.sidebar { grid-column: 2; grid-row: 1; }
.userarea { grid-column: 1 / span 2; grid-row: 2; display: flex; flex-direction: column; gap: 8px; }
.main { grid-column: 3; grid-row: 1 / span 2; min-width: 0; min-height: 0; display: flex; }
.main-body { flex: 1; display: flex; gap: 8px; min-height: 0; min-width: 0; }
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* ─────────────── Server-Leiste ─────────────── */
.rail { padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail .sep { width: 28px; height: 1px; background: var(--line-2); flex: none; margin: 2px 0; }
.rail-item { position: relative; width: 64px; display: flex; justify-content: center; flex: none; }
.rail-item .pill {
  position: absolute; left: -1px; top: 50%; width: 3px; height: 0; background: var(--text-strong); border-radius: 0 3px 3px 0; transform: translateY(-50%); transition: height .2s;
}
.rail-item.unread .pill { height: 8px; }
.rail-item:hover .pill { height: 18px; }
.rail-item.active .pill { height: 32px; }
.rail-btn {
  width: 44px; height: 44px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden;
  transition: border-radius .2s, background .2s, color .2s, box-shadow .2s, transform .15s; color: var(--text); font-weight: 700; font-size: 15px; position: relative;
}
.rail-btn img { width: 100%; height: 100%; object-fit: cover; }
.rail-btn svg { color: var(--muted); }
.rail-item:hover .rail-btn { border-radius: 12px; background: var(--panel-3); transform: translateY(-1px); }
.rail-item:hover .rail-btn svg { color: var(--text-strong); }
.rail-item.active .rail-btn { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--text-strong); border-radius: 13px; }
.rail-btn.home { background: linear-gradient(145deg, var(--panel-3), var(--panel)); }
.rail-btn.home img { width: 44px; height: 44px; }
.rail-btn.action svg { color: var(--muted); }
.rail-item:hover .rail-btn.action { background: var(--accent); border-color: transparent; }
.rail-item:hover .rail-btn.action svg { color: #fff; }
.rail-btn.green-act svg { color: var(--green); }
.rail-item:hover .rail-btn.green-act { background: var(--green); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-grid; place-items: center; line-height: 1;
}
.rail-item .badge { position: absolute; right: 6px; top: -3px; border: 3px solid var(--panel); height: 22px; min-width: 22px; border-radius: 11px; }
.rail-item .badge.dot { min-width: 0; width: 14px; height: 14px; padding: 0; background: var(--accent); right: 9px; }

.tip {
  position: fixed; z-index: 1000; background: var(--float); color: var(--text-strong); padding: 7px 11px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); border: 1px solid var(--line); pointer-events: none; white-space: nowrap; animation: fade .1s; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}

/* ─────────────── Seitenleiste ─────────────── */
.sidebar { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-header {
  height: 60px; flex: none; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 16px; color: var(--text-strong); gap: 8px; letter-spacing: -.02em;
}
.sidebar-header.clickable { cursor: pointer; transition: background .15s; }
.sidebar-header.clickable:hover { background: var(--hover); }
.sidebar-header .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-header svg { color: var(--muted); }
.search-fake {
  width: 100%; height: 36px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500;
  text-align: left; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px;
}
.search-fake:hover { border-color: var(--line-2); color: var(--text); }
.search-fake kbd { margin-left: auto; font: 600 11px var(--font); background: var(--panel-3); padding: 2px 6px; border-radius: 6px; color: var(--muted); }
.sidebar-body { flex: 1; padding: 10px 10px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: var(--r); color: var(--muted); font-weight: 500; margin-bottom: 2px; cursor: pointer; width: 100%;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--active); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line); }
.nav-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--faint); letter-spacing: .1em;
}
.section-title button { color: var(--faint); display: grid; padding: 2px; border-radius: 6px; }
.section-title button:hover { color: var(--text); background: var(--hover); }
.dm-item { height: 46px; }
.dm-item .sub { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-item.unread { color: var(--text-strong); font-weight: 600; }

.category {
  display: flex; align-items: center; gap: 4px; padding: 18px 8px 6px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--faint); cursor: pointer; user-select: none;
}
.category:hover { color: var(--muted); }
.category .cname { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.category svg.chev { transition: transform .15s; }
.category.collapsed svg.chev { transform: rotate(-90deg); }
.category .grow { flex: 1; }
.category .add { display: grid; color: var(--faint); padding: 2px; border-radius: 6px; }
.category .add:hover { color: var(--text); background: var(--hover); }
.channel {
  position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; margin: 2px 0; border-radius: var(--r); color: var(--muted);
  cursor: pointer; font-weight: 500; transition: background .12s, color .12s;
}
.channel svg { color: var(--faint); }
.channel:hover { background: var(--hover); color: var(--text); }
.channel.active { background: var(--active); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line); }
.channel.active svg { color: var(--text); }
.channel.unread { color: var(--text-strong); font-weight: 600; }
.channel.unread::before { content: ''; position: absolute; left: -10px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text-strong); }
.channel.muted { opacity: .45; }
.channel .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .tools { display: none; gap: 2px; }
.channel .tools button { color: var(--faint); display: grid; padding: 3px; border-radius: 6px; }
.channel .tools button:hover { color: var(--text); background: var(--hover); }
.channel:hover .tools, .channel.active .tools { display: flex; }
.voice-users { margin: 0 0 6px 30px; }
.voice-user { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.voice-user:hover { background: var(--hover); color: var(--text); }
.voice-user .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user .icons { display: flex; gap: 4px; color: var(--faint); align-items: center; }
.voice-user .live { background: var(--red); color: #fff; font-size: 9.5px; font-weight: 800; padding: 2px 5px; border-radius: 5px; letter-spacing: .04em; }

/* ─────────────── Unten links: Voice + User ─────────────── */
.voice-panel { padding: 12px; }
.voice-panel .row { display: flex; align-items: center; gap: 8px; }
.voice-panel .status { flex: 1; min-width: 0; }
.voice-panel .status .t { color: var(--green); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.voice-panel .status .c { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 2px; }
.voice-panel .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.voice-panel .btns button { height: 34px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); }
.voice-panel .btns button:hover { background: var(--active); }
.voice-panel .btns button.on { background: var(--accent); color: #fff; border-color: transparent; }
.user-panel { height: 62px; display: flex; align-items: center; padding: 0 10px; gap: 2px; }
.user-panel .me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 5px 8px 5px 5px; border-radius: 12px; cursor: pointer; }
.user-panel .me:hover { background: var(--hover); }
.user-panel .me .names { min-width: 0; line-height: 1.25; }
.user-panel .me .n { font-size: 14px; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-panel .me .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; position: relative; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--hover); color: var(--text-strong); }
.icon-btn.active { color: var(--text-strong); background: var(--active); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--red) 14%, transparent); }

/* ─────────────── Avatare & Rahmen ─────────────── */
.avatar { position: relative; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; user-select: none; }
.avatar > .img { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(145deg, var(--c, #8b5cf6), color-mix(in srgb, var(--c, #8b5cf6) 55%, #000)); position: relative; z-index: 1; }
.avatar > .img img { width: 100%; height: 100%; object-fit: cover; }
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px; width: 34%; height: 34%; min-width: 10px; min-height: 10px; border-radius: 50%; z-index: 3;
  border: 2.5px solid var(--ring, var(--panel)); background: #6b6b75;
}
.avatar .dot.online { background: var(--green); }
.avatar .dot.idle { background: var(--yellow); }
.avatar .dot.dnd { background: var(--red); }
.avatar .dot.offline { background: #6b6b75; }
.avatar .dot.offline::after { content: ''; position: absolute; inset: 22%; background: var(--ring, var(--panel)); border-radius: 50%; }
.avatar .dot.dnd::after { content: ''; position: absolute; left: 18%; right: 18%; top: 40%; height: 20%; background: var(--ring, var(--panel)); border-radius: 2px; }
.avatar.speaking > .img { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--green); }
.avatar[class*="frame-"]::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; z-index: 0; }
.profile .pa .avatar[class*="frame-"]::before, .account-card .head .avatar[class*="frame-"]::before { inset: -9px; }
.avatar.frame-glow::before { box-shadow: 0 0 14px 2px var(--accent); background: var(--accent); }
.avatar.frame-rainbow::before { background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #8b5cf6, #ec4899, #f43f5e); animation: spin 3s linear infinite; }
.avatar.frame-fire::before { background: conic-gradient(from 180deg, #ef4444, #f97316, #facc15, #f97316, #ef4444); filter: blur(.5px); box-shadow: 0 0 12px rgba(249,115,22,.7); animation: spin 2.2s linear infinite; }
.avatar.frame-neon::before { background: #06b6d4; box-shadow: 0 0 6px #06b6d4, 0 0 16px #22d3ee; animation: neon 1.6s ease-in-out infinite; }
.avatar.frame-gold::before { background: linear-gradient(135deg, #fde68a, #b45309, #fef3c7, #92400e); box-shadow: 0 0 10px rgba(234,179,8,.5); }
.avatar.frame-ice::before { background: conic-gradient(#e0f2fe, #7dd3fc, #ffffff, #38bdf8, #e0f2fe); box-shadow: 0 0 12px rgba(125,211,252,.6); animation: spin 5s linear infinite; }

.ubadge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; padding: 1px 6px 1px 4px; border-radius: 6px; line-height: 1.5;
  color: var(--b); background: color-mix(in srgb, var(--b) 16%, transparent); border: 1px solid color-mix(in srgb, var(--b) 40%, transparent); vertical-align: 1px; letter-spacing: .01em; }
.ubadge svg { width: 11px; height: 11px; stroke-width: 2.4; }

/* ─────────────── Kopfzeile ─────────────── */
.main-header { height: 60px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.main-header .title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text-strong); white-space: nowrap; letter-spacing: -.02em; }
.main-header .title svg { color: var(--muted); }
.main-header .topic { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line-2); cursor: pointer; }
.main-header .spacer { flex: 1; }
.main-header .tools { display: flex; align-items: center; gap: 8px; }
.tool-group { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.tool-group .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.main-header .search { position: relative; }
.main-header .search input {
  width: 170px; height: 38px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); padding: 0 12px 0 34px; font-size: 13px; outline: none; transition: width .2s, border-color .15s;
}
.main-header .search input:focus { width: 250px; border-color: var(--line-2); }
.main-header .search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }

/* ─────────────── Nachrichten ─────────────── */
.messages { flex: 1; display: flex; flex-direction: column; padding: 8px 0 12px; }
.messages-inner { margin-top: auto; }
.welcome { padding: 24px; margin: 24px 0 8px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.welcome .big-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; margin-bottom: 18px; color: var(--text-strong); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.welcome .big-icon svg { width: 32px; height: 32px; }
.welcome h2 { font-size: 30px; margin: 6px 0 6px; color: var(--text-strong); font-weight: 800; letter-spacing: -.04em; }
.welcome p { color: var(--muted); margin: 0; max-width: 520px; line-height: 1.5; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 14px; transition: .15s; }
.chip:hover { background: var(--panel-3); color: var(--text-strong); transform: translateY(-1px); }
.load-more { text-align: center; color: var(--muted); font-size: 13px; padding: 14px; }
.divider { display: flex; align-items: center; margin: 22px 20px 6px; height: 0; border-top: 1px solid var(--line); justify-content: center; }
.divider span { background: var(--panel); color: var(--faint); font-size: 11.5px; font-weight: 700; padding: 2px 10px; transform: translateY(-50%); border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; }
.divider.new { border-color: var(--red); justify-content: flex-end; }
.divider.new span { background: var(--red); color: #fff; border: 0; font-size: 10px; font-weight: 800; padding: 1px 7px; }

.msg { position: relative; padding: 3px 56px 3px 76px; margin: 0 8px; border-radius: 12px; min-height: 22px; line-height: 1.45; }
.msg.head { margin-top: 16px; }
.msg:hover { background: var(--hover); }
.msg.editing, .msg.replying { background: var(--accent-soft); }
.msg.mentioned { background: var(--mention-bg); }
.msg.mentioned::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--mention-bar); }
.msg.highlight { animation: flash 2s ease; }
.msg .msg-avatar { position: absolute; left: 18px; top: 4px; cursor: pointer; }
.msg.has-ref .msg-avatar { top: 26px; }
.msg .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg .author { font-weight: 700; color: var(--text-strong); cursor: pointer; letter-spacing: -.01em; }
.msg .author:hover { text-decoration: underline; }
.msg .time { font-size: 11.5px; color: var(--faint); font-weight: 500; }
.msg .side-time { position: absolute; left: 0; width: 76px; text-align: center; font-size: 10.5px; color: var(--faint); top: 6px; opacity: 0; }
.msg:hover .side-time { opacity: 1; }
.msg .content { color: var(--text); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .edited { font-size: 10.5px; color: var(--faint); margin-left: 4px; }
.msg .ref { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 4px; position: relative; cursor: pointer; min-width: 0; }
.msg .ref::before { content: ''; position: absolute; left: -40px; top: 9px; width: 32px; height: 12px; border-left: 2px solid var(--line-2); border-top: 2px solid var(--line-2); border-top-left-radius: 8px; }
.msg .ref .ref-author { font-weight: 700; color: var(--text-strong); opacity: .85; white-space: nowrap; }
.msg .ref .ref-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .ref:hover .ref-text { color: var(--text); }
.msg.system { padding-top: 6px; padding-bottom: 6px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 14px; }
.msg.system .sys-icon { position: absolute; left: 32px; top: 8px; color: var(--green); }
.msg.system .sys-icon.pin { color: var(--muted); }
.msg.system b { color: var(--text-strong); font-weight: 600; cursor: pointer; }
.msg.system .time { margin-left: 6px; }

.msg .actions {
  position: absolute; right: 14px; top: -18px; display: none; background: var(--float); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; box-shadow: var(--shadow); z-index: 2; gap: 1px;
}
.msg:hover .actions, .msg.menu-open .actions { display: flex; }
.msg .actions button { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.msg .actions button:hover { background: var(--hover); color: var(--text-strong); }
.msg .actions button.danger:hover { color: var(--red); }
.msg .actions .quick { font-size: 17px; }
.msg .actions .vsep { width: 1px; background: var(--line-2); margin: 5px 3px; }

/* Markdown */
.content strong { font-weight: 700; color: var(--text-strong); }
.content code { font-family: var(--mono); font-size: 84%; background: var(--code-bg); border: 1px solid var(--line); padding: .1em .35em; border-radius: 6px; }
.content pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 6px 0 0; max-width: 92%; overflow-x: auto; white-space: pre; }
.content pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.5; }
.content blockquote { margin: 2px 0; padding: 2px 10px 2px 14px; border-left: 3px solid var(--line-2); border-radius: 2px; color: var(--muted); }
.content h1, .content h2, .content h3 { margin: 8px 0 4px; color: var(--text-strong); line-height: 1.25; letter-spacing: -.03em; }
.content h1 { font-size: 1.55em; } .content h2 { font-size: 1.28em; } .content h3 { font-size: 1.08em; }
.content .spoiler { background: var(--panel-3); color: transparent; border-radius: 5px; cursor: pointer; padding: 0 3px; transition: .15s; }
.content .spoiler.shown { background: var(--active); color: inherit; cursor: auto; }
.content .mention { background: var(--accent-soft); color: var(--accent-2); border-radius: 6px; padding: 0 4px; font-weight: 600; cursor: pointer; }
:root[data-theme="light"] .content .mention { color: var(--accent); }
.content .mention:hover { background: var(--accent); color: #fff; }
.content .emoji-big { font-size: 46px; line-height: 1.15; }
.content ul { margin: 4px 0; padding-left: 22px; }

/* Anhänge */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-wrap { position: relative; }
.att-wrap .fav { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; opacity: 0; transition: .15s; backdrop-filter: blur(6px); }
.att-wrap:hover .fav { opacity: 1; }
.att-wrap .fav.on { color: #facc15; opacity: 1; }
.att-wrap .fav.on svg { fill: #facc15; }
.att-img { max-width: min(420px, 100%); max-height: 320px; border-radius: 14px; cursor: zoom-in; object-fit: contain; background: var(--panel-2); border: 1px solid var(--line); }
.att-video { max-width: min(500px, 100%); max-height: 340px; border-radius: 14px; background: #000; }
.att-file { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; width: 420px; max-width: 100%; }
.att-file .fi { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; flex: none; }
.att-file .fn { flex: 1; min-width: 0; }
.att-file .fn a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-file .fs { font-size: 12px; color: var(--muted); }
audio.att-audio { width: 100%; margin-top: 6px; height: 34px; }

/* Sprachnachricht */
.vmsg { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); width: 340px; max-width: 100%; }
.vmsg-play { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.vmsg-play svg { width: 16px; height: 16px; fill: currentColor; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--faint); transition: background .1s; }
.wave i.on { background: var(--accent-2); }
.vmsg .dur { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* Sticker */
.sticker { font-size: 96px; line-height: 1.1; display: inline-block; margin: 4px 0; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); user-select: none; }
.sticker.a-wave { animation: s-wave 1.6s ease-in-out infinite; transform-origin: 70% 80%; }
.sticker.a-pop { animation: s-pop 1.8s ease-in-out infinite; }
.sticker.a-pulse { animation: s-pulse 1.4s ease-in-out infinite; }
.sticker.a-beat { animation: s-beat 1.2s ease-in-out infinite; }
.sticker.a-shake { animation: s-shake 1.3s ease-in-out infinite; }
.sticker.a-fly { animation: s-fly 2s ease-in-out infinite; }
.sticker.a-tilt { animation: s-tilt 2.2s ease-in-out infinite; }
.sticker.a-float { animation: s-float 2.6s ease-in-out infinite; }
.sticker.a-spin { animation: s-spin 3s linear infinite; }

/* Umfrage */
.poll { margin-top: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: 460px; max-width: 100%; }
.poll .q { font-weight: 700; font-size: 16px; color: var(--text-strong); letter-spacing: -.02em; }
.poll .sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 12px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); margin-bottom: 8px; overflow: hidden; text-align: left; background: var(--panel); transition: border-color .15s; }
.poll-opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .4s ease; z-index: 0; }
.poll-opt.mine { border-color: var(--accent); }
.poll-opt.mine .bar { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.poll-opt > *:not(.bar) { position: relative; z-index: 1; }
.poll-opt .txt { flex: 1; font-weight: 600; }
.poll-opt .pct { font-size: 13px; font-weight: 700; color: var(--muted); }
.poll-opt .ck { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.poll-opt.mine .ck { background: var(--accent); border-color: var(--accent); color: #fff; }
.poll-opt .ck svg { width: 12px; height: 12px; stroke-width: 3; }
.poll .foot { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; }

/* Reaktionen */
.reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.reaction { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; user-select: none; transition: .12s; }
.reaction:hover { border-color: var(--line-2); transform: translateY(-1px); }
.reaction.me { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.reaction .n { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.reaction.me .n { color: var(--accent-2); }
.reaction.add { opacity: 0; color: var(--muted); }
.msg:hover .reaction.add { opacity: 1; }

/* ─────────────── Composer ─────────────── */
.composer-wrap { padding: 0 18px 18px; flex: none; position: relative; }
.typing { position: absolute; left: 24px; right: 24px; bottom: 0; height: 18px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.typing b { font-weight: 700; color: var(--text); }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; background: var(--text); border-radius: 50%; animation: bounce 1.2s infinite; opacity: .6; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
.composer { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 18px; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--text-strong) 22%, transparent); box-shadow: 0 0 0 4px rgba(255,255,255,.025); }
.composer .bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.composer .bar b { color: var(--text-strong); }
.composer .bar .grow { flex: 1; }
.composer .uploads { display: flex; gap: 12px; padding: 14px 14px 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.upload-chip { width: 150px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; position: relative; }
.upload-chip .thumb { height: 96px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: var(--panel-3); color: var(--muted); }
.upload-chip .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-chip .nm { font-size: 12px; margin-top: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.upload-chip .rm { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--float); border: 1px solid var(--line-2); color: var(--red); display: grid; place-items: center; box-shadow: var(--shadow); }
.upload-chip .prog { height: 3px; background: var(--accent); border-radius: 2px; margin-top: 4px; transition: width .2s; }
.composer .row { display: flex; align-items: flex-end; padding: 4px 6px 4px 6px; gap: 2px; }
.composer .row .cbtn { width: 38px; height: 44px; display: grid; place-items: center; color: var(--muted); flex: none; border-radius: 10px; }
.composer .row .cbtn:hover { color: var(--text-strong); }
.composer .row .cbtn svg { width: 20px; height: 20px; }
.composer .tools-right { display: flex; align-items: center; gap: 0; height: 44px; }
.composer textarea { flex: 1; background: none; border: 0; outline: none; resize: none; padding: 12px 6px; max-height: 50vh; line-height: 1.4; color: var(--text); min-height: 44px; }
.composer textarea::placeholder { color: var(--faint); }
.composer .primary-btn { width: 36px; height: 36px; border-radius: 12px; background: var(--text-strong); color: var(--panel); display: grid; place-items: center; margin: 4px 2px 4px 6px; flex: none; transition: transform .12s, background .15s; }
.composer .primary-btn:hover { transform: scale(1.06); }
.composer .primary-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.composer .primary-btn.send { background: var(--accent); color: #fff; }
.composer.disabled { opacity: .6; }
.composer.disabled textarea { cursor: not-allowed; }
.composer .note { font-size: 12px; color: var(--muted); padding: 0 16px 8px; display: flex; align-items: center; gap: 6px; }
.recbar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; height: 52px; }
.recbar .rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: neon 1s ease-in-out infinite; flex: none; }
.recbar .rtime { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-strong); min-width: 44px; }
.recbar .wave { height: 28px; }
.recbar .wave i { background: var(--accent-2); }
.edit-box { margin-top: 4px; }
.edit-box textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; outline: none; resize: none; color: var(--text); }
.edit-box .hint a { cursor: pointer; }

.autocomplete { position: absolute; left: 18px; right: 18px; bottom: calc(100% - 12px); background: var(--float); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px 0; box-shadow: var(--shadow); z-index: 20; max-height: 320px; overflow-y: auto; }
.autocomplete .h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--faint); padding: 4px 16px 8px; }
.autocomplete .it { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 0 6px; border-radius: 10px; cursor: pointer; }
.autocomplete .it.sel { background: var(--active); }
.autocomplete .it .u { color: var(--muted); font-size: 13px; margin-left: auto; }
.jump-bar { position: absolute; left: 30px; right: 30px; top: -38px; height: 34px; background: var(--accent); color: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); }
.jump-bar button { font-weight: 800; }

/* ─────────────── Mitglieder ─────────────── */
.members { width: 250px; flex: none; padding: 6px 10px 20px; }
.members .group { padding: 20px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--faint); letter-spacing: .1em; }
.member { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.member:hover { background: var(--hover); }
.member .names { min-width: 0; flex: 1; line-height: 1.3; }
.member .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; color: var(--text-strong); }
.member .n .nm { overflow: hidden; text-overflow: ellipsis; }
.member .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member.offline { opacity: .45; }
.member.offline:hover { opacity: 1; }
.crown { color: var(--yellow); display: inline-flex; }
.crown svg { stroke-width: 2.2; }

/* Seitenpanel */
.side-panel { width: 420px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.side-panel .hd { height: 60px; display: flex; align-items: center; padding: 0 10px 0 18px; font-weight: 700; color: var(--text-strong); gap: 10px; border-bottom: 1px solid var(--line); }
.side-panel .hd .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-panel .bd { flex: 1; padding: 10px; }
.result { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; padding: 6px 0 8px; cursor: pointer; position: relative; transition: border-color .15s; }
.result:hover { border-color: var(--line-2); }
.result .where { font-size: 12px; color: var(--muted); padding: 4px 14px 2px; font-weight: 700; }
.result .msg { margin: 0; padding-right: 12px; }
.result .msg:hover { background: none; }
.result .jump { position: absolute; right: 10px; top: 8px; font-size: 11.5px; font-weight: 700; background: var(--panel-3); padding: 3px 9px; border-radius: 8px; opacity: 0; }
.result:hover .jump { opacity: 1; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 40px 20px; gap: 12px; line-height: 1.5; }
.empty .big { font-size: 46px; }
.empty .big-i { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-strong); }
.empty .big-i svg { width: 30px; height: 30px; }

/* ─────────────── Freunde ─────────────── */
.tabs { display: flex; align-items: center; gap: 4px; }
.tabs .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 8px; }
.tab { height: 32px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: var(--active); color: var(--text-strong); }
.tab.add { background: var(--accent); color: #fff; }
.tab.add.active { background: var(--accent-soft); color: var(--accent-2); }
.friends { flex: 1; padding: 18px 24px; }
.friends .count { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--faint); margin: 8px 0 10px; }
.friend-row { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 12px; margin: 0 -12px 2px; border-radius: 14px; cursor: pointer; transition: background .12s; }
.friend-row:hover { background: var(--hover); }
.friend-row .names { flex: 1; min-width: 0; }
.friend-row .n { font-weight: 700; color: var(--text-strong); }
.friend-row .n .u { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; opacity: 0; transition: .12s; }
.friend-row:hover .n .u { opacity: 1; }
.friend-row .s { font-size: 13px; color: var(--muted); }
.round-btn { width: 38px; height: 38px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; transition: .12s; }
.round-btn:hover { color: var(--text-strong); border-color: var(--line-2); }
.round-btn.ok:hover { color: var(--green); }
.round-btn.no:hover { color: var(--red); }
.add-friend h2 { margin: 6px 0; font-size: 20px; color: var(--text-strong); letter-spacing: -.03em; }
.add-friend p { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.add-friend .box { display: flex; align-items: center; background: var(--panel-2); border-radius: 16px; padding: 0 8px 0 16px; border: 1px solid var(--line-2); }
.add-friend .box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.add-friend .box input { flex: 1; background: none; border: 0; outline: none; height: 56px; font-size: 16px; }
.add-friend .msgline { font-size: 14px; margin-top: 10px; }
.add-friend .msgline.ok { color: var(--green); } .add-friend .msgline.err { color: var(--red); }
.active-now { width: 340px; flex: none; padding: 18px; }
.active-now h3 { margin: 4px 0 16px; font-size: 18px; color: var(--text-strong); letter-spacing: -.03em; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 10px; }
.card .t { font-weight: 700; color: var(--text-strong); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card .d { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.plus-card { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--panel-2)), var(--panel-2) 60%); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ─────────────── Voice ─────────────── */
.voice-view { flex: 1; background: #000; display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-panel); overflow: hidden; }
.chat .voice-view { border-radius: 0; border-bottom: 1px solid var(--line); }
.voice-grid { flex: 1; display: grid; gap: 10px; padding: 16px; align-content: center; justify-content: center; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); overflow: auto; }
.tile { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(circle at 50% 40%, #1f1f25, #111114); border: 1px solid rgba(255,255,255,.06); border-radius: 18px; display: grid; place-items: center; overflow: hidden; min-height: 150px; max-height: 70vh; transition: box-shadow .12s; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--green), 0 0 30px rgba(34,197,94,.2); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile .label { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); color: #fff; padding: 4px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .tile-avatar { width: 84px; height: 84px; }
.voice-controls { height: 84px; display: flex; align-items: center; justify-content: center; gap: 12px; flex: none; }
.vc-btn { width: 52px; height: 52px; border-radius: 16px; background: #1c1c21; border: 1px solid rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; transition: .15s; }
.vc-btn:hover { background: #28282f; transform: translateY(-1px); }
.vc-btn.off { background: #fff; color: #000; }
.vc-btn.on { background: var(--accent); border-color: transparent; }
.vc-btn.leave { background: var(--red); border-color: transparent; width: 64px; }
.voice-join { flex: 1; display: grid; place-items: center; color: #fff; text-align: center; }
.voice-join h2 { font-size: 28px; margin: 12px 0 4px; letter-spacing: -.03em; }
.voice-join p { color: #a1a1aa; margin: 0 0 20px; }

/* ─────────────── Layer: Modals / Menüs ─────────────── */
#layer > * { z-index: 100; }
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); display: grid; place-items: center; animation: fade .15s; padding: 16px; }
.modal { width: 100%; max-width: 480px; background: var(--float); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.2,.9,.3,1.2); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { max-width: 580px; }
.modal .mh { padding: 26px 22px 8px; text-align: center; position: relative; }
.modal .mh.left { text-align: left; }
.modal .mh h2 { margin: 0; font-size: 21px; color: var(--text-strong); font-weight: 800; letter-spacing: -.03em; }
.modal .mh p { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.modal .mh .x { position: absolute; right: 14px; top: 14px; color: var(--muted); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.modal .mh .x:hover { color: var(--text); background: var(--hover); }
.modal .mb { padding: 16px 22px; overflow-y: auto; }
.modal .mf { padding: 14px 22px; background: color-mix(in srgb, var(--panel) 60%, transparent); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.modal .mf .left { margin-right: auto; }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 16px; text-align: left; transition: .15s; font-weight: 700; color: var(--text-strong); background: var(--panel-2); }
.option:hover { background: var(--panel-3); transform: translateY(-1px); }
.option .oi { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none; background: var(--panel); border: 1px solid var(--line); }
.option .od { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.option .grow { flex: 1; }
.option > svg { color: var(--muted); }
.radio-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; }
.radio-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.radio-card .rt { font-weight: 700; color: var(--text-strong); }
.radio-card .rd { font-size: 13px; color: var(--muted); }
.radio-card input { accent-color: var(--accent); width: 18px; height: 18px; }
.icon-upload { width: 84px; height: 84px; border-radius: 24px; border: 2px dashed var(--line-2); display: grid; place-items: center; margin: 0 auto 16px; cursor: pointer; overflow: hidden; color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; text-align: center; letter-spacing: .05em; }
.icon-upload:hover { border-color: var(--accent); color: var(--text); }
.icon-upload img { width: 100%; height: 100%; object-fit: cover; }
.invite-box { display: flex; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 5px; align-items: center; }
.invite-box input { flex: 1; background: none; border: 0; outline: none; padding: 0 10px; }

.menu { position: fixed; min-width: 210px; max-width: 320px; background: var(--float); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); z-index: 200; animation: fade .1s; max-height: 80vh; overflow-y: auto; }
.menu .mi { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text); width: 100%; text-align: left; }
.menu .mi svg { color: var(--muted); }
.menu .mi:hover { background: var(--active); color: var(--text-strong); }
.menu .mi:hover svg { color: var(--text-strong); }
.menu .mi.danger, .menu .mi.danger svg { color: var(--red); }
.menu .mi.danger:hover { background: color-mix(in srgb, var(--red) 14%, transparent); }
.menu .mi.brand, .menu .mi.brand svg { color: var(--accent-2); }
.menu .msep { height: 1px; background: var(--line); margin: 5px 6px; }
.menu .mi .mi-sub { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.menu .mi .left { display: flex; align-items: center; gap: 10px; }
.menu .status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Profil-Popout */
.profile { position: fixed; width: 320px; background: var(--float); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); z-index: 200; overflow: hidden; animation: pop .15s ease; }
.profile.themed { background: linear-gradient(170deg, var(--ta), var(--tb)); border-color: rgba(255,255,255,.12); }
.profile .banner { height: 96px; background: var(--c); background-size: cover; background-position: center; }
.profile .pa { position: absolute; left: 18px; top: 50px; --ring: var(--float); }
.profile .pa .avatar > .img { box-shadow: 0 0 0 6px var(--float); }
.profile.themed .pa .avatar > .img { box-shadow: 0 0 0 6px var(--ta); }
.profile .pb { padding: 52px 14px 14px; }
.profile .pbox { background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
:root[data-theme="light"] .profile:not(.themed) .pbox { background: var(--panel-2); }
.profile .dn { font-size: 20px; font-weight: 800; color: var(--text-strong); letter-spacing: -.03em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile .un { font-size: 13.5px; color: var(--muted); }
.profile .cs { font-size: 14px; margin-top: 8px; }
.profile .sec { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.profile .sec h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.profile .sec p { margin: 0; font-size: 14px; white-space: pre-wrap; line-height: 1.45; }
.role-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.role-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #99aab5); }
.profile .pact { display: flex; gap: 8px; margin-top: 12px; }
.profile .pact .btn { flex: 1; }

/* Picker (Emoji / GIF / Sticker) */
.picker { position: fixed; width: 380px; height: 420px; background: var(--float); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); z-index: 210; display: flex; flex-direction: column; animation: pop .15s ease; overflow: hidden; }
.picker .ph { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.picker .ph input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; height: 36px; padding: 0 12px; outline: none; }
.picker .ptabs { display: flex; gap: 4px; }
.picker .ptabs button { flex: 1; height: 30px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.picker .ptabs button.on { background: var(--active); color: var(--text-strong); }
.picker .pb { flex: 1; padding: 6px 10px; }
.picker .pcat { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--faint); padding: 10px 4px 6px; }
.picker .pgrid { display: grid; grid-template-columns: repeat(9, 1fr); }
.picker .pgrid button { font-size: 24px; height: 38px; border-radius: 9px; line-height: 1; transition: transform .1s; }
.picker .pgrid button:hover { background: var(--hover); transform: scale(1.15); }
.picker .sgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 6px; }
.picker .sgrid button { font-size: 48px; height: 78px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.picker .sgrid button:hover { border-color: var(--accent); }
.picker .mgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding-top: 6px; }
.picker .mgrid button { height: 120px; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); position: relative; }
.picker .mgrid img, .picker .mgrid video { width: 100%; height: 100%; object-fit: cover; }
.picker .pf { height: 44px; display: flex; align-items: center; padding: 0 14px; gap: 8px; background: var(--panel); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.picker .pf .pv { font-size: 22px; }

/* ─────────────── Einstellungen ─────────────── */
.settings-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; animation: fade .15s; }
.settings {
  position: relative; width: min(1120px, 100%); height: min(840px, 100%); display: flex; overflow: hidden;
  background: var(--float); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
.settings .snav { flex: 0 0 250px; background: var(--panel); border-right: 1px solid var(--line); }
.settings .snav-inner { padding: 18px 10px 24px 12px; }
.settings .snav .stitle { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; font-weight: 800; color: var(--text-strong); letter-spacing: -.02em; }
.settings .snav .stitle img, .settings .snav .stitle .sicon { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }
.settings .snav h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--faint); margin: 14px 0 4px; padding: 6px 10px; }
.settings .snav .si { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; margin-bottom: 2px; font-size: 14.5px; }
.settings .snav .si svg { width: 17px; height: 17px; }
.settings .snav .si:hover { background: var(--hover); color: var(--text); }
.settings .snav .si.active { background: var(--active); color: var(--text-strong); }
.settings .snav .si.danger { color: var(--red); }
.settings .snav .si .plus { margin-left: auto; font-size: 9.5px; font-weight: 800; background: var(--accent); color: #fff; padding: 2px 6px; border-radius: 6px; letter-spacing: .04em; }
.settings .snav .ssep { height: 1px; background: var(--line); margin: 10px 10px; }
.settings .scontent { flex: 1; display: flex; min-width: 0; }
.settings .scontent-inner { width: 100%; max-width: 820px; padding: 34px 40px 60px; }
.settings .scontent-inner h2 { margin: 0 0 20px; font-size: 22px; color: var(--text-strong); letter-spacing: -.03em; }
.settings .scontent-inner h3 { color: var(--text-strong); letter-spacing: -.02em; }
.settings .sclose { position: absolute; top: 16px; right: 16px; z-index: 2; }
.settings .sclose button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; background: var(--panel-2); }
.settings .sclose button:hover { color: var(--text); border-color: var(--text); }
.settings .sclose span { display: none; }
.settings .row-split { display: flex; gap: 24px; }
.settings .row-split > * { flex: 1; min-width: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row .t { font-weight: 600; color: var(--text-strong); }
.setting-row .d { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.account-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.account-card .banner { height: 110px; background: var(--c); background-size: cover; background-position: center; }
.account-card .head { display: flex; align-items: flex-start; gap: 16px; padding: 0 18px; margin-top: -42px; position: relative; z-index: 1; }
.account-card .head .avatar > .img { box-shadow: 0 0 0 7px var(--panel-2); }
.account-card .head .names { flex: 1; min-width: 0; padding-top: 54px; }
.account-card .head .head-btn { margin-top: 56px; flex: none; }
.account-card .head .names .n { font-size: 20px; font-weight: 800; color: var(--text-strong); letter-spacing: -.03em; }
.account-card .body { margin: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-swatches button { width: 32px; height: 32px; border-radius: 10px; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.color-swatches button.sel { border-color: var(--text-strong); }
.color-swatches input[type=color] { width: 32px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.theme-card { border-radius: 16px; border: 2px solid var(--line); overflow: hidden; text-align: left; transition: .15s; }
.theme-card:hover { transform: translateY(-2px); }
.theme-card.sel { border-color: var(--accent); }
.theme-card .tp { height: 74px; display: flex; gap: 6px; padding: 10px; background: var(--tb); }
.theme-card .tp i { border-radius: 8px; background: var(--tp); }
.theme-card .tl { padding: 8px 12px; font-weight: 700; font-size: 13.5px; background: var(--panel-2); }
.option-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.option-pills button { padding: 8px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
.option-pills button.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--text-strong); }
.roles-layout { display: flex; gap: 20px; min-height: 400px; }
.roles-list { width: 210px; flex: none; }
.roles-list .rl { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.roles-list .rl:hover { background: var(--hover); }
.roles-list .rl.sel { background: var(--active); }
.roles-list .rl i { width: 12px; height: 12px; border-radius: 50%; background: var(--c, #99aab5); flex: none; }
.roles-editor { flex: 1; min-width: 0; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.perm-row .t { font-weight: 600; color: var(--text-strong); }
.perm-row .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mrow .names { flex: 1; min-width: 0; }
.mrow .names .n { font-weight: 700; color: var(--text-strong); }
.mrow .names .u { font-size: 13px; color: var(--muted); }
.audit-row { display: flex; gap: 12px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; align-items: center; }
.audit-row .ai { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-3); display: grid; place-items: center; flex: none; color: var(--muted); }
.audit-row .at { flex: 1; font-size: 14px; }
.audit-row .at b { color: var(--text-strong); }
.audit-row .tm { font-size: 12px; color: var(--muted); }
.danger-zone { border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); border-radius: 16px; padding: 18px; margin-top: 28px; }
.danger-zone h3 { margin: 0 0 8px; color: var(--red); font-size: 16px; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 300; animation: fade .15s; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 12px; }
.lightbox a { color: #fff; opacity: .7; font-size: 14px; margin-top: 10px; display: block; }
.dropzone { position: absolute; inset: 8px; background: color-mix(in srgb, var(--accent) 80%, transparent); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; color: #fff; text-align: center; pointer-events: none; animation: fade .1s; border-radius: 16px; }
.dropzone .inner { border: 2px dashed rgba(255,255,255,.6); border-radius: 20px; padding: 40px 60px; }
.dropzone h2 { margin: 8px 0; }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--float); border: 1px solid var(--line-2); color: var(--text-strong); padding: 11px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; animation: pop .2s ease; display: flex; align-items: center; gap: 8px; }
.toast.err { border-color: color-mix(in srgb, var(--red) 60%, transparent); }
.toast.ok { border-color: color-mix(in srgb, var(--green) 60%, transparent); }

.loading { height: 100%; display: grid; place-items: center; background: var(--bg); }
.loading .spin { width: 64px; height: 64px; animation: breathe 1.6s ease-in-out infinite; }
.loading p { color: var(--muted); text-align: center; margin-top: 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; }
.conn-banner { background: var(--red); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 5px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes zoomin { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
@keyframes neon { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
@keyframes s-wave { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-8deg); } 60% { transform: rotate(14deg); } }
@keyframes s-pop { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.18) rotate(-6deg); } 50% { transform: scale(.95); } }
@keyframes s-pulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); } 50% { transform: scale(1.1); filter: drop-shadow(0 0 18px rgba(255,160,60,.6)); } }
@keyframes s-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes s-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes s-fly { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(10px, -16px) rotate(8deg); } }
@keyframes s-tilt { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes s-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes s-spin { to { transform: rotate(360deg); } }

.compact .msg { padding-left: 18px; }
.compact .msg .msg-avatar { display: none; }
.compact .msg.head { margin-top: 6px; }
.compact .msg .side-time { display: none; }
.compact .msg .ref::before { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
@media (max-width: 1150px) { .members, .active-now { display: none; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { display: none; }
  .userarea { grid-column: 1 / span 2; }
  .main { grid-column: 2; grid-row: 1; }
  .shell.show-sidebar .sidebar { display: flex; position: fixed; left: 80px; top: 8px; bottom: 86px; width: 268px; z-index: 60; box-shadow: var(--shadow); }
  .main-header .topic, .main-header .search { display: none; }
  .msg { padding-right: 16px; }
  .side-panel { position: fixed; inset: 8px; width: auto; z-index: 70; }
  .settings-wrap { padding: 0; }
  .settings { border-radius: 0; height: 100%; }
  .settings .snav { flex: 0 0 64px; } .settings .snav-inner { padding: 12px 6px; }
  .settings .snav .si span, .settings .snav h4, .settings .snav .stitle span, .settings .snav .si .plus { display: none; }
  .settings .scontent-inner { padding: 20px 16px; }
  .settings .row-split { flex-direction: column; }
}
.mobile-menu { display: none; }
@media (max-width: 760px) { .mobile-menu { display: grid; } }

/* ═════════════════════ v3: Threads, Inbox, Events, Catch-up, … ═════════════════════ */
.dim { color: var(--muted); font-weight: 500; }
svg.i.filled { fill: currentColor; }
.lock { display: inline-grid; color: var(--faint); }
.bot-tag { background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 5px; letter-spacing: .04em; }
kbd.kbd { font: 700 12px var(--font); background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 3px 8px; border-radius: 7px; color: var(--text-strong); white-space: nowrap; }

/* Threads */
.thread-item { height: 30px; margin-left: 18px; font-size: 14px; }
.thread-item .thread-line { width: 12px; height: 16px; border-left: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2); border-bottom-left-radius: 8px; margin-top: -10px; flex: none; }
.thread-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; max-width: 100%; transition: .12s; }
.thread-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.thread-chip svg { color: var(--accent-2); }
.thread-chip b { color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.thread-chip span { color: var(--muted); white-space: nowrap; }
.main-header .crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-weight: 600; }
.main-header .crumb:hover { color: var(--text-strong); }
.thread-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 6px; }
.thread-row:hover { border-color: var(--line-2); background: var(--panel-3); }
.thread-row .grow { flex: 1; min-width: 0; }
.thread-row .dim { font-size: 12.5px; }

/* Lesebestätigung */
.seen { display: flex; justify-content: flex-end; align-items: center; gap: 0; padding: 2px 24px 0; font-size: 11.5px; color: var(--accent-2); font-weight: 600; }
.seen svg + svg { margin-left: -8px; }
.seen svg { stroke-width: 2.6; }

/* Catch-up */
.catchup { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 8px 8px 8px 14px; border-radius: 14px; font-size: 13.5px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--panel-2)), var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); flex: none; animation: pop .2s ease; }
.catchup svg { color: var(--accent-2); }
.catchup .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catchup button { height: 30px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 13px; background: var(--panel-3); }
.catchup button:first-of-type { background: var(--accent); color: #fff; }
.catchup button.x { padding: 0 8px; background: none; color: var(--muted); }
.cu-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.cu-stats div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.cu-stats b { display: block; font-size: 24px; color: var(--text-strong); letter-spacing: -.03em; }
.cu-stats span { font-size: 12px; color: var(--muted); }
.cu-people, .cu-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.cu-person, .cu-topics span { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 13px; font-weight: 600; }
.cu-topics span { padding: 4px 10px; }
.cu-person b, .cu-topics b { color: var(--accent-2); }

/* Inbox */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1; height: 34px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--active); color: var(--text-strong); }
.inbox-item { border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .12s; }
.inbox-item:hover { border-color: var(--line-2); }
.ii-where { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.ii-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.ii-note { font-weight: 600; color: var(--text-strong); margin-bottom: 6px; }
.mini-msg { display: flex; gap: 10px; }
.mm-body { min-width: 0; flex: 1; }
.mm-meta { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
.mm-meta span { font-size: 11.5px; color: var(--faint); }
.mini-msg .content { font-size: 14px; max-height: 120px; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Events */
.event-chip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; margin: 2px 0 6px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text-strong); font-size: 13.5px; }
.event-chip svg { color: var(--accent-2); }
.event-chip .grow { min-width: 0; flex: 1; }
.event-chip small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-chip.ghost { background: none; border-color: transparent; color: var(--muted); padding: 8px 10px; }
.event-chip.ghost:hover { background: var(--hover); color: var(--text); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 5px; animation: neon 1s infinite; vertical-align: 1px; }
.event-card { display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 10px; }
.event-card.live { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.ev-date { width: 56px; height: 62px; flex: none; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ev-date span { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--red); }
.ev-date b { font-size: 22px; color: var(--text-strong); line-height: 1.1; }
.ev-body { flex: 1; min-width: 0; }
.ev-time { font-size: 12.5px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: .03em; }
.ev-title { font-size: 17px; font-weight: 800; color: var(--text-strong); margin: 2px 0 4px; letter-spacing: -.02em; }
.ev-desc { font-size: 14px; color: var(--text); margin-bottom: 6px; white-space: pre-wrap; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.ev-meta svg { vertical-align: -2px; }
.ev-people { display: inline-flex; align-items: center; gap: 2px; }
.ev-people .avatar { margin-right: -6px; box-shadow: 0 0 0 2px var(--panel-2); border-radius: 50%; }
.ev-people .avatar:last-of-type { margin-right: 6px; }
.ev-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* Bearbeitungsverlauf */
.edit-ver { border-left: 3px solid var(--line-2); padding: 6px 0 10px 14px; margin-bottom: 8px; }
.edit-ver.cur { border-color: var(--accent); }
.ev-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; margin-bottom: 4px; }
.msg .edited { cursor: pointer; }
.msg .edited:hover { color: var(--accent-2); text-decoration: underline; }

/* Code */
.content pre { position: relative; }
.code-lang { position: absolute; top: 6px; right: 40px; font: 700 10.5px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.code-copy { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); opacity: 0; background: var(--panel-3); }
.content pre:hover .code-copy { opacity: 1; }
.tk-c { color: #6b7280; font-style: italic; } .tk-s { color: #a5d6a7; } .tk-n { color: #f9a875; } .tk-k { color: #c4a7ff; font-weight: 600; } .tk-f { color: #7cc4ff; }
:root[data-theme="light"] .tk-s { color: #15803d; } :root[data-theme="light"] .tk-n { color: #c2410c; } :root[data-theme="light"] .tk-k { color: #7c3aed; } :root[data-theme="light"] .tk-f { color: #1d4ed8; }
.code-sample { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; margin: 10px 0 0; color: var(--muted); }

/* Emojis */
.cemoji { width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: -0.35em; display: inline-block; }
.cemoji.big { width: 48px; height: 48px; }
.picker .pgrid .cemoji { width: 28px; height: 28px; margin: auto; }
.reaction .cemoji { width: 18px; height: 18px; vertical-align: -4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.emoji-tile { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.emoji-tile img { width: 32px; height: 32px; object-fit: contain; }
.emoji-tile code { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

/* Warum Nexus */
.why-logo { display: flex; justify-content: center; margin-bottom: 10px; } .why-logo img { width: 56px; height: 56px; }
table.why { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.why th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px; text-align: center; }
table.why th:first-child { text-align: left; }
table.why td { padding: 10px; border-top: 1px solid var(--line); text-align: center; }
table.why td:first-child { text-align: left; font-weight: 600; color: var(--text-strong); }
table.why .nx { background: var(--accent-soft); }
table.why th.nx { color: var(--accent-2); border-radius: 12px 12px 0 0; }
table.why tr:last-child td.nx { border-radius: 0 0 12px 12px; }
table.why .yes { color: var(--green); display: inline-grid; } table.why .yes svg { stroke-width: 3; }
table.why .no { color: var(--faint); }
table.why .paid { font-size: 12.5px; color: var(--yellow); font-weight: 600; }
table.why .free { color: var(--green); font-size: 16px; }

/* Login mit Marketing */
.auth.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; padding: 0; place-items: stretch; }
.auth .pitch { position: relative; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; color: #e4e4e9; }
.auth .pitch .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.auth .pitch .brand img { width: 44px; height: 44px; }
.auth .pitch .brand span { font-size: 22px; font-weight: 800; letter-spacing: -.04em; color: #fff; }
.auth .pitch h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.04; letter-spacing: -.05em; margin: 0 0 16px; color: #fff; }
.auth .pitch h1 em { font-style: normal; background: linear-gradient(90deg, #c4b5fd, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth .pitch p.lead { font-size: 17px; color: #a1a1aa; max-width: 520px; line-height: 1.55; margin: 0 0 28px; }
.auth .feat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 600px; }
.auth .feat { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); font-size: 13.5px; color: #c4c4cc; line-height: 1.4; }
.auth .feat svg { color: #c4b5fd; flex: none; margin-top: 1px; }
.auth .feat b { color: #fff; display: block; font-size: 14px; }
.auth .pitch .why-link { margin-top: 22px; color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; width: fit-content; }
.auth .formside { display: grid; place-items: center; padding: 24px; position: relative; }
@media (max-width: 980px) { .auth.split { grid-template-columns: 1fr; } .auth .pitch { display: none; } }

/* ═════════════════════ Entdecken ═════════════════════ */
.discover { flex: 1; min-height: 0; }
.disc-hero { position: relative; margin: 12px; border-radius: calc(var(--r-panel) - 4px); overflow: hidden; padding: 56px 32px 40px; text-align: center;
  background: radial-gradient(600px 300px at 20% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
              radial-gradient(500px 300px at 90% 100%, rgba(20,184,166,.35), transparent 70%), linear-gradient(135deg, #14101f, #0b0b10); border: 1px solid var(--line); }
.disc-hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); }
.disc-hero-inner { position: relative; max-width: 640px; margin: 0 auto; color: #fff; }
.disc-hero h1 { font-size: clamp(28px, 3.4vw, 42px); margin: 0 0 8px; letter-spacing: -.045em; line-height: 1.05; }
.disc-hero h1 em { font-style: normal; background: linear-gradient(90deg, #c4b5fd, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.disc-hero p { margin: 0 0 22px; color: #b4b4c0; }
.disc-search { display: flex; align-items: center; gap: 10px; background: rgba(10,10,14,.75); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 0 16px; backdrop-filter: blur(10px); }
.disc-search:focus-within { border-color: rgba(255,255,255,.35); }
.disc-search svg { color: #9b9ba6; }
.disc-search input { flex: 1; background: none; border: 0; outline: none; height: 52px; font-size: 16px; color: #fff; }
.disc-invite { display: flex; align-items: center; gap: 8px; margin: 12px auto 0; max-width: 460px; background: rgba(10,10,14,.55); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 4px 4px 4px 12px; color: #9b9ba6; }
.disc-invite input { flex: 1; background: none; border: 0; outline: none; height: 32px; font-size: 13.5px; color: #fff; min-width: 0; }
.disc-invite .btn { background: #fafafa; color: #0d0d10; }
.disc-body { padding: 8px 24px 32px; }
.disc-head { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 14px; }
.disc-head h2 { margin: 0; font-size: 20px; color: var(--text-strong); letter-spacing: -.03em; }
.disc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.disc-card { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; display: flex; flex-direction: column; }
.disc-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.dc-banner { height: 96px; background-size: cover; background-position: center; }
.dc-icon { position: absolute; left: 16px; top: 64px; width: 56px; height: 56px; border-radius: 16px; background: var(--panel-3); border: 4px solid var(--panel-2); display: grid; place-items: center; overflow: hidden; font-weight: 800; color: var(--text-strong); }
.dc-icon img { width: 100%; height: 100%; object-fit: cover; }
.dc-icon.big { position: static; width: 76px; height: 76px; border-radius: 22px; font-size: 22px; border-color: var(--float); flex: none; }
.dc-body { padding: 34px 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dc-name { font-weight: 800; font-size: 16px; color: var(--text-strong); letter-spacing: -.02em; }
.dc-desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.dc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dc-tags span { font-size: 11.5px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.dc-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.dc-foot i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 5px; }
.dc-foot i.on { background: var(--green); }
.dc-cat { margin-left: auto; font-weight: 700; color: var(--text); background: var(--panel-3); padding: 2px 8px; border-radius: 7px; }
.dc-member { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(6px); }
.modal.dp { overflow: hidden; }
.dp-banner { height: 130px; background-size: cover; background-position: center; position: relative; }
.dp-banner .x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 10px; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; }
.dp-head { display: flex; gap: 16px; align-items: flex-start; padding: 0 22px; margin-top: -38px; position: relative; z-index: 1; }
.dp-head > div:last-child { padding-top: 46px; min-width: 0; }
.dp-head h2 { margin: 0 0 6px; font-size: 22px; color: var(--text-strong); letter-spacing: -.03em; }
.dp-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-channels span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); padding: 4px 9px; border-radius: 9px; color: var(--muted); }

/* Abzeichen */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge-card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; transition: .12s; position: relative; }
.badge-card:hover { border-color: var(--line-2); }
.badge-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.badge-card small { font-size: 11.5px; color: var(--muted); }
.badge-card.locked { opacity: .55; cursor: not-allowed; }
.badge-card.locked .ubadge { filter: grayscale(.8); }
.bprog { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.bprog b { display: block; height: 100%; background: var(--accent); }

/* ═════════════════════ Steuerelemente v4 ═════════════════════ */
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b9ba6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select.input option { background: var(--float); color: var(--text); }
.dd { width: 100%; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 0 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-align: left; transition: border-color .15s, box-shadow .15s; }
.dd:hover { border-color: var(--line-2); }
.dd:focus-visible, .dd.open { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dd .dd-label { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dd .dd-label svg { color: var(--muted); }
.dd > svg { color: var(--muted); flex: none; }
.popover { padding: 8px; }
.dd-pop { max-height: 320px; overflow-y: auto; }
.dd-pop .mi.on { background: var(--accent-soft); color: var(--text-strong); }
.dd-pop .mi.on svg { color: var(--accent-2); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--panel-3); outline: none; margin: 10px 0 4px; accent-color: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.vsec { background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; transition: opacity .2s; }
.vsec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 16px; }
.vsec h3 svg { color: var(--accent-2); }
.vsec .setting-row { padding: 12px 0; }
.vsec .setting-row:last-child { border-bottom: 0; }
.vsec.dimmed { opacity: .45; pointer-events: none; }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vgrid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.vgrid .field, .vgrid3 .field { margin-bottom: 10px; }
.vslider { margin-bottom: 8px; }
.vs-head { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.vs-head b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.meter-wrap { display: flex; align-items: center; gap: 12px; }
.meter { position: relative; flex: 1; height: 14px; border-radius: 7px; background: var(--panel-3); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #64748b, #94a3b8); transition: width .05s linear; border-radius: 7px; }
.meter i.hot { background: linear-gradient(90deg, #16a34a, #4ade80); }
.meter .thr { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--yellow); border-radius: 2px; box-shadow: 0 0 6px var(--yellow); }
.cam-prev { position: relative; display: flex; align-items: flex-end; gap: 10px; }
.cam-prev video { width: 320px; aspect-ratio: 16/9; border-radius: 14px; background: #000; border: 1px solid var(--line); object-fit: cover; }
.cam-prev .vq { position: absolute; left: 10px; top: 10px; }
.vq { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 7px; letter-spacing: .02em; backdrop-filter: blur(6px); }
.vq:empty { display: none; }
.tile-fs { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 9px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; opacity: 0; transition: .15s; }
.tile:hover .tile-fs { opacity: 1; }
.tile:fullscreen { border-radius: 0; max-height: none; }
.vol-pop { width: 270px; }
.vp-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; color: var(--text-strong); }
.vp-row { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; font-size: 13.5px; color: var(--muted); }
.vp-row span { display: flex; align-items: center; gap: 6px; }
.vp-row b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.vol-pop .range { margin: 8px 6px 2px; width: calc(100% - 12px); }
.vp-marks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); padding: 0 6px 8px; }
.stream-pop { width: 300px; }
.sm-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-weight: 800; color: var(--text-strong); }
.mi.on { background: var(--accent-soft); }
.sm-toggle { cursor: pointer; }
.sm-toggle span { display: flex; align-items: center; gap: 8px; }
.sm-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
@media (max-width: 900px) { .vgrid, .vgrid3 { grid-template-columns: 1fr; } }

/* ═════════════════════ v5: Forum, Embeds, Whiteboard, Statistiken ═════════════════════ */
/* Markdown-Extras */
.content .md-table { overflow-x: auto; margin: 6px 0; max-width: 100%; }
.content table { border-collapse: separate; border-spacing: 0; font-size: 14px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.content th { background: var(--panel-2); font-weight: 700; color: var(--text-strong); }
.content th, .content td { padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: normal; }
.content tr:last-child td { border-bottom: 0; }
.content ol { margin: 4px 0; padding-left: 24px; }
.content ul.tasks { list-style: none; padding-left: 4px; }
.content ul.tasks li { display: flex; align-items: center; gap: 8px; }
.content ul.tasks .tick { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--line-2); display: inline-grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; flex: none; }
.content ul.tasks li.done .tick { background: var(--green); border-color: var(--green); }
.content ul.tasks li.done { color: var(--muted); text-decoration: line-through; }
.content .subtext { font-size: 12px; color: var(--muted); }
.content .ts { background: var(--panel-3); border-radius: 6px; padding: 0 5px; font-weight: 500; }
.content a.masked { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }

/* Link-Vorschauen */
.embed-slot:empty { display: none; }
.embed { margin-top: 8px; max-width: 460px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--ec, var(--accent)); display: flex; flex-direction: column; gap: 4px; }
.embed .e-site { font-size: 12px; color: var(--muted); font-weight: 600; }
.embed .e-title { font-weight: 700; color: var(--link); font-size: 15px; }
.embed .e-desc { font-size: 13.5px; color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.embed .e-media { position: relative; display: block; margin-top: 6px; border-radius: 10px; overflow: hidden; }
.embed .e-media img { width: 100%; max-height: 260px; object-fit: cover; }
.embed .e-play { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; }
.embed .e-play svg { fill: #fff; }
.embed.img { padding: 0; border: 0; background: none; }
.embed.img img { max-width: min(420px, 100%); max-height: 320px; border-radius: 14px; cursor: zoom-in; }

/* Forum */
.forum { flex: 1; min-height: 0; padding: 16px 20px 28px; }
.forum-hero { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--panel-2)), var(--panel-2)); border: 1px solid var(--line); margin-bottom: 14px; }
.forum-hero .fh-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--accent-2); flex: none; }
.forum-hero h2 { margin: 0 0 2px; font-size: 20px; color: var(--text-strong); letter-spacing: -.03em; }
.forum-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.forum-hero .grow { flex: 1; min-width: 0; }
.forum-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.fb-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.fb-search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); }
.fb-sort button { padding: 0 12px; }
.forum-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ftag { padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ftag b { color: var(--faint); font-weight: 700; margin-left: 2px; }
.ftag.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text-strong); }
.post-card { display: flex; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; transition: border-color .12s, transform .12s; }
.post-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.post-card.archived { opacity: .6; }
.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pc-title { font-weight: 800; font-size: 16px; color: var(--text-strong); letter-spacing: -.02em; }
.pc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pc-tags span { font-size: 11.5px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; }
.pc-prev { font-size: 13.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pc-meta b { color: var(--text); }
.pc-stat { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.pc-stat:first-of-type { margin-left: auto; }
.pc-thumb { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex: none; }

/* Whiteboard */
.wb-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); display: flex; flex-direction: column; padding: 14px; gap: 10px; animation: fade .15s; }
.wb-top { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 16px; background: var(--float); border: 1px solid var(--line-2); }
.wb-title { display: flex; align-items: center; gap: 8px; color: var(--text-strong); }
.wb-live { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.wb-people { display: flex; margin-left: auto; }
.wb-person { width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 2px solid var(--float); margin-left: -6px; }
.wb-actions { display: flex; gap: 2px; }
.wb-stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.wb-board { position: relative; border-radius: 16px; overflow: hidden; background-color: #141418; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 22px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.08); }
.wb-board canvas { display: block; touch-action: none; cursor: crosshair; }
.wb-cursors { position: absolute; inset: 0; pointer-events: none; }
.wb-cursor { position: absolute; transform: translate(-2px, -2px); transition: left .06s linear, top .06s linear; display: flex; align-items: flex-start; gap: 2px; }
.wb-cursor svg { width: 18px; height: 18px; fill: var(--c); stroke: #fff; stroke-width: 1.5; }
.wb-cursor span { background: var(--c); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-top: 12px; white-space: nowrap; }
.wb-tools { align-self: center; display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 16px; background: var(--float); border: 1px solid var(--line-2); box-shadow: var(--shadow); flex-wrap: wrap; justify-content: center; }
.wb-tool { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); }
.wb-tool:hover { background: var(--hover); color: var(--text-strong); }
.wb-tool.on { background: var(--accent); color: #fff; }
.wb-color { width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); margin: 0 1px; }
.wb-color.on { border-color: var(--text-strong); transform: scale(1.12); }
.wb-sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 6px; }

/* Statistiken */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { font-size: 28px; color: var(--text-strong); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }
.stat small i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.chart { position: relative; height: 190px; padding: 0 0 22px 34px; }
.ch-grid { position: absolute; inset: 0 0 22px 34px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.ch-grid span { border-top: 1px solid var(--line); position: relative; }
.ch-grid span::before { content: attr(data-v); position: absolute; left: -34px; top: -8px; width: 28px; text-align: right; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ch-bars { position: relative; height: 100%; display: flex; align-items: flex-end; gap: 4px; }
.ch-col { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 6px; cursor: default; }
.ch-col:hover { background: var(--hover); }
.ch-col i { width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; transition: filter .12s; }
.ch-col:hover i { filter: brightness(1.2); }
.ch-x { position: absolute; left: 34px; right: 0; bottom: 0; display: flex; gap: 4px; }
.ch-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.heat { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.hc { height: 34px; border-radius: 6px; background: var(--accent); opacity: calc(.08 + var(--a) * .92); }
.hc:hover { outline: 2px solid var(--text-strong); }
.heat-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 40px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hb-t { height: 10px; background: var(--panel-3); border-radius: 5px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar b { text-align: right; color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* Rollen-Auswahl, Status, Stichwörter */
.role-picks { display: flex; flex-direction: column; gap: 6px; }
.role-pick { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; text-align: left; }
.role-pick i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.role-pick span { flex: 1; }
.role-pick svg { color: var(--muted); }
.role-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.role-pick.on svg { color: var(--accent-2); }
.status-input { display: flex; gap: 8px; }
.status-emoji { width: 46px; height: 44px; flex: none; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 22px; display: grid; place-items: center; }
.kw-box { display: flex; flex-wrap: wrap; gap: 6px; }
.kw { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 700; font-size: 13px; }
.kw button { display: grid; color: var(--muted); border-radius: 50%; padding: 2px; }
.kw button:hover { color: var(--red); }

/* ═════════════════════ Wiki ═════════════════════ */
.tool-nav { margin: 2px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tool-nav .nav-item { height: 36px; }
.wiki { flex: 1; display: flex; min-height: 0; }
.wiki-tree { width: 250px; flex: none; border-right: 1px solid var(--line); padding: 10px 8px; }
.wt-item { display: flex; align-items: center; gap: 8px; height: 34px; padding-right: 6px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.wt-item:hover { background: var(--hover); color: var(--text); }
.wt-item.active { background: var(--active); color: var(--text-strong); }
.wt-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-ico { width: 20px; text-align: center; flex: none; }
.wt-add { opacity: 0; display: grid; padding: 3px; border-radius: 6px; color: var(--muted); }
.wt-item:hover .wt-add { opacity: 1; }
.wt-add:hover { background: var(--active); color: var(--text-strong); }
.wiki-page { flex: 1; min-width: 0; }
.wiki-article { max-width: 860px; margin: 0 auto; padding: 28px 40px 60px; }
.wiki-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.wiki-crumbs a { cursor: pointer; color: var(--muted); }
.wiki-crumbs a:hover { color: var(--text-strong); text-decoration: none; }
.wiki-head { display: flex; align-items: center; gap: 14px; }
.wiki-icon { font-size: 44px; line-height: 1; }
.wiki-head h1 { margin: 0; font-size: 34px; letter-spacing: -.045em; color: var(--text-strong); }
.wiki-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 12px 0 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.wiki-meta b { color: var(--text); }
.wiki-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.wiki-body { display: flex; gap: 28px; align-items: flex-start; flex-direction: row-reverse; }
.wiki-content { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.7; white-space: normal; }
.wiki-content h1, .wiki-content h2, .wiki-content h3 { margin: 22px 0 8px; scroll-margin-top: 20px; }
.wiki-content p { margin: 0 0 10px; }
.wiki-content blockquote { margin: 10px 0; }
.wiki-toc { position: sticky; top: 0; width: 200px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.wiki-toc a { font-size: 13px; color: var(--muted); cursor: pointer; padding: 3px 0; }
.wiki-toc a:hover { color: var(--text-strong); text-decoration: none; }
.wiki-link { cursor: pointer; background: var(--accent-soft); color: var(--accent-2); padding: 1px 6px; border-radius: 6px; font-weight: 600; text-decoration: none !important; }
.wiki-link.missing { background: none; color: var(--red); border-bottom: 1px dashed var(--red); border-radius: 0; }
.wiki-children { margin-top: 32px; }
.wc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.wc-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; color: var(--text); text-decoration: none !important; }
.wc-card:hover { border-color: var(--line-2); }
.wc-card span { font-size: 22px; } .wc-card small { color: var(--muted); font-size: 12px; }
.wiki-hit { display: block; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; color: var(--text); text-decoration: none !important; }
.wiki-hit span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.wiki-edit { display: flex; flex-direction: column; height: 100%; padding: 18px 22px; gap: 10px; }
.we-head { display: flex; align-items: center; gap: 10px; }
.we-icon { width: 52px; height: 52px; border-radius: 14px; font-size: 28px; background: var(--panel-2); border: 1px solid var(--line); }
.we-title { flex: 1; background: none; border: 0; outline: none; font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--text-strong); }
.we-tools { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); flex-wrap: wrap; }
.we-tools button { min-width: 32px; height: 30px; border-radius: 8px; font-weight: 800; color: var(--muted); padding: 0 6px; }
.we-tools button:hover { background: var(--active); color: var(--text-strong); }
.we-tools .grow { flex: 1; }
.we-split { flex: 1; min-height: 300px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.we-split textarea { resize: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--text); font: 14px/1.6 var(--mono); outline: none; }
.we-split textarea:focus { border-color: var(--accent); }
.we-prev { border: 1px dashed var(--line-2); border-radius: 14px; padding: 16px 20px; overflow-y: auto; white-space: normal; line-height: 1.65; }
.we-foot { display: flex; justify-content: flex-end; gap: 8px; }
.modal.modal-xl { max-width: 1000px; }
.rev-layout { display: grid; grid-template-columns: 260px 1fr; gap: 12px; height: 60vh; }
.rev-list { display: flex; flex-direction: column; gap: 4px; }
.rev { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.rev b { display: block; font-size: 13.5px; color: var(--text-strong); }
.rev small { font-size: 12px; color: var(--muted); }
.rev.on { border-color: var(--accent); background: var(--accent-soft); }
.rev-prev { border: 1px solid var(--line); border-radius: 12px; padding: 16px; white-space: normal; }

/* ═════════════════════ Kanban ═════════════════════ */
.board-switch { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; color: var(--text-strong); padding: 4px 8px; border-radius: 9px; letter-spacing: -.02em; }
.board-switch:hover { background: var(--hover); }
.kanban { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.kcols { display: flex; gap: 12px; align-items: flex-start; min-height: 100%; }
.kcol { width: 290px; flex: none; display: flex; flex-direction: column; max-height: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; }
.kcol.over { border-color: color-mix(in srgb, var(--red) 60%, transparent); }
.kcol.over .cnt { color: var(--red); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 14px; }
.kcol-head i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kcol-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); font-size: 14px; }
.kcol-head .cnt { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--panel-3); padding: 1px 8px; border-radius: 999px; }
.kcol-head .icon-btn { width: 28px; height: 28px; }
.kcards { flex: 1; min-height: 40px; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 8px; border-radius: 12px; transition: background .12s; }
.kcards.drop { background: var(--accent-soft); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 7px; transition: border-color .12s, transform .12s, box-shadow .12s; }
.kcard:hover { border-color: var(--line-2); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.kcard.dragging { opacity: .4; transform: rotate(2deg); }
.kph { height: 52px; border-radius: 12px; border: 2px dashed var(--accent); background: var(--accent-soft); flex: none; }
.kc-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.kc-labels span { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; color: #fff; background: var(--l); letter-spacing: .02em; }
.kc-title { font-weight: 600; font-size: 14px; color: var(--text-strong); line-height: 1.35; overflow-wrap: anywhere; }
.kc-prio { display: inline-flex; vertical-align: -2px; margin-right: 5px; }
.kc-prio svg { stroke-width: 2.4; }
.kc-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.kc-meta:empty { display: none; }
.kc-due { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 7px; background: var(--panel-3); font-weight: 700; }
.kc-due.soon { background: color-mix(in srgb, var(--yellow) 22%, transparent); color: var(--yellow); }
.kc-due.over { background: color-mix(in srgb, var(--red) 22%, transparent); color: var(--red); }
.kc-chk { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.kc-chk.ok { color: var(--green); }
.kc-people { margin-left: auto; display: flex; }
.kc-people .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel); border-radius: 50%; }
.kadd { margin: 6px 8px 10px; height: 36px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.kadd:hover { background: var(--hover); color: var(--text-strong); }
.kadd-box { margin: 6px 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.kadd-box textarea { background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 10px; resize: none; color: var(--text); outline: none; font: inherit; font-size: 14px; }
.kadd-box div { display: flex; gap: 6px; align-items: center; }
.kcol-add { width: 260px; flex: none; height: 48px; border-radius: 14px; border: 2px dashed var(--line-2); color: var(--muted); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.kcol-add:hover { border-color: var(--accent); color: var(--text-strong); }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; width: 100%; }
.tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; }
.tpl:hover, .tpl.on { border-color: var(--accent); background: var(--accent-soft); }
.tpl span { font-size: 22px; } .tpl b { color: var(--text-strong); } .tpl small { color: var(--muted); font-size: 12px; }
.kmodal { display: grid; grid-template-columns: 1fr 280px; min-height: 480px; }
.km-main { padding: 24px; min-width: 0; overflow-y: auto; max-height: 80vh; }
.km-title { width: 100%; background: none; border: 0; outline: none; resize: none; font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--text-strong); font-family: inherit; overflow: hidden; }
.km-title:focus { background: var(--panel-2); border-radius: 8px; }
.km-sub { font-size: 13px; }
.km-desc { min-height: 60px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: text; }
.km-desc .content { white-space: normal; }
.km-chk { display: flex; flex-direction: column; gap: 4px; }
.km-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; }
.km-item:hover { background: var(--hover); }
.km-item span { flex: 1; }
.km-item.done span { text-decoration: line-through; color: var(--muted); }
.km-box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; color: #fff; flex: none; }
.km-item.done .km-box { background: var(--green); border-color: var(--green); }
.km-box svg { stroke-width: 3; }
.km-bar { display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--panel-3); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.km-bar b { display: block; height: 100%; background: var(--green); }
.km-chk-add { display: flex; gap: 6px; margin-top: 8px; }
.km-side { position: relative; padding: 24px 18px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.km-side .label { margin-top: 12px; }
.km-x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.km-people { display: flex; flex-wrap: wrap; gap: 4px; }
.km-person { display: inline-flex; align-items: center; gap: 6px; padding: 2px; border-radius: 999px; border: 2px solid transparent; opacity: .55; }
.km-person.on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); padding-right: 10px; font-size: 12.5px; font-weight: 700; }
.km-person:hover { opacity: 1; }
.km-labels { display: flex; flex-wrap: wrap; gap: 5px; }
.km-label { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--l); color: var(--l); }
.km-label.on { background: var(--l); color: #fff; }
@media (max-width: 900px) { .wiki-tree { display: none; } .we-split { grid-template-columns: 1fr; } .kmodal { grid-template-columns: 1fr; } .wiki-toc { display: none; } .wiki-article { padding: 20px; } }
.main-header .seg { padding: 3px; }
.main-header .seg button { height: 30px; padding: 0 12px; flex: none; white-space: nowrap; }

/* ═════════════════════ Desktop-App ═════════════════════ */
#titlebar { display: none; }
.is-desktop #titlebar {
  display: flex; position: fixed; top: 0; left: 0; right: 0; height: 36px; z-index: 1000; align-items: center; gap: 8px; padding: 0 150px 0 14px;
  -webkit-app-region: drag; user-select: none; font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: -.01em; background: transparent;
}
.is-desktop #titlebar img { width: 16px; height: 16px; }
.is-desktop #titlebar .tb-where { font-weight: 500; color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.is-desktop #titlebar .tb-where:not(:empty)::before { content: '·'; margin-right: 8px; }
/* Ziehbarer Bereich bleibt auch über Modals erreichbar, Inhalt rückt darunter */
.is-desktop .is-drag { -webkit-app-region: drag; }
.is-desktop .shell { padding-top: 36px; }
.is-desktop .auth { padding-top: 52px; }
.is-desktop .settings-wrap, .is-desktop .backdrop, .is-desktop .wb-wrap, .is-desktop .lightbox { top: 36px; }
.is-desktop #conn { top: 36px !important; }
.is-desktop .loading { padding-top: 36px; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.src { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line); text-align: left; transition: .12s; }
.src:hover { border-color: var(--accent); transform: translateY(-2px); }
.src > img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #000; border-radius: 9px; }
.src span { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.src-ic { width: 16px; height: 16px; }

/* ───────── v6: Icons statt Emojis ───────── */
svg.i.s20 { width: 20px; height: 20px; }
svg.i.s22 { width: 22px; height: 22px; }
.toast .t-ico { display: grid; place-items: center; flex: none; color: var(--muted); }
.toast.ok .t-ico { color: var(--green); }
.toast.err .t-ico { color: var(--red); }
.icon-pop { padding: 8px; width: 316px; }
.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.icon-pick .ip { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; color: var(--text); background: transparent; border: 1px solid transparent; cursor: pointer; }
.icon-pick .ip:hover { background: var(--panel-2); color: var(--text-strong); }
.icon-pick .ip.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--text-strong); }
.option .oi { color: var(--text-strong); }
.tpl span { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-strong); }
.wt-ico { display: grid; place-items: center; color: var(--muted); }
.wiki-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-strong); }
.wiki-icon svg { width: 28px; height: 28px; }
.wiki-head { align-items: center; }
.wc-card span { color: var(--text-strong); display: flex; }
.we-icon { display: grid; place-items: center; color: var(--text-strong); cursor: pointer; }
.we-tools button svg { display: block; }
.wiki-link svg, .wiki-crumbs a svg, .wiki-hit svg, .board-switch svg { vertical-align: -2px; }
.lbl-i { display: flex; align-items: center; gap: 6px; }
.dc-member { display: inline-flex; align-items: center; gap: 4px; }
.status-emoji[data-ico] { display: grid; place-items: center; color: var(--text-strong); }
.chip svg { vertical-align: -3px; }
/* Pegel: Schwelle direkt ziehbar */
.meter { height: 22px; border-radius: 11px; overflow: visible; }
.meter i { border-radius: 11px; }
.meter.adjustable { cursor: ew-resize; }
.meter .thr { top: -4px; bottom: -4px; width: 4px; margin-left: -2px; cursor: ew-resize; transition: transform .1s; }
.meter .thr::after { content: ''; position: absolute; left: 50%; top: -5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px var(--bg), 0 0 8px var(--yellow); }
.meter.dragging .thr, .meter .thr:hover { transform: scaleX(1.4); }
.meter:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ───────── v6: Einstellungen mit Unterpunkten ───────── */
.settings .snav .ssubs { display: none; margin: 2px 0 6px 18px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.settings .snav .ssubs.open { display: block; animation: pop .15s ease; }
.settings .snav .ssub { display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; position: relative; }
.settings .snav .ssub:hover { color: var(--text); background: var(--hover); }
.settings .snav .ssub.active { color: var(--text-strong); font-weight: 600; }
.settings .snav .ssub.active::before { content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }
@media (max-width: 900px) { .settings .snav .ssubs { display: none !important; } }
.msg-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.msg-modes .mm { text-align: left; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line); transition: .12s; }
.msg-modes .mm:hover { border-color: var(--line-2); }
.msg-modes .mm.on { border-color: var(--accent); }
.msg-modes .mm .t { font-weight: 700; color: var(--text-strong); margin-top: 10px; }
.msg-modes .mm .d { font-size: 12.5px; color: var(--muted); }
.mm-prev { height: 64px; border-radius: 10px; background: var(--bg); padding: 10px; display: flex; gap: 10px; }
.mm-prev .av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); flex: none; }
.mm-prev > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.mm-prev b, .mm-prev span { display: block; height: 7px; border-radius: 4px; background: var(--line-2); }
.mm-prev b { width: 40%; background: var(--accent); opacity: .7; }
.mm-prev.compact { flex-direction: column; gap: 5px; }
.mm-prev.compact > div { flex-direction: row; gap: 6px; }
.mm-prev.compact b { width: 22%; } .mm-prev.compact span { flex: 1; }
.snd-list { margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.snd-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.snd-row:last-child { border-bottom: 0; }
.snd-row .grow { flex: 1; color: var(--text); font-size: 14px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.sb-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13.5px; }
.sb-btn:hover { border-color: var(--accent); color: var(--text-strong); }
.sb-btn:active { transform: scale(.97); }
.settings .vsec { scroll-margin-top: 24px; }

/* Barrierefreiheit & Chat-Optionen */
body.desat { filter: saturate(var(--sat)); }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
body.underline-links .content a, body.underline-links a.wiki-link { text-decoration: underline; text-underline-offset: 3px; }
body.high-contrast { --line: rgba(255,255,255,.22); --line-2: rgba(255,255,255,.34); --muted: #c4c7d0; --faint: #a3a7b3; }
body.high-contrast .content { color: var(--text-strong); }
body.no-role-colors .msg .author .nm { color: var(--text-strong) !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
body.no-anim-emoji .sticker, body.no-anim-emoji .sticker * { animation: none !important; }
body.show-spoilers .content .spoiler { background: var(--active); color: inherit; }
body.no-typing .typing { visibility: hidden; }
body.no-jumbo .content .emoji-big { font-size: inherit; }
.msg.head { margin-top: var(--msg-gap, 16px); }
/* Streamer-Modus: sensible Infos unscharf */
body.streamer .invite-box input, body.streamer [data-sensitive] { filter: blur(6px); transition: filter .15s; }
body.streamer .invite-box input:hover, body.streamer [data-sensitive]:hover { filter: none; }

/* ─────────────── Gleitende Aktiv-Markierungen (glide.js) ─────────────── */
.glide-host { isolation: isolate; }
.glide-ind {
  position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; will-change: transform;
  transition: transform .32s cubic-bezier(.22, .9, .25, 1), width .32s cubic-bezier(.22, .9, .25, 1), height .32s cubic-bezier(.22, .9, .25, 1), opacity .18s;
}
.glide-ind.no-tr { transition: none !important; }
.glide-ind.g-bg { background: var(--active); border-radius: 10px; }
.sidebar-body > .glide-ind.g-bg { border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.autocomplete > .glide-ind.g-bg { transition-duration: .16s; }
.glide-ind.g-bar { background: var(--accent); border-radius: 2px; z-index: 1; }
.glide-ind.g-pill { background: var(--text-strong); border-radius: 0 3px 3px 0; z-index: 2; }
/* eigene Hintergründe der aktiven Elemente aus – die Markierung übernimmt */
.glide-host .si.active, .glide-host .channel.active, .glide-host .nav-item.active, .glide-host .tab.active:not(.add),
.glide-host .wt-item.active, .glide-host .rl.sel, .glide-host .it.sel { background: transparent; box-shadow: none; }
.glide-host .si.active:hover, .glide-host .channel.active:hover, .glide-host .nav-item.active:hover,
.glide-host .wt-item.active:hover, .glide-host .rl.sel:hover { background: transparent; }
.settings .snav .ssubs.glide-host .ssub.active::before { display: none; }
#rail.glide-host .rail-item.active .pill { opacity: 0; }

/* Nachrichten: weicher Hover und sanftes Einblenden neuer Nachrichten */
.msg { transition: background .16s ease; }
.msg.msg-in { animation: msg-in .32s cubic-bezier(.22, .9, .25, 1); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* weichere Übergänge an Listen-Elementen */
.si, .ssub, .tab, .wt-item, .rl, .autocomplete .it, .channel, .nav-item { transition: background .14s, color .14s; }
