* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0a0b0f;
  --bg-elevated: #14161d;
  --bg-elevated-2: #1c1f29;
  --border: #262a36;
  --accent: #6d5dfc;
  --accent-2: #8b7cff;
  --accent-gradient: linear-gradient(135deg, #6d5dfc 0%, #a855f7 100%);
  --text: #f2f2f5;
  --text-dim: #8b8d98;
  --text-faint: #55575f;
  --success: #34d399;
  --danger: #f0576a;
  --radius: 18px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

input, button, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---------- AUTH ---------- */

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(109,93,252,0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(168,85,247,0.14), transparent 45%),
    var(--bg);
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(109,93,252,0.4);
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 5px;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 8px 20px rgba(109,93,252,0.35);
  transition: transform 0.1s, opacity 0.15s;
}

.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { opacity: 0.6; }

.switch-mode {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.switch-mode b { color: var(--accent-2); font-weight: 600; }

.error-banner {
  background: rgba(240,87,106,0.12);
  border: 1px solid rgba(240,87,106,0.3);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: none;
}

.error-banner.show { display: block; }

/* ---------- BANNED SCREEN ---------- */

.banned-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.banned-box {
  text-align: center;
  max-width: 340px;
}

.banned-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.banned-box h1 {
  font-size: 22px;
  margin-bottom: 10px;
  color: var(--danger);
}

.banned-box p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ---------- CHAT LAYOUT ---------- */

.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.view.active { display: flex; }

/* -- list view -- */

.list-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.list-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.list-header-top h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.me-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.avatar.large { width: 76px; height: 76px; font-size: 26px; }
.avatar.small { width: 30px; height: 30px; font-size: 12px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.search-box input:focus { outline: none; border-color: var(--accent); }

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 15px;
  pointer-events: none;
}

.list-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.list-section-label {
  padding: 14px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.conv-item, .search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s;
}

.conv-item:active, .search-result-item:active { background: var(--bg-elevated); }

.conv-avatar-wrap { position: relative; flex-shrink: 0; }

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-faint);
  border: 2px solid var(--bg);
}

.status-dot.online { background: var(--success); }

.conv-body { flex: 1; min-width: 0; }

.conv-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.conv-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 4px; }

.group-badge { font-size: 12px; }

.conv-time { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }

.conv-preview {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
  color: var(--text-faint);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-size: 14px; }

/* -- chat view -- */

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:active { background: var(--bg-elevated-2); }

.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-weight: 700; font-size: 15px; }
.chat-header-status { font-size: 12px; color: var(--text-dim); }
.chat-header-status.online { color: var(--success); }

.messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}

.msg-row { display: flex; align-items: flex-start; position: relative; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }

.msg-swipe-wrap {
  display: flex;
  align-items: flex-start;
  max-width: 76%;
  position: relative;
  transition: transform 0.15s ease;
  touch-action: pan-y;
}

.msg-row.mine .msg-swipe-wrap { justify-content: flex-end; }

.msg-swipe-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -34px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated-2);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
}

.msg-row.mine .msg-swipe-icon { left: auto; right: -34px; }

.msg-swipe-wrap.swipe-active .msg-swipe-icon { opacity: 1; color: var(--accent-2); }

.msg {
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}

.msg.deleted {
  font-style: italic;
  opacity: 0.6;
}

.msg-sender {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 2px;
}

.msg-reply-preview {
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(0,0,0,0.15);
  cursor: pointer;
}

.msg.mine .msg-reply-preview { background: rgba(255,255,255,0.15); }

.msg-reply-line {
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent-2);
  flex-shrink: 0;
}

.msg-reply-body { min-width: 0; }

.msg-reply-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-2);
}

.msg.mine .msg-reply-name { color: #fff; opacity: 0.9; }

.msg-reply-text {
  font-size: 12.5px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edited-tag {
  font-size: 10px;
  opacity: 0.6;
  font-style: italic;
  margin-left: 6px;
}

.msg.mine {
  background: var(--accent-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.theirs {
  background: var(--bg-elevated-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg.system {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  margin: 6px auto;
  text-align: center;
}

.msg .time {
  display: inline-block;
  font-size: 10px;
  opacity: 0.65;
  margin-left: 8px;
  vertical-align: bottom;
}

.day-divider {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  margin: 14px 0 8px;
}

.reply-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.reply-bar.editing .reply-bar-line { background: var(--success); }

.reply-bar-line {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--accent-2);
  flex-shrink: 0;
}

.reply-bar-body { flex: 1; min-width: 0; }

.reply-bar-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
}

.reply-bar-text {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-bar-close {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 15px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.input-bar textarea {
  flex: 1;
  resize: none;
  max-height: 100px;
  padding: 11px 16px;
  border-radius: 22px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.input-bar textarea:focus { outline: none; border-color: var(--accent); }

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(109,93,252,0.4);
}

.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.4; box-shadow: none; }

.admin-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-gradient);
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

.connection-banner {
  text-align: center;
  font-size: 12px;
  padding: 6px;
  background: rgba(240,87,106,0.12);
  color: var(--danger);
  display: none;
}

.connection-banner.show { display: block; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- MODALS ---------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.show { display: flex; }

.modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}

@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 20px; }
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal-list {
  max-height: 220px;
  overflow-y: auto;
}

.modal-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-size: 14px;
  cursor: pointer;
}

.modal-list-item:active { background: var(--bg-elevated-2); border-radius: 10px; }

.profile-avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.profile-username {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
}

.secondary-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn:active { opacity: 0.8; }

.danger-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(240,87,106,0.35);
  background: rgba(240,87,106,0.1);
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
}

.text-btn {
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.modal-actions .text-btn { width: auto; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 14px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.chip-remove {
  cursor: pointer;
  color: var(--text-faint);
  font-size: 11px;
}

/* ---------- ATTACHMENTS ---------- */

.msg-attachment { margin-bottom: 4px; border-radius: 12px; overflow: hidden; }

.msg-attachment-image img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  display: block;
}

.msg-attachment-video video {
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  display: block;
  background: #000;
}

.round-bubble {
  background: transparent !important;
  padding: 0 !important;
}

.msg-attachment-round {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.msg-attachment-round video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.msg-attachment-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-width: 180px;
  cursor: pointer;
}

.voice-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.msg.theirs .voice-play-btn { background: var(--bg-elevated-2); color: var(--accent-2); }

.voice-wave {
  flex: 1;
  height: 20px;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px);
  opacity: 0.5;
  border-radius: 4px;
}

.voice-duration { font-size: 11.5px; opacity: 0.8; flex-shrink: 0; }

.msg-attachment-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-width: 180px;
  cursor: pointer;
  border-radius: 12px;
  background: rgba(0,0,0,0.15);
}

.msg.mine .msg-attachment-file { background: rgba(255,255,255,0.12); }

.file-icon { font-size: 24px; flex-shrink: 0; }
.file-info { min-width: 0; }
.file-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.file-size { font-size: 11px; opacity: 0.7; }

.views-tag {
  font-size: 10px;
  opacity: 0.65;
  margin-left: 6px;
}

.mention-tag {
  color: var(--accent-2);
  font-weight: 600;
}

.msg.mine .mention-tag { color: #fff; text-decoration: underline; }

/* ---------- ATTACH BAR / MENU ---------- */

.attach-btn { flex-shrink: 0; }

.attach-menu {
  display: none;
  position: absolute;
  bottom: 64px;
  left: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 150;
}

.attach-menu.show { display: block; }

.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
}

.attach-menu-item:active { background: var(--bg-elevated-2); }

.attach-menu-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.attach-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.attach-preview-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--bg-elevated-2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.attach-preview-body { flex: 1; min-width: 0; }
.attach-preview-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-preview-size { font-size: 11.5px; color: var(--text-dim); }

.voice-recording-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.voice-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-rec 1.2s infinite;
}

@keyframes pulse-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.voice-rec-time { font-weight: 700; font-size: 14px; flex-shrink: 0; }
.voice-rec-hint { font-size: 12px; color: var(--text-dim); }

.voice-btn { flex-shrink: 0; }

/* ---------- MENTION AUTOCOMPLETE ---------- */

.mention-popup {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 8px;
  right: 8px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 150;
}

.mention-popup.show { display: block; }

.mention-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
}

.mention-popup-item:active { background: var(--bg-elevated-2); }

/* ---------- REACTIONS ---------- */

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.msg-reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.msg.mine .msg-reaction { background: rgba(255,255,255,0.18); }

.msg-reaction.mine {
  background: var(--accent-2);
  color: #fff;
}

.msg-reaction-count { font-size: 11px; opacity: 0.85; }

.reaction-picker {
  display: none;
  position: fixed;
  z-index: 260;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.reaction-picker.show { display: block; }

.reaction-picker-emojis { display: flex; gap: 4px; }

.reaction-emoji-btn {
  font-size: 22px;
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.reaction-emoji-btn:active { transform: scale(1.3); }
.reaction-emoji-btn.selected { background: var(--bg-elevated-2); }

/* ---------- CONTEXT MENU ---------- */

.context-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 250;
  align-items: center;
  justify-content: center;
}

.context-menu-overlay.show { display: flex; }

.context-menu {
  width: 260px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

.context-menu-reactions {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.context-menu-item {
  padding: 13px 16px;
  font-size: 14.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.context-menu-item:last-child { border-bottom: none; }
.context-menu-item:active { background: var(--bg-elevated-2); }
.context-menu-item.danger { color: var(--danger); }

/* ---------- TABS (channel modal) ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg-elevated-2);
  border-radius: 12px;
  padding: 4px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}

.tab.active { background: var(--accent-gradient); color: #fff; }

.field-label-row {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.conv-tag {
  font-size: 11.5px;
  color: var(--accent-2);
}

.channel-subs-count {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
}
