/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 15px; }

/* ── Theme variables ──────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #181c24;
  --bg3: #1e2330;
  --bg4: #252b3a;
  --border: #2a3045;
  --text: #e8eaf0;
  --text2: #9aa0b4;
  --text3: #5c6480;
  --accent: #5b7fff;
  --accent-hover: #7090ff;
  --accent-text: #ffffff;
  --danger: #e05c5c;
  --danger-hover: #f07070;
  --success: #3ecf8e;
  --warning: #f0a030;
  --shadow: rgba(0,0,0,0.5);
  --pill-direct: #2d3f6b;
  --pill-group: #2d4a3a;
  --pill-channel: #4a2d5a;
  --online: #3ecf8e;
  --away: #f0a030;
  --dnd: #e05c5c;
}
[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #ffffff;
  --bg3: #e8eaf2;
  --bg4: #dde0ee;
  --border: #c8cce0;
  --text: #1a1d2e;
  --text2: #4a5070;
  --text3: #8890b0;
  --accent: #3d5fff;
  --accent-hover: #2a4aee;
  --accent-text: #ffffff;
  --danger: #cc3333;
  --danger-hover: #aa2222;
  --success: #22a86b;
  --warning: #d08000;
  --shadow: rgba(0,0,0,0.15);
  --pill-direct: #c8d4f8;
  --pill-group: #c8ecd8;
  --pill-channel: #e8c8f4;
  --online: #22a86b;
  --away: #d08000;
  --dnd: #cc3333;
}

body { background: var(--bg); color: var(--text); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Typography helpers ───────────────────────────────────────────────────── */
.muted { color: var(--text2); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  background: var(--accent);
  color: var(--accent-text);
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

button.secondary { background: var(--bg4); color: var(--text); }
button.secondary:hover { background: var(--border); color: var(--text); }

button.secondary-2 { background: var(--pill-channel); color: var(--text); }
button.secondary-2:hover { background: var(--border); color: var(--text); }

button.ghost-button { background: transparent; color: var(--text2); border: 1px solid var(--border); }
button.ghost-button:hover { background: var(--bg3); color: var(--text); border-color: var(--text3); }

button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: var(--danger-hover); }

button.icon-btn {
  background: transparent;
  color: var(--text2);
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
}
button.icon-btn:hover { background: var(--bg3); color: var(--text); }

/* ── Inputs ───────────────────────────────────────────────────────────────── */
input, textarea, select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 60px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text2); }
label input, label textarea, label select { margin-top: 2px; }

/* ── View shell ───────────────────────────────────────────────────────────── */
.view { min-height: 100vh; }

/* ── Auth ─────────────────────────────────────────────────────────────────── */
#authView { display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 8px 32px var(--shadow); }
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; }
.brand h1 { font-size: 24px; font-weight: 700; }
.brand p { font-size: 13px; color: var(--text2); margin-top: 2px; }
.version-pill { background: var(--bg3); color: var(--text3); font-size: 11px; padding: 2px 8px; border-radius: 20px; display: inline-block; margin-top: 4px; }
.theme-row { display: flex; justify-content: flex-end; }
.tabs { display: flex; gap: 4px; background: var(--bg3); border-radius: 10px; padding: 4px; }
.tab { flex: 1; background: transparent; color: var(--text2); border-radius: 7px; padding: 7px; font-size: 14px; }
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab:hover:not(.active) { background: var(--bg4); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form button[type="submit"] { margin-top: 4px; width: 100%; padding: 10px; font-size: 15px; }
.error { background: rgba(224,92,92,0.15); border: 1px solid var(--danger); color: var(--danger); border-radius: 8px; padding: 10px 14px; font-size: 13px; }

/* ── App shell ────────────────────────────────────────────────────────────── */
#chatView { height: 100vh; overflow: hidden; }
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar { width: 290px; min-width: 220px; max-width: 320px; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); gap: 8px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.sidebar-brand strong { font-size: 15px; }

.profile-chip { display: flex; align-items: center; gap: 10px; background: transparent; color: var(--text); border-radius: 0; padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; width: 100%; }
.profile-chip:hover { background: var(--bg3); }
.profile-chip > div:last-child { font-size: 14px; font-weight: 500; min-width: 0; }

.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.sidebar-actions button { font-size: 12px; padding: 7px 8px; }
.span-all { grid-column: 1 / -1; }

.search-bar-wrap { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.search-bar-wrap input { font-size: 13px; padding: 7px 10px; }

.filter-tabs { display: flex; gap: 2px; padding: 6px 14px 2px; overflow-x: auto; }
.filter-tab { background: transparent; color: var(--text2); font-size: 12px; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.filter-tab.active { background: var(--accent); color: var(--accent-text); }
.filter-tab:hover:not(.active) { background: var(--bg3); color: var(--text); }

.folders-section { padding: 6px 14px 0; }
.folders-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.folder-chip { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text2); }
.folder-chip:hover { background: var(--bg3); color: var(--text); }
.folder-chip.active { background: var(--bg4); color: var(--text); }

.chats-list { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.chat-item { display: block; width: 100%; background: transparent; color: var(--text); border-radius: 0; padding: 10px 14px; text-align: left; border-bottom: 1px solid transparent; }
.chat-item:hover { background: var(--bg3); }
.chat-item.active { background: var(--bg4); border-left: 3px solid var(--accent); }
.chat-item-head { display: flex; align-items: center; gap: 10px; }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-row { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.chat-item-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-meta { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.type-pill { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-top: 3px; background: var(--bg3); color: var(--text3); }
.type-pill[data-type="direct"] { background: var(--pill-direct); }
.type-pill[data-type="group"] { background: var(--pill-group); }
.type-pill[data-type="channel"] { background: var(--pill-channel); }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar { border-radius: 50%; background: var(--bg4); color: var(--text2); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 28px; }
.avatar-wrap { position: relative; display: inline-block; }
.presence-dot { position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg2); }
.presence-dot.online { background: var(--online); }
.presence-dot.away { background: var(--away); }
.presence-dot.dnd { background: var(--dnd); }
.presence-dot.offline { background: var(--text3); }

/* ── Main area ────────────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: var(--bg2); border-bottom: 1px solid var(--border); gap: 12px; min-height: 62px; flex-shrink: 0; }
.chat-header-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.chat-header-main h2 { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-main .muted { font-size: 12px; }
.chat-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.chat-header-actions button { font-size: 12px; padding: 6px 10px; }

.pinned-bar { background: var(--bg3); border-bottom: 1px solid var(--border); padding: 6px 18px; font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; }
.pinned-bar:hover { background: var(--bg4); }

.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text2); }
.empty-logo { width: 80px; height: 80px; object-fit: contain; opacity: 0.3; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text2); }
.empty-state p { font-size: 14px; }

.chat-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.notice { padding: 8px 18px; font-size: 12px; color: var(--text2); background: var(--bg3); border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.messages { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.message { padding: 6px 10px; border-radius: 10px; max-width: 72%; position: relative; }
.message.me { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 3px; }
.message.them { align-self: flex-start; background: var(--bg2); border-bottom-left-radius: 3px; }
.message.deleted { opacity: 0.5; font-style: italic; }
.message-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; font-size: 11px; }
.message-head { display: flex; align-items: center; gap: 6px; }
.message-head strong { font-size: 12px; cursor: pointer; }
.message-head strong:hover { text-decoration: underline; }
.message.me .message-top { color: rgba(255,255,255,0.7); }
.message.them .message-top { color: var(--text2); }
.message-body { font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.message-body code { background: rgba(0,0,0,0.2); padding: 1px 5px; border-radius: 4px; font-family: monospace; font-size: 12px; }
.message-body pre { background: rgba(0,0,0,0.25); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 6px 0; }
.message-body pre code { background: none; padding: 0; }
.message.them .message-body code { background: var(--bg3); }
.message.them .message-body pre { background: var(--bg3); }
.message-edited { font-size: 10px; opacity: 0.6; margin-top: 2px; }
.message-actions { display: none; position: absolute; top: -12px; right: 6px; background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 4px; gap: 2px; flex-direction: row; box-shadow: 0 2px 8px var(--shadow); }
.message:hover .message-actions { display: flex; }
.message-actions button { background: transparent; border: none; padding: 3px 5px; font-size: 14px; color: var(--text2); border-radius: 14px; }
.message-actions button:hover { background: var(--bg3); color: var(--text); }

.reply-preview { background: rgba(0,0,0,0.15); border-left: 3px solid rgba(255,255,255,0.4); border-radius: 4px; padding: 4px 8px; margin-bottom: 5px; font-size: 12px; }
.message.them .reply-preview { background: var(--bg3); border-left-color: var(--accent); }

.reactions-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction-chip { display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 2px 7px; font-size: 13px; cursor: pointer; border: 1px solid transparent; }
.reaction-chip:hover { border-color: var(--accent); }
.reaction-chip.mine { background: rgba(91,127,255,0.3); border-color: var(--accent); }
.reaction-chip .count { font-size: 11px; color: inherit; }
.message.them .reaction-chip { background: var(--bg3); }

.forward-tag { font-size: 11px; opacity: 0.7; margin-bottom: 3px; font-style: italic; }

.typing-indicator { padding: 4px 18px; font-size: 12px; color: var(--text3); height: 20px; flex-shrink: 0; }

/* ── Attachment cards ─────────────────────────────────────────────────────── */
.attachment-card { margin-top: 6px; border-radius: 8px; overflow: hidden; }
.attachment-preview { max-width: 280px; max-height: 320px; display: block; border-radius: 8px; cursor: pointer; object-fit: cover; width: 100%; }
.attachment-preview:hover { opacity: 0.9; }
.file-chip { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.2); padding: 10px 14px; border-radius: 8px; font-size: 13px; text-decoration: none; color: inherit; }
.file-chip:hover { background: rgba(0,0,0,0.3); }
.file-chip-icon { font-size: 22px; }
.file-chip-info { min-width: 0; }
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.file-chip-size { font-size: 11px; opacity: 0.7; }
.message.them .file-chip { background: var(--bg3); }

/* ── Poll card ────────────────────────────────────────────────────────────── */
.poll-card { background: rgba(0,0,0,0.15); border-radius: 10px; padding: 12px 14px; margin-top: 6px; min-width: 220px; }
.message.them .poll-card { background: var(--bg3); }
.poll-question { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.poll-option { margin-bottom: 8px; cursor: pointer; }
.poll-bar-wrap { background: rgba(0,0,0,0.2); border-radius: 6px; height: 6px; margin-top: 3px; overflow: hidden; }
.message.them .poll-bar-wrap { background: var(--bg4); }
.poll-bar { background: var(--accent); height: 100%; border-radius: 6px; transition: width 0.3s; }
.poll-option-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.poll-option.voted .poll-option-row { font-weight: 600; }

/* ── Composer ─────────────────────────────────────────────────────────────── */
.composer-wrap { border-top: 1px solid var(--border); background: var(--bg2); padding: 10px 14px; flex-shrink: 0; }
.reply-bar { display: flex; align-items: center; justify-content: space-between; background: var(--bg3); border-radius: 7px; padding: 6px 10px; margin-bottom: 8px; font-size: 12px; color: var(--text2); }
.reply-bar button { background: transparent; border: none; padding: 0 4px; color: var(--text3); font-size: 16px; }
.composer { display: flex; flex-direction: column; gap: 6px; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer-row textarea { flex: 1; min-height: 40px; max-height: 140px; resize: none; font-size: 14px; padding: 9px 12px; border-radius: 10px; }
.composer-row button { flex-shrink: 0; padding: 9px 12px; font-size: 13px; }
.composer-extras { display: flex; gap: 4px; flex-wrap: wrap; }
.composer-extras button { font-size: 12px; padding: 5px 10px; }

/* ── Call overlay ─────────────────────────────────────────────────────────── */
#callOverlay { position: fixed; inset: 0; background: rgba(10,12,20,0.96); z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
#callOverlay.hidden { display: none !important; }
.call-header-text { color: #fff; font-size: 18px; font-weight: 600; opacity: 0.8; }
.call-tiles { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 900px; }
.call-tile { background: var(--bg3); border-radius: 16px; width: 200px; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; position: relative; overflow: hidden; border: 2px solid transparent; transition: border-color 0.2s; }
.call-tile.speaking { border-color: var(--success); }
.call-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call-tile-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.call-tile-name { color: #fff; font-size: 13px; font-weight: 600; background: rgba(0,0,0,0.5); padding: 2px 10px; border-radius: 12px; }
.call-tile-muted { font-size: 14px; }
.call-controls { display: flex; gap: 12px; align-items: center; }
.call-btn { width: 54px; height: 54px; border-radius: 50%; font-size: 20px; display: flex; align-items: center; justify-content: center; padding: 0; border: none; }
.call-btn.mute { background: var(--bg4); color: var(--text); }
.call-btn.mute:hover { background: var(--border); }
.call-btn.mute.active { background: var(--warning); color: #fff; }
.call-btn.video-btn { background: var(--bg4); color: var(--text); }
.call-btn.video-btn:hover { background: var(--border); }
.call-btn.video-btn.active { background: var(--warning); color: #fff; }
.call-btn.screen { background: var(--bg4); color: var(--text); }
.call-btn.screen:hover { background: var(--border); }
.call-btn.screen.active { background: var(--accent); color: #fff; }
.call-btn.hangup { background: var(--danger); color: #fff; }
.call-btn.hangup:hover { background: var(--danger-hover); }
#remoteAudios { display: none; }

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 2000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox.hidden { display: none !important; }
#lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }

/* ── Dialogs ──────────────────────────────────────────────────────────────── */
dialog { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 0; color: var(--text); max-width: 480px; width: 90vw; box-shadow: 0 16px 48px var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,0.6); }
.dialog-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dialog-card h3 { font-size: 18px; font-weight: 700; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 0; list-style: none; margin-top: 4px; }
.dialog-section { display: flex; flex-direction: column; gap: 10px; }
.dialog-section-title { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ── Profile dialog ───────────────────────────────────────────────────────── */
.profile-dialog-top { display: flex; align-items: center; gap: 16px; }
.profile-stat { font-size: 12px; color: var(--text2); }
.profile-bio { font-size: 14px; color: var(--text); background: var(--bg3); border-radius: 8px; padding: 10px 12px; }
.profile-actions { display: flex; gap: 8px; }

/* ── Settings ─────────────────────────────────────────────────────────────── */
.settings-tabs { display: flex; gap: 4px; background: var(--bg3); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.settings-tab { flex: 1; min-width: 70px; background: transparent; color: var(--text2); border-radius: 7px; padding: 6px 10px; font-size: 13px; }
.settings-tab.active { background: var(--accent); color: var(--accent-text); }
.settings-tab:hover:not(.active) { background: var(--bg4); color: var(--text); }
.settings-pane { display: flex; flex-direction: column; gap: 14px; }
.settings-pane.hidden { display: none !important; }
.session-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg3); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.session-item.current { border: 1px solid var(--accent); }

/* ── Media tab ────────────────────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.media-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; }
.media-thumb:hover { opacity: 0.85; }

/* ── Search overlay ───────────────────────────────────────────────────────── */
#searchOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
#searchOverlay.hidden { display: none !important; }
.search-panel { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; width: 90vw; max-width: 560px; overflow: hidden; box-shadow: 0 16px 48px var(--shadow); }
.search-panel input { border: none; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 16px; padding: 16px 18px; }
.search-results { max-height: 420px; overflow-y: auto; }
.search-section-title { padding: 10px 16px 4px; font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
.search-result-item:hover { background: var(--bg3); }
.search-result-name { font-size: 14px; font-weight: 500; }
.search-result-sub { font-size: 12px; color: var(--text2); }

/* ── Channel directory ────────────────────────────────────────────────────── */
.channel-dir-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.channel-dir-item:last-child { border-bottom: none; }

/* ── App footer ───────────────────────────────────────────────────────────── */
.app-footer { padding: 6px 18px; font-size: 11px; color: var(--text3); border-top: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
.app-footer a { color: var(--text3); text-decoration: none; }
.app-footer a:hover { color: var(--text2); }

/* ── Emoji picker ─────────────────────────────────────────────────────────── */
.emoji-quick { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 4px 8px; box-shadow: 0 4px 16px var(--shadow); }
.emoji-quick button { background: transparent; border: none; font-size: 18px; padding: 2px 4px; border-radius: 6px; }
.emoji-quick button:hover { background: var(--bg3); }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.span-all { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: auto; }

@media (max-width: 640px) {
  .sidebar { width: 100%; position: absolute; z-index: 100; height: 100vh; transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .call-tile { width: 140px; height: 110px; }
}
