:root {
  --bg: #0a0a12;
  --bg-mid: #12121f;
  --surface: rgba(20, 20, 31, 0.92);
  --surface-2: rgba(28, 28, 43, 0.88);
  --surface-glass: rgba(20, 20, 31, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f4f4f8;
  --text-secondary: #8b8ba3;
  --text-muted: #5c5c72;
  --primary: #8e2de2;
  --secondary: #e040fb;
  --accent: #4a00e0;
  --online: #10b981;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #8e2de2, #e040fb);
  --bubble-in: rgba(255, 255, 255, 0.07);
  --bubble-out: linear-gradient(135deg, #4a00e0, #8e2de2, #e040fb);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --sidebar-w: 380px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

/* ─── Login ─── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 25%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 42%),
    radial-gradient(circle at 80% 75%, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 38%),
    linear-gradient(180deg, var(--bg), var(--bg-mid), var(--bg));
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: #141622;
  box-shadow: 0 12px 40px color-mix(in srgb, var(--primary) 35%, transparent);
  position: relative;
  overflow: hidden;
}

.logo::after {
  content: '';
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ec8ff, #b44bff);
  opacity: 0.85;
  mask: radial-gradient(circle at 50% 55%, transparent 35%, black 36%);
}

.login-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.login-hint { margin: 0 0 8px; color: var(--text); font-size: 15px; font-weight: 500; }
.login-steps { margin: 0 0 24px; color: var(--text-secondary); line-height: 1.55; font-size: 14px; }
.login-card p { margin: 0 0 24px; color: var(--text-secondary); line-height: 1.55; font-size: 14px; }

.qr-box {
  width: 228px;
  height: 228px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 10px;
}

.qr-box canvas, .qr-box img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.status { color: var(--text-secondary); font-size: 13px; min-height: 20px; margin-bottom: 14px; }
.status.ok { color: var(--online); }
.status.err { color: #fca5a5; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 22px 0 16px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.form { display: grid; gap: 10px; text-align: left; }
.form input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.btn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: white;
  background: var(--gradient);
  transition: transform 0.12s, opacity 0.12s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-md); }
.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--text); }

/* ─── Shell ─── */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg), var(--bg-mid) 50%, var(--bg));
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell.chat-open .sidebar { display: none; }
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  flex-shrink: 0;
}

.panel-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sidebar-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Bottom nav */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--nav-h);
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  padding: 0 4px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  margin: 6px 2px;
  transition: color 0.15s, background 0.15s;
}
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-item.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  font-weight: 600;
}

/* ─── Search & filters ─── */
.search-wrap {
  padding: 0 16px 10px;
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.search-wrap input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.search-wrap input::placeholder { color: var(--text-muted); }

.filters {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.filter-btn.active {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}

/* ─── List items ─── */
.list { flex: 1; }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.list-item:hover { background: rgba(255, 255, 255, 0.04); }
.list-item.active { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.list-item.system .list-item-title { color: var(--primary); }

.list-item-body { flex: 1; min-width: 0; }
.list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.list-item-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.list-item-sub {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  flex: 1;
}
.list-item-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Avatars */
.avatar {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  font-weight: 700;
  user-select: none;
}
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.avatar-system {
  background: #141622;
  border: 1px solid var(--border);
}
.avatar-system .pulse-mark {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ec8ff, #b44bff);
  opacity: 0.9;
}
.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--bg);
}

.section-label {
  padding: 10px 16px 6px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-weight: 600;
}
.search-results { border-top: 1px solid var(--border); margin-top: 4px; }

.empty-hint {
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 24px;
  font-size: 14px;
}

/* ─── Chat pane ─── */
.chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.chat-pane::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 50%),
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--secondary) 8%, transparent), transparent 35%),
    radial-gradient(circle at 15% 70%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 35%);
  pointer-events: none;
}

.chat-pane > * { position: relative; z-index: 1; }

.chat-pane.empty {
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 32px;
}
.empty-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 24px;
  background: #141622;
  box-shadow: 0 16px 48px color-mix(in srgb, var(--primary) 30%, transparent);
  position: relative;
}
.empty-logo::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ec8ff, #b44bff);
  opacity: 0.85;
}
.empty-state h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.empty-state p { margin: 0; color: var(--text-secondary); font-size: 14px; }

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header-info { flex: 1; min-width: 0; }
.chat-header-info strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.peer-status { font-size: 12px; color: var(--text-secondary); }
.peer-status.online { color: var(--online); }
.typing { font-size: 12px; color: var(--secondary); font-style: italic; }

.chat-header-actions { display: flex; gap: 6px; }

.mobile-back { display: none; }
@media (max-width: 900px) { .mobile-back { display: inline-flex; } }

/* Messages */
.messages {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg {
  max-width: min(68%, 520px);
  padding: 10px 14px 8px;
  border-radius: 18px 18px 18px 6px;
  background: var(--bubble-in);
  align-self: flex-start;
  border: 1px solid var(--border);
  animation: msg-in 0.2s ease;
}
.msg.mine {
  align-self: flex-end;
  background: var(--bubble-out);
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
}
.msg .meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 3px;
}
.msg.mine .meta { color: rgba(255, 255, 255, 0.55); }
.msg .text { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.45; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-image { max-width: 260px; border-radius: 12px; display: block; margin-top: 2px; }
.msg-sticker { width: 120px; height: 120px; object-fit: contain; }

.voice-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}

.reply-preview {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  border-left: 3px solid var(--secondary);
  padding-left: 8px;
  margin-bottom: 6px;
}

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.reaction-chip {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.msg-actions {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button {
  border: 0;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 7px;
  opacity: 0.8;
}
.msg-actions button:hover { opacity: 1; }

/* Composer */
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.reply-bar button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 20px; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}
.composer input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  min-height: 44px;
}
.composer input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

.icon-btn {
  border: 0;
  background: var(--surface-2);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--text); }
.icon-btn.accent { background: var(--gradient); color: white; }
.icon-btn.accent:hover { opacity: 0.9; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.composer .btn-send {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.composer .btn-send svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2.2; }

.sticker-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  max-height: 160px;
  overflow: auto;
  background: var(--surface);
}
.sticker-item {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 10px;
  transition: background 0.12s;
}
.sticker-item:hover { background: rgba(255, 255, 255, 0.08); }
.sticker-item img { width: 48px; height: 48px; object-fit: contain; }

.reaction-picker {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  z-index: 200;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.reaction-picker button {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.1s;
}
.reaction-picker button:hover { background: rgba(255, 255, 255, 0.08); }

/* Profile */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 0 12px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.profile-card-info strong { display: block; font-size: 16px; font-weight: 600; }
.profile-card-info span { font-size: 13px; color: var(--text-secondary); }

.profile-menu { padding: 0 12px 12px; }
.profile-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s;
}
.profile-item:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.profile-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.profile-item.danger { color: #fca5a5; }
.profile-section { margin: 16px 4px; }
.theme-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.theme-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s;
}
.theme-swatch:hover { transform: scale(1.08); }
.theme-swatch.active { border-color: white; box-shadow: 0 0 0 2px var(--primary); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--text-secondary); }
.small { font-size: 12px; }

label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 4px;
}
label input, label textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.profile-sub { padding: 8px 12px; }
.back-sub { margin-bottom: 12px; }

/* Admin */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 4px; }
.stat {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border);
}
.stat b { display: block; font-size: 22px; font-weight: 700; }
.stat span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--primary) 30%, transparent); font-weight: 600; }
.tag.ban { background: rgba(239, 68, 68, 0.3); }
.admin-list .admin-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.admin-actions button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
#admin-search {
  width: calc(100% - 8px);
  margin: 0 4px 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
}
#admin-refresh { margin: 0 4px 12px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 300;
  padding: 20px;
  animation: fade-in 0.2s ease;
}
.modal {
  width: min(420px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: slide-up 0.25s ease;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.modal input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  margin-bottom: 10px;
  font-family: inherit;
}
.modal-list { max-height: 240px; margin-bottom: 12px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Call overlay */
#call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.94);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: grid;
  place-items: center;
}
.call-card { text-align: center; padding: 32px; }
.call-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 15%, transparent);
}
.call-actions { display: flex; gap: 20px; justify-content: center; margin-top: 28px; }
.call-accept {
  background: var(--online) !important;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 24px;
  padding: 0;
}
.call-reject { background: var(--danger) !important; }
#remote-audio { display: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  z-index: 600;
  transition: transform 0.25s ease;
  box-shadow: var(--shadow);
  font-size: 14px;
  backdrop-filter: blur(12px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

.hidden { display: none !important; }
