/* Pyron — styles. Themes are CSS variables set on <html data-theme="…">. */

:root {
  --bg-0: #08070f;      /* deepest: app backdrop, rails */
  --bg-1: #0e0c1b;      /* sidebar */
  --bg-2: #13111f;      /* main chat */
  --bg-3: #1b1830;      /* raised: inputs, cards */
  --bg-4: #252141;      /* hover / highest */
  --text: #eceaf6;
  --muted: #9b98b4;
  --faint: #6d6a86;
  --border: rgba(160, 140, 255, 0.12);
  --accent: #8b5cf6;
  --accent-2: #3b82f6;
  --accent-rgb: 139, 92, 246;
  --on-accent: #ffffff;
  --success: #3ecf8e;
  --warn: #f5a524;
  --danger: #f2555a;
  --glow-a: #6d28d9;
  --glow-b: #1d4ed8;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --chat-size: 15px;
  --radius: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

[data-theme="ember"] { --bg-0:#0d0806; --bg-1:#150d0a; --bg-2:#1a110d; --bg-3:#251812; --bg-4:#33211a; --accent:#f97316; --accent-2:#ef4444; --accent-rgb:249,115,22; --border:rgba(255,160,120,.12); --muted:#b39d93; --faint:#7d6a62; --glow-a:#c2410c; --glow-b:#991b1b; }
[data-theme="ocean"] { --bg-0:#050b10; --bg-1:#0a131b; --bg-2:#0d1822; --bg-3:#13222f; --bg-4:#1b3042; --accent:#06b6d4; --accent-2:#3b82f6; --accent-rgb:6,182,212; --border:rgba(120,200,255,.12); --muted:#93a8b8; --faint:#647a8a; --glow-a:#0e7490; --glow-b:#1d4ed8; }
[data-theme="forest"] { --bg-0:#050c08; --bg-1:#0a140e; --bg-2:#0e1a13; --bg-3:#15251b; --bg-4:#1e3326; --accent:#22c55e; --accent-2:#14b8a6; --accent-rgb:34,197,94; --border:rgba(140,230,170,.12); --muted:#95ad9e; --faint:#667d6f; --glow-a:#15803d; --glow-b:#0f766e; }
[data-theme="rose"] { --bg-0:#0e060b; --bg-1:#160b12; --bg-2:#1b0f17; --bg-3:#271622; --bg-4:#36202f; --accent:#ec4899; --accent-2:#a855f7; --accent-rgb:236,72,153; --border:rgba(255,150,210,.12); --muted:#b498aa; --faint:#80677a; --glow-a:#be185d; --glow-b:#7e22ce; }
[data-theme="graphite"] { --bg-0:#0a0a0b; --bg-1:#111113; --bg-2:#161618; --bg-3:#1f1f23; --bg-4:#2a2a30; --accent:#e4e4e7; --accent-2:#a1a1aa; --accent-rgb:228,228,231; --on-accent:#111113; --border:rgba(255,255,255,.09); --muted:#a1a1aa; --faint:#71717a; --glow-a:#3f3f46; --glow-b:#27272a; }
[data-theme="light"] { --bg-0:#e9e8f1; --bg-1:#f3f2f8; --bg-2:#ffffff; --bg-3:#f0eff6; --bg-4:#e4e2ee; --text:#1c1a29; --muted:#5f5c74; --faint:#8b88a0; --border:rgba(40,30,90,.12); --accent:#6d28d9; --accent-2:#2563eb; --accent-rgb:109,40,217; --glow-a:#c4b5fd; --glow-b:#bfdbfe; --shadow:0 18px 50px rgba(40,30,90,.18); color-scheme: light; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg-0); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; font-size: 15px; }
::selection { background: rgba(var(--accent-rgb), 0.35); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.stop-a { stop-color: var(--accent); }
.stop-b { stop-color: var(--accent-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.thin-scroll::-webkit-scrollbar { width: 6px; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Fonts users can pick for names and bios */
.font-serif { font-family: "DM Serif Display", Georgia, serif !important; letter-spacing: 0.01em; }
.font-mono { font-family: var(--mono) !important; }
.font-rounded { font-family: "Nunito", var(--sans) !important; font-weight: 800; }
.font-hand { font-family: "Caveat", cursive !important; font-size: 1.25em; }
.font-pixel { font-family: "Silkscreen", monospace !important; letter-spacing: 0.02em; }
.font-display { font-family: "Bebas Neue", var(--display) !important; letter-spacing: 0.06em; font-size: 1.15em; }

/* Background glow */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(110px); }
.glow.a { width: 560px; height: 560px; background: var(--glow-a); top: -220px; right: -160px; opacity: 0.22; }
.glow.b { width: 600px; height: 600px; background: var(--glow-b); bottom: -280px; left: -200px; opacity: 0.16; }

/* Boot */
.boot { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; }
.boot-logo { width: 64px; height: 64px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.1); filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .6)); } }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(var(--accent-rgb), 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons + fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; font-weight: 500; font-size: 0.9rem; white-space: nowrap;
  background: var(--bg-4); color: var(--text); transition: background .15s, filter .15s, transform .1s, opacity .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--grad); color: var(--on-accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-4); filter: none; }
.btn.success { background: var(--success); color: #062b1a; }
.btn.small { padding: 6px 12px; font-size: 0.82rem; }
.btn.lg { padding: 12px 18px; font-size: 0.95rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .ico { width: 17px; height: 17px; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

.icon-btn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s, transform .1s; flex-shrink: 0; }
.icon-btn:hover { background: var(--bg-4); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.active { color: var(--text); background: rgba(var(--accent-rgb), .16); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; text-align: left; }
.field > span, .label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.field em { text-transform: none; font-style: normal; font-weight: 400; opacity: 0.8; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: -4px; }
input, textarea, select {
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
input[type=color] { padding: 0; width: 40px; height: 34px; border-radius: 8px; cursor: pointer; background: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type=color]::-webkit-color-swatch { border-radius: 5px; border: none; }
input[type=range] { padding: 0; border: none; background: none; box-shadow: none !important; accent-color: var(--accent); height: 22px; }
.error { color: #ffd3d4; background: rgba(242, 85, 90, 0.12); border: 1px solid rgba(242, 85, 90, 0.35); padding: 9px 12px; border-radius: 8px; font-size: 0.86rem; margin-bottom: 14px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700; display: inline-grid; place-items: center; }
kbd { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; }

/* Auth */
.auth { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.auth-card {
  width: min(440px, 100%); padding: 34px 32px; border-radius: 16px; text-align: center;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); animation: rise .5s var(--ease);
}
.auth-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 18px; }
.auth-logo svg { width: 36px; height: 36px; }
.auth-card h1 { font-family: var(--display); font-size: 1.6rem; font-weight: 600; margin-bottom: 4px; }
.auth-card > p.muted { margin-bottom: 22px; }
.auth-card .btn.wide { margin: 4px 0 14px; }
.auth-card p.small { text-align: left; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* App layout */
.app { position: relative; z-index: 1; display: flex; height: 100%; height: 100dvh; height: var(--vvh, 100dvh); }

.sidebar { width: 288px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg-1); border-right: 1px solid var(--border); }
.side-top { padding: 14px 12px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; padding: 0 4px; }
.brand svg { width: 26px; height: 26px; }
.conn { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: auto; transition: background .3s; }
.conn.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.search-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 7px; background: var(--bg-0); color: var(--faint); font-size: 0.83rem; transition: color .15s; }
.search-btn:hover { color: var(--muted); }

/* Sidebar body: Friends + DM header stay put; the DM list and the server list
   scroll separately. While servers are open, DMs take at most about half. */
.side-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.side-top { flex: none; padding: 8px 8px 0; }
.conv-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 4px; }
.side-scroll:has(.servers-drop:not(.closed)) .conv-list { max-height: max(120px, calc(50% - 110px)); }
.conv-list, .servers-drop .server-list { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
.conv-list::-webkit-scrollbar, .servers-drop .server-list::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-thumb, .servers-drop .server-list::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
.conv-list::-webkit-scrollbar-track, .servers-drop .server-list::-webkit-scrollbar-track { background: transparent; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--muted); text-align: left; font-weight: 500; transition: background .15s, color .15s; }
.nav-item span:nth-child(2) { flex: 1; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-4); color: var(--text); }

.side-section { display: flex; align-items: center; justify-content: space-between; padding: 16px 6px 4px 10px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.side-section:hover { color: var(--text); }

.conv { width: 100%; display: flex; align-items: center; gap: 11px; padding: 6px 8px; border-radius: 8px; text-align: left; color: var(--muted); transition: background .12s, color .12s; position: relative; margin-bottom: 1px; }
.conv:hover { background: var(--bg-3); color: var(--text); }
.conv.active { background: var(--bg-4); color: var(--text); }
.conv.unread { color: var(--text); }
.conv.unread .conv-name { font-weight: 700; }
.conv.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--text); transition: height .2s; }
.conv-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.conv-name, .conv-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-name { font-size: 0.93rem; font-weight: 500; }
.conv-preview { font-size: 0.76rem; color: var(--faint); }
.conv .close-x { opacity: 0; }
.empty-list { padding: 12px 10px; color: var(--faint); font-size: 0.84rem; line-height: 1.5; }

/* Servers dropdown */
.servers-drop { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 6px 8px 0; padding-top: 8px; border-top: 1px solid var(--border); }
.servers-head { flex: none; }
#serverCollapse { flex: 0 1 auto; min-height: 0; }
#serverCollapse > .server-list { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.servers-head { display: flex; align-items: center; gap: 4px; }
.servers-toggle { flex: 1; display: flex; align-items: center; gap: 6px; padding: 8px 6px; border-radius: 8px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.servers-toggle:hover { color: var(--text); }
.servers-toggle .chev { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.servers-drop.closed .servers-toggle .chev { transform: rotate(-90deg); }
.servers-toggle .count { color: var(--faint); }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s var(--ease); }
.collapse > * { overflow: hidden; min-height: 0; }
.servers-drop.closed .collapse { grid-template-rows: 0fr; }
.collapse > * { transition: visibility 0s linear 0s; }
.servers-drop.closed #serverCollapse > .server-list { padding-bottom: 0; visibility: hidden; transition: visibility 0s linear .28s; }
.server-list { display: flex; flex-direction: column; gap: 2px; }
.server-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 10px; color: var(--muted); text-align: left; position: relative; cursor: pointer; transition: background .12s, color .12s; }
.server-row:hover { background: var(--bg-3); color: var(--text); }
.server.open .server-row { color: var(--text); }
.server-row .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.93rem; font-weight: 600; }
.server-row .chev { width: 14px; height: 14px; transition: transform .25s var(--ease); opacity: 0.55; }
.server.open .server-row .chev { transform: rotate(90deg); }
.server-row .gear { opacity: 0; transition: opacity .15s; }
.server-row:hover .gear, .server-row .gear:focus-visible { opacity: 1; }
.server .collapse { grid-template-rows: 0fr; }
.server.open .collapse { grid-template-rows: 1fr; }
.server-icon { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 0.74rem; color: #fff; overflow: hidden; transition: border-radius .2s var(--ease); }
.server-row:hover .server-icon { border-radius: 14px; }
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-icon.lg { width: 72px; height: 72px; border-radius: 22px; font-size: 1.4rem; }
.channel-list { margin: 2px 0 6px 21px; padding-left: 10px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.channel { width: 100%; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; color: var(--faint); font-size: 0.9rem; font-weight: 500; text-align: left; transition: background .12s, color .12s; }
.channel:hover { background: var(--bg-3); color: var(--muted); }
.channel.active { background: var(--bg-4); color: var(--text); }
.channel.unread { color: var(--text); font-weight: 700; }
.channel .hash { font-size: 1.05rem; opacity: 0.7; width: 15px; text-align: center; font-weight: 400; }
.channel .ico { width: 16px; height: 16px; }
.channel .cname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel.in-call { color: var(--success); }
.voice-users { display: flex; flex-direction: column; gap: 1px; margin: 0 0 4px 22px; }
.voice-user { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--muted); padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.voice-user:hover { color: var(--text); background: var(--bg-3); }
.voice-user .flags { margin-left: auto; display: flex; gap: 2px; color: var(--danger); }
.voice-user .flags .ico { width: 14px; height: 14px; }
.speaking-ring { border-radius: 50%; transition: box-shadow .15s; }
.speaking .speaking-ring, .speaking-ring.speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--success); }
.server-empty { padding: 6px 8px 4px; color: var(--faint); font-size: 0.82rem; line-height: 1.5; }

/* Voice panel */
.voice-panel { padding: 10px 10px 8px; border-top: 1px solid var(--border); background: var(--bg-1); animation: slideUp .25s var(--ease); }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } }
.voice-top { display: flex; align-items: center; gap: 8px; }
.voice-status { flex: 1; min-width: 0; }
.voice-status strong { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: 0.84rem; }
.voice-status strong.connecting { color: var(--warn); }
.voice-status span { display: block; font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.signal i { width: 3px; background: currentColor; border-radius: 1px; }
.signal i:nth-child(1) { height: 5px; } .signal i:nth-child(2) { height: 8px; } .signal i:nth-child(3) { height: 12px; }
.voice-controls { display: flex; gap: 6px; margin-top: 8px; }
.voice-controls .btn { flex: 1; padding: 7px; background: var(--bg-3); }
.voice-controls .btn.on { color: var(--danger); }
.btn.leave, .voice-controls .btn.leave { background: rgba(242, 85, 90, .18); color: var(--danger); }
.btn.leave:hover { background: var(--danger); color: #fff; filter: none; }

/* User panel */
.user-panel { display: flex; align-items: center; gap: 2px; padding: 8px; background: var(--bg-0); border-top: 1px solid var(--border); }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 4px; border-radius: 8px; text-align: left; transition: background .12s; }
.me-btn:hover { background: var(--bg-3); }
.me-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-text strong, .me-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text strong { font-size: 0.88rem; font-weight: 600; }
.me-text span { font-size: 0.74rem; color: var(--muted); }
.panel-btn { width: 32px; height: 32px; }
.panel-btn .ico { width: 19px; height: 19px; }
.panel-btn.on { color: var(--danger); }

/* Avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; color: #fff; position: relative; background: var(--bg-4); user-select: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.xs { width: 22px; height: 22px; font-size: 0.58rem; }
.avatar.sm { width: 30px; height: 30px; font-size: 0.72rem; }
.avatar.md { width: 36px; height: 36px; font-size: 0.8rem; }
.avatar.lg { width: 80px; height: 80px; font-size: 1.6rem; }
.avatar.xl { width: 92px; height: 92px; font-size: 2rem; }
.avatar.group { border-radius: 30%; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--bg-1); background: var(--faint); transition: background .3s; }
.avatar.xs .dot { width: 9px; height: 9px; border-width: 2px; }
.avatar.lg .dot { width: 20px; height: 20px; border-width: 4px; right: 2px; bottom: 2px; }
.avatar.xl .dot { width: 24px; height: 24px; border-width: 5px; right: 2px; bottom: 2px; }
.dot.online { background: var(--success) !important; }
.dot.idle { background: var(--warn) !important; }
.dot.dnd { background: var(--danger) !important; }
.dot.offline { background: var(--faint) !important; }
.clickable { cursor: pointer; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--bg-2); }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.view-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 54px; flex-shrink: 0; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-2) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 2; }
.view-head h2 { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.head-ico { color: var(--muted); }
.divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.menu-btn { display: none; }

.seg { display: flex; gap: 6px; overflow-x: auto; }
.seg button { padding: 4px 10px; border-radius: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; transition: background .12s, color .12s; }
.seg button:hover { background: var(--bg-3); color: var(--text); }
.seg button.active { background: var(--bg-4); color: var(--text); }
.seg button.accent { background: var(--success); color: #052e1a; }
.seg button.accent.active { background: transparent; color: var(--success); }

.friends-body { flex: 1; overflow-y: auto; padding: 18px 26px; }
.section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 6px 4px 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; border-top: 1px solid var(--border); transition: background .12s; animation: fadeIn .2s ease; }
.person:first-of-type { border-top-color: transparent; }
.person:hover { background: var(--bg-3); border-top-color: transparent; }
.person:hover + .person { border-top-color: transparent; }
.person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-text strong { font-weight: 600; }
.person-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-actions { display: flex; gap: 6px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-1); color: var(--muted); display: grid; place-items: center; transition: color .12s, background .12s; }
.round-btn:hover { color: var(--text); background: var(--bg-0); }
.round-btn.ok:hover { color: var(--success); }
.round-btn.no:hover { color: var(--danger); }
.round-btn .ico { width: 18px; height: 18px; }
.empty-state { text-align: center; color: var(--muted); padding: 70px 20px; line-height: 1.6; animation: fadeIn .3s ease; }
.empty-state .big { font-size: 3rem; margin-bottom: 10px; opacity: 0.8; }
.add-friend { max-width: 640px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.add-friend h3 { font-size: 1rem; text-transform: uppercase; margin-bottom: 6px; }
.add-friend p { margin-bottom: 14px; font-size: 0.9rem; }
.add-row { display: flex; gap: 8px; align-items: center; }
.add-row input { flex: 1; }
.add-friend .add-row { background: var(--bg-0); border: 1px solid var(--border); border-radius: 10px; padding: 6px 6px 6px 4px; }
.add-friend .add-row input { border: none; background: none; box-shadow: none; }
.form-msg { margin-top: 10px; font-size: 0.86rem; }
.form-msg.ok { color: var(--success); }
.form-msg.bad { color: var(--danger); }

/* Chat */
.chat-head .chat-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.chat-title h2, .chat-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title span { font-size: 0.84rem; color: var(--muted); }
.chat-actions { display: flex; gap: 2px; }
.chat-body { flex: 1; min-height: 0; display: flex; }
.chat-col { min-width: 0; }
.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.messages { flex: 1; overflow-y: auto; padding: 16px 0 6px; overflow-anchor: none; font-size: var(--chat-size); }
.load-more { display: block; margin: 4px auto 12px; }
.chat-start { padding: 20px 18px 18px; }
.chat-start h3 { font-family: var(--display); font-size: 1.9rem; margin: 12px 0 4px; }

.day { display: flex; align-items: center; gap: 10px; margin: 18px 18px 6px; font-size: 0.74rem; font-weight: 600; color: var(--faint); }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.msg { display: flex; gap: 14px; padding: 4px 18px 2px; position: relative; margin-top: 14px; transition: background .08s; }
.msg.compact { margin-top: 0; padding-top: 1px; }
.msg:hover { background: color-mix(in srgb, var(--bg-0) 35%, transparent); }
.msg.new { animation: msgIn .28s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg-gutter { width: 40px; flex-shrink: 0; font-size: 0.66rem; color: transparent; padding-top: 4px; text-align: right; }
.msg:hover .msg-gutter { color: var(--faint); }
.msg > .avatar { width: 40px; height: 40px; margin-top: 2px; }
.msg-body { min-width: 0; flex: 1; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.msg-author { font-weight: 600; font-size: 1em; cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 0.74rem; color: var(--faint); }
.msg-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.45; color: color-mix(in srgb, var(--text) 92%, var(--muted)); }
.msg-text a { color: var(--accent-2); }
.msg-gif, .att-img { display: block; max-width: min(400px, 100%); max-height: 340px; border-radius: 10px; margin-top: 6px; background: var(--bg-3); }
.att-img { cursor: zoom-in; object-fit: contain; transition: filter .15s; }
.att-img:hover { filter: brightness(1.06); }
.att-video { display: block; max-width: min(480px, 100%); max-height: 360px; border-radius: 10px; margin-top: 6px; background: #000; }
.att-audio { display: block; margin-top: 6px; width: min(380px, 100%); }
.att-file { display: inline-flex; align-items: center; gap: 12px; margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border); max-width: 100%; text-decoration: none; color: var(--text); }
.att-file:hover { border-color: rgba(var(--accent-rgb), .5); }
.att-file .ico { color: var(--accent); width: 28px; height: 28px; }
.att-file-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; color: var(--accent-2); }
.msg-actions { position: absolute; top: -14px; right: 18px; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0,0,0,.25); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .12s, transform .12s; z-index: 1; }
.msg:hover .msg-actions { opacity: 1; transform: none; pointer-events: auto; }
.msg-actions button { width: 30px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.msg-actions button:hover { background: var(--bg-4); color: var(--text); }
.msg-actions button.del:hover { color: var(--danger); }
.msg-actions .ico { width: 17px; height: 17px; }
body.compact-mode .msg { margin-top: 4px; padding-top: 1px; gap: 10px; }
body.compact-mode .msg > .avatar { display: none; }
body.compact-mode .msg-gutter { display: none; }
body.compact-mode .msg-meta { display: inline-flex; margin-right: 6px; }
body.compact-mode .msg-body { display: block; }
body.compact-mode .msg-text { display: inline; }

.typing { height: 22px; padding: 0 18px; font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.composer-wrap { padding: 0 16px 18px; position: relative; }
.composer { display: flex; align-items: flex-end; gap: 2px; padding: 4px 6px; border-radius: 10px; background: var(--bg-3); border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: rgba(var(--accent-rgb), .45); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1); }
.composer textarea { border: none; background: transparent; resize: none; max-height: 220px; padding: 9px 6px; line-height: 1.45; box-shadow: none !important; font-size: var(--chat-size); }
.composer .icon-btn { margin-bottom: 2px; }
.gif-btn { font-size: 0.66rem; font-weight: 800; letter-spacing: .04em; border: 2px solid currentColor; width: auto !important; height: 22px !important; padding: 0 5px; margin: 8px 4px 8px !important; border-radius: 5px; }
.send-btn { color: var(--accent); }

.pending { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--bg-3); animation: slideUp .2s var(--ease); }
.pending img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.pending-text { flex: 1; min-width: 0; }
.pending-text div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; border-radius: 4px; background: var(--bg-0); margin-top: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); width: 0; transition: width .15s; }

.gif-panel { position: absolute; right: 16px; bottom: calc(100% - 8px); width: min(420px, calc(100% - 32px)); height: 430px; z-index: 10; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .18s var(--ease); transform-origin: bottom right; }
.gif-grid { flex: 1; overflow-y: auto; columns: 2; column-gap: 8px; }
.gif-grid .gif-pick { display: block; width: 100%; border-radius: 8px; overflow: hidden; background: var(--bg-3); break-inside: avoid; transition: transform .12s; }
.gif-grid img { display: block; width: 100%; }
.gif-grid .gif-pick:hover { outline: 2px solid var(--accent); transform: scale(1.02); }
.gif-grid .note { column-span: all; color: var(--muted); font-size: 0.86rem; line-height: 1.55; padding: 8px 4px; }
.gif-foot { text-align: right; font-size: .72rem; color: var(--faint); }

.drop-zone { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.55); pointer-events: none; animation: fadeIn .15s; }
.drop-zone > div { padding: 34px 48px; border-radius: 18px; background: var(--grad); color: var(--on-accent); text-align: center; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); animation: pop .2s var(--ease); }
.drop-zone strong { font-family: var(--display); font-size: 1.3rem; }

/* Member list */
.member-panel { width: 240px; flex-shrink: 0; overflow-y: auto; padding: 10px 8px 16px; background: var(--bg-1); border-left: 1px solid var(--border); animation: slideIn .22s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } }
.member-group { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 14px 8px 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.member:hover { background: var(--bg-3); }
.member.offline { opacity: 0.45; }
.member.offline:hover { opacity: 1; }
.member-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.member-text strong { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-text span { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .avatar .dot { border-color: var(--bg-1); }

/* Call strip */
.call-strip { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 18px 16px; background: radial-gradient(ellipse at top, rgba(var(--accent-rgb), .18), transparent 70%), var(--bg-0); border-bottom: 1px solid var(--border); animation: fadeIn .25s; }
.call-people { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.call-person { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); width: 76px; text-align: center; }
.call-person .avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.call-person span { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-person .speaking-ring { border-radius: 50%; }
.call-buttons { display: flex; gap: 10px; }
.call-buttons .round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); color: var(--text); transition: transform .12s, filter .12s; }
.call-buttons .round:hover { filter: brightness(1.2); transform: scale(1.05); }
.call-buttons .round.on { background: var(--text); color: var(--bg-0); }
.call-buttons .round.red { background: var(--danger); color: #fff; }
.call-buttons .round.green { background: var(--success); color: #052e1a; }
.call-label { font-size: .8rem; color: var(--muted); }

/* Modals */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s; }
.modal { width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 22px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .2s var(--ease); }
.modal.wide { width: min(560px, 100%); }
.modal h3 { font-family: var(--display); font-size: 1.3rem; margin-bottom: 4px; }
.modal > p.muted { margin-bottom: 16px; font-size: 0.9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal hr, .settings hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
@keyframes pop { from { opacity: 0; transform: scale(0.95); } }
.pick-list { max-height: 280px; overflow-y: auto; border-radius: 10px; padding: 4px; background: var(--bg-0); }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick:hover { background: var(--bg-3); }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.pick span { flex: 1; }
.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.lightbox { max-width: 92vw; max-height: 86vh; border-radius: 10px; display: block; }
.modal.bare { padding: 0; background: transparent; border: none; box-shadow: none; width: auto; overflow: visible; }
.invite-box { display: flex; gap: 8px; align-items: center; background: var(--bg-0); border-radius: 8px; padding: 6px 6px 6px 12px; }
.invite-box code { flex: 1; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }
.chan-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.chan-row input { flex: 1; padding: 7px 10px; }
.tabs-mini { display: flex; gap: 4px; margin: 4px 0 18px; padding: 3px; background: var(--bg-0); border-radius: 9px; }
.tabs-mini button { flex: 1; padding: 7px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.tabs-mini button.active { color: var(--text); background: var(--bg-4); }
.char-count { font-size: 0.72rem; color: var(--faint); text-align: right; margin-top: -10px; margin-bottom: 10px; }
textarea.bio { resize: vertical; min-height: 90px; }

/* Profile popout / card */
.popout { position: fixed; z-index: 60; width: 320px; border-radius: 14px; overflow: hidden; background: var(--bg-1); box-shadow: var(--shadow), 0 0 0 1px var(--border); animation: pop .16s var(--ease); }
.pcard { --pc: var(--accent); position: relative; border-radius: inherit; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 28%, var(--bg-1)) 0%, var(--bg-1) 55%); }
.pcard.no-accent { background: var(--bg-1); }
.pc-banner { height: 110px; background: var(--pc); background-size: cover; background-position: center; }
.pc-avatar { position: absolute; left: 16px; top: 62px; border-radius: 50%; padding: 5px; background: inherit; }
.pcard .pc-avatar { background: color-mix(in srgb, var(--pc) 22%, var(--bg-1)); }
.pcard.no-accent .pc-avatar { background: var(--bg-1); }
.pc-body { padding: 54px 16px 16px; }
.pc-name { font-size: 1.3rem; font-weight: 700; line-height: 1.2; word-break: break-word; }
.pc-user { font-size: 0.86rem; color: var(--muted); margin-top: 2px; }
.pc-custom { margin-top: 10px; font-size: 0.88rem; }
.pc-inner { margin-top: 12px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--bg-0) 70%, transparent); }
.pc-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); margin-bottom: 5px; }
.pc-label:not(:first-child) { margin-top: 12px; }
.pc-bio { font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.pc-actions { display: flex; gap: 8px; margin-top: 12px; }
.pc-actions .btn { flex: 1; }
.pc-edge { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 55%, transparent); }
.pcard.no-accent .pc-edge { display: none; }

/* Status menu */
.status-menu { position: fixed; left: 10px; bottom: 64px; z-index: 55; width: 250px; padding: 6px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .14s var(--ease); transform-origin: bottom left; }
.status-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-align: left; font-size: 0.88rem; }
.status-menu button:hover { background: var(--accent); color: var(--on-accent); }
.status-menu button:hover .sdesc { color: inherit; opacity: .85; }
.status-menu .sdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-menu .sdesc { display: block; font-size: 0.74rem; color: var(--muted); }
.status-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 6px; }
.sdot.online { background: var(--success); } .sdot.idle { background: var(--warn); } .sdot.dnd { background: var(--danger); } .sdot.invisible, .sdot.offline { background: var(--faint); }

/* Incoming call */
.incoming { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 70; width: 260px; padding: 20px; border-radius: 16px; background: var(--bg-1); box-shadow: var(--shadow), 0 0 0 1px var(--border); animation: drop .3s var(--ease); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px); } }
.incoming .avatar { animation: ringpulse 1.4s infinite; }
@keyframes ringpulse { 0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, .6); } 80% { box-shadow: 0 0 0 18px rgba(62, 207, 142, 0); } }
.incoming .row { display: flex; gap: 18px; margin-top: 6px; }

/* Toasts */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 0.88rem; animation: toastIn .25s var(--ease); max-width: 90vw; }
.toast.bad { border-color: rgba(242, 85, 90, .5); }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* Quick switcher */
.qs { width: min(560px, 100%); padding: 18px; }
.qs-input { font-size: 1.05rem; padding: 14px; }
.qs-list { margin-top: 10px; max-height: 360px; overflow-y: auto; }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--muted); }
.qs-item .sub { margin-left: auto; font-size: .75rem; color: var(--faint); }
.qs-item.sel, .qs-item:hover { background: var(--bg-4); color: var(--text); }
.qs-tip { font-size: .74rem; color: var(--faint); margin-top: 10px; }

/* Settings overlay (full screen) */
.settings { position: fixed; inset: 0; z-index: 45; display: flex; background: var(--bg-2); animation: settingsIn .25s var(--ease); }
.settings.closing { animation: settingsOut .18s ease forwards; }
@keyframes settingsIn { from { opacity: 0; transform: scale(1.04); } }
@keyframes settingsOut { to { opacity: 0; transform: scale(1.04); } }
.settings-nav { flex: 1 0 220px; display: flex; justify-content: flex-end; background: var(--bg-1); overflow-y: auto; }
.settings-nav-inner { width: 230px; padding: 60px 8px 20px 20px; }
.settings-nav h5 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 6px 10px; }
.snav { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--muted); font-weight: 500; margin-bottom: 2px; transition: background .12s, color .12s; }
.snav:hover { background: var(--bg-3); color: var(--text); }
.snav.active { background: var(--bg-4); color: var(--text); }
.snav.danger { color: var(--danger); }
.settings-nav .sep { height: 1px; background: var(--border); margin: 8px 10px; }
.settings-content { flex: 1 1 800px; overflow-y: auto; position: relative; }
.settings-inner { max-width: 760px; padding: 60px 40px 120px; animation: fadeIn .2s; }
.settings-inner > h2 { font-family: var(--display); font-size: 1.35rem; margin-bottom: 20px; }
.settings-close { position: fixed; top: 54px; right: max(24px, calc(50% - 600px)); display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: .72rem; font-weight: 600; z-index: 2; }
.settings-close .circle { width: 36px; height: 36px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; transition: background .15s; }
.settings-close:hover { color: var(--text); }
.settings-close:hover .circle { background: var(--bg-4); }
.settings-close .ico { width: 18px; height: 18px; }
.save-bar { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); width: min(700px, calc(100% - 40px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 10px; background: var(--bg-0); box-shadow: var(--shadow); transition: transform .3s var(--ease); z-index: 3; }
.save-bar.show { transform: translate(-50%, 0); }
.save-bar.shake { animation: shake .4s; background: var(--danger); }
@keyframes shake { 20%, 60% { transform: translate(calc(-50% - 6px), 0); } 40%, 80% { transform: translate(calc(-50% + 6px), 0); } }
.save-bar span { flex: 1; font-size: .9rem; font-weight: 500; }

.profile-editor { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.preview-col { position: sticky; top: 20px; }
.preview-col .popout { position: static; animation: none; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.color-row input[type=range] { flex: 1; width: auto; min-width: 120px; }
.color-chip { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .12s; }
.color-chip:hover { transform: scale(1.12); }
.color-chip.active { border-color: var(--text); }
.color-chip.none { background: repeating-linear-gradient(45deg, var(--bg-4) 0 4px, var(--bg-3) 4px 8px); }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.font-opt { padding: 9px 6px; border-radius: 8px; background: var(--bg-0); border: 2px solid transparent; font-size: .95rem; transition: border-color .12s; text-align: center; }
.font-opt:hover { border-color: var(--bg-4); }
.font-opt.active { border-color: var(--accent); }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.theme-card { border-radius: 12px; padding: 0; overflow: hidden; border: 2px solid var(--border); text-align: left; transition: transform .15s, border-color .15s; background: var(--bg-0); }
.theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); }
.theme-card .swatch { height: 64px; display: flex; align-items: flex-end; padding: 8px; gap: 5px; }
.theme-card .swatch i { width: 16px; height: 16px; border-radius: 50%; }
.theme-card .tname { display: block; padding: 8px 10px; font-size: .84rem; font-weight: 600; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t { font-weight: 500; }
.toggle-row .d { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--bg-4); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(18px); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.meter { position: relative; height: 10px; border-radius: 5px; background: var(--bg-0); overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--warn); transition: width .06s linear; }
.meter-fill.hot { background: var(--success); }
.meter-th { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.sens { position: relative; }
.sens input[type=range] { position: absolute; inset: -6px 0 auto; opacity: .0001; height: 22px; cursor: ew-resize; }
.slider-val { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.test-row { display: flex; gap: 10px; align-items: center; }
.test-row .meter { flex: 1; }

/* Image cropper */
.cropper { width: min(520px, 100%); }
.crop-stage { position: relative; margin: 6px auto 16px; border-radius: 10px; overflow: hidden; background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.crop-zoom input { flex: 1; }

.scrim { display: none; }

/* Mobile */
@media (max-width: 1100px) {
  .member-panel { width: 200px; }
  .profile-editor { grid-template-columns: 1fr; }
  .preview-col { position: static; }
}
/* Mentions + ping badges */
.mention { display: inline; padding: 0 3px; border-radius: 4px; background: rgba(var(--accent-rgb), .18); color: var(--accent); font-weight: 600; cursor: pointer; transition: background .12s, color .12s; }
.mention:hover { background: var(--accent); color: #fff; }
.mention.me { background: rgba(250, 168, 26, .2); color: #f0b232; }
.mention.me:hover { background: #f0b232; color: #1a1205; }
.msg.mentioned { background: rgba(250, 168, 26, .08); box-shadow: inset 2px 0 0 #f0b232; }
.msg.mentioned:hover { background: rgba(250, 168, 26, .12); }
.ping-badge { flex-shrink: 0; margin-left: auto; animation: popIn .25s var(--ease); box-shadow: 0 0 0 3px var(--bg-1); }
.conv .ping-badge { margin-left: 6px; }
.channel .ping-badge { min-width: 16px; height: 16px; font-size: 0.66rem; }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }
#serversUnread.ping { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.mention-menu { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 10px); z-index: 20; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 10px; background: var(--bg-1); box-shadow: var(--shadow), 0 0 0 1px var(--border); animation: slideUp .15s var(--ease); }
.mm-title { padding: 4px 8px 6px; font-size: 0.7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mm-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.mm-item.active { background: var(--bg-4); }
.mm-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-user { margin-left: auto; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.mm-at { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); color: var(--muted); font-weight: 700; flex-shrink: 0; }
.sound-previews { flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sound-previews .btn { display: inline-flex; align-items: center; gap: 6px; }
.sound-previews .ico { width: 15px; height: 15px; }

/* Screen share */
.voice-actions { display: flex; gap: 6px; margin-top: 8px; }
.voice-act { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; border-radius: 8px; background: var(--bg-3); color: var(--text); font-size: 0.82rem; font-weight: 600; transition: background .15s, transform .12s, color .15s; }
.voice-act:hover:not(:disabled) { background: var(--bg-4); }
.voice-act:active:not(:disabled) { transform: scale(.97); }
.voice-act:disabled { opacity: .5; cursor: default; }
.voice-act .ico { width: 17px; height: 17px; }
.voice-act.on { background: rgba(var(--accent-rgb), .2); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.call-buttons .round.accent { background: var(--accent); color: #fff; }

.live { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 4px; background: #ed4245; color: #fff; font-size: 0.62rem; font-weight: 800; letter-spacing: .06em; line-height: 1.4; flex-shrink: 0; }
.live.clickable { cursor: pointer; transition: filter .12s, transform .12s; }
.live.clickable:hover { filter: brightness(1.15); transform: scale(1.06); }
.call-person .live { margin-top: -2px; }

.stage { position: fixed; z-index: 60; right: 20px; bottom: 20px; width: min(520px, calc(100vw - 32px)); height: 340px; min-width: 300px; min-height: 200px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  display: flex; flex-direction: column; background: #000; border-radius: 14px; overflow: hidden; resize: both;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px var(--border); animation: stageIn .3s var(--ease); }
@keyframes stageIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.stage.theater { inset: 24px; width: auto; height: auto; max-width: none; max-height: none; resize: none; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.6), 0 30px 80px rgba(0,0,0,.6); }
.stage.min { width: auto; height: auto; min-width: 0; min-height: 0; resize: none; background: transparent; box-shadow: none; overflow: visible; }
.stage-pill { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 999px; background: var(--bg-1); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--border); font-size: 0.85rem; font-weight: 600; transition: transform .15s var(--ease); }
.stage-pill:hover { transform: translateY(-2px); }
.stage-pill .ico { width: 15px; height: 15px; color: var(--muted); }
.stage-pill-name { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; background: var(--bg-1); border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; }
.stage.theater .stage-head { cursor: default; }
.stage-head:active { cursor: grabbing; }
.stage-head strong { font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-head > .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stage-head-btns { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.stage-stop { display: flex; align-items: center; gap: 6px; margin-right: 4px; padding: 4px 10px; border-radius: 6px; background: var(--danger); color: #fff; font-size: 0.78rem; font-weight: 700; transition: filter .12s; }
.stage-stop:hover { filter: brightness(1.1); }
.stage-stop .ico { width: 15px; height: 15px; }

.stage-body { flex: 1; min-height: 0; display: flex; gap: 6px; padding: 6px; background: #050507; }
.stage-body.focused { flex-direction: column; }
.stage-body.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.stage-thumbs { display: flex; gap: 6px; height: 22%; min-height: 64px; max-height: 130px; overflow-x: auto; }
.stage-thumbs .tile { aspect-ratio: 16 / 9; height: 100%; flex: 0 0 auto; }

.tile { position: relative; flex: 1; min-height: 0; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; }
.tile.big { cursor: default; }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile:fullscreen { border-radius: 0; }
.tile:not(.big)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s; pointer-events: none; }
.tile:not(.big):hover::after { box-shadow: inset 0 0 0 2px var(--accent); }
.tile-label { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 16px); padding: 4px 8px 4px 5px; border-radius: 8px; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; font-size: 0.78rem; font-weight: 600; }
.tile-label span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-thumbs .tile-label .avatar, .stage-thumbs .tile-label .live { display: none; }
.tile-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s var(--ease); }
.tile:hover .tile-actions, .tile:focus-within .tile-actions { opacity: 1; transform: none; }
.stage-thumbs .tile-actions { display: none; }
.tile-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .12s; }
.tile-btn:hover { background: rgba(0,0,0,.85); }
.tile-btn .ico { width: 16px; height: 16px; }
.self-note { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.55); color: rgba(255,255,255,.75); font-size: 0.72rem; pointer-events: none; }
.stage-thumbs .self-note { display: none; }

@media (max-width: 820px) {
  .stage:not(.min):not(.theater) { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; height: 34vh; resize: none; }
  .stage.theater { inset: 8px; }
}

@media (max-width: 820px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .25s var(--ease); width: min(300px, 86vw); }
  .app.side-open .sidebar { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.55); animation: fadeIn .2s; }
  .menu-btn { display: grid; }
  .msg { padding-left: 12px; padding-right: 12px; }
  .friends-body { padding: 14px; }
  .composer-wrap { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .view-head .divider, .head-ico { display: none; }
  .chat-title span { display: none; }
  .settings { flex-direction: column; }
  .settings-nav { flex: 0 0 auto; justify-content: flex-start; }
  .settings-nav-inner { width: 100%; padding: 14px 60px 10px 12px; display: flex; gap: 4px; overflow-x: auto; }
  .settings-nav h5, .settings-nav .sep { display: none; }
  .snav { width: auto; white-space: nowrap; }
  .settings-inner { padding: 24px 16px 120px; }
  .settings-close { top: 12px; right: 12px; }
  .settings-close .esc { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Roles, moderation, soundboard, starred GIFs, close buttons ---- */
.conv-close { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; color: var(--faint); opacity: 0; cursor: pointer; transition: opacity .12s, background .12s, color .12s; }
.conv-close .ico { width: 14px; height: 14px; }
.conv:hover .conv-close, .conv:focus-within .conv-close, .conv.active .conv-close { opacity: 1; }
.conv-close:hover { background: var(--bg-0); color: var(--text); }
@media (hover: none) { .conv-close { opacity: .7; } }

.channel .ico.lock { width: 12px; height: 12px; margin-left: auto; opacity: .55; flex: none; }
.channel .ico.lock + .ping-badge, .channel .ico.lock + .small { margin-left: 6px; }
.channel.voice.locked { opacity: .55; }

.composer.blocked { opacity: .7; }
.composer.blocked textarea { cursor: not-allowed; }
.voice-actions:empty { display: none; }

.member .crown { color: var(--warn); margin-left: 4px; }
.member .crown .ico, .member .timeout-ico .ico { width: 13px; height: 13px; vertical-align: -1px; }
.member .timeout-ico { color: var(--danger); margin-left: 4px; }

.mention.role { cursor: default; }

/* Role chips */
.role-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; align-items: center; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 6px; background: var(--bg-3); font-size: .76rem; font-weight: 500; color: var(--text); line-height: 1.5; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.role-x { display: grid; place-items: center; width: 14px; height: 14px; margin-left: 1px; border-radius: 50%; color: var(--muted); }
.role-x .ico { width: 10px; height: 10px; }
.role-x:hover { background: var(--danger); color: #fff; }
select.role-add { width: auto; padding: 2px 6px; font-size: .76rem; border-radius: 6px; background: var(--bg-3); border: 1px dashed var(--border); color: var(--muted); cursor: pointer; }
.pc-timeout { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .8rem; color: var(--danger); }
.pc-timeout .ico { width: 14px; height: 14px; }
.mod-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mod-row .btn .ico { width: 14px; height: 14px; }
.btn.danger-ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(242, 85, 90, .45); }
.btn.danger-ghost:hover { background: rgba(242, 85, 90, .12); }

.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 6px 11px; border-radius: 8px; background: var(--bg-3); color: var(--muted); font-size: .84rem; font-weight: 500; }
.chip-btn:hover { color: var(--text); }
.chip-btn.active { background: rgba(var(--accent-rgb), .22); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55); }
.check-row { display: flex; align-items: center; gap: 9px; margin: 6px 0 10px; font-size: .86rem; color: var(--muted); cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.note-box { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 9px; background: var(--bg-0); color: var(--muted); font-size: .84rem; margin: 6px 0 12px; }
.note-box .ico { width: 15px; height: 15px; flex: none; }
.pick.disabled { opacity: .5; cursor: not-allowed; }

/* Server modal: roles */
.tabs-mini { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs-mini::-webkit-scrollbar { display: none; }
.tabs-mini button { flex: 1 0 auto; white-space: nowrap; padding: 7px 8px; }
.role-list { display: flex; flex-direction: column; gap: 2px; }
.role-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.role-row:hover { background: var(--bg-3); }
.role-row.locked { cursor: default; opacity: .7; }
.role-row.locked:hover { background: transparent; }
.role-row .role-name { font-weight: 600; }
.role-row .spacer { flex: 1; }
.role-row .icon-btn:disabled { opacity: .3; cursor: default; }
.lock-note { color: var(--faint); display: grid; place-items: center; width: 28px; }
.lock-note .ico { width: 14px; height: 14px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; background: var(--bg-0); color: var(--muted); font-size: .7rem; font-weight: 600; white-space: nowrap; }
.tag .ico { width: 11px; height: 11px; }
.tag.warn { color: var(--warn); }
.back-btn { margin-bottom: 8px; }
.role-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.05rem; }
.role-title .ico { width: 18px; height: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: transform .12s; }
.swatch:hover { transform: scale(1.1); }
.swatch.active { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--text); }
.swatch.none { background: linear-gradient(135deg, transparent 45%, var(--danger) 45%, var(--danger) 55%, transparent 55%), var(--bg-3); }
.swatches input[type=color] { width: 34px; height: 28px; padding: 0; border: none; background: none; cursor: pointer; }
.perm-group { margin-top: 10px; }
.perm-group > .label { margin-bottom: 2px; }
.toggle-row.disabled { opacity: .45; }
.toggle-row.danger .t { color: var(--danger); }
.sticky-save { position: sticky; bottom: -1px; padding: 12px 0 4px; margin-top: 10px; background: var(--bg-1); border-top: 1px solid var(--border); z-index: 1; }

/* Channel permissions */
.perm-split { display: grid; grid-template-columns: 170px 1fr; gap: 14px; margin-top: 8px; }
.perm-roles { display: flex; flex-direction: column; gap: 2px; }
.perm-role { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; color: var(--muted); text-align: left; font-weight: 500; font-size: .86rem; }
.perm-role span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-role:hover { background: var(--bg-3); color: var(--text); }
.perm-role.active { background: var(--bg-4); color: var(--text); }
.perm-roles select.role-add { margin-top: 6px; padding: 6px; }
.tri-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.tri { display: inline-flex; border-radius: 7px; overflow: hidden; background: var(--bg-0); flex: none; }
.tri-btn { width: 32px; height: 26px; font-weight: 700; color: var(--faint); font-size: .85rem; }
.tri-btn:disabled { cursor: not-allowed; }
.tri-btn.deny.on { background: var(--danger); color: #fff; }
.tri-btn.inherit.on { background: var(--bg-4); color: var(--text); }
.tri-btn.allow.on { background: var(--success); color: #062015; }
@media (max-width: 560px) { .perm-split { grid-template-columns: 1fr; } .perm-roles { flex-direction: row; flex-wrap: wrap; } }

input.search { flex: 1; }
.person-text .role-chips { margin-top: 3px; }

/* Starred GIFs */
.gif-tabs { display: flex; gap: 4px; padding: 3px; background: var(--bg-0); border-radius: 9px; }
.gif-tabs button { flex: 1; padding: 6px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .84rem; }
.gif-tabs button.active { background: var(--bg-4); color: var(--text); }
.gif-panel input[hidden] { display: none; }
.gif-grid .gif-tile { position: relative; margin-bottom: 8px; break-inside: avoid; }
.gif-star { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; opacity: 0; transition: opacity .12s, transform .12s, color .12s; z-index: 1; }
.gif-star .ico { width: 16px; height: 16px; }
.gif-star:hover { transform: scale(1.12); }
.gif-star.on { color: #f5c542; }
.gif-tile:hover .gif-star, .gif-wrap:hover .gif-star, .gif-star.on { opacity: 1; }
.gif-grid .gif-tile .gif-star.on { opacity: .9; }
.gif-wrap { position: relative; display: inline-block; max-width: 100%; }
.gif-wrap .gif-star.on { opacity: 0; }
.gif-wrap:hover .gif-star.on { opacity: 1; }
@media (hover: none) { .gif-star { opacity: .85; } }

/* Soundboard */
.sb-pop { position: fixed; z-index: 60; width: 320px; max-height: min(460px, 70vh); display: flex; flex-direction: column; border-radius: 12px; background: var(--bg-1); box-shadow: var(--shadow), 0 0 0 1px var(--border); animation: pop .16s var(--ease); }
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.sb-body { overflow-y: auto; padding: 0 12px 12px; }
.sb-head { display: flex; align-items: center; gap: 7px; margin: 10px 0 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sb-head span { flex: 1; }
.sb-head .server-icon.xs { width: 18px; height: 18px; font-size: .55rem; border-radius: 5px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.sb-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border-radius: 9px; background: var(--bg-3); color: var(--text); font-size: .76rem; transition: background .12s, transform .1s; min-width: 0; }
.sb-btn:hover { background: var(--bg-4); }
.sb-btn:active { transform: scale(.95); }
.sb-emoji { font-size: 1.3rem; line-height: 1; }
.sb-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note.small { font-size: .8rem; color: var(--faint); padding: 2px 0 4px; }
.sound-list { display: flex; flex-direction: column; gap: 2px; }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.sound-row:hover { background: var(--bg-3); }
.sound-row .sound-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-input { text-align: center; font-size: 1.1rem; }
[data-speak] { position: relative; }
.sound-float { position: absolute; left: 50%; top: -4px; font-size: 1.4rem; pointer-events: none; animation: soundFloat 1.6s ease-out forwards; z-index: 5; }
@keyframes soundFloat { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -4px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -34px) scale(1); } }
@media (max-width: 820px) { .member-panel { position: absolute; right: 0; top: 54px; bottom: 0; z-index: 15; width: 240px; box-shadow: var(--shadow); } }

.tile-noaudio { display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 1px 6px 1px 4px; border-radius: 5px; background: rgba(242, 85, 90, .85); font-size: .68rem; font-weight: 700; }
.tile-noaudio .ico { width: 12px; height: 12px; }
.tile-label .tile-noaudio:last-child { overflow: visible; }


.stage.snapping { transition: left .24s cubic-bezier(.2,.8,.2,1), top .24s cubic-bezier(.2,.8,.2,1) !important; }


/* Call panel follows you into every view */
.call-strip { position: relative; flex-shrink: 0; gap: 12px; padding: 12px 18px 14px; z-index: 1; }
.call-head { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.call-room { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: .8rem; font-weight: 600; color: var(--success); padding: 2px 6px; border-radius: 6px; }
.call-room span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-room.link { cursor: pointer; }
.call-room.link:hover { background: var(--bg-3); text-decoration: underline; }
.call-head .chev { font-size: .8rem; line-height: 1; }
.call-person { position: relative; }
.call-buttons .round.tts-btn { font-weight: 700; font-size: .9rem; }
.call-buttons .round.accent { background: var(--accent); color: #fff; }
.tts-bar { align-self: stretch; display: flex; gap: 8px; max-width: 560px; width: 100%; margin: 0 auto; }
.tts-input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .9rem; }
.tts-input:focus { outline: none; border-color: var(--accent); }
.tts-float { position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px; padding: 6px 10px; border-radius: 10px; background: var(--bg-4); color: var(--text); font-size: .78rem; line-height: 1.3; white-space: normal; text-align: left; box-shadow: var(--shadow); z-index: 6; pointer-events: none; animation: fadeIn .2s; }
.call-strip.compact { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 14px; }
.call-strip.compact .call-head { align-self: center; flex: 0 1 auto; order: 0; }
.call-strip.compact .call-people { flex: 1 1 auto; gap: 6px; justify-content: flex-start; flex-wrap: wrap; }
.call-strip.compact .call-person { width: auto; }
.call-strip.compact .call-person .avatar { width: 30px; height: 30px; font-size: .75rem; }
.call-strip.compact .call-person > span, .call-strip.compact .call-label { display: none; }
.call-strip.compact .call-buttons { gap: 6px; }
.call-strip.compact .call-buttons .round { width: 34px; height: 34px; }
.call-strip.compact .call-buttons .round .ico { width: 17px; height: 17px; }
.call-strip.compact .tts-bar { flex-basis: 100%; }
.call-strip.compact .tts-float { bottom: auto; top: calc(100% + 4px); }
.tts-settings { display: grid; gap: 4px; }
@media (max-height: 640px) { .call-strip .call-person .avatar { width: 44px; height: 44px; } .call-buttons .round { width: 40px; height: 40px; } }

/* Soundboard: blue ring while someone's sound plays */
.sb-speaking .speaking-ring, .speaking-ring.sb-speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px #4f8cff; }
.tile.sb-speaking { box-shadow: 0 0 0 3px #4f8cff; }

/* Call panel shrink/expand: a clear pill instead of a tiny arrow */
.strip-toggle { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 6px 12px 6px 9px; border-radius: 999px; background: rgba(var(--accent-rgb), .18); border: 1px solid rgba(var(--accent-rgb), .45); color: var(--text); font-size: .8rem; font-weight: 600; transition: background .12s, transform .12s; }
.strip-toggle:hover { background: rgba(var(--accent-rgb), .32); transform: translateY(-1px); }
.strip-toggle .ico { width: 18px; height: 18px; stroke-width: 2.6; transition: transform .2s; }
.strip-toggle.up .ico { transform: rotate(-90deg); }
.strip-toggle.down .ico { transform: rotate(90deg); }
.call-strip.compact .strip-toggle { padding: 4px 10px 4px 7px; }

/* Server view: one server's channels take over the sidebar */
.side-scroll.in-server > :not(#serverPane) { display: none; }
.server-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: svIn .22s var(--ease); }
@keyframes svIn { from { opacity: 0; transform: translateX(14px); } }
.sv-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 6px; border-bottom: 1px solid var(--border); }
.sv-back { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--bg-3); color: var(--text); transition: background .12s, transform .12s; }
.sv-back:hover { background: var(--bg-4); transform: translateX(-2px); }
.sv-back .ico { width: 18px; height: 18px; stroke-width: 2.4; transform: rotate(180deg); }
.sv-back .unread-dot, .sv-back .ping-badge { position: absolute; top: -3px; right: -3px; }
.sv-name { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; line-height: 1.2; padding: 2px 4px; border-radius: 6px; }
.sv-name:hover { background: var(--bg-3); }
.sv-name > span:first-child { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-sub { font-size: .72rem; color: var(--faint); }
.sv-list.channel-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 8px 8px 14px; border-left: none; scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
.server-row.active { background: var(--bg-4); color: var(--text); }
.server-row .server-live { color: var(--success); display: grid; }
.server-row .server-live .ico { width: 14px; height: 14px; }

/* Channel categories */
.cat-head { display: flex; align-items: center; gap: 2px; margin-top: 12px; }
.cat-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 4px 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; }
.cat-toggle:hover { color: var(--text); }
.cat-toggle .chev { width: 12px; height: 12px; flex: none; stroke-width: 2.6; transform: rotate(90deg); transition: transform .2s var(--ease); }
.cat-head.closed .cat-toggle .chev { transform: rotate(0deg); }
.cat-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-count { font-size: .68rem; font-weight: 600; color: var(--faint); background: var(--bg-3); border-radius: 999px; padding: 0 6px; letter-spacing: 0; }
.cat-add { opacity: 0; transition: opacity .15s; }
.cat-head:hover .cat-add, .cat-add:focus-visible { opacity: 1; }
.cat-body { display: flex; flex-direction: column; gap: 1px; }
.cat-empty { padding: 4px 10px; font-size: .8rem; color: var(--faint); font-style: italic; }

.typing-preview { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--bg-1); height: auto; }

/* Sharing sounds */
.sb-cell { position: relative; }
.sb-cell .sb-btn { width: 100%; }
.sb-share { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--bg-1); color: var(--muted); opacity: 0; transition: opacity .12s; }
.sb-share .ico { width: 13px; height: 13px; }
.sb-cell:hover .sb-share, .sb-share:focus-visible { opacity: 1; }
.sb-share:hover { color: var(--text); background: var(--bg-4); }
.share-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin-top: 10px; }
.share-target { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; text-align: left; color: var(--text); }
.share-target:hover { background: var(--bg-3); }
.share-target:disabled { opacity: .5; }
.share-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-text strong { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-card { display: flex; align-items: center; gap: 12px; max-width: 380px; margin-top: 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.sound-card-play { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .18); font-size: 1.4rem; transition: transform .12s, box-shadow .12s; }
.sound-card-play:hover { transform: scale(1.06); }
.sound-card-play.on { box-shadow: 0 0 0 3px #4f8cff; }
.sound-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sound-card-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-card .btn.saved { color: var(--success); }

/* Per-person call menu */
.call-menu, .quick-menu { position: fixed; z-index: 60; width: 270px; padding: 10px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .15s var(--ease); }
.call-menu .spinner { margin: 14px auto; }
.cm-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.cm-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cm-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-field { display: flex; flex-direction: column; gap: 4px; padding: 6px 2px; }
.cm-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cm-field input[type=range] { flex: 1; }
.call-menu .toggle-row { padding: 8px 2px; gap: 10px; }
.call-menu .toggle-row .t { font-size: .88rem; }
.call-menu .toggle-row .d { font-size: .75rem; }
.cm-sep { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--border); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--danger); }
.cm-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 7px; color: var(--muted); }
.cm-row:hover { background: var(--bg-3); color: var(--text); }
.call-person, .voice-user { cursor: pointer; }
.call-person:hover .avatar { filter: brightness(1.12); }

/* Stop sounds */
.stop-sounds { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 22%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); color: var(--text); font-size: .78rem; font-weight: 600; animation: fadeIn .15s; }
.stop-sounds:hover { background: color-mix(in srgb, var(--danger) 38%, transparent); }
.stop-sounds .ico { width: 14px; height: 14px; fill: currentColor; }
.stop-sounds.wide { width: 100%; justify-content: center; margin-top: 8px; border-radius: 8px; padding: 7px; }

/* Slowmode */
.slow-badge { display: flex; align-items: center; gap: 6px; margin: 0 4px 6px; font-size: .78rem; color: var(--muted); }
.slow-badge .ico { width: 14px; height: 14px; }
.slow-badge.waiting { color: var(--warning, #f0b232); font-weight: 600; }
.slow-select { width: auto; max-width: 130px; }
.slow-tag { font-size: .8rem; }

/* Channel edit mode */
.sv-edit { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 8px 8px; padding: 9px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.sv-edit > span:not(.switch) { flex: 1; }
.sv-edit .ico { width: 16px; height: 16px; }
.sv-edit.on { color: var(--text); border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .14); }
.ch-edit { display: flex; align-items: center; gap: 2px; border-radius: 7px; }
.ch-edit .channel { flex: 1; min-width: 0; }
.grip { flex: none; display: grid; place-items: center; width: 16px; color: var(--faint); cursor: grab; }
.grip .ico { width: 14px; height: 14px; }
.dots .ico { width: 16px; height: 16px; }
.ch-edit.dragging, .cat-head.dragging { opacity: .4; }
.channel-list.editing .ch-edit:hover, .channel-list.editing .cat-head:hover { background: var(--bg-3); }
.channel-list.editing .cat-head { border-radius: 7px; padding-right: 2px; }
.cat-head.loose { margin-top: 4px; padding: 4px 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.drop-into { background: rgba(var(--accent-rgb), .16) !important; outline: 1px dashed rgba(var(--accent-rgb), .7); }

/* Quick ⋮ menu */
.quick-menu { width: 230px; padding: 6px; }
.qm-title { padding: 6px 8px 8px; font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 7px; font-size: .88rem; color: var(--text); text-align: left; }
.qm-item:hover { background: var(--bg-4); }
.qm-item .ico { width: 16px; height: 16px; color: var(--muted); }
.qm-item.danger, .qm-item.danger .ico { color: var(--danger); }
.qm-item.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.qm-field { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: .88rem; }
.qm-field .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.qm-field span { flex: 1; }
.qm-field select { width: auto; max-width: 120px; padding: 4px 6px; font-size: .82rem; }

/* ---- Discover ---------------------------------------------------------- */
.discover-body { flex: 1; overflow-y: auto; padding: 0 24px 40px; }
.discover-hero { max-width: 1100px; margin: 0 auto; padding: 34px 0 22px; text-align: center; }
.discover-hero h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.discover-hero p { margin-bottom: 18px; }
.discover-search { width: min(520px, 100%); padding: 12px 16px; border-radius: 999px; font-size: 1rem; }
.discover-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.discover-grid > .empty-state, .discover-grid > .spinner { grid-column: 1 / -1; }
.empty-state strong { display: block; color: var(--text); }
.srv-card { position: relative; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
.srv-card:not(.preview):hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.srv-banner { height: 96px; background-size: cover; background-position: center; flex: none; }
.srv-card-body { position: relative; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.srv-card-icon { margin-top: -26px; margin-bottom: 4px; width: max-content; border-radius: 16px; border: 4px solid var(--bg-2); background: var(--bg-2); }
.srv-card h3 { font-size: 1.02rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-bio { color: var(--muted); font-size: .86rem; line-height: 1.45; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.srv-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.srv-card-foot .muted { display: flex; align-items: center; gap: 6px; }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }
.srv-bio-plain { white-space: pre-wrap; color: var(--muted); margin: 6px 0 4px; }

/* Server overview: profile editor with live preview */
.srv-editor { display: grid; grid-template-columns: 1fr 250px; gap: 18px; align-items: start; }
.srv-editor-fields { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.srv-editor textarea { resize: vertical; width: 100%; }
.srv-preview { margin-top: 6px; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type=color] { width: 44px; height: 32px; padding: 2px; border-radius: 8px; cursor: pointer; }
@media (max-width: 640px) { .srv-editor { grid-template-columns: 1fr; } }

/* Server sidebar banner */
.sv-banner { height: 70px; margin: -2px -2px 0; border-radius: 10px 10px 0 0; }

/* ---- Call invite card --------------------------------------------------- */
.invite-card { display: flex; align-items: center; gap: 12px; max-width: 400px; margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--success); }
.invite-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.invite-icon .ico { width: 22px; height: 22px; }
.invite-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.invite-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-card .btn { flex: none; }
/* ---- Sidebar folders ---------------------------------------------------- */
.folder { margin: 2px 0; border-radius: 10px; }
.folder-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--text); user-select: none; transition: background .12s; }
.folder-head:hover { background: var(--bg-3); }
.folder-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--folder); background: color-mix(in srgb, var(--folder) 18%, transparent); }
.folder-ico .ico { width: 18px; height: 18px; }
.folder-name { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-count { font-size: .72rem; color: var(--muted); background: var(--bg-3); border-radius: 999px; padding: 1px 7px; }
.folder-head .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.folder-head.open .chev { transform: rotate(90deg); }
.folder-more { opacity: 0; }
.folder-head:hover .folder-more, .folder-head:focus-within .folder-more { opacity: 1; }
.folder-body { margin: 2px 0 4px 14px; padding-left: 6px; border-left: 2px solid color-mix(in srgb, var(--folder) 55%, transparent); }
.folder-empty { font-size: .8rem; color: var(--muted); padding: 6px 8px; }
.folder-drop { background: color-mix(in srgb, var(--folder, var(--accent)) 22%, transparent) !important; outline: 2px dashed var(--folder, var(--accent)); outline-offset: -2px; border-radius: 8px; }
.conv.dragging, .server-row.dragging { opacity: .45; }
.folder-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.swatch.on { border-color: var(--text); }
.folder-pick { max-height: 260px; }
.folder-pick .share-target { cursor: pointer; }
@media (hover: none) { .folder-more { opacity: 1; } }
/* ---- Site owner badge + verified servers -------------------------------- */
.site-badge { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; color: #f5b041; flex: none; }
.site-badge .ico { width: 16px; height: 16px; filter: drop-shadow(0 0 4px rgba(245,176,65,.45)); }
.site-badge.big { gap: 5px; margin: 6px 0 2px; padding: 3px 10px 3px 7px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(90deg, rgba(245,176,65,.22), rgba(236,72,153,.18)); border: 1px solid rgba(245,176,65,.45); width: max-content; }
.site-badge.big .ico { width: 15px; height: 15px; }
.msg-meta .site-badge { margin-left: -2px; margin-right: 2px; }
.verified-badge { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; color: #3b9cff; flex: none; }
.verified-badge .ico { width: 15px; height: 15px; stroke: none; }
.verified-badge .ico path:last-child { stroke: #fff; }
.server-row .name { display: flex; align-items: center; }
.name-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-name > .sv-title { display: flex; align-items: center; min-width: 0; font-weight: 700; font-size: .95rem; }
.srv-card h3 { display: flex; align-items: center; }
.invite-srv { display: flex; align-items: center; gap: 2px; }
.invite-srv .verified-badge { margin: 0 2px 0 0; }
.verify-btn .ico { width: 15px; height: 15px; color: var(--muted); }
.verify-btn.on .ico { color: #3b9cff; }
.discover-owner { max-width: 520px; margin: 14px auto 0; text-align: left; padding: 4px 14px; border-radius: 12px; border: 1px dashed rgba(245,176,65,.5); background: rgba(245,176,65,.06); }
.owner-box { margin: 6px 0 10px; padding: 2px 12px; border-radius: 10px; border: 1px dashed rgba(245,176,65,.5); background: rgba(245,176,65,.06); }
.invite-new { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); max-width: 640px; }
.invite-new h3 { margin-bottom: 4px; }
.invite-new .invite-box { margin-top: 10px; }

/* Quick-menu dropdowns (Slowmode, Category): label on top, the dropdown full width under it. */
.qm-field { display: grid; grid-template-columns: 16px 1fr; align-items: center; column-gap: 9px; row-gap: 6px; padding: 7px 8px; }
.qm-field select { grid-column: 1 / -1; width: 100%; max-width: none; min-width: 0; padding: 6px 8px; font-size: .84rem; border-radius: 7px; }
.quick-menu { max-width: calc(100vw - 16px); }
/* Checkboxes in pickers and check rows: normal size (inputs are full-width by default). */
.folder-pick input[type=checkbox], .check-row input[type=checkbox] { width: 18px; height: 18px; flex: none; padding: 0; margin: 0; accent-color: var(--accent); box-shadow: none; cursor: pointer; }
.folder-pick .share-target { gap: 10px; }
.folder-pick .share-text strong { color: var(--text); }

/* ---- Sign-up safety ------------------------------------------------------ */
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 14px; font-size: .86rem; color: var(--muted); text-align: left; line-height: 1.45; cursor: pointer; }
.check-row input[type=checkbox] { margin-top: 1px; }
.check-row a { color: var(--accent); }
.turnstile-box { min-height: 65px; margin: 0 0 14px; display: flex; justify-content: center; align-items: center; }
.auth-card h1 + .muted { margin-bottom: 16px; }
.alt-form { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 4px; }
.code-input { text-align: center; font-size: 1.7rem; letter-spacing: .5em; font-weight: 700; padding: 12px; font-family: var(--mono); }
.alt-links { margin-top: 12px; }
.alt-change { margin-top: 10px; text-align: left; }
.email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.chip-ok { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.chip-ok.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.blocked-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

/* ---- Blocking and reports ------------------------------------------------ */
.blocked-msg { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 72px; color: var(--faint); font-size: .84rem; font-style: italic; }
.blocked-msg .ico { width: 14px; height: 14px; }
.blocked-msg .link { font-style: normal; }
.pc-safety { display: flex; gap: 6px; margin-top: 8px; }
.pc-safety .btn { flex: 1; justify-content: center; gap: 6px; }
.pc-safety .ico { width: 14px; height: 14px; }
.danger-text { color: var(--danger) !important; }

/* ---- Pyron updates -------------------------------------------------------- */
.pyron-av { display: grid; place-items: center; background: #0b0a16; border: 1px solid rgba(168, 85, 247, .45); border-radius: 50%; flex: none; }
.pyron-av svg { width: 64%; height: 64%; }
.avatar.xl.pyron-av { width: 80px; height: 80px; }
.official-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: .58rem; font-weight: 800; letter-spacing: .04em; vertical-align: middle; background: var(--grad); color: #fff; }
.updates-conv .conv-name { display: flex; align-items: center; }
.updates-conv { border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; margin-bottom: 4px; }
.updates-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }
.updates-intro { padding: 30px 20px 16px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.updates-intro h2 { margin: 12px 0 4px; font-size: 1.5rem; }
.update-msg { padding-top: 10px; padding-bottom: 10px; }
.update-title { font-weight: 700; font-size: 1.02rem; margin: 2px 0 4px; }
.updates-empty { padding: 20px; }

/* ---- Admin page ----------------------------------------------------------- */
#adminRoot:empty { display: none; }
.admin { position: fixed; inset: 0; z-index: 46; background: var(--bg-1); display: flex; flex-direction: column; animation: fadeIn .2s ease; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--bg-0); }
.admin-brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.admin-brand .ico { width: 22px; height: 22px; color: #f5b041; }
.admin-head-actions { display: flex; align-items: center; gap: 8px; }
.admin-tabs { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.admin-tab { padding: 9px 14px; border-radius: 9px 9px 0 0; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tab:hover { color: var(--text); }
.admin-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.admin-body { flex: 1; overflow-y: auto; padding: 22px; width: min(1100px, 100%); margin: 0 auto; }
.admin-lock { margin: 10vh auto 0; width: min(420px, calc(100% - 40px)); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.admin-lock .ico.big { width: 44px; height: 44px; color: var(--accent); }
.admin-lock input { text-align: center; }
.admin-cmd { display: block; padding: 10px 14px; border-radius: 10px; background: var(--bg-3); font-family: var(--mono); font-size: .88rem; user-select: all; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.stat-card { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.stat-card[onclick], button.stat-card:hover { border-color: rgba(var(--accent-rgb), .45); }
.stat-card strong { font-size: 1.8rem; font-family: var(--display); }
.stat-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-3); margin-bottom: 14px; }
.seg button { padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg button.on { background: var(--bg-1); color: var(--text); }
.report-list { display: flex; flex-direction: column; gap: 12px; }
.report-card { padding: 14px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.report-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-reason { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 18%, transparent); color: #ff9a9d; }
.chip-ban { margin-left: 6px; font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: var(--danger); color: #fff; vertical-align: middle; }
.report-who { display: flex; flex-direction: column; gap: 2px; }
.report-details { color: var(--muted); font-style: italic; }
.report-msg { margin: 0; padding: 10px 12px; border-left: 3px solid var(--border); background: var(--bg-1); border-radius: 0 10px 10px 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.admin-search { margin-bottom: 12px; }
.admin-list { display: flex; flex-direction: column; gap: 4px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.admin-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-row-text strong { display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-compose { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.update-preview { margin-top: 6px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg-2); }
.admin-nav .ico { color: #f5b041; }
@media (max-width: 760px) { .admin-compose { grid-template-columns: 1fr; } .admin-body { padding: 14px; } .admin-head { padding: 12px 14px; } }
/* ---- Chat formatting ---- */
.msg-text em { font-style: italic; }
.msg-text strong { font-weight: 700; }
.msg-text s { opacity: .75; }
.inline-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--bg-0); border: 1px solid var(--border); }

/* ---- Channel notice (pinned guide card) ---- */
.chan-notice { margin: 10px 16px 0; padding: 10px 14px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent, #8b5cf6) 10%, var(--bg-1)); border: 1px solid color-mix(in srgb, var(--accent, #8b5cf6) 35%, transparent); flex-shrink: 0; max-height: 34vh; overflow-y: auto; }
.chan-notice.folded { padding-bottom: 10px; }
.chan-notice-head { display: flex; align-items: center; gap: 8px; }
.chan-notice-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--accent, #8b5cf6) 25%, transparent); color: var(--accent, #a78bfa); flex: none; }
.chan-notice-ico .ico { width: 16px; height: 16px; }
.chan-notice-title { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-notice-tag { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 2px 6px; border-radius: 6px; background: var(--bg-0); flex: none; }
.chan-notice-head .icon-btn:first-of-type { margin-left: auto; }
.chan-notice .msg-text { margin: 8px 0 0 34px; white-space: pre-wrap; }
.notice-preview { margin: 4px 0 12px; }
/* Headings, small text and spoilers */
.msg-text .md-h1 { font-size: 1.5em; font-weight: 800; line-height: 1.25; margin: 4px 0 2px; }
.msg-text .md-h2 { font-size: 1.25em; font-weight: 750; line-height: 1.3; margin: 4px 0 2px; }
.msg-text .md-h3 { font-size: 1.08em; font-weight: 700; line-height: 1.35; margin: 2px 0; }
.msg-text .md-sub { font-size: .76em; color: var(--muted); line-height: 1.4; }
.spoiler { background: var(--bg-4, #2b2840); color: transparent; border-radius: 4px; padding: 0 2px; cursor: pointer; transition: background .15s, color .15s; user-select: none; }
.spoiler * { color: transparent !important; background: transparent !important; pointer-events: none; }
.spoiler:hover { background: color-mix(in srgb, var(--bg-4, #2b2840) 80%, #fff 8%); }
.spoiler.revealed { background: color-mix(in srgb, var(--text) 10%, transparent); color: inherit; cursor: auto; user-select: auto; }
.spoiler.revealed * { color: inherit !important; pointer-events: auto; }
.spoiler.revealed .mention { color: var(--accent-2, #c4b5fd) !important; }
.att-spoiler { position: relative; display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; cursor: pointer; }
.att-spoiler > :first-child { filter: blur(44px) brightness(.7); transition: filter .25s; }
.att-spoiler .spoiler-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 6px 14px; border-radius: 999px; background: rgba(0,0,0,.7); color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .08em; pointer-events: none; }
.att-spoiler.revealed { cursor: auto; }
.att-spoiler.revealed > :first-child { filter: none; }
.att-spoiler.revealed .spoiler-label { display: none; }
.pending.spoiled img { filter: blur(8px); }
.spoil-toggle { flex: none; }
.pending.spoiled .spoil-toggle { background: var(--accent, #8b5cf6); color: #fff; border-color: transparent; }
/* Welcome (system) messages */
.system-msg { display: flex; align-items: center; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.system-ico { display: grid; place-items: center; width: 40px; flex: none; font-size: 1.1rem; cursor: pointer; }
.system-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.system-line .msg-text { color: var(--muted); }
.system-line .msg-text .mention { font-weight: 600; }
.welcome-preview { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 4px 0 10px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--border); }
.welcome-preview .system-ico { width: auto; cursor: default; }
.welcome-preview .msg-text { color: var(--muted); }
.label + .hint { margin: 4px 0 10px; }

/* ---- UI fixes ---- */
.theme-card .swatch { width: auto; height: 64px; border-radius: 0; border: 0; box-shadow: none; transform: none; }
.theme-card .swatch i { flex: none; width: 16px; height: 16px; border-radius: 50%; }
.theme-card { display: flex; flex-direction: column; align-items: stretch; height: auto; }
.srv-editor + .hint { margin-top: 10px; }
.srv-editor-fields .row-btns { margin-top: 8px; }

/* ---- Twemoji ---- */
img.emoji { width: 1.375em; height: 1.375em; vertical-align: -0.3em; margin: 0 .05em; object-fit: contain; }
.msg-text.jumbo img.emoji { width: 3rem; height: 3rem; vertical-align: -0.6rem; margin: 2px 1px; }
.mention img.emoji, .reply-snip img.emoji { width: 1.1em; height: 1.1em; }
.emoji-btn .ico { width: 22px; height: 22px; }

/* ---- Emoji picker ---- */
.emoji-picker { position: fixed; z-index: 75; display: flex; flex-direction: column; border-radius: 12px; background: var(--bg-1); box-shadow: var(--shadow), 0 0 0 1px var(--border); overflow: hidden; animation: pop .14s var(--ease); }
.ep-head { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); }
.ep-search { flex: 1; min-width: 0; height: 34px; }
.ep-tone { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.ep-tone:hover { background: var(--bg-3); }
.ep-tone img.emoji { width: 22px; height: 22px; margin: 0; }
.ep-main { flex: 1; min-height: 0; display: flex; }
.ep-tabs { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; background: var(--bg-0); overflow-y: auto; flex: none; }
.ep-tab { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.ep-tab:hover { background: var(--bg-3); color: var(--text); }
.ep-tab img.emoji { width: 20px; height: 20px; margin: 0; filter: grayscale(.5); }
.ep-tab:hover img.emoji { filter: none; }
.ep-tab .ico { width: 18px; height: 18px; }
.ep-grid { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.ep-title { position: sticky; top: -4px; z-index: 1; padding: 8px 2px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--bg-1); }
.ep-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.ep-cell { height: 38px; display: grid; place-items: center; border-radius: 7px; }
.ep-cell:hover { background: var(--bg-3); }
.ep-cell img.emoji { width: 28px; height: 28px; margin: 0; }
.ep-note { padding: 20px 6px; text-align: center; }
.ep-footer { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; border-top: 1px solid var(--border); background: var(--bg-0); font-weight: 600; font-size: .88rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ep-footer img.ep-big { width: 30px; height: 30px; margin: 0; }

/* ---- Reactions ---- */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--bg-3); border: 1px solid transparent; font-size: .82rem; font-weight: 600; color: var(--muted); transition: background .12s, border-color .12s; }
.reaction img.emoji { width: 17px; height: 17px; margin: 0; vertical-align: 0; }
.reaction:hover { border-color: var(--border); background: var(--bg-4, var(--bg-3)); }
.reaction.mine { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--text); }
.reaction.add { opacity: 0; padding: 0 6px; }
.reaction.add .ico { width: 17px; height: 17px; }
.msg:hover .reaction.add, .reaction.add:focus-visible { opacity: 1; }

/* ---- Replies ---- */
.reply-line { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 0 3px; font-size: .82rem; color: var(--muted); cursor: pointer; }
.reply-line > .ico { width: 15px; height: 15px; flex: none; transform: scaleX(-1); opacity: .7; }
.reply-line .avatar.xs { width: 16px; height: 16px; font-size: .5rem; }
.reply-line strong { color: var(--text); font-weight: 600; flex: none; opacity: .85; }
.reply-line:hover strong, .reply-line:hover .reply-snip { color: var(--text); }
.reply-snip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.reply-line.missing { cursor: default; font-style: italic; }
.reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 -6px; padding: 7px 8px 12px 14px; border-radius: 10px 10px 0 0; background: var(--bg-0); font-size: .84rem; color: var(--muted); }
.reply-bar strong { color: var(--text); }
.reply-bar .icon-btn { width: 26px; height: 26px; }
.msg.flash { animation: msgFlash 1.6s ease; }
@keyframes msgFlash { 0%, 40% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }

/* ---- Editing ---- */
.edit-box { margin: 2px 0; }
.edit-input { width: 100%; resize: none; min-height: 40px; padding: 9px 12px; border-radius: 9px; background: var(--bg-0); line-height: 1.45; }
.edit-hint { margin-top: 4px; }
.edit-hint .link { color: var(--accent); font-size: inherit; padding: 0; }
.msg.editing .msg-actions { display: none; }
.edited { margin-left: 5px; font-size: .68rem; color: var(--muted); white-space: nowrap; user-select: none; }

/* ---- Server invite card ---- */
.sinv-card { --sinv: var(--accent); width: min(400px, 100%); margin-top: 6px; border-radius: 12px; overflow: hidden; background: var(--bg-0); border: 1px solid var(--border); }
.sinv-banner { height: 64px; background-size: cover; background-position: center; }
.sinv-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.sinv-top { display: flex; align-items: flex-end; gap: 12px; margin-top: -24px; }
.sinv-top .server-icon { width: 56px; height: 56px; border-radius: 16px; font-size: 1.1rem; flex: none; box-shadow: 0 0 0 4px var(--bg-0); }
.sinv-head { display: flex; flex-direction: column; min-width: 0; padding-top: 30px; align-self: flex-start; }
.sinv-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.sinv-name { font-size: 1.05rem; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sinv-bio { margin: 0; font-size: .86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sinv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sinv-count { display: inline-flex; align-items: center; gap: 6px; }
.sinv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sinv); }
.sinv-foot .btn.primary { background: var(--sinv); border-color: var(--sinv); }

/* ---- OG badge + server tags ---- */
.og-badge { display: inline-flex; align-items: center; height: 17px; padding: 0 5px; margin-left: 4px; border-radius: 5px; font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: #1a1205; background: linear-gradient(135deg, #fde68a, #f59e0b); vertical-align: middle; user-select: none; }
.og-badge.big { height: 22px; padding: 0 8px; margin: 0; font-size: .7rem; border-radius: 7px; }
.user-tag { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 5px 0 3px; margin-left: 5px; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--border); font-size: .66rem; font-weight: 800; letter-spacing: .03em; color: var(--text); vertical-align: middle; white-space: nowrap; }
.user-tag .tag-ico { width: 13px; height: 13px; margin: 0; border-radius: 3px; object-fit: cover; vertical-align: 0; }
.user-tag .ico.tag-ico { color: var(--muted); }
.pc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-badges .site-badge.big { margin: 0; }
.tag-edit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.tag-preview { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--border); }
.tag-preview-name { font-weight: 700; }
.tag-preview .user-tag { margin-left: 0; }
.tag-wear { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tag-wear > .user-tag { margin-left: 0; height: 22px; font-size: .74rem; }

/* ---- Pyron updates in the nav ---- */
.updates-slot:empty { display: none; }
.updates-nav .avatar.nav-av { width: 20px; height: 20px; flex: none; }
.updates-nav .avatar.nav-av svg { width: 15px; height: 15px; }
.updates-nav .ping-badge, .updates-nav .badge { margin-left: auto; }
.updates-nav.unread > span { color: var(--text); font-weight: 700; }
/* Name + badges sit tight together in the message header */
.msg-who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; align-self: center; }
.msg-who .site-badge, .msg-who .user-tag, .msg-who .og-badge { margin: 0; }
.msg-meta { align-items: center; }
.msg-meta .msg-time { align-self: center; }

/* Settings > Profiles: badges and server tag */
.badge-rows .toggle-row .t { display: flex; align-items: center; gap: 6px; }
.badge-rows .site-badge, .badge-rows .og-badge { margin: 0; }
.tag-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); max-width: 100%; transition: border-color .12s, background .12s; }
.tag-opt:hover { background: var(--bg-3); }
.tag-opt.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tag-opt .user-tag { margin: 0; }
.tag-opt-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
/* Profile link buttons */
.pc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pc-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--pc, var(--accent)) 16%, var(--bg-3)); border: 1px solid color-mix(in srgb, var(--pc, var(--accent)) 35%, var(--border)); color: var(--text); font-size: .82rem; font-weight: 600; text-decoration: none; transition: filter .12s, transform .12s; }
.pc-link:hover { filter: brightness(1.15); text-decoration: none; transform: translateY(-1px); }
.pc-link .ico { width: 14px; height: 14px; flex: none; opacity: .8; }
.pc-link-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-link-host { color: var(--muted); font-weight: 500; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.links-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; align-items: flex-start; }
.le-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 8px; width: 100%; align-items: center; }
.le-del .ico { width: 15px; height: 15px; }
/* Toggled call buttons: tinted, so the icon stays visible with any accent (even white). */
.call-buttons .round.accent { background: color-mix(in srgb, var(--accent) 26%, var(--bg-3)); color: var(--text); box-shadow: inset 0 0 0 2px var(--accent); }
.call-buttons .round.on { background: rgba(237, 66, 69, .18); color: #ff6b6e; box-shadow: inset 0 0 0 2px rgba(237, 66, 69, .55); }
.mention:hover { color: var(--on-accent); }
.voice-act.on { background: color-mix(in srgb, var(--accent) 22%, var(--bg-3)); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.call-person .live { width: auto; align-self: center; }

/* Cameras in the call panel */
.call-person.has-cam { width: auto; }
.cam-tile { width: 192px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer; }
.cam-tile:fullscreen { width: 100%; height: 100%; border-radius: 0; }
.cam-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam-tile:fullscreen .cam-video { object-fit: contain; }
.cam-video.self { transform: scaleX(-1); }
.call-person.has-cam > span { max-width: 192px; }
.call-strip.compact .cam-tile { width: 96px; border-radius: 8px; }
@media (max-width: 700px) { .cam-tile { width: 140px; } }

/* GIF folders */
.gif-folder-bar { column-span: all; position: sticky; top: 0; z-index: 2; background: var(--bg-1); padding-bottom: 8px; margin-bottom: 4px; display: flex; flex-direction: column; gap: 6px; }
.gif-folders { display: flex; flex-wrap: wrap; gap: 6px; max-height: 98px; overflow-y: auto; scrollbar-width: thin; }
.gif-folder { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border); color: var(--muted); font-size: .78rem; font-weight: 600; }
.gif-folder .ico { width: 14px; height: 14px; }
.gif-folder:hover { color: var(--text); background: var(--bg-4); }
.gif-folder.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg-3)); }
.gif-folder .gf-count { font-size: .7rem; color: var(--faint); }
.gif-folder.add { padding: 0 8px; }
.gf-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-input { flex: none; width: 130px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: .8rem; }
.gf-tools { display: flex; align-items: center; gap: 6px; }
.gf-tools > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-tools .btn .ico { width: 14px; height: 14px; }
.gif-move { position: absolute; top: 6px; right: 40px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; opacity: 0; transition: opacity .12s; z-index: 1; }
.gif-move .ico { width: 15px; height: 15px; }
.gif-tile:hover .gif-move { opacity: 1; }
@media (hover: none) { .gif-move { opacity: .85; } }
.gif-move-menu { position: absolute; z-index: 20; width: 180px; max-height: 260px; overflow-y: auto; padding: 6px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; animation: pop .14s var(--ease); }
.gmm-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 8px; }
.gmm-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; color: var(--text); font-size: .84rem; text-align: left; }
.gmm-item .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.gmm-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmm-item:hover { background: var(--bg-4); }
.gmm-item.active { background: color-mix(in srgb, var(--accent) 18%, var(--bg-3)); }
.gmm-empty { font-size: .78rem; color: var(--muted); padding: 6px 8px; }
.srv-card h3 .user-tag { margin-left: 6px; }.call-person .speaking-ring.cam-tile { border-radius: 12px; }
.call-strip.compact .call-person .speaking-ring.cam-tile { border-radius: 8px; }
.voice-actions { flex-wrap: wrap; }
.voice-actions .voice-act { flex: 1 1 calc(50% - 3px); min-width: 0; white-space: nowrap; }
/* Custom About me background */
.pc-inner.custom-bg { border: 1px solid rgba(255, 255, 255, .08); }
.pc-inner.dark-bg .pc-label { color: #fff; }
.pc-inner.dark-bg .pc-bio { color: rgba(255, 255, 255, .92); }
.pc-inner.light-bg { border-color: rgba(0, 0, 0, .1); }
.pc-inner.light-bg .pc-label { color: rgba(15, 12, 25, .75); }
.pc-inner.light-bg .pc-bio { color: #16131f; }
.pc-inner.custom-bg .pc-link { background: rgba(0, 0, 0, .22); border-color: rgba(255, 255, 255, .18); color: #fff; }
.pc-inner.custom-bg .pc-link-host { color: rgba(255, 255, 255, .7); }
.pc-inner.light-bg .pc-link { background: rgba(255, 255, 255, .55); border-color: rgba(0, 0, 0, .15); color: #16131f; }
.pc-inner.light-bg .pc-link-host { color: rgba(15, 12, 25, .6); }/* Custom profile card background gradient */
.pcard.custom-card { background: linear-gradient(180deg, var(--card-top, color-mix(in srgb, var(--pc) 28%, var(--bg-1))) 0%, var(--card-bot, var(--bg-1)) 100%); }
.pcard.custom-card .pc-avatar { background: var(--card-top, color-mix(in srgb, var(--pc) 22%, var(--bg-1))); }
.pcard.light-card { --text: #16131f; --muted: #4a4660; --faint: #6b6780; color: #16131f; }
.pcard.light-card .pc-inner:not(.custom-bg) { background: rgba(255, 255, 255, .5); }
.pcard.light-card .pc-link { color: #16131f; }

/* Notifications inbox */
.inbox-tabs { margin-bottom: 0; }
.inbox-clear { margin-left: auto; }
.inbox-body { flex: 1; overflow-y: auto; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 12px; }
.inbox-card { width: 100%; max-width: 820px; margin: 0 auto; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden; flex: none; }
.inbox-card.new { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.inbox-top { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--border); font-size: .85rem; color: var(--muted); min-width: 0; }
.inbox-top b { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-top > span:not(.inbox-kind):not(.inbox-spacer) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-top .inbox-srv { width: 22px; height: 22px; min-width: 22px; border-radius: 7px; font-size: .55rem; flex: none; }
.inbox-top .avatar.xs { width: 22px; height: 22px; font-size: .6rem; flex: none; }
.inbox-kind { flex: none; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--bg-4); color: var(--muted); }
.inbox-kind.ping { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.inbox-spacer { flex: 1; }
.inbox-top .btn.small { flex: none; }
.inbox-x { flex: none; }
.inbox-more { display: block; width: 100%; padding: 6px 14px; text-align: left; font-size: .8rem; color: var(--muted); border-bottom: 1px dashed var(--border); }
.inbox-more:hover { color: var(--text); background: var(--bg-3); }
.inbox-msg { display: flex; gap: 10px; padding: 10px 14px 4px; }
.inbox-msg .avatar { flex: none; }
.inbox-msg-body { min-width: 0; flex: 1; }
.inbox-msg-meta { display: flex; align-items: baseline; gap: 8px; }
.inbox-author { font-weight: 600; }
.inbox-msg .msg-text { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.inbox-replied { font-size: .78rem; color: var(--muted); margin: 1px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-sent { padding: 4px 14px 0 50px; font-size: .78rem; font-weight: 600; color: var(--success); }
.inbox-reply { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 12px 50px; }
.inbox-reply textarea { flex: 1; resize: none; min-height: 38px; max-height: 140px; padding: 9px 12px; border-radius: 10px; background: var(--bg-3); border: 1px solid transparent; color: var(--text); font: inherit; font-size: .92rem; line-height: 1.35; }
.inbox-reply textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.inbox-reply .btn { flex: none; height: 38px; }
.inbox-empty { margin: 70px auto 0; max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.inbox-empty .ico { width: 44px; height: 44px; color: var(--faint); margin-bottom: 4px; }
@media (max-width: 820px) {
  .inbox-body { padding: 12px 10px 30px; }
  .inbox-reply, .inbox-sent { padding-left: 14px; }
  #inboxView .view-head .divider { display: none; }
}
@media (max-width: 820px) { #inboxTabs button { padding: 5px 9px; } #inboxView .head-ico { display: none; } }

/* ---- Sound panel (composer) ---- */
.sound-btn .ico { width: 20px; height: 20px; }
.sound-panel { height: 400px; }
.sound-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.sp-srcs { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
.sp-srcs::-webkit-scrollbar { display: none; }
.sp-src { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 160px; padding: 5px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--bg-3); border: 1px solid transparent; }
.sp-src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-src:hover { color: var(--text); }
.sp-src.active { color: var(--text); border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .14); }
.sp-src .server-icon, .sp-src .xxs { width: 18px; height: 18px; min-width: 18px; font-size: .55rem; border-radius: 6px; }
.sp-search { flex-shrink: 0; }
.sp-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; align-content: start; }
.sp-grid .note { grid-column: 1 / -1; color: var(--muted); font-size: .86rem; line-height: 1.55; padding: 8px 4px; }
.sp-cell { position: relative; }
.sp-send { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 30px 10px 10px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); text-align: left; transition: transform .12s, border-color .12s; }
.sp-send:hover { border-color: rgba(var(--accent-rgb), .7); transform: translateY(-1px); }
.sp-send:disabled { opacity: .5; }
.sp-send .sb-emoji { font-size: 1.15rem; }
.sp-send .sb-name { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-prev { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.sp-prev:hover { color: var(--text); background: var(--bg-4); }
.sp-prev .ico { width: 13px; height: 13px; }
.vm-idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 10px 24px; }
.vm-idle p { max-width: 300px; margin: 0; line-height: 1.5; }
.vm-big { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 28px rgba(var(--accent-rgb), .35); transition: transform .15s; }
.vm-big:hover:not(:disabled) { transform: scale(1.06); }
.vm-big:disabled { opacity: .4; }
.vm-big .ico { width: 36px; height: 36px; }
.vm-big.busy { animation: vmPulse 1.2s ease-in-out infinite; }
@keyframes vmPulse { 50% { transform: scale(.92); opacity: .7; } }
.vm-rec { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 6px 4px; }
.vm-head { display: flex; align-items: center; gap: 8px; }
.vm-dot { width: 10px; height: 10px; border-radius: 50%; background: #f04747; animation: vmBlink 1s steps(2) infinite; }
@keyframes vmBlink { 50% { opacity: .25; } }
.vm-time { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: auto; }
.vm-wave { width: 100%; height: 70px; border-radius: 10px; background: var(--bg-0); }
.vm-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.vm-actions .btn { display: inline-flex; align-items: center; gap: 4px; }
.vm-actions .ico { width: 15px; height: 15px; }
.voice-msg { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 12px 8px 8px; width: min(340px, 100%); border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border); }
.voice-msg.playing { border-color: rgba(var(--accent-rgb), .55); }
.vmp-play { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); }
.vmp-play .ico { width: 15px; height: 15px; }
.vmp-mic { color: var(--muted); display: grid; }
.vmp-mic .ico { width: 15px; height: 15px; }
.vmp-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-0); cursor: pointer; overflow: hidden; }
.vmp-fill { height: 100%; width: 0; background: var(--grad); }
.vmp-time { font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 34px; text-align: right; }
.vm-rec .voice-msg { width: 100%; margin: 0; }
@media (max-width: 640px) { .sound-panel { height: 360px; } .sp-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }

/* ---- Media link embeds ---- */
.msg-embeds { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 6px; }
.embed-img { display: block; max-width: min(420px, 100%); max-height: 340px; border-radius: 10px; cursor: zoom-in; object-fit: contain; background: var(--bg-3); }
.embed-video { margin-top: 0; }
.msg-embeds .att-audio { margin-top: 0; }
.embed-yt { position: relative; width: min(440px, 100%); aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; border: 1px solid var(--border); }
.embed-yt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .15s; }
.embed-yt:hover img { filter: brightness(.85); }
.embed-yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 46px; border-radius: 12px; background: #f00; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 18px rgba(0,0,0,.4); pointer-events: none; }
.embed-yt-play .ico { width: 22px; height: 22px; fill: currentColor; }
.embed-yt-link { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px; font-size: .74rem; font-weight: 600; color: #fff; background: rgba(0,0,0,.6); text-decoration: none; }
.embed-yt iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---- Admin: reading DMs ---- */
.admin-dm-list { display: flex; flex-direction: column; gap: 4px; max-height: 56vh; overflow-y: auto; }
.admin-grp { display: grid; place-items: center; background: var(--bg-3); font-size: .8rem; }
.modal.wide { width: min(720px, calc(100vw - 32px)); max-width: none; }
.admin-dm-msgs { display: flex; flex-direction: column; gap: 12px; max-height: 58vh; overflow-y: auto; padding: 10px; border-radius: 10px; background: var(--bg-0); border: 1px solid var(--border); }
.admin-dm-msg { display: flex; gap: 10px; align-items: flex-start; }
.admin-dm-body { min-width: 0; flex: 1; }
.admin-dm-body .msg-text { white-space: pre-wrap; word-break: break-word; }
.admin-log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.admin-log-head h4 { margin: 0; }

/* ---- Someone you're calling: pulsing until they pick up ---- */
.call-person.ringing { cursor: default; }
.call-person.ringing .avatar { opacity: .55; filter: grayscale(.35); animation: ringFade 1.6s ease-in-out infinite; }
.ring-pulse { position: relative; }
.ring-pulse::before, .ring-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .8); animation: ringWave 1.6s ease-out infinite; pointer-events: none; }
.ring-pulse::after { animation-delay: .8s; }
.ringing-label { font-size: .7rem; color: var(--muted); animation: ringFade 1.6s ease-in-out infinite; }
@keyframes ringWave { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes ringFade { 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .ring-pulse::before, .ring-pulse::after { animation: none; opacity: .5; } .call-person.ringing .avatar, .ringing-label { animation: none; } }

/* ---- Admin: bios in the user list ---- */
.admin-status { color: var(--text-2, var(--muted)); font-style: italic; }
.admin-bio { margin-top: 4px; padding: 6px 9px; border-radius: 8px; background: var(--bg-0); border: 1px solid var(--border); font-size: .84rem; line-height: 1.45; cursor: pointer; max-width: 560px; }
.admin-bio .msg-text { white-space: pre-wrap; word-break: break-word; max-height: 4.35em; overflow: hidden; }
.admin-bio.open .msg-text { max-height: none; }
.admin-nobio { font-style: italic; opacity: .7; }

/* GIF folders hidden from All */
.gif-folder .gf-hid { width: 12px; height: 12px; opacity: .7; }
.gif-folder.hidden-all .gf-name { font-style: italic; }

/* Notifications: dot on the bell (seen, not cleared) and on the phone menu button (new) */
.inbox-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); flex-shrink: 0; margin-right: 4px; }
.inbox-dot[hidden] { display: none; }
[data-menu].has-dot { position: relative; }
[data-menu].has-dot::after { content: ""; position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg-1); }
/* ---- Admin: viewing servers ---- */
.admin-srv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.admin-srv-head h3 { margin: 0; }
.admin-sub { margin: 14px 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.admin-chan-ico { width: 24px; text-align: center; font-weight: 700; color: var(--muted); }
.admin-voice-chan { opacity: .7; cursor: default; }
.admin-srv-members { display: flex; flex-wrap: wrap; gap: 6px; max-height: 26vh; overflow-y: auto; }
.admin-member { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); font-size: .82rem; }
.admin-member:hover { border-color: rgba(var(--accent-rgb), .6); }

/* Camera tile: avatar until the first frame arrives (instead of a black box) */
.cam-tile { position: relative; }
.cam-wait { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--bg-3); color: var(--muted); font-size: .68rem; pointer-events: none; }
.cam-tile.cam-waiting .cam-wait { display: flex; }
/* Forwarded messages: the original, quoted with its author */
.fwd { border-left: 3px solid var(--border-strong, rgba(255,255,255,.18)); padding: 6px 0 6px 12px; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fwd-kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-style: italic; color: var(--muted, #9aa0b4); }
.fwd-kicker .ico { width: 14px; height: 14px; }
.fwd-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.fwd-who .msg-time { margin-left: 0; }
.fwd-preview { margin: 0 0 12px; }
.fwd-snip { font-size: 13px; color: var(--text, inherit); opacity: .85; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.5em; overflow: hidden; }
.modal .fwd-preview + input { margin-bottom: 8px; }

/* "Pyron has been updated" bar */
.update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--panel, #1c1a2b); border: 1px solid var(--border, rgba(255,255,255,.12)); box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 14px; max-width: calc(100vw - 24px); }
.update-bar > span { white-space: nowrap; }

/* Call people: cameras and avatars share one centre line */
.call-people { align-items: center; }
/* A camera you clicked to enlarge */
.call-person.cam-big .cam-tile { width: min(640px, 86vw); }
.call-person.cam-big > span { max-width: min(640px, 86vw); }
.cam-full { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 8px; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cam-full .ico { width: 18px; height: 18px; }
.cam-tile:hover .cam-full, .cam-full:focus-visible { opacity: 1; }
@media (hover: none) { .cam-full { opacity: 1; } }
.cam-tile:fullscreen .cam-full { display: none; }

/* Screen shares in the call panel: same tile and enlarge as cameras, but shown whole */
.screen-tile video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen-tile .screen-live { position: absolute; left: 8px; top: 8px; width: auto; pointer-events: none; }
.cam-btns { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.cam-tile:hover .cam-btns, .cam-btns:focus-within { opacity: 1; }
@media (hover: none) { .cam-btns { opacity: 1; } }
.cam-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.cam-btn:hover { background: rgba(0,0,0,.8); }
.cam-btn .ico { width: 16px; height: 16px; }
.call-strip.compact .cam-btns, .call-strip.compact .screen-live { display: none; }
.cam-tile:fullscreen .cam-btns { display: none; }
.cam-tile:fullscreen video { object-fit: contain; }
/* The LIVE tag under a name hangs below it, so it never shifts that person off the centre line */
.call-person > .live { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; }
.call-people:has(.call-person > .live) { padding-bottom: 16px; }

/* Popped-out screen window: put it back in the call panel */
.stage-back { display: flex; align-items: center; gap: 6px; margin-right: 4px; padding: 4px 10px; border-radius: 6px; background: var(--bg-3, rgba(255,255,255,.1)); color: var(--text); font-size: 0.78rem; font-weight: 700; transition: filter .12s; }
.stage-back:hover { filter: brightness(1.2); }
.stage-back .ico { width: 15px; height: 15px; }
