@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #111114;
  --bg-card: #18181d;
  --bg-card-hover: #1f1f26;
  --border: #2a2a35;
  --border-bright: #3d3d50;
  --purple-primary: #7c3aed;
  --purple-light: #9d5ff3;
  --purple-glow: rgba(124, 58, 237, 0.3);
  --purple-subtle: rgba(124, 58, 237, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #9090a8;
  --text-muted: #55556a;
  --gray-100: #e8e8f0;
  --gray-400: #9090a8;
  --gray-600: #55556a;
  --gray-800: #2a2a35;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-bright);
}

.navbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.navbar-title span { color: var(--purple-light); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  display: block;
  padding: 0.4rem 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--text-primary);
  background: var(--purple-subtle);
}

.navbar-nav a.active { color: var(--purple-light); }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
}

.lang-btn.active {
  background: var(--purple-primary);
  color: #fff;
}

.btn-nav-auth {
  padding: 0.4rem 1rem;
  background: var(--purple-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-nav-auth:hover { background: var(--purple-light); transform: translateY(-1px); }

/* ─── PAGES ─── */
.page { display: none; padding-top: 64px; min-height: 100vh; }
.page.active { display: block; }

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 58, 237, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
}

#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 800px;
}

.hero-logo-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  position: relative;
}

.hero-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--purple-primary), transparent);
  opacity: 0.6;
  animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.03); }
}

.hero-logo {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border: 2px solid var(--border-bright);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-subtle);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--purple-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--purple-light);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-title .accent { color: var(--purple-light); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.75rem 2rem;
  background: var(--purple-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.25s;
  box-shadow: 0 0 24px var(--purple-glow);
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 0 36px var(--purple-glow);
}

.btn-outline {
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-block;
}

.btn-outline:hover {
  border-color: var(--purple-primary);
  color: var(--purple-light);
  background: var(--purple-subtle);
}

/* ─── PLATFORM BUTTONS ─── */
.platforms-section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.platforms-grid {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s;
  min-width: 180px;
}

.platform-btn:hover {
  border-color: var(--purple-primary);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--purple-primary);
}

.platform-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.platform-btn .platform-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.platform-btn .platform-name { font-size: 0.9rem; font-weight: 600; }
.platform-btn .platform-sub { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }

/* ─── PROJECTS PAGE ─── */
.page-header {
  padding: 3rem 2rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header h1 span { color: var(--purple-light); }

.page-header p { color: var(--text-secondary); margin-top: 0.5rem; }

.projects-grid {
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}

.project-card:hover {
  border-color: var(--purple-primary);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px var(--purple-primary), 0 0 40px rgba(124,58,237,0.1);
}

.project-banner {
  height: 140px;
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(124,58,237,0.3) 0%, transparent 70%);
}

.project-banner-icon {
  font-size: 3rem;
  position: relative;
  z-index: 1;
}

.project-body { padding: 1.25rem; }

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-purple { background: var(--purple-subtle); color: var(--purple-light); border: 1px solid rgba(124,58,237,0.3); }
.tag-gray { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

.project-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-project-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-project-link:hover {
  color: var(--purple-light);
  border-color: var(--purple-primary);
  background: var(--purple-subtle);
}

.btn-project-link img { width: 14px; height: 14px; border-radius: 3px; }

/* ─── CHAT PAGE ─── */
.chat-layout {
  display: flex;
  height: calc(100vh - 64px);
}

.chat-sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.chat-sidebar-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-channels {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.channel-group-label {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  margin: 0 0.5rem;
  transition: all 0.15s;
}

.channel-item:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.channel-item.active { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.channel-item .channel-hash { color: var(--text-muted); font-size: 1rem; }
.channel-item.active .channel-hash { color: var(--purple-light); }

.chat-user-bar {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.2);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--purple-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { font-size: 0.7rem; color: var(--success); }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chat-header .channel-hash { color: var(--text-muted); font-size: 1.1rem; }
.chat-header-name { font-weight: 700; font-size: 0.95rem; }
.chat-header-topic { color: var(--text-muted); font-size: 0.8rem; margin-left: 0.5rem; padding-left: 0.75rem; border-left: 1px solid var(--border); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg-group { display: flex; gap: 12px; padding: 4px 0; }
.msg-group:hover { background: rgba(255,255,255,0.015); border-radius: 6px; margin: 0 -8px; padding: 4px 8px; }

.msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--purple-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-content { flex: 1; min-width: 0; }

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.msg-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--purple-light);
}

.msg-author.owner { color: #f59e0b; }

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.msg-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

.system-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.system-msg::before, .system-msg::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.chat-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  transition: border-color 0.2s;
}

.chat-input-wrap:focus-within { border-color: var(--purple-primary); }

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  resize: none;
  max-height: 150px;
  line-height: 1.5;
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 32px; height: 32px;
  background: var(--purple-primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--purple-light); }
.chat-send-btn svg { width: 16px; height: 16px; }

/* ─── AUTH MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.1);
}

.modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.75rem;
}

.modal-logo img {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.modal-logo-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.modal-logo-name span { color: var(--purple-light); }

.modal h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.modal-sub { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.75rem; line-height: 1.5; }

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus { border-color: var(--purple-primary); }
.form-input::placeholder { color: var(--text-muted); }

.form-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 5px;
  display: none;
}

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

.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0.5rem 0;
}

.code-digit {
  width: 48px; height: 56px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.code-digit:focus { border-color: var(--purple-primary); }

.btn-full {
  width: 100%;
  padding: 0.75rem;
  background: var(--purple-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  margin-top: 0.5rem;
  box-shadow: 0 0 24px var(--purple-glow);
}

.btn-full:hover { background: var(--purple-light); }
.btn-full:disabled { opacity: 0.5; cursor: not-allowed; }

.modal-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.modal-switch a {
  color: var(--purple-light);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.modal-switch a:hover { text-decoration: underline; }

.modal-step { display: none; }
.modal-step.active { display: block; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 320px;
}

.toast.show { transform: translateX(0); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast-dot.success { background: var(--success); }
.toast-dot.error { background: var(--error); }
.toast-text { font-size: 0.85rem; color: var(--text-primary); }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a { color: var(--purple-light); text-decoration: none; }

/* ─── AUTH GATE for Chat ─── */
.auth-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 64px);
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.auth-gate h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-gate p { color: var(--text-secondary); font-size: 0.9rem; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar-nav { display: none; }
  .chat-sidebar { display: none; }
  .hero-title { font-size: 2rem; }
}

/* ═══════════════════════════════════════════════════════
   NEW FEATURES – v3
   ═══════════════════════════════════════════════════════ */

/* ── CONTEXT MENU ── */
.ctx-menu {
  position: fixed;
  z-index: 9000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  min-width: 180px;
  padding: 4px 0;
  animation: ctx-in .1s ease;
}
@keyframes ctx-in { from { opacity:0; transform:scale(.95) translateY(-4px); } to { opacity:1; transform:none; } }

.ctx-item {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
  user-select: none;
}
.ctx-item:hover { background: var(--bg-hover, rgba(255,255,255,.06)); }
.ctx-item.danger { color: var(--error, #ef4444); }
.ctx-item.danger:hover { background: rgba(239,68,68,.1); }

.ctx-separator {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}

/* ── EDIT BAR ── */
.edit-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 5px 14px;
  background: rgba(124,58,237,.15);
  border-top: 1px solid rgba(124,58,237,.35);
  font-size: 0.78rem;
  color: var(--purple-light, #a78bfa);
  gap: 8px;
}
.edit-bar button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .15s;
}
.edit-bar button:hover { background: rgba(255,255,255,.08); color: var(--text-primary); }

/* ── CUSTOM DELETE CONFIRM ── */
.custom-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
}
.custom-confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: confirm-in .18s ease;
}
@keyframes confirm-in { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:none; } }
.custom-confirm-icon { font-size: 2.2rem; margin-bottom: .6rem; }
.custom-confirm-title { font-family: 'Space Grotesk',sans-serif; font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.custom-confirm-sub { color: var(--text-secondary); font-size: .85rem; margin-bottom: 1.4rem; }
.custom-confirm-actions { display: flex; gap: .75rem; }
.btn-primary.danger { background: var(--error, #ef4444); }
.btn-primary.danger:hover { background: #dc2626; }

/* ── MARKDOWN HEADINGS ── */
.msg-text .md-h1 { font-family: 'Space Grotesk',sans-serif; font-size: 1.4rem; font-weight: 700; margin: .4rem 0 .2rem; line-height: 1.25; color: var(--text-primary); }
.msg-text .md-h2 { font-family: 'Space Grotesk',sans-serif; font-size: 1.15rem; font-weight: 700; margin: .35rem 0 .15rem; color: var(--text-primary); }
.msg-text .md-h3 { font-family: 'Space Grotesk',sans-serif; font-size: 1rem; font-weight: 600; margin: .3rem 0 .1rem; color: var(--text-secondary); }

/* ── DM PANEL ── */
.dm-panel {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 340px;
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.45);
  z-index: 800;
  flex-direction: column;
  animation: dm-in .2s ease;
}
@keyframes dm-in { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }

.dm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
.dm-partner-avatar,
.dm-partner-avatar-img {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.dm-partner-name { font-weight: 700; font-size: .88rem; }
.dm-close-btn {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .85rem;
  padding: 3px 6px; border-radius: 4px;
  transition: background .15s, color .15s;
}
.dm-close-btn:hover { background: rgba(255,255,255,.07); color: var(--text-primary); }

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dm-msg { display: flex; flex-direction: column; }
.dm-msg-row { display: flex; gap: 8px; align-items: flex-start; }
.dm-msg-own .dm-msg-row { flex-direction: row-reverse; }
.dm-msg-bubble {
  background: var(--bg-secondary);
  border-radius: 12px 12px 12px 2px;
  padding: 7px 11px;
  max-width: 230px;
  font-size: .84rem;
  line-height: 1.45;
}
.dm-msg-own .dm-msg-bubble {
  background: rgba(124,58,237,.28);
  border-radius: 12px 12px 2px 12px;
}
.dm-msg-meta { font-size: .72rem; color: var(--text-muted); margin-bottom: 2px; display: flex; gap: 6px; align-items: baseline; }

.dm-input-row {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.dm-input-row .chat-input { flex: 1; min-height: 34px; font-size: .84rem; }
.dm-input-row .chat-send-btn { padding: 0 10px; font-size: .9rem; }

/* ── msg-actions edit button ── */
.msg-action-btn { font-size: .85rem; }

@media (max-width: 600px) {
  .dm-panel { right: 0; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

/* ═══════════════════════════════════════════
   v4 ADDITIONS
═══════════════════════════════════════════ */

/* ── CONTEXT MENU redesign ── */
.ctx-menu {
  position: fixed; z-index: 9000;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.65), 0 2px 8px rgba(0,0,0,.4);
  min-width: 200px; padding: 5px 0;
  animation: ctx-in .12s cubic-bezier(.16,1,.3,1);
}
@keyframes ctx-in { from { opacity:0; transform:scale(.94) translateY(-6px); } to { opacity:1; transform:none; } }
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: .875rem; font-weight: 500;
  color: var(--text-primary); cursor: pointer;
  border-radius: 6px; margin: 1px 4px;
  transition: background .1s;
}
.ctx-item:hover { background: rgba(124,58,237,.18); }
.ctx-item.danger { color: #f87171; }
.ctx-item.danger:hover { background: rgba(239,68,68,.15); }
.ctx-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.ctx-sep { height: 1px; background: rgba(255,255,255,.07); margin: 4px 8px; }
.ctx-header { padding: 6px 14px; font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; cursor: default; }

/* ── CHANNEL BADGES (unread) ── */
.ch-badge {
  margin-left: auto; flex-shrink: 0;
  border-radius: 50px; font-size: .7rem; font-weight: 700;
  line-height: 1;
}
.ch-badge.unread {
  width: 8px; height: 8px; background: var(--error, #ef4444); border-radius: 50%;
}
.ch-badge.ping {
  background: var(--error, #ef4444); color: #fff;
  padding: 2px 5px; min-width: 16px; text-align: center;
}
.channel-item { display: flex; align-items: center; }

/* ── MENTIONS ── */
.mention {
  background: rgba(124,58,237,.22); color: #a78bfa;
  border-radius: 4px; padding: 0 4px; font-weight: 600;
  cursor: pointer;
}
.mention:hover { background: rgba(124,58,237,.38); }
.mention-everyone { background: rgba(239,68,68,.2); color: #fca5a5; }
.mention-me { background: rgba(251,191,36,.15); color: #fbbf24; }
.msg-mentioned { background: rgba(251,191,36,.05); border-left: 3px solid #fbbf24 !important; }

/* ── MENTION DROPDOWN ── */
.mention-dropdown {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.5);
  max-height: 200px; overflow-y: auto; z-index: 500;
}
.mention-item {
  padding: 9px 14px; cursor: pointer; font-size: .875rem;
  color: var(--text-primary);
  transition: background .1s;
}
.mention-item:hover { background: rgba(124,58,237,.18); }

/* ── ATTACHMENTS ── */
.msg-attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.att-image-wrap { max-width: 400px; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.att-image { max-width: 100%; max-height: 300px; object-fit: cover; display: block; transition: opacity .15s; }
.att-image:hover { opacity: .9; }
.att-file {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; max-width: 340px;
  text-decoration: none; color: var(--text-primary);
  transition: background .15s;
}
.att-file:hover { background: var(--bg-hover, rgba(255,255,255,.06)); }
.att-icon { font-size: 1.5rem; flex-shrink: 0; }
.att-info { flex: 1; min-width: 0; }
.att-name { display: block; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-size { font-size: .75rem; color: var(--text-muted); }
.att-dl { color: var(--text-muted); font-size: .9rem; flex-shrink: 0; }

/* ── EMOJI PICKER redesign ── */
#emoji-picker {
  position: fixed; z-index: 8000; display: none;
  width: 340px; max-height: 380px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  flex-direction: column; overflow: hidden;
}
.ep-search-wrap { padding: 10px 10px 6px; }
.ep-search {
  width: 100%; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; color: var(--text-primary); font-size: .85rem;
  outline: none; box-sizing: border-box;
}
.ep-search:focus { border-color: var(--purple-primary); }
.ep-body { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.ep-cat-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 4px 4px; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ep-btn {
  background: none; border: none; font-size: 1.3rem; padding: 5px;
  cursor: pointer; border-radius: 6px; line-height: 1; transition: background .1s;
}
.ep-btn:hover { background: rgba(124,58,237,.2); }

/* ── ATTACH BUTTON ── */
#attach-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--text-muted); padding: 0 6px; transition: color .15s; }
#attach-btn:hover { color: var(--text-primary); }


/* ═══════════════════════════════════════════
   v4 FIXES
═══════════════════════════════════════════ */

/* ── AVATAR IMAGES (were missing) ── */
.msg-avatar-img,
.member-avatar-img,
.profile-avatar-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.member-avatar-img { width: 32px; height: 32px; }
.profile-avatar-img { width: 80px; height: 80px; }

/* ── DELETE CONFIRM — always centered ── */
.custom-confirm-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
}
.custom-confirm-overlay.show { display: flex !important; }
.custom-confirm-box {
  position: relative;
  width: 90%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.7);
  animation: confirm-in .18s cubic-bezier(.16,1,.3,1);
}

/* ── EMOJI PICKER — fixed positioning ── */
#emoji-picker {
  position: fixed !important;
  z-index: 9800 !important;
}

/* ── CONTEXT MENU — better hover states ── */
.ctx-item {
  transition: background .08s, color .08s;
  border-radius: 6px;
  margin: 1px 4px;
}
.ctx-item:hover {
  background: rgba(124,58,237,.22) !important;
  color: #fff !important;
}
.ctx-item.danger:hover {
  background: rgba(239,68,68,.18) !important;
  color: #fca5a5 !important;
}

/* ── SIDEBAR USER BAR — clickable logout area ── */
.chat-user-bar { position: relative; }
.user-bar-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 8px; right: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  padding: 6px;
  z-index: 2000;
  animation: ctx-in .12s cubic-bezier(.16,1,.3,1);
}
.user-bar-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: .875rem; font-weight: 500;
  color: var(--text-primary); transition: background .1s;
}
.user-bar-menu-item:hover { background: rgba(255,255,255,.07); }
.user-bar-menu-item.danger { color: #f87171; }
.user-bar-menu-item.danger:hover { background: rgba(239,68,68,.12); }

/* ── DM NOTIFICATION BADGE ── */
.dm-inbox-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted);
  padding: 0 6px; transition: color .15s;
}
.dm-inbox-btn:hover { color: var(--text-primary); }
.dm-inbox-btn .dm-badge {
  position: absolute; top: -4px; right: -2px;
  background: var(--error, #ef4444); color: #fff;
  border-radius: 50px; font-size: .65rem; font-weight: 700;
  padding: 1px 4px; min-width: 14px; text-align: center;
  line-height: 1.4;
}

/* ── DM INBOX PANEL ── */
.dm-inbox-panel {
  position: fixed;
  bottom: 0; right: 20px;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.1);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  z-index: 850;
  display: none;
  flex-direction: column;
  max-height: 420px;
  animation: dm-in .2s ease;
}
.dm-inbox-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.07);
  font-weight: 700; font-size: .9rem;
}
.dm-inbox-list { flex: 1; overflow-y: auto; }
.dm-inbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background .1s;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.dm-inbox-item:hover { background: rgba(255,255,255,.05); }
.dm-inbox-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--purple-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dm-inbox-info { flex: 1; min-width: 0; }
.dm-inbox-name { font-size: .875rem; font-weight: 600; }
.dm-inbox-last { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-inbox-unread {
  background: var(--purple-primary); color: #fff;
  border-radius: 50px; font-size: .7rem; font-weight: 700;
  padding: 2px 6px; flex-shrink: 0;
}

/* ── DM PANEL moved right when inbox open ── */
.dm-panel { right: 20px !important; }

/* ── MENTION DROPDOWN positioning fix ── */
.mention-dropdown {
  position: absolute !important;
  bottom: 100% !important;
  left: 0; right: 0;
  z-index: 600 !important;
  margin-bottom: 4px;
}
.chat-input-wrap { position: relative !important; }

/* ── EDIT BAR ── */
.edit-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(124,58,237,.15);
  border-top: 2px solid rgba(124,58,237,.5);
  font-size: .8rem;
  color: #a78bfa;
  gap: 8px;
  border-radius: 8px 8px 0 0;
  margin: 0 8px;
}
.edit-bar.visible { display: flex; }
.edit-bar button {
  background: none; border: 1px solid rgba(124,58,237,.4);
  color: #a78bfa; cursor: pointer; font-size: .78rem;
  padding: 3px 8px; border-radius: 6px; transition: all .15s;
}
.edit-bar button:hover { background: rgba(124,58,237,.2); color: #fff; }

/* ═══════════════════════════════════════════
   v5 — FIXES & NEW FEATURES
═══════════════════════════════════════════ */

/* ── MEMBER AVATAR (was missing, caused wrong display) ── */
.member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.member-avatar-wrap {
  position: relative; flex-shrink: 0;
}
.member-status {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.member-status.online  { background: #22c55e; }
.member-status.idle    { background: #f59e0b; }
.member-status.dnd     { background: #ef4444; }
.member-status.offline { background: #6b7280; }

/* ── FILE PREVIEW IN CHAT ── */
.att-preview-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.att-img-preview {
  position: relative; border-radius: 10px; overflow: hidden;
  max-width: 300px; cursor: zoom-in;
  border: 1px solid rgba(255,255,255,.08);
}
.att-img-preview img {
  display: block; max-width: 300px; max-height: 250px;
  object-fit: cover; transition: opacity .15s;
}
.att-img-preview:hover img { opacity: .9; }
.att-img-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  font-size: .75rem; color: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: space-between;
}
.att-dl-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  border-radius: 6px; padding: 3px 8px; cursor: pointer;
  font-size: .75rem; font-weight: 600; transition: background .15s;
  text-decoration: none;
}
.att-dl-btn:hover { background: rgba(255,255,255,.28); }

.att-file-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 12px 14px;
  max-width: 380px;
}
.att-file-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.att-file-info { flex: 1; min-width: 0; }
.att-file-name {
  font-size: .875rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-primary);
}
.att-file-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.att-file-dl {
  background: rgba(124,58,237,.2); border: 1px solid rgba(124,58,237,.4);
  color: #a78bfa; border-radius: 8px; padding: 6px 12px;
  cursor: pointer; font-size: .8rem; font-weight: 600;
  transition: all .15s; white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}
.att-file-dl:hover { background: rgba(124,58,237,.35); color: #fff; }

/* ── DOWNLOAD WARNING MODAL ── */
.dl-warn-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.8); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
.dl-warn-overlay.show { display: flex; }
.dl-warn-box {
  background: var(--bg-card); border: 1px solid rgba(255,165,0,.3);
  border-radius: 16px; padding: 2rem; max-width: 400px; width: 90%;
  text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.7);
  animation: confirm-in .18s cubic-bezier(.16,1,.3,1);
}
.dl-warn-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.dl-warn-title { font-family:'Space Grotesk',sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.dl-warn-file {
  background: rgba(255,165,0,.1); border: 1px solid rgba(255,165,0,.2);
  border-radius: 8px; padding: 8px 12px; margin: .75rem 0;
  font-size: .85rem; color: #fbbf24; font-weight: 600; word-break: break-all;
}
.dl-warn-text { font-size: .85rem; color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.5; }
.dl-warn-actions { display: flex; gap: .75rem; }

/* ── EMOJI PICKER v2 — text-based ── */
.ep-tabs {
  display: flex; overflow-x: auto; gap: 2px;
  padding: 6px 8px 0; border-bottom: 1px solid rgba(255,255,255,.06);
  scrollbar-width: none;
}
.ep-tabs::-webkit-scrollbar { display: none; }
.ep-tab {
  background: none; border: none; cursor: pointer;
  padding: 6px 8px; border-radius: 6px 6px 0 0; font-size: 1rem;
  opacity: .5; transition: opacity .15s, background .15s;
  white-space: nowrap; flex-shrink: 0;
}
.ep-tab:hover { opacity: .8; background: rgba(255,255,255,.05); }
.ep-tab.active { opacity: 1; background: rgba(124,58,237,.2); }

/* ── FORUM CHANNEL ── */
.forum-container { padding: 1.5rem; max-width: 860px; }
.forum-header { margin-bottom: 1.5rem; }
.forum-threads { display: flex; flex-direction: column; gap: 10px; }
.forum-thread-card {
  background: var(--bg-card); border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; padding: 1rem 1.25rem;
  cursor: pointer; transition: all .15s;
  display: flex; gap: 14px; align-items: flex-start;
}
.forum-thread-card:hover {
  border-color: rgba(124,58,237,.4);
  background: rgba(124,58,237,.05);
  transform: translateY(-1px);
}
.forum-thread-thumb {
  width: 56px; height: 56px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
  background: rgba(124,58,237,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.forum-thread-body { flex: 1; min-width: 0; }
.forum-thread-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.forum-thread-desc { font-size: .85rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-thread-meta { font-size: .75rem; color: var(--text-muted); margin-top: 6px; display: flex; gap: 12px; align-items: center; }
.forum-thread-reactions { display: flex; gap: 4px; margin-top: 6px; }
.forum-reaction-pill {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 3px 8px; font-size: .8rem;
  cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 4px;
}
.forum-reaction-pill:hover, .forum-reaction-pill.reacted {
  background: rgba(124,58,237,.2); border-color: rgba(124,58,237,.5); color: #a78bfa;
}
.forum-new-thread-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--purple-primary), #6366f1);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: opacity .15s; margin-bottom: 1.25rem;
}
.forum-new-thread-btn:hover { opacity: .85; }

/* Thread detail */
.thread-detail { display: flex; flex-direction: column; height: 100%; }
.thread-detail-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
}
.thread-back-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; padding: 4px 8px;
  border-radius: 6px; transition: all .15s;
}
.thread-back-btn:hover { background: rgba(255,255,255,.07); color: var(--text-primary); }
.thread-detail-title { font-weight: 700; font-size: 1.05rem; }
.thread-detail-messages { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.thread-input-area {
  padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; gap: 8px;
}

/* ── DM FULLSCREEN MODE ── */
.dm-panel.fullscreen {
  position: fixed !important;
  inset: 64px 0 0 0 !important;
  width: 100% !important;
  max-height: none !important;
  height: calc(100vh - 64px) !important;
  border-radius: 0 !important;
  border: none !important;
  right: 0 !important;
  bottom: 0 !important;
}
.dm-panel.fullscreen .dm-messages { max-height: none; flex: 1; }

/* ── MENTION DROPDOWN ── */
.mention-item { display: flex; align-items: center; gap: 8px; }
.mention-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
