/* Lexglomi — chalk on black, red only where attention is needed */
:root {
  --bg: #000000; --panel: #141416; --panel-2: #1d1d21; --panel-3: #26262b; --line: #2b2b31;
  --hover: rgba(255, 255, 255, .055); --active: rgba(255, 255, 255, .10);
  --ink: #f4f4f5; --ink-2: #b9b9c1; --ink-3: #85858e;
  --red: #c70026; --red-hi: #e4173f; --red-soft: rgba(199, 0, 38, .14);
  --ok: #2fb67a; --idle: #e0a33a; --dnd: #c70026; --off: #6b6b73;
  --shadow: 0 10px 34px rgba(0, 0, 0, .55);
  --r-s: 6px; --r-m: 10px; --r-l: 16px;
  --rail: 72px; --side: 248px; --members: 248px;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --panel: #f3f3f5; --panel-2: #e9e9ec; --panel-3: #dedee2; --line: #d8d8dd;
  --hover: rgba(0, 0, 0, .045); --active: rgba(0, 0, 0, .08);
  --ink: #0b0b0c; --ink-2: #44444b; --ink-3: #6c6c74; --red-soft: rgba(199, 0, 38, .09);
  --shadow: 0 10px 30px rgba(0, 0, 0, .14);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 400 1rem/1.4 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: #4ea1ff; }
:root[data-theme="light"] a { color: #0a63c9; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 2px; border-radius: 4px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
.pad { padding: 8px 12px; }
.pad-l { padding: 20px 28px; }
.mobile-only { display: none !important; }
.reduce-motion *, .reduce-motion *::before { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 1000; background: #000; display: grid; place-items: center; transition: opacity .75s ease; }
.intro[data-theme-intro="light"] { background: #fff; }
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.intro.static .intro-video { opacity: 1; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-hint { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; margin: 0; color: #888; font-size: .9rem; }
.intro-skip { position: absolute; right: 24px; bottom: 22px; color: #777; font-size: .85rem; padding: 6px 12px; border-radius: 99px; border: 1px solid #333; }
.intro[data-theme-intro="light"] .intro-skip { border-color: #ccc; }
.intro-skip:hover { color: #ccc; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r-s); font-weight: 600; font-size: .94rem; transition: background .15s, transform .1s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.sm { height: 32px; padding: 0 12px; font-size: .85rem; }
.btn.wide { width: 100%; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hi); }
.btn-ghost { background: var(--panel-2); color: var(--ink); }
.btn-ghost:hover { background: var(--panel-3); }
.btn-danger { background: transparent; color: var(--red-hi); box-shadow: inset 0 0 0 1.5px var(--red-hi); }
.btn-danger:hover { background: var(--red); color: #fff; box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { color: transparent; position: relative; }
.btn.busy::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.linkish { color: #4ea1ff; font-weight: 500; padding: 0; }
:root[data-theme="light"] .linkish { color: #0a63c9; }
.linkish:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-s); color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.off { color: var(--red-hi); }
.icon-btn.on { color: var(--ink); }
.icon-btn.danger:hover { background: var(--red); color: #fff; }
.field { display: grid; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; }
.field > span, .field > legend { font-size: .78rem; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink-3); }
textarea { resize: vertical; }
input[type=color] { width: 56px; height: 36px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--panel-2); padding: 2px; }
input[type=range] { width: 100%; accent-color: var(--red); }
input[type=checkbox], input[type=radio] { accent-color: var(--red); width: 18px; height: 18px; }
input[role=switch] { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--panel-3); position: relative; cursor: pointer; transition: background .15s; flex: none; }
input[role=switch]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
input[role=switch]:checked { background: var(--red); }
input[role=switch]:checked::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row span { display: grid; gap: 2px; } .switch-row small { color: var(--ink-3); font-size: .82rem; }
.check { display: flex; align-items: center; gap: 8px; }
.form-error { color: var(--red-hi); font-size: .88rem; min-height: 1em; margin: 4px 0 12px; }
.form-msg.ok { color: var(--ok); } .form-msg.err { color: var(--red-hi); }
.notice { background: var(--panel-2); border-left: 3px solid var(--red); padding: 10px 14px; border-radius: var(--r-s); margin: 0 0 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tag { font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: var(--red); color: #fff; margin-left: 6px; vertical-align: 2px; }
.tag.ok { background: var(--ok); } .tag.warn { background: var(--idle); color: #000; }
kbd { background: var(--panel-3); border-radius: 4px; padding: 1px 6px; font: .82rem var(--mono); }
.spin { display: inline-block; width: 22px; height: 22px; border: 2.5px solid var(--ink-3); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 16px; display: grid; gap: 8px; justify-items: center; }
.empty-t { font-weight: 700; font-size: 1.05rem; margin: 0; }
.empty p { margin: 0; }

/* ---------- auth ---------- */
.auth { position: fixed; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 6vh 20px 40px; background: var(--bg); transition: opacity .35s; }
.auth.leaving { opacity: 0; }
.auth-wordmark { width: min(360px, 72vw); height: auto; margin-bottom: 28px; transform-origin: center; }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 1.6rem; margin: 0 0 18px; font-weight: 800; }
.auth-card form { display: block; }
.auth-card .btn-primary { width: 100%; height: 44px; margin-top: 4px; }
.auth-card .linkish { font-size: .86rem; display: block; margin: -6px 0 12px; }
.switch { color: var(--ink-3); font-size: .9rem; margin-top: 18px; } .switch .linkish { display: inline; margin: 0; font-size: .9rem; }
.btn-google { width: 100%; height: 44px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.btn-google:hover { background: #f4f4f4; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .8rem; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-foot { color: var(--ink-3); font-size: .82rem; margin-top: auto; padding-top: 32px; text-align: center; max-width: 380px; }
.auth-invite { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: var(--r-m); padding: 14px; margin-bottom: 22px; }
.auth-invite h2 { margin: 2px 0; font-size: 1.15rem; } .auth-invite p { margin: 0; }

/* ---------- avatars & icons ---------- */
.av { --s: 40px; position: relative; width: var(--s); height: var(--s); flex: none; display: inline-block; }
.av img, .av-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; }
.av-fallback { color: #fff; font-weight: 700; font-size: calc(var(--s) * .36); }
.av.group .av-fallback { background: var(--panel-3); color: var(--ink-2); }
.av.group .ic { width: 55%; height: 55%; }
.av .st { position: absolute; right: -2px; bottom: -2px; width: calc(var(--s) * .32 + 4px); height: calc(var(--s) * .32 + 4px); min-width: 12px; min-height: 12px; border-radius: 50%; border: 3px solid var(--panel); background: var(--off); }
.st-online { background: var(--ok) !important; } .st-idle { background: var(--idle) !important; } .st-dnd { background: var(--dnd) !important; }
.st-idle::after { content: ''; position: absolute; width: 55%; height: 55%; top: -1px; left: -1px; border-radius: 50%; background: var(--panel); }
.st-dnd::after { content: ''; position: absolute; left: 22%; right: 22%; top: 42%; height: 18%; background: var(--panel); border-radius: 2px; }
.st-offline::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: var(--panel); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; } .dot.online { background: var(--ok); }
.srv-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--panel-2) center/cover; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--ink); flex: none; overflow: hidden; }
.srv-icon.sm { width: 24px; height: 24px; font-size: .55rem; } .srv-icon.lg { width: 56px; height: 56px; border-radius: 16px; } .srv-icon.xl { width: 80px; height: 80px; border-radius: 24px; font-size: 1.4rem; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; display: inline-grid; place-items: center; line-height: 1; }
.live { background: var(--red); color: #fff; font-size: .62rem; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: .02em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) var(--side) 1fr var(--members); height: 100dvh; }
.shell.no-members { grid-template-columns: var(--rail) var(--side) 1fr 0; }
.shell.no-members .members { display: none; }
body.offline .shell::before { content: 'Reconnecting to Lexglomi…'; position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: var(--idle); color: #000; text-align: center; font-size: .82rem; font-weight: 700; padding: 3px; }

/* rail */
.rail { background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail hr { width: 32px; border: 0; border-top: 2px solid var(--panel-3); margin: 2px 0; }
.rail-btn { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; }
.rail-btn .srv-icon, .rail-btn.home img, .rail-btn.action { transition: border-radius .18s ease, background .15s; }
.rail-btn.home { background: var(--panel-2); border-radius: 50%; }
.rail-btn.home img { width: 22px; height: auto; }
.rail-btn:hover .srv-icon, .rail-btn.active .srv-icon, .rail-btn.home:hover, .rail-btn.home.active { border-radius: 15px; }
.rail-btn.home.active { background: var(--red); }
:root[data-theme="light"] .rail-btn.home.active img { filter: invert(1); }
.rail-btn.action { background: var(--panel-2); border-radius: 50%; color: var(--ink-2); }
.rail-btn.action:hover { border-radius: 15px; background: var(--ink); color: var(--bg); }
.rail-btn .badge { position: absolute; right: -4px; bottom: -4px; box-shadow: 0 0 0 4px var(--bg); }
.rail-btn .pill { position: absolute; left: -12px; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--ink); transition: height .18s; }
.rail-btn.unread .pill { height: 8px; } .rail-btn:hover .pill { height: 20px; } .rail-btn.active .pill { height: 40px; }
.rail-voice { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }
.rail-voice .ic { width: 12px; height: 12px; }

/* sidebar */
.side { background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.side-h { height: 52px; flex: none; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); position: relative; }
.server-name { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; height: 100%; padding: 0 6px; font-weight: 800; text-align: left; overflow: hidden; }
.server-name span { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name .ic { position: relative; }
.srv-banner { position: absolute; inset: -1px -10px; background: center/cover; opacity: .55; mask-image: linear-gradient(to bottom, #000 30%, transparent); }
.search-fake { width: 100%; height: 30px; border-radius: var(--r-s); background: var(--bg); color: var(--ink-3); font-size: .84rem; text-align: left; padding: 0 10px; }
.side-body { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 10px; border-radius: var(--r-s); color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.nav-item:hover { background: var(--hover); color: var(--ink); } .nav-item.active { background: var(--active); color: var(--ink); }
.nav-item .badge { margin-left: auto; }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.side-label .icon-btn { width: 22px; height: 22px; } .side-label .ic { width: 16px; height: 16px; }
.dm-row { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: var(--r-s); color: var(--ink-2); cursor: pointer; }
.dm-row:hover { background: var(--hover); color: var(--ink); } .dm-row.active { background: var(--active); color: var(--ink); }
.dm-row.unread .dm-name { color: var(--ink); font-weight: 700; }
.dm-row .av .st { border-color: var(--panel); }
.dm-text { flex: 1; min-width: 0; display: grid; } .dm-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-text small { color: var(--ink-3); font-size: .76rem; }
.dm-row .close { opacity: 0; width: 22px; height: 22px; } .dm-row:hover .close { opacity: 1; } .dm-row .close .ic { width: 15px; height: 15px; }
.live-dot { color: var(--ok); } .live-dot .ic { width: 16px; height: 16px; }
.cat { display: flex; align-items: center; justify-content: space-between; padding: 16px 2px 4px 0; }
.cat-btn { display: flex; align-items: center; gap: 2px; font-size: .8rem; font-weight: 700; color: var(--ink-3); flex: 1; text-align: left; }
.cat-btn:hover { color: var(--ink); } .cat-btn .ic { width: 14px; height: 14px; transition: transform .15s; }
.cat.collapsed .cat-btn .ic { transform: rotate(-90deg); }
.cat .icon-btn { width: 22px; height: 22px; } .cat .icon-btn .ic { width: 16px; height: 16px; }
.ch { position: relative; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; margin: 1px 0; border-radius: var(--r-s); color: var(--ink-3); cursor: pointer; }
.ch .ic { width: 19px; height: 19px; opacity: .85; }
.ch:hover { background: var(--hover); color: var(--ink-2); }
.ch.active { background: var(--active); color: var(--ink); }
.ch.unread { color: var(--ink); font-weight: 700; }
.ch.muted { opacity: .45; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-pip { position: absolute; left: -8px; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--ink); transition: height .15s; }
.ch.unread .unread-pip { height: 8px; }
.lock { position: absolute; left: 18px; top: 6px; } .lock .ic { width: 10px; height: 10px; stroke-width: 2.4; }
.ch-tools { display: none; gap: 0; } .ch:hover .ch-tools, .ch.active .ch-tools { display: flex; }
.ch-tools .icon-btn { width: 22px; height: 22px; } .ch-tools .ic { width: 15px; height: 15px; }
.ch .limit { font-size: .7rem; background: var(--panel-3); padding: 0 5px; border-radius: 4px; }
.ch.thread { height: 30px; padding-left: 28px; font-size: .92rem; }
.branch { position: absolute; left: 16px; top: -6px; width: 10px; height: 20px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 8px; }
.vc-status { padding: 0 8px 0 33px; font-size: .78rem; color: var(--ink-3); margin-top: -2px; }
.vc-users { list-style: none; margin: 0 0 4px; padding: 0 0 0 26px; }
.vc-user { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px; border-radius: var(--r-s); color: var(--ink-2); font-size: .9rem; cursor: pointer; }
.vc-user:hover { background: var(--hover); }
.vc-user .av { box-shadow: 0 0 0 2px transparent; border-radius: 50%; transition: box-shadow .1s; }
.vc-user.speaking .av { box-shadow: 0 0 0 2px var(--ok); }
.vc-user > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-flags { display: flex; gap: 2px; align-items: center; color: var(--ink-3); } .vc-flags .ic { width: 15px; height: 15px; } .vc-flags .red { color: var(--red-hi); }

/* voice panel + me panel */
.voice-panel { border-top: 1px solid var(--line); padding: 8px 8px 6px; background: var(--panel); }
.vp-top { display: flex; align-items: center; justify-content: space-between; }
.vp-info { display: grid; text-align: left; min-width: 0; }
.vp-info b { display: flex; align-items: center; gap: 6px; font-size: .86rem; } .vp-info b.ok { color: var(--ok); } .vp-info b.warn { color: var(--idle); }
.vp-info b .ic { width: 16px; height: 16px; } .vp-info small { color: var(--ink-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-info:hover small { color: var(--ink); text-decoration: underline; }
.vp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.vp-btn { height: 32px; border-radius: var(--r-s); background: var(--panel-2); color: var(--ink-2); display: grid; place-items: center; }
.vp-btn:hover { background: var(--panel-3); color: var(--ink); } .vp-btn.on { background: var(--ink); color: var(--bg); } .vp-btn.live { background: var(--red); color: #fff; }
.me-panel { height: 56px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 8px; background: var(--panel-2); }
:root[data-theme="dark"] .me-panel { background: #0d0d0f; }
.me-btn { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px; border-radius: var(--r-s); text-align: left; }
.me-btn:hover { background: var(--hover); }
.me-btn .av .st { border-color: var(--panel-2); }
:root[data-theme="dark"] .me-btn .av .st { border-color: #0d0d0f; }
.me-text { display: grid; min-width: 0; } .me-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text b { font-size: .88rem; } .me-text small { color: var(--ink-3); font-size: .75rem; }

/* main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.main-h { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.h-title { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.h-title .ic { color: var(--ink-3); width: 22px; height: 22px; }
.h-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.h-topic { color: var(--ink-3); font-size: .86rem; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.h-topic br { display: none; }
.h-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.h-search { position: relative; margin-left: 6px; }
.h-search input { width: 150px; height: 28px; padding: 0 28px 0 8px !important; font-size: .84rem; background: var(--panel) !important; transition: width .2s; }
.h-search input:focus { width: 230px; }
.h-search .ic { position: absolute; right: 6px; top: 5px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.main-body { flex: 1; min-height: 0; display: flex; position: relative; }
.main-body:has(> .call-bar-slot) { flex-direction: column; }
.call-bar-slot:empty { display: none; }
.tabs { display: flex; align-items: center; gap: 4px; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); overflow-x: auto; }
.tab { height: 30px; padding: 0 10px; border-radius: var(--r-s); color: var(--ink-2); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab:hover { background: var(--hover); color: var(--ink); } .tab.active { background: var(--active); color: var(--ink); }
.tab.add { background: var(--red); color: #fff; } .tab.add.active { background: transparent; color: var(--red-hi); }

/* friends */
.friends { flex: 1; overflow-y: auto; max-width: 900px; }
.mem-h { font-size: .76rem; font-weight: 700; color: var(--ink-3); margin: 14px 8px 6px; }
.friend { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer; }
.friend:hover { background: var(--hover); border-top-color: transparent; }
.friend-text { flex: 1; display: grid; min-width: 0; } .friend-text small { color: var(--ink-3); }
.friend-actions { display: flex; gap: 8px; }
.round { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); color: var(--ink-2); display: grid; place-items: center; }
.round:hover { color: var(--ink); background: var(--panel-2); } .round.ok:hover { color: var(--ok); }
.round.big { width: 60px; height: 60px; } .round.big.danger { background: var(--red); color: #fff; } .round.big.ok { background: var(--ok); color: #fff; }
.add-friend { max-width: 720px; } .add-friend h2 { margin: 0 0 4px; }
.inline-form { display: flex; gap: 10px; margin-top: 16px; background: var(--panel); padding: 8px; border-radius: var(--r-m); border: 1px solid var(--line); }
.inline-form input { border: 0 !important; background: transparent !important; }

/* members */
.members { background: var(--panel); overflow-y: auto; padding: 8px 8px 20px; }
.mem { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: var(--r-s); cursor: pointer; }
.mem:hover { background: var(--hover); }
.mem.off { opacity: .4; } .mem.off:hover { opacity: 1; }
.mem-text { min-width: 0; display: grid; } .mem-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-name { font-weight: 600; color: var(--rc, var(--ink-2)); display: flex; align-items: center; gap: 4px; }
[data-grad] { background: linear-gradient(90deg, var(--rc), var(--rc2)); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.mem-text small { color: var(--ink-3); font-size: .76rem; }
.crown { color: var(--idle); } .crown .ic { width: 14px; height: 14px; }

/* ---------- chat ---------- */
.chat-split { flex: 1; display: flex; min-width: 0; min-height: 0; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat.drop::after { content: 'Drop files to upload'; position: absolute; inset: 12px; border: 2px dashed var(--red); border-radius: var(--r-l); background: rgba(0,0,0,.6); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #fff; z-index: 5; }
.thread-pane { border-left: 1px solid var(--line); max-width: 46%; }
.thread-pane.full { max-width: none; border: 0; }
.thread-h { height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-bottom: 1px solid var(--line); flex: none; }
.thread-h .h-topic { display: none; }
.scroller { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.msgs { padding: 0 0 16px; min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.loading-msgs { display: grid; place-items: center; padding: 40px; }
.load-more { display: grid; place-items: center; padding: 20px; }
.chan-intro { padding: 32px 16px 8px; display: grid; gap: 6px; justify-items: start; }
.chan-intro h2 { margin: 6px 0 0; font-size: 1.8rem; font-weight: 800; } .chan-intro p { margin: 0; }
.chan-intro.small h2 { font-size: 1.3rem; }
.intro-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; }
.intro-ic .ic { width: 36px; height: 36px; }
.day { display: flex; align-items: center; margin: 22px 16px 6px; color: var(--ink-3); font-size: .74rem; font-weight: 700; }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day span { padding: 0 8px; }
.new-line { display: flex; align-items: center; margin: 10px 16px 4px 16px; }
.new-line::before { content: ''; flex: 1; height: 1px; background: var(--red); }
.new-line span { background: var(--red); color: #fff; font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 0 4px 4px 0; }

.msg { position: relative; display: grid; grid-template-columns: 72px 1fr; padding: 2px 48px 2px 0; margin-top: 16px; min-width: 0; }
.msg.grouped { margin-top: 0; }
.msg:hover { background: var(--hover); }
.msg.mentioned { background: var(--red-soft); box-shadow: inset 2px 0 0 var(--red); }
.msg.flash { animation: flash 2s ease; }
@keyframes flash { 0%, 40% { background: rgba(199, 0, 38, .28); } }
.msg.pending .msg-c { opacity: .55; }
.msg.failed .md { color: var(--red-hi); }
.msg-c[data-progress]::after { content: 'Uploading ' attr(data-progress); font-size: .75rem; color: var(--ink-3); }
.msg-av { grid-row: span 2; justify-self: center; align-self: start; margin-top: 2px; }
.msg-h { margin: 0; font-size: 1rem; font-weight: 600; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.author { font-weight: 700; color: var(--rc, var(--ink)); }
.author:hover { text-decoration: underline; }
.msg-h time { color: var(--ink-3); font-size: .74rem; font-weight: 500; }
.role-ic { width: 18px; height: 18px; object-fit: contain; align-self: center; }
.gutter-time { grid-row: 1; justify-self: center; align-self: center; font-size: .66rem; color: var(--ink-3); opacity: 0; }
.msg.grouped:hover .gutter-time { opacity: 1; }
.msg-c { grid-column: 2; min-width: 0; }
.md { line-height: 1.375; overflow-wrap: anywhere; white-space: pre-wrap; }
.md br { content: ''; }
.md strong { font-weight: 800; }
.md .md-h { margin: 8px 0 2px; line-height: 1.25; } h3.md-h { font-size: 1.5rem; } h4.md-h { font-size: 1.25rem; } h5.md-h { font-size: 1.05rem; }
.md ul, .md ol { margin: 4px 0; padding-left: 22px; white-space: normal; }
.md blockquote { margin: 4px 0; padding: 0 0 0 12px; border-left: 4px solid var(--panel-3); }
.subtext { display: block; color: var(--ink-3); font-size: .78rem; }

code.icode { font-family: var(--mono); font-size: .85em; background: var(--panel-2); padding: 1px 4px; border-radius: 4px; }
pre.code { position: relative; margin: 6px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; overflow-x: auto; max-width: 860px; white-space: pre; }
pre.code code { font: .84rem/1.5 var(--mono); }
pre.code .lang { position: absolute; top: 4px; right: 60px; font: .68rem var(--mono); color: var(--ink-3); }
.copy-code { position: absolute; top: 6px; right: 6px; font-size: .72rem; padding: 2px 8px; border-radius: 4px; background: var(--panel-2); opacity: 0; } pre.code:hover .copy-code { opacity: 1; }
.spoiler { background: var(--panel-3); color: transparent; border-radius: 4px; cursor: pointer; transition: color .1s; }
.spoiler * { visibility: hidden; } .spoiler.shown { color: inherit; background: var(--panel-2); } .spoiler.shown * { visibility: visible; }
.mention { background: rgba(199, 0, 38, .18); color: #ff9db0; border-radius: 4px; padding: 0 3px; font-weight: 600; cursor: pointer; }
:root[data-theme="light"] .mention { color: #9e001f; }
.mention:hover { background: var(--red); color: #fff; }
.mention.role { background: color-mix(in srgb, var(--rc) 22%, transparent); color: var(--rc); }
.mention.channel { background: var(--panel-3); color: var(--ink); }
.emoji { width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.jumbo-wrap { font-size: 2.6rem; line-height: 1.15; } .emoji.jumbo { width: 48px; height: 48px; }
time.ts { background: var(--panel-2); border-radius: 4px; padding: 0 3px; }
.edited { color: var(--ink-3); font-size: .7rem; margin-left: 4px; }
.reply-ref { grid-column: 2; display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-3); margin: 2px 0 2px; position: relative; cursor: pointer; min-width: 0; }
.reply-ref::before { content: ''; position: absolute; left: -38px; top: 9px; width: 30px; height: 12px; border-left: 2px solid var(--panel-3); border-top: 2px solid var(--panel-3); border-top-left-radius: 6px; }
.reply-ref b { color: var(--ink-2); white-space: nowrap; } .reply-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-ref:hover span { color: var(--ink); }
.msg .reply-ref + .msg-av { grid-row: 2 / span 2; }
.msg-tools { position: absolute; right: 12px; top: -16px; display: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow); padding: 2px; z-index: 3; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: flex; }
.msg-tools button { width: 32px; height: 30px; border-radius: 4px; display: grid; place-items: center; color: var(--ink-2); font-size: 1rem; }
.msg-tools button:hover { background: var(--panel-2); color: var(--ink); }
.msg.system { display: flex; align-items: center; gap: 12px; padding: 4px 16px 4px 26px; margin-top: 8px; color: var(--ink-3); font-size: .92rem; }
.msg.system p { margin: 0; } .msg.system b { color: var(--ink); cursor: pointer; } .msg.system time { font-size: .72rem; margin-left: 4px; }
.sys-ic { width: 28px; display: grid; place-items: center; } .msg.join .sys-ic { color: var(--ok); } .msg.automod .sys-ic { color: var(--red-hi); }
.msg.system blockquote { margin: 4px 0 0; padding-left: 8px; border-left: 3px solid var(--red); color: var(--ink-2); }
.msg.blocked { display: block; padding: 6px 16px 6px 72px; }
.msg.editing .msg-tools { display: none !important; }
.edit-box textarea { min-height: 44px; margin: 4px 0; background: var(--panel) !important; }
.edit-box p { margin: 0 0 4px; }
.fail-note { color: var(--red-hi); font-size: .8rem; margin: 2px 0; }
.xpost { color: var(--ink-3); font-size: .78rem; display: flex; gap: 4px; align-items: center; margin: 0; }
.xpost .ic { width: 14px; height: 14px; }
.fwd { border-left: 3px solid var(--panel-3); padding-left: 10px; margin: 4px 0; } .fwd p { margin: 2px 0; } .fwd .ic { width: 14px; height: 14px; vertical-align: -2px; }

/* attachments */
.media-grid { display: grid; gap: 4px; margin-top: 6px; max-width: 520px; }
.media-grid.n2, .media-grid.n4 { grid-template-columns: 1fr 1fr; } .media-grid.n3 { grid-template-columns: 1fr 1fr 1fr; }
.media-grid:not(.n1) .att-img { aspect-ratio: 1; }
.att-img { position: relative; display: block; max-width: 100%; border-radius: var(--r-m); overflow: hidden; background: var(--panel); }
.att-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spoiler-media img, video.spoiler-media { filter: blur(44px); }
.spoiler-media.shown img, video.spoiler-media.shown { filter: none; }
.sp-label { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; background: rgba(0,0,0,.65); color: #fff; font-weight: 800; padding: 6px 12px; border-radius: 99px; font-size: .8rem; }
.spoiler-media.shown .sp-label { display: none; }
.att-video { display: block; max-width: min(520px, 100%); max-height: 400px; border-radius: var(--r-m); margin-top: 6px; background: #000; }
.att-file { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); max-width: 440px; }
.att-file > .ic { width: 32px; height: 32px; color: var(--ink-3); }
.att-file > div { flex: 1; min-width: 0; display: grid; } .att-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .att-file small { color: var(--ink-3); }
.att-file audio { width: 100%; height: 34px; margin-top: 6px; }
.voice-msg { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-top: 6px; background: var(--panel); border-radius: 99px; max-width: 360px; }
.vm-play { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; }
.vm-play .ic { width: 16px; height: 16px; }
.vm-wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; }
.vm-wave i { flex: 1; background: var(--ink-3); border-radius: 2px; min-height: 3px; } .vm-wave i.on { background: var(--ink); }
.vm-time { font: .74rem var(--mono); color: var(--ink-3); }
.vm-speed { font-size: .72rem; font-weight: 800; background: var(--panel-3); border-radius: 99px; padding: 2px 6px; }
.embed { margin-top: 6px; max-width: 440px; background: var(--panel); border-left: 4px solid var(--ec, var(--panel-3)); border-radius: var(--r-s); padding: 10px 14px 14px; display: grid; gap: 4px; }
.embed p { margin: 0; font-size: .86rem; color: var(--ink-2); } .embed-t { font-weight: 700; }
.embed-img { max-width: 100%; max-height: 260px; border-radius: var(--r-s); margin-top: 6px; }
.yt { position: relative; aspect-ratio: 16/9; width: 100%; background: #000 center/cover; border-radius: var(--r-s); margin-top: 6px; display: grid; place-items: center; }
.yt .ic { width: 56px; height: 56px; color: #fff; background: var(--red); border-radius: 50%; padding: 14px; }
.yt-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r-s); margin-top: 6px; }
.spotify { width: 100%; height: 152px; border: 0; border-radius: 12px; margin-top: 6px; }
.poll { margin-top: 6px; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; }
.poll-q { font-weight: 800; margin: 0; } .poll > p { margin: 2px 0 10px; }
.poll-a { position: relative; display: flex; justify-content: space-between; width: 100%; padding: 10px 12px; margin-bottom: 6px; border-radius: var(--r-s); background: var(--panel-2); overflow: hidden; text-align: left; border: 1.5px solid transparent; }
.poll-a::before { content: ''; position: absolute; inset: 0; width: var(--pct); background: var(--panel-3); transition: width .4s; }
.poll-a > * { position: relative; } .poll-a.mine { border-color: var(--red); } .poll-a:not([disabled]):hover { border-color: var(--ink-3); }
.poll .muted.small:last-child { margin: 8px 0 0; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--panel); border: 1px solid transparent; font-size: .9rem; }
.react b { font-size: .8rem; color: var(--ink-2); }
.react:hover { border-color: var(--ink-3); }
.react.me { background: var(--red-soft); border-color: var(--red); } .react.me b { color: var(--ink); }
.react.burst { background: linear-gradient(90deg, var(--red-soft), transparent); }
.react.add { opacity: 0; color: var(--ink-3); } .msg:hover .react.add { opacity: 1; } .react.add .ic { width: 16px; height: 16px; }
.react .emoji { width: 18px; height: 18px; vertical-align: 0; }
.thread-chip { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 12px; background: var(--panel); border-radius: var(--r-s); border: 1px solid var(--line); max-width: 440px; text-align: left; }
.thread-chip span { color: #4ea1ff; font-size: .82rem; margin-left: auto; } .thread-chip:hover { border-color: var(--ink-3); }
.jump-present { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; background: var(--red); color: #fff; font-weight: 700; padding: 6px 16px; border-radius: 99px; box-shadow: var(--shadow); font-size: .85rem; z-index: 4; }

/* composer */
.composer-wrap { padding: 0 16px 20px; flex: none; position: relative; }
.typing { height: 20px; font-size: .78rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); animation: blink 1.2s infinite; } .dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { background: var(--panel); border-radius: var(--r-m); border: 1px solid var(--line); position: relative; }
.composer.disabled { padding: 14px 16px; color: var(--ink-3); } .composer.disabled p { margin: 0; }
.comp-row { display: flex; align-items: flex-end; gap: 2px; padding: 4px 6px; }
.comp-row textarea { flex: 1; resize: none; border: 0 !important; background: transparent !important; padding: 10px 6px !important; max-height: 320px; line-height: 1.4; }
.comp-row .icon-btn { width: 38px; height: 40px; } .comp-row .ic { width: 22px; height: 22px; }
.comp-row .send { color: var(--ink-3); } .comp-row .send:hover { color: var(--red-hi); }
.comp-row .rec { color: #fff; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(199, 0, 38, .25); } }
.reply-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel-2); border-radius: var(--r-m) var(--r-m) 0 0; font-size: .84rem; color: var(--ink-2); }
.reply-bar span { flex: 1; } .ping-toggle { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: .78rem; } .ping-toggle input { width: 14px; height: 14px; }
.files { display: flex; gap: 10px; padding: 12px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.file-chip { position: relative; width: 160px; flex: none; background: var(--panel-2); border-radius: var(--r-s); padding: 8px; display: grid; gap: 4px; font-size: .8rem; }
.file-chip img { width: 100%; height: 100px; object-fit: cover; border-radius: 4px; } .file-chip > .ic { width: 100%; height: 100px; color: var(--ink-3); padding: 28px; }
.file-chip.sp img { filter: blur(12px); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .file-chip small { color: var(--ink-3); }
.chip-tools { position: absolute; top: -8px; right: -6px; display: flex; background: var(--panel); border-radius: var(--r-s); box-shadow: var(--shadow); }
.chip-tools .icon-btn { width: 28px; height: 28px; } .chip-tools .ic { width: 16px; height: 16px; }
.autocomplete { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; padding: 6px; z-index: 6; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-s); cursor: pointer; }
.ac-item small { color: var(--ink-3); margin-left: auto; } .ac-item.sel, .ac-item:hover { background: var(--panel-2); }
.ac-item .emo { font-size: 1.2rem; width: 24px; text-align: center; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.slow-note { font-size: .74rem; color: var(--ink-3); margin: 4px 4px 0; }

/* search pane */
.search-pane { width: 400px; flex: none; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.search-pane header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.search-body { flex: 1; overflow-y: auto; padding: 8px; }
.search-help { text-decoration: underline dotted; cursor: help; float: right; }
.search-hit { display: grid; gap: 4px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px; margin-bottom: 8px; }
.search-hit:hover { border-color: var(--ink-3); } .hit-head { display: flex; align-items: center; gap: 8px; }

/* forum */
.forum { flex: 1; overflow-y: auto; max-width: 980px; }
.forum-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.forum-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-btn { padding: 4px 10px; border-radius: 99px; background: var(--panel-2); font-size: .82rem; } .tag-btn.on { background: var(--red); color: #fff; }
.posts { display: grid; gap: 10px; }
.post { display: flex; gap: 14px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; }
.post:hover { border-color: var(--ink-3); }
.post-text { display: grid; gap: 4px; min-width: 0; flex: 1; } .post-text b { font-size: 1.05rem; }
.post-ex { color: var(--ink-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-text small { display: flex; gap: 4px; align-items: center; } .post-text small .ic { width: 14px; height: 14px; }
.post-tags { display: flex; gap: 4px; } .post-tags i { font-style: normal; font-size: .72rem; background: var(--panel-3); padding: 1px 8px; border-radius: 99px; }
.post-img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--r-s); order: 2; }
.posts:has(.post.media) { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.post.media { flex-direction: column; } .post.media .post-img { width: 100%; height: 180px; order: 0; }

/* ---------- voice view ---------- */
.voice-split { flex: 1; display: flex; min-width: 0; }
.voice-view { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #000; color: #fff; padding: 16px; position: relative; }
:root[data-theme="light"] .voice-view { background: #0c0c0d; }
.voice-chat { max-width: 420px; border-left: 1px solid var(--line); background: var(--bg); }
.voice-empty { margin: auto; text-align: center; display: grid; justify-items: center; gap: 4px; color: #ddd; }
.voice-empty .ic { width: 48px; height: 48px; color: #666; }
.voice-empty h2 { margin: 6px 0 0; }
.tiles { flex: 1; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-content: center; max-width: 1400px; width: 100%; margin: 0 auto; }
.tiles.n1 { grid-template-columns: minmax(240px, 760px); justify-content: center; }
.tile { position: relative; aspect-ratio: 16/9; background: #18181b; border-radius: var(--r-m); overflow: hidden; display: grid; place-items: center; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .1s; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--ok); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; } .tile video.mirror { transform: scaleX(-1); object-fit: cover; }
.tile-av .av-fallback, .tile-av img { box-shadow: 0 0 0 6px rgba(255,255,255,.04); }
.tile-name { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 6px; font-size: .84rem; font-weight: 600; }
.tile-name .ic { width: 15px; height: 15px; color: var(--red-hi); } .tile-name small { display: inline-flex; align-items: center; gap: 2px; color: #bbb; } .tile-name small .ic { color: #bbb; width: 13px; }
.tile-act { position: absolute; inset: auto 8px 8px auto; background: var(--red); color: #fff; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 99px; }
.focus-layout { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tile.big { flex: 1; aspect-ratio: auto; min-height: 0; }
.big-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tile.big:hover .big-tools, .tile.big:focus-within .big-tools { opacity: 1; } .big-tools .icon-btn { background: rgba(0,0,0,.6); color: #fff; }
.strip { display: flex; gap: 10px; overflow-x: auto; flex: none; } .strip .tile { width: 200px; flex: none; }
.stream-preview { display: grid; justify-items: center; gap: 10px; text-align: center; } .stream-preview p { margin: 0; color: #ccc; }
.vc-controls { display: flex; justify-content: center; gap: 12px; padding-top: 16px; flex: none; }
.ctl { width: 52px; height: 52px; border-radius: 50%; background: #26262b; color: #fff; display: grid; place-items: center; }
.ctl:hover { background: #34343a; } .ctl.off { background: #fff; color: var(--red); } .ctl.on { background: #fff; color: #000; } .ctl.live { background: var(--red); color: #fff; } .ctl.danger { background: var(--red); } .ctl.danger:hover { background: var(--red-hi); }
.ctl .ic { width: 24px; height: 24px; }
.stage { flex: 1; overflow-y: auto; } .stage .mem-h { color: #999; }
.stage .tiles { align-content: start; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.audience { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 8px; }
.aud { display: grid; justify-items: center; gap: 4px; width: 92px; font-size: .8rem; text-align: center; position: relative; }
.aud.speaking .av { box-shadow: 0 0 0 3px var(--ok); border-radius: 50%; }
.hand { position: absolute; top: 0; right: 14px; background: var(--idle); color: #000; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; } .hand .ic { width: 14px; height: 14px; }
.call-bar { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 16px; background: #000; color: #fff; border-bottom: 1px solid var(--line); }
.call-people { display: flex; gap: 16px; } .call-av { border-radius: 50%; transition: box-shadow .1s; } .call-av.speaking { box-shadow: 0 0 0 3px var(--ok); }
.call-ctl { display: flex; gap: 10px; } .call-ctl .ctl { width: 44px; height: 44px; }
.call-in { padding: 28px 20px 24px; } .call-in h2 { margin: 12px 0 2px; }
.call-btns { display: flex; gap: 40px; justify-content: center; margin-top: 22px; }
.call-view .modal-body, .call-view { padding: 0; }
.modal.call-view { width: min(1200px, 96vw); height: min(760px, 90vh); }
.call-full, .call-full .voice-view { height: 100%; }

/* ---------- overlays ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .72); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal-back.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--line); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal.sm { width: min(420px, 100%); } .modal.lg { width: min(760px, 100%); } .modal.xl { width: min(1100px, 100%); }
.modal > header { display: flex; align-items: center; gap: 10px; padding: 18px 18px 8px 22px; }
.modal > header h2 { margin: 0; font-size: 1.25rem; flex: 1; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; }
.modal-body.center { text-align: center; display: grid; justify-items: center; }
.modal > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; background: var(--panel-2); }
.qs-modal { width: min(560px, 100%); } .qs { padding: 18px; } .qs-in { font-size: 1.1rem; height: 52px; }
.qs-list { margin: 10px 0; max-height: 360px; overflow-y: auto; }
.qs-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; border-radius: var(--r-s); text-align: left; font-weight: 600; }
.qs-item small { color: var(--ink-3); font-weight: 400; } .qs-item.sel, .qs-item:hover { background: var(--panel-2); }
.tpl-list { display: grid; gap: 8px; margin: 14px 0; }
.tpl { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); text-align: left; }
.tpl b { flex: none; } .tpl small { color: var(--ink-3); flex: 1; } .tpl .ic { transform: rotate(-90deg); color: var(--ink-3); } .tpl:hover { background: var(--panel-2); }
.join-box { text-align: center; padding-top: 8px; } .join-box h3 { margin: 6px 0 10px; font-size: 1rem; }
.upload-circle { width: 88px; height: 88px; border-radius: 50%; border: 2px dashed var(--ink-3); display: grid; place-items: center; align-content: center; gap: 2px; margin: 8px auto 18px; cursor: pointer; background: center/cover; color: var(--ink-3); font-size: .74rem; font-weight: 700; }
.upload-circle.has { border: 0; color: transparent; } .upload-circle.has .ic { display: none; }
.types { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; } .types legend { font-size: .78rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.type { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel-2); border-radius: var(--r-s); cursor: pointer; border: 1.5px solid transparent; }
.type:has(input:checked) { border-color: var(--red); } .type span { display: grid; } .type small { color: var(--ink-3); font-size: .8rem; } .type input { margin-left: auto; order: 3; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-s); cursor: pointer; }
.pick:hover { background: var(--panel-2); } .pick > span:not(.role-dot):not(.role-chips) { flex: 1; display: grid; min-width: 0; } .pick small { color: var(--ink-3); font-size: .8rem; }
.pick-search, .disc-q, .mq, .u-q { margin-bottom: 10px; }
.pick-list { max-height: 320px; overflow-y: auto; }
.copy-row { display: flex; gap: 8px; }
.inv-opts { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: .86rem; color: var(--ink-2); }
.inv-opts select { width: auto; margin-left: 6px; padding: 6px 8px; }
.inv-friends { max-height: 220px; overflow-y: auto; margin-bottom: 14px; }
.invite-card h2 { margin: 2px 0 4px; } .invite-card .srv-icon { margin-bottom: 10px; }
.disc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.disc { position: relative; background: var(--panel-2); border-radius: var(--r-m); padding: 0 14px 14px; display: grid; gap: 6px; overflow: hidden; }
.disc-banner { height: 80px; margin: 0 -14px; background: var(--panel-3) center/cover; } .disc .srv-icon { margin-top: -28px; border: 4px solid var(--panel-2); }
.disc p { margin: 0; }
.cs-row { display: flex; gap: 8px; } .cs-row .cs-emoji { width: 64px; text-align: center; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0 0 16px; }
.seg legend { font-size: .78rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; width: 100%; }
.seg label { cursor: pointer; } .seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 8px 14px; border-radius: var(--r-s); background: var(--panel-2); font-weight: 600; font-size: .88rem; border: 1.5px solid transparent; }
.seg input:checked + span { border-color: var(--red); background: var(--red-soft); } .seg input:focus-visible + span { outline: 2px solid var(--red-hi); }
.seg.big span { padding: 14px 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answers .field { margin-bottom: 8px; }
.tag-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; } .tag-pick label span { padding: 4px 10px; border-radius: 99px; background: var(--panel-2); font-size: .84rem; } .tag-pick input { display: none; } .tag-pick input:checked + span { background: var(--red); color: #fff; }
.event { background: var(--panel-2); border-radius: var(--r-m); padding: 14px; margin-bottom: 10px; } .event h3 { margin: 4px 0; }
.ev-when { color: var(--red-hi); font-weight: 700; font-size: .84rem; margin: 0; display: flex; gap: 6px; align-items: center; } .ev-when .ic { width: 16px; height: 16px; }
.ev-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lightbox { width: auto; max-width: 96vw; background: transparent; border: 0; box-shadow: none; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: var(--r-s); }
.lb-open { color: #ccc; font-size: .84rem; margin-top: 8px; } .lb-close { position: fixed; top: 16px; right: 16px; color: #fff; }

.menu { position: fixed; z-index: 200; min-width: 200px; max-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 6px; animation: fade .1s; max-height: 80vh; overflow-y: auto; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.menu-h { font-size: .72rem; font-weight: 700; color: var(--ink-3); margin: 6px 8px 2px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 4px; text-align: left; font-size: .88rem; font-weight: 500; }
.menu-item span { flex: 1; } .menu-item small { color: var(--ink-3); font-size: .74rem; }
.menu-item:hover, .menu-item:focus-visible { background: var(--red); color: #fff; outline: none; } .menu-item:hover small { color: #ffd5dd; }
.menu-item.danger { color: var(--red-hi); } .menu-item.danger:hover { color: #fff; }
.menu-item[disabled] { opacity: .4; }
.check { font-style: normal; width: 14px; }
.popover { position: fixed; z-index: 150; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); animation: fade .1s; max-width: calc(100vw - 16px); }
.popover.wide { width: 440px; }
.panel h3 { margin: 0; padding: 14px 16px 10px; font-size: 1rem; border-bottom: 1px solid var(--line); }
.panel-body { max-height: 440px; overflow-y: auto; padding: 8px; }
.pin-row { display: flex; gap: 10px; padding: 10px; border-radius: var(--r-s); background: var(--bg); margin-bottom: 6px; } .pin-row > div { flex: 1; min-width: 0; }
.thread-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border-radius: var(--r-s); text-align: left; } .thread-row:hover { background: var(--panel-2); } .thread-row small { margin-left: auto; }
.picker { width: 352px; display: flex; flex-direction: column; height: 380px; }
.pk-search { margin: 10px; width: calc(100% - 20px) !important; }
.pk-body { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.pk-h { font-size: .74rem; font-weight: 700; color: var(--ink-3); margin: 10px 4px 4px; }
.pk-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.pk-grid button { height: 40px; font-size: 1.5rem; border-radius: var(--r-s); display: grid; place-items: center; }
.pk-grid button:hover { background: var(--panel-2); } .pk-grid img { width: 30px; height: 30px; object-fit: contain; }
.sb { width: 360px; } .sb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sb-btn { padding: 10px 6px; border-radius: var(--r-s); background: var(--panel-2); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sb-btn:hover { background: var(--red); color: #fff; }

/* profile */
.profile-card { width: 320px; overflow: hidden; border-radius: var(--r-l); --accent: var(--panel-3); }
.pc-banner { height: 92px; background: var(--accent) center/cover; } .pc-banner.tall { height: 140px; }
.pc-av { margin: -44px 0 0 16px; } .pc-av .av { box-shadow: 0 0 0 6px var(--panel); border-radius: 50%; } .pc-av .av .st { border-width: 5px; }
.pc-body { padding: 8px 16px 16px; } .pc-body h3 { margin: 0; font-size: 1.25rem; } .pc-body > p { margin: 0 0 6px; }
.pc-status { background: var(--panel-2); border-radius: var(--r-s); padding: 6px 10px; }
.pc-voice { display: flex; gap: 6px; align-items: center; color: var(--ok); font-size: .84rem; font-weight: 600; } .pc-voice .ic { width: 16px; height: 16px; }
.pc-sec { border-top: 1px solid var(--line); padding: 10px 0 4px; } .pc-sec h4 { margin: 0 0 6px; font-size: .74rem; color: var(--ink-3); }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; padding: 2px 8px; background: var(--panel-2); border-radius: 4px; }
.role-chip i { width: 10px; height: 10px; border-radius: 50%; }
.pc-msg input { margin-top: 10px; }
.profile-pop { padding: 0; }
.profile-modal { width: min(600px, 100%); }
.profile-full { --accent: var(--panel-3); } .pf-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 18px; margin-top: -48px; }
.pf-head .av { box-shadow: 0 0 0 7px var(--panel); border-radius: 50%; } .pf-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 6px; }
.pf-body { padding: 10px 22px 22px; max-height: 60vh; overflow-y: auto; } .pf-body h2 { margin: 0; }
.mutual { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 6px 0; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--panel-2); font-size: .86rem; }
.note { min-height: 50px; background: transparent !important; border-style: dashed !important; }

/* settings */
.settings { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr); background: var(--bg); animation: fade .15s; }
.set-nav { background: var(--panel); display: flex; justify-content: flex-end; overflow-y: auto; padding: 56px 8px 40px 20px; }
.set-nav-in { width: 200px; }
.set-h { font-size: .74rem; font-weight: 800; color: var(--ink-3); margin: 16px 10px 6px; }
.set-tab { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: var(--r-s); color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }
.set-tab:hover { background: var(--hover); color: var(--ink); } .set-tab.active { background: var(--active); color: var(--ink); }
.set-tab.danger { color: var(--red-hi); } .set-nav hr { border: 0; border-top: 1px solid var(--line); margin: 10px; }
.set-main { overflow-y: auto; padding: 56px 40px 80px; }
.set-content { max-width: 740px; }
.set-content h2 { margin: 0 0 6px; font-size: 1.35rem; } .set-content h2 + .muted { margin-top: 0; }
.set-content h3 { font-size: 1rem; margin: 28px 0 8px; } .danger-h { color: var(--red-hi); }
.set-content > .field, .set-content > .switch-row, .set-content > .seg { margin-top: 16px; }
.set-close { position: fixed; top: 44px; right: 36px; display: grid; justify-items: center; gap: 4px; color: var(--ink-3); font-size: .72rem; font-weight: 700; }
.set-close .ic { width: 36px; height: 36px; padding: 6px; border-radius: 50%; border: 2px solid var(--ink-3); }
.set-close:hover { color: var(--ink); } .set-close:hover .ic { border-color: var(--ink); }
.acct-card { display: flex; align-items: center; gap: 16px; background: var(--panel); border-radius: var(--r-l); padding: 18px; margin: 18px 0; } .acct-card div { flex: 1; } .acct-card h3 { margin: 0; }
.kv { background: var(--panel); border-radius: var(--r-l); padding: 6px 18px; margin: 0; }
.kv > div { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .kv > div:last-child { border: 0; }
.kv dt { font-size: .76rem; font-weight: 800; color: var(--ink-3); width: 140px; flex: none; } .kv dd { margin: 0; flex: 1; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.steps { padding-left: 18px; line-height: 1.6; } .key { display: block; font: 1rem var(--mono); background: var(--panel-2); padding: 8px 12px; border-radius: var(--r-s); margin: 6px 0; letter-spacing: .08em; }
.profile-edit { display: grid; grid-template-columns: 1fr 320px; gap: 28px; margin-top: 16px; align-items: start; }
.pe-preview .profile-card { background: var(--panel); border: 1px solid var(--line); }
.session { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); } .session > div:nth-child(2) { flex: 1; display: grid; }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); } .sound-row span { flex: 1; }
.mic-test { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; } .meter { flex: 1; height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; } .meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .06s; }
.about-wm { width: 260px; margin: 12px 0; }
.ov-top { display: flex; gap: 20px; align-items: center; margin-top: 12px; } .ov-top .upload-circle { margin: 0; } .grow { flex: 1; }
.roles-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-top: 16px; align-items: start; }
.role-list { display: grid; gap: 2px; position: sticky; top: 0; } .role-list .btn { margin-bottom: 8px; } .role-list select { margin-top: 10px; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-s); text-align: left; font-weight: 600; color: var(--ink-2); }
.role-item i { width: 12px; height: 12px; border-radius: 50%; flex: none; } .role-item small { margin-left: auto; color: var(--ink-3); }
.role-item:hover { background: var(--hover); } .role-item.active { background: var(--active); color: var(--ink); }
.perms h3 { margin-top: 22px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm-row span:first-child { display: grid; } .perm-row small { color: var(--ink-3); font-size: .8rem; }
.tri { display: flex; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line); flex: none; }
.tri button { width: 34px; height: 28px; font-weight: 800; color: var(--ink-3); }
.tri button.on.deny { background: var(--red); color: #fff; } .tri button.on.inherit { background: var(--panel-3); color: var(--ink); } .tri button.on.allow { background: var(--ok); color: #fff; }
.sticky-save { position: sticky; bottom: -80px; background: var(--bg); padding: 14px 0; margin-top: 10px; }
.emoji-list { margin-top: 16px; } .emoji-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); } .emoji-row img { width: 32px; height: 32px; object-fit: contain; } .emoji-row b { flex: 1; }
.sb-add { display: flex; gap: 8px; margin: 14px 0; } .sb-add .em { width: 80px; }
.audit { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .audit p { margin: 0 0 2px; } .quote { border-left: 3px solid var(--panel-3); padding-left: 8px; }
.report { background: var(--panel-2); border-radius: var(--r-m); padding: 14px; margin: 10px 0; } .report p { margin: 0 0 4px; }
.rep-ctx { background: var(--bg); border-radius: var(--r-s); padding: 8px 10px; font-size: .86rem; margin: 8px 0; } .rep-ctx p.hl { background: var(--red-soft); border-left: 3px solid var(--red); padding-left: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.stats > div { background: var(--panel-2); border-radius: var(--r-m); padding: 14px; } .stats dt { color: var(--ink-3); font-size: .78rem; font-weight: 700; } .stats dd { margin: 4px 0 0; font-size: 1.4rem; font-weight: 800; } .stats small { font-size: .74rem; color: var(--ink-3); font-weight: 500; }

/* toasts */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); font-weight: 600; padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: .9rem; animation: up .2s ease; max-width: min(90vw, 560px); text-align: center; }
.toast-error { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes up { from { transform: translateY(-10px); opacity: 0; } }

/* compact density */
[data-density="compact"] .msg { margin-top: 2px; grid-template-columns: 72px 1fr; }
[data-density="compact"] .msg-av { display: none; }
[data-density="compact"] .msg-h { grid-column: 2; }

/* ---------- phones ---------- */
@media (max-width: 1100px) { .shell { grid-template-columns: var(--rail) var(--side) 1fr 0; } .members { display: none; } .search-pane { position: absolute; inset: 0 0 0 auto; width: min(400px, 100%); z-index: 5; } }
@media (max-width: 760px) {
  .mobile-only { display: inline-grid !important; }
  .shell, .shell.no-members { grid-template-columns: var(--rail) 1fr; grid-template-rows: 100dvh; }
  .shell[data-pane="main"] .rail, .shell[data-pane="main"] .side { display: none; }
  .shell[data-pane="main"] { grid-template-columns: 1fr; }
  .shell[data-pane="side"] .main { display: none; }
  .side { padding-bottom: env(safe-area-inset-bottom); }
  .main-h { padding-left: 4px; } .h-topic, .h-search, [data-chat=threads], [data-chat=members] { display: none !important; }
  .msg { grid-template-columns: 56px 1fr; padding-right: 8px; }
  .msg-tools { right: 4px; } .composer-wrap { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .thread-pane:not(.full) { position: absolute; inset: 0; max-width: none; z-index: 6; background: var(--bg); }
  .tabs { margin-left: 4px; padding-left: 4px; }
  .settings { grid-template-columns: 1fr; } .set-nav { padding: 56px 12px 40px; justify-content: stretch; } .set-nav-in { width: 100%; }
  .set-main { position: absolute; inset: 0; background: var(--bg); padding: 20px 16px 80px; display: none; } .settings.show-main .set-main { display: block; }
  .set-close { top: 12px; right: 12px; } .profile-edit, .roles-layout, .two { grid-template-columns: 1fr; } .pe-preview { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; } .ctl { width: 46px; height: 46px; }
  .popover.wide, .picker, .sb { width: calc(100vw - 16px); }
  .voice-chat { position: absolute; inset: 0; max-width: none; z-index: 6; }
  .modal { max-height: 92vh; }
}
