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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a26;
  --bg-hover: #222233;
  --bg-active: #2a2a3d;
  --accent: #7c3aed;
  --accent-hover: #8b5cf6;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #606078;
  --border: #2a2a3d;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --online: #22c55e;
  --offline: #606078;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--accent-glow); }
  50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(124,58,237,0.1); }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.08) 0%, transparent 60%);
}

.auth-container {
  width: 400px;
  padding: 48px 40px;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 80px rgba(124,58,237,0.05);
  animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.auth-logo .eclipse-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e, var(--accent));
  margin: 0 auto 16px;
  position: relative;
  box-shadow: 0 0 30px var(--accent-glow);
}

.auth-logo .eclipse-icon::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--bg-tertiary), var(--bg-primary));
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-tab:hover:not(.active) {
  background: var(--bg-tertiary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
  display: none;
}

.auth-error.visible {
  display: block;
}

/* ==================== MAIN LAYOUT ==================== */
.app-layout {
  display: none;
  height: 100vh;
  background: var(--bg-primary);
}

.app-layout.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

/* Server strip (Discord-style icon bar) */
.server-strip {
  width: 72px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.server-strip::-webkit-scrollbar { width: 0; }

.server-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  position: relative;
  transition: border-radius 0.2s ease, background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.server-icon:hover {
  border-radius: 16px;
  background: var(--accent);
  color: white;
}

.server-icon.active {
  border-radius: 16px;
  background: var(--accent);
  color: white;
}

.server-icon.active::before {
  content: '';
  position: absolute;
  left: -14px;
  width: 4px;
  height: 36px;
  background: white;
  border-radius: 0 4px 4px 0;
}

.server-icon:hover::before {
  content: '';
  position: absolute;
  left: -14px;
  width: 4px;
  height: 20px;
  background: white;
  border-radius: 0 4px 4px 0;
}

.server-icon.active:hover::before {
  height: 36px;
}

.server-icon.home-icon {
  background: var(--bg-tertiary);
}

.server-icon.home-icon.active {
  background: var(--accent);
}

.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-strip-separator {
  width: 32px;
  height: 2px;
  background: var(--border);
  margin: 4px 0;
  flex-shrink: 0;
}

.server-icon-add {
  background: var(--bg-tertiary);
  color: var(--success);
  font-size: 24px;
  font-weight: 300;
}

.server-icon-add:hover {
  background: var(--success);
  color: white;
}

/* Channel items */
.channel-item {
  padding: 6px 12px !important;
  min-height: 36px !important;
}

.category-header {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.category-header:hover {
  color: var(--text-primary) !important;
}

.cat-toggle {
  font-size: 9px;
  display: inline-block;
  width: 10px;
  transition: transform 0.15s;
}

/* Settings tabs */
.settings-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.settings-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-tab.active {
  background: var(--accent);
  color: white;
}

.server-settings-modal input[type="text"],
.server-settings-modal input[type="color"],
.server-settings-modal select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  display: flex;
  gap: 2px;
  padding: 12px;
}

.nav-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-btn svg { width: 20px; height: 20px; }

.nav-btn.active {
  background: var(--bg-active);
  color: var(--accent);
}

.nav-btn:hover:not(.active) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 12px 8px;
}

/* Friend / Chat items */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  animation: fadeIn 0.3s ease;
}

.list-item:hover {
  background: var(--bg-hover);
}

.list-item.active {
  background: var(--bg-active);
}

.user-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
  z-index: 1000;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu-item:hover {
  background: var(--bg-hover);
}

.user-menu-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.user-menu-item.danger {
  color: var(--danger);
}

.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

.list-item.has-unread {
  background: rgba(234, 179, 8, 0.08);
}

.unread-badge {
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.server-icon .unread-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  border: 2px solid var(--bg-primary);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  position: relative;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  position: absolute;
  bottom: -1px;
  right: -1px;
}

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

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* User section at bottom of sidebar */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-actions {
  display: flex;
  gap: 6px;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .username {
  font-size: 14px;
  font-weight: 600;
}

.sidebar-user .user-status {
  font-size: 12px;
  color: var(--success);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn svg { width: 18px; height: 18px; }

.add-person-row:hover { background: var(--bg-hover); }

/* ==================== CHAT AREA ==================== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: fadeIn 0.3s ease;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
}

.chat-header-info h3 {
  font-size: 16px;
  font-weight: 600;
}

.chat-header-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-header .secure-badge {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(34,197,94,0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message {
  padding: 4px 0;
}
.message.msg-new {
  animation: messageIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.message-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 4px;
}

.message-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-hover);
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.message-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  padding-left: 50px;
  word-wrap: break-word;
}

.message-content img.sticker {
  max-width: 128px;
  max-height: 128px;
  border-radius: 8px;
}

.message-content .emoji-large {
  font-size: 40px;
  line-height: 1.2;
}

/* File attachment in messages */
.file-attachment {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  max-width: 360px;
  cursor: pointer;
}

.file-attachment:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(124,58,237,0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* Media containers (video/audio) */
.media-container {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 480px;
}

.media-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.media-header .file-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-header .file-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.media-download-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: var(--transition);
}

.media-download-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.audio-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(124,58,237,0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Image container - no header, fits image */
.image-container {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 480px;
  position: relative;
  display: inline-block;
}

.image-container .media-header {
  display: none;
}

.media-image {
  display: block;
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.2s ease;
}

.image-container:hover .media-image {
  filter: brightness(0.85);
}

.image-container .image-hover-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border-radius: var(--radius);
}

.image-container:hover .image-hover-overlay {
  opacity: 1;
}

.image-hover-overlay .image-dl-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  pointer-events: all;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.image-hover-overlay .image-dl-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}

/* Image lightbox / fullscreen viewer */
.image-lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: fadeIn 0.2s ease;
  cursor: zoom-out;
}

.image-lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-lightbox .lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
}

.image-lightbox .lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

.image-lightbox .lightbox-download {
  position: absolute;
  bottom: 24px;
  right: 24px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.image-lightbox .lightbox-download:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.media-video {
  width: 100%;
  display: block;
  max-height: 360px;
  background: #000;
}

.media-audio {
  width: 100%;
  display: block;
  padding: 8px 14px 12px;
  outline: none;
}

/* Style the audio element */
.media-audio::-webkit-media-controls-panel {
  background: var(--bg-tertiary);
}

/* Typing indicator */
.typing-indicator {
  padding: 4px 24px 4px 74px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 24px;
  transition: var(--transition);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Message input */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  transition: var(--transition);
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
  padding: 4px 0;
}

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

.input-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.input-actions button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.input-actions button:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
}

.send-btn {
  background: var(--accent) !important;
  color: white !important;
  border-radius: 8px !important;
}

.send-btn:hover {
  background: var(--accent-hover) !important;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 16px;
  animation: fadeIn 0.5s ease;
}

.empty-state .eclipse-logo-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e, var(--accent));
  position: relative;
  animation: glow 3s ease infinite;
}

.empty-state .eclipse-logo-large::after {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--bg-tertiary), var(--bg-primary));
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  max-width: 300px;
  text-align: center;
  line-height: 1.5;
}

/* ==================== MODAL / POPUP ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal .form-group { margin-bottom: 16px; }

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

/* ==================== STICKER / EMOJI PICKER ==================== */
.picker-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  width: 320px;
  max-height: 360px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.picker-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.picker-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.picker-content {
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}

.picker-content.stickers-grid {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.emoji-item, .sticker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 22px;
}

.emoji-item:hover, .sticker-item:hover {
  background: var(--bg-hover);
  transform: scale(1.15);
}

.sticker-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* ==================== FRIEND REQUESTS ==================== */
.request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  animation: fadeIn 0.3s ease;
}

.request-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* ==================== ADMIN PANEL ==================== */
/* Floating admin panel window */
.admin-float {
  position: fixed;
  z-index: 900;
  width: 480px;
  max-width: calc(100vw - 24px);
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
  overflow: hidden;
}

.admin-float.minimized {
  max-height: none;
  height: auto !important;
  width: 220px;
}

.admin-float.minimized .admin-float-body {
  display: none;
}

.admin-float-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.admin-float-titlebar:active {
  cursor: grabbing;
}

.admin-float-titlebar h3 {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.admin-float-titlebar .admin-win-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 16px;
  line-height: 1;
}

.admin-float-titlebar .admin-win-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.admin-float-titlebar .admin-win-btn.close-btn:hover {
  background: var(--danger);
  color: white;
}

.admin-float-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.admin-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.admin-card h4 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-card .form-group {
  margin-bottom: 10px;
}

.admin-card input {
  font-size: 13px;
}

/* Link embeds */
.link-embed {
  margin-top: 8px;
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px;
  max-width: 420px;
  display: flex;
  gap: 12px;
  overflow: hidden;
}

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

.link-embed-site {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.link-embed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-embed-title:hover {
  text-decoration: underline;
}

.link-embed-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.link-embed-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

/* Loading screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loading-content .eclipse-logo-large {
  margin: 0 auto;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Bot Builder blocks */
.block-card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: fadeIn 0.2s ease;
}

.block-card input,
.block-card select {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
}

.block-card .action-block input {
  background: var(--bg-secondary);
}

.block-card button:hover {
  filter: brightness(1.2);
}

/* Onboarding */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(124,58,237,0.2), rgba(10,10,15,0.95));
  backdrop-filter: blur(8px);
  z-index: 99996;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.onboarding-card {
  max-width: 460px;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-icon {
  font-size: 56px;
  margin-bottom: 12px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes crateSpin {
  0%   { transform: rotateY(0deg) scale(0.6); }
  10%  { transform: rotateY(360deg) scale(1); }
  40%  { transform: rotateY(1800deg) scale(1.1); }
  75%  { transform: rotateY(3240deg) scale(1.15); }
  90%  { transform: rotateY(3420deg) scale(1.25); }
  100% { transform: rotateY(3600deg) scale(0); opacity: 0; }
}

/* ==================== CRATE REVEAL ==================== */
.crate-modal {
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
}
.crate-status {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 600;
  margin-bottom: 14px;
}
.crate-reel-outer {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-primary);
  padding: 14px 0;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.5);
}
.crate-reel-strip {
  display: flex;
  will-change: transform;
}
.crate-reel-item {
  flex: 0 0 84px;
  height: 96px;
  margin: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.crate-reel-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 40%);
  pointer-events: none;
}
.crate-pointer {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}
.crate-pointer::before,
.crate-pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}
.crate-pointer {
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.crate-pointer::before {
  top: -7px;
  border-top: 8px solid currentColor;
  filter: drop-shadow(0 0 4px currentColor);
}
.crate-pointer::after {
  bottom: -7px;
  border-bottom: 8px solid currentColor;
  filter: drop-shadow(0 0 4px currentColor);
}
.crate-fade-left, .crate-fade-right {
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  pointer-events: none;
  z-index: 1;
}
.crate-fade-left { left: 0; background: linear-gradient(90deg, var(--bg-primary) 0%, transparent 100%); }
.crate-fade-right { right: 0; background: linear-gradient(-90deg, var(--bg-primary) 0%, transparent 100%); }
.crate-result-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 14px;
}
.crate-result-rarity {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-top: 4px;
}
.crate-result-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.onboarding-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.onboarding-body {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 24px;
}

.onboarding-body p {
  margin-bottom: 10px;
}

.onboarding-body p:last-child {
  margin-bottom: 0;
}

.onboarding-body strong {
  color: var(--text-primary);
}

.onboarding-body kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  color: var(--accent-hover);
  font-weight: 600;
  margin: 0 2px;
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  transition: all 0.3s;
}

.onboarding-dot.done {
  background: var(--accent);
  opacity: 0.5;
}

.onboarding-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

.onboarding-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.onboarding-actions .btn {
  min-width: 120px;
}

/* Notice popup (friendly info) */
.notice-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.notice-popup {
  max-width: 440px;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 0 40px rgba(124,58,237,0.25), 0 12px 40px rgba(0,0,0,0.5);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notice-popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(124,58,237,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hover);
}

.notice-popup h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notice-popup-from {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.notice-popup-from strong {
  color: var(--text-secondary);
}

.notice-popup-message {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 280px;
  overflow-y: auto;
}

.notice-popup .btn {
  min-width: 140px;
}

/* Warning popup (blocking) */
.warning-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.warning-popup {
  max-width: 520px;
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--warning);
  border-radius: 16px;
  padding: 40px 32px 32px;
  text-align: center;
  box-shadow: 0 0 80px rgba(245,158,11,0.4), 0 20px 60px rgba(0,0,0,0.6);
  animation: warningShake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes warningShake {
  0%, 100% { transform: translateX(0) scale(1); }
  10% { transform: translateX(-8px) scale(0.98); }
  20% { transform: translateX(8px) scale(1.01); }
  30% { transform: translateX(-6px) scale(0.99); }
  40% { transform: translateX(6px) scale(1); }
  50% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.warning-popup-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(245,158,11,0.15);
  border: 2px solid var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  animation: warningPulse 1.5s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
  50% { box-shadow: 0 0 0 20px rgba(245,158,11,0); }
}

.warning-popup h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--warning);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.warning-popup-from {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.warning-popup-from strong {
  color: var(--text-primary);
}

.warning-popup-message {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 28px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.warning-popup .btn {
  min-width: 200px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .warning-popup {
    padding: 32px 20px 24px;
  }
  .warning-popup-icon {
    width: 96px;
    height: 96px;
  }
  .warning-popup-icon svg {
    width: 64px;
    height: 64px;
  }
  .warning-popup h1 {
    font-size: 28px;
  }
}

/* Ban / kick screens */
.ban-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(239,68,68,0.15), transparent 60%), var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  animation: fadeIn 0.4s ease;
}

.ban-screen.kick-screen {
  background: radial-gradient(ellipse at top, rgba(245,158,11,0.15), transparent 60%), var(--bg-primary);
}

.ban-screen-content {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ban-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  border: 2px solid rgba(239,68,68,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  animation: banPulse 2s ease-in-out infinite;
}

.ban-icon.kick-icon {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
  color: var(--warning);
}

@keyframes banPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 16px rgba(239,68,68,0); }
}

.kick-icon {
  animation: kickPulse 2s ease-in-out infinite;
}

@keyframes kickPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 0 16px rgba(245,158,11,0); }
}

.ban-screen h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.ban-reason {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 28px;
  padding: 0 16px;
}

.ban-details {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  text-align: left;
}

.ban-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.ban-detail-item:last-child {
  border-bottom: none;
}

.ban-detail-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.ban-detail-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.ban-screen-content .btn {
  min-width: 180px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .ban-screen-content {
    padding: 36px 20px;
  }
  .ban-icon {
    width: 96px;
    height: 96px;
  }
  .ban-icon svg {
    width: 72px;
    height: 72px;
  }
  .ban-screen h1 {
    font-size: 22px;
  }
}

/* Members panel */
.members-panel {
  width: 240px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
  overflow-y: auto;
  flex-direction: column;
}

.members-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.members-panel-header h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin: 0;
}

.members-role-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 12px 16px 4px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.member-item:hover {
  background: var(--bg-hover);
}

.member-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.member-item:hover .member-actions {
  opacity: 1;
}

.member-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
}

.member-action-btn:hover {
  background: var(--bg-active);
  color: var(--accent);
}

.member-action-btn.kick-btn:hover {
  color: var(--danger);
}

/* Mod terminal */
.mod-float {
  width: 520px;
  height: 400px;
  max-height: 90vh;
  resize: both;
  overflow: hidden;
  min-width: 320px;
  min-height: 200px;
}

.mod-term-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0c0c0c;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  min-height: 0;
  overflow: hidden;
}

.mod-term-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  line-height: 1.6;
  color: #d4d4d4;
  -webkit-overflow-scrolling: touch;
}

.mod-term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.mod-term-input-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid #1e1e1e;
  background: #0c0c0c;
  gap: 6px;
  flex-shrink: 0;
}

.mod-term-prompt {
  color: #22c55e;
  font-weight: 700;
  flex-shrink: 0;
}

.mod-term-input-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

.mod-term-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #f59e0b;
  font: inherit;
  caret-color: #f59e0b;
  position: relative;
  z-index: 1;
}

.mod-term-ghost {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  white-space: pre;
  color: #7a6520;
  font: inherit;
  z-index: 0;
}

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 350px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

.toast.hiding {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ==================== UPLOAD PROGRESS ==================== */
.upload-progress {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 280px;
  box-shadow: var(--shadow);
  z-index: 500;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-progress .upload-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress .upload-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress .upload-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 0.2s ease;
  width: 0%;
}

.upload-progress .upload-percent {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

/* ==================== MESSAGE ACTIONS ==================== */
.message {
  position: relative;
}

.message:hover .msg-actions,
.message:focus-within .msg-actions {
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.msg-actions {
  position: absolute;
  top: -4px;
  right: 8px;
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  opacity: 0.4;
  pointer-events: all;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
  z-index: 10;
}

.msg-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.msg-action-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.msg-action-btn[data-action="delete"]:hover {
  color: var(--danger);
}

/* ==================== REACTIONS ==================== */
.reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 50px;
  margin-top: 4px;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
}

.reaction-pill:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.reaction-pill.mine {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* Reaction picker popup */
.reaction-picker {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  gap: 2px;
  box-shadow: var(--shadow);
  z-index: 200;
  animation: scaleIn 0.15s ease;
}

.reaction-quick {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.reaction-quick:hover {
  background: var(--bg-hover);
  transform: scale(1.2);
}

/* ==================== REPLY ==================== */
.reply-quote {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 4px 50px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.reply-bar {
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.reply-author {
  font-weight: 600;
  color: var(--accent);
}

.reply-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.reply-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.reply-preview-bar .reply-bar {
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.reply-cancel {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.reply-cancel:hover {
  color: var(--danger);
}

/* ==================== PIN INDICATOR ==================== */
.pin-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 50px;
  font-size: 11px;
  color: var(--warning);
  margin-bottom: 2px;
}

/* ==================== THEME OPTION ==================== */
.theme-option {
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.theme-option:hover {
  background: var(--bg-hover);
}

.theme-option.active {
  background: var(--bg-active);
}

/* ==================== FRIEND CHECKBOX ==================== */
.friend-checkbox-label:hover {
  background: var(--bg-hover);
}

.friend-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ==================== SCREENSHARE ==================== */
.screenshare-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2500;
  pointer-events: none;
}

.screenshare-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 640px;
  max-width: calc(100vw - 48px);
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.3);
  pointer-events: all;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  resize: both;
  min-width: 320px;
  min-height: 200px;
}

.screenshare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  cursor: grab;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.screenshare-header:active {
  cursor: grabbing;
}

.screenshare-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.screenshare-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.screenshare-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.screenshare-fullscreen-btn,
.screenshare-pip-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.screenshare-fullscreen-btn:hover,
.screenshare-pip-btn:hover {
  background: rgba(255,255,255,0.2);
}

.screenshare-stop-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: var(--danger);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.screenshare-stop-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

#screenshareVideo {
  width: 100%;
  flex: 1;
  background: #000;
  display: block;
  min-height: 0;
  object-fit: contain;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  /* ---- Layout: overlapping panels with slide transitions ---- */
  .app-layout.active {
    position: relative;
    overflow: hidden;
  }

  .server-strip {
    display: none;
  }

  .members-panel {
    display: none !important;
  }

  .sidebar {
    width: 100% !important;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 50;
    animation: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .sidebar.mobile-hidden {
    transform: translateX(-100%);
    pointer-events: none;
  }

  .chat-area {
    width: 100%;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    will-change: transform, opacity;
  }

  .chat-area.mobile-hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
  }

  /* ---- Mobile back button ---- */
  .mobile-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 4px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-back-btn:active {
    background: var(--bg-hover);
  }

  /* ---- Sidebar header ---- */
  .sidebar-header {
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0));
  }

  .sidebar-header h2 {
    font-size: 22px;
  }

  /* ---- Bottom tab bar (replaces inline sidebar nav) ---- */
  .sidebar-nav {
    order: 99;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 4px 0;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0));
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-radius: 0;
    gap: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  }

  .nav-btn {
    padding: 6px 4px 4px;
    font-size: 11px;
    border-radius: 0;
    gap: 2px;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
  }

  .nav-btn svg { width: 22px; height: 22px; }

  .nav-btn.active {
    background: transparent;
    color: var(--accent);
  }

  .nav-btn.active::after {
    content: '';
    display: none;
  }

  .nav-btn:hover:not(.active) {
    background: transparent;
  }

  .nav-btn:active {
    opacity: 0.7;
  }

  /* ---- Sidebar content: leave room for bottom tabs ---- */
  .sidebar-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  /* ---- User profile section above tabs ---- */
  .sidebar-user {
    padding: 10px 16px;
    gap: 8px;
    margin-bottom: 56px; /* space for bottom tabs */
  }

  .sidebar-user-profile {
    gap: 10px;
  }

  .sidebar-user-profile .avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .sidebar-user .username {
    font-size: 13px;
  }

  .sidebar-user .user-status {
    font-size: 11px;
  }

  .sidebar-user-actions {
    gap: 4px;
  }

  .sidebar-user .icon-btn {
    width: 34px;
    height: 34px;
  }

  .sidebar-user .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  /* ---- List items: bigger touch targets ---- */
  .list-item {
    padding: 12px 16px;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
  }

  .list-item:active {
    background: var(--bg-active);
  }

  .list-item-name {
    font-size: 15px;
  }

  .list-item-sub {
    font-size: 13px;
  }

  /* ---- Chat header ---- */
  .chat-header {
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0));
    gap: 10px;
  }

  .chat-header .avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .chat-header-info h3 {
    font-size: 15px;
    line-height: 1.2;
  }

  .chat-header-info span {
    font-size: 11px;
  }

  .chat-header .icon-btn {
    width: 34px;
    height: 34px;
  }

  .chat-header .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .chat-header .btn-sm {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* ---- Chat messages ---- */
  .chat-messages {
    padding: 8px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .message-group-header {
    margin-top: 12px;
  }

  .message-group-header .avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .message-author {
    font-size: 13px;
  }

  .message-content {
    padding-left: 42px;
    font-size: 15px;
  }

  /* ---- Message actions: long-press bottom sheet ---- */
  .msg-actions {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0;
    pointer-events: none;
    display: none;
    z-index: 200;
  }

  .message.mobile-actions-open .msg-actions {
    display: flex;
    opacity: 1;
    pointer-events: all;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    gap: 8px;
    justify-content: center;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .message.mobile-actions-open .msg-actions .msg-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
  }

  .message.mobile-actions-open .msg-actions .msg-action-btn svg {
    width: 20px;
    height: 20px;
  }

  .message.mobile-actions-open .msg-actions .msg-action-btn:active {
    background: var(--bg-active);
    color: var(--accent);
  }

  .message.mobile-actions-open .msg-actions .msg-action-btn[data-action="delete"]:active {
    color: var(--danger);
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Overlay behind bottom sheet */
  .mobile-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    animation: fadeIn 0.2s ease;
  }

  /* ---- Chat input ---- */
  .chat-input-area {
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
  }

  .chat-input-wrapper {
    padding: 4px 6px;
    gap: 4px;
    border-radius: 22px;
  }

  .chat-input-wrapper textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 8px 4px;
    min-height: 36px;
  }

  .input-actions {
    gap: 0;
  }

  .input-actions button {
    width: 34px;
    height: 34px;
  }

  .send-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
  }

  /* ---- Modals → bottom sheets ---- */
  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    width: 100vw;
    max-width: 100vw;
    padding: 20px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--bg-active);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  .modal h3 {
    font-size: 18px;
    text-align: center;
  }

  .modal-actions {
    gap: 8px;
  }

  .modal-actions .btn {
    flex: 1;
    min-height: 44px;
  }

  /* ---- Picker (emoji/sticker) ---- */
  .picker-popup {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100% !important;
    max-height: 50vh;
    border-radius: 16px 16px 0 0 !important;
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 150 !important;
  }

  /* ---- Toasts ---- */
  .toast-container {
    top: auto;
    bottom: calc(70px + env(safe-area-inset-bottom, 0));
    right: 12px;
    left: 12px;
  }

  .toast {
    max-width: 100%;
    border-radius: 12px;
  }

  /* ---- Media ---- */
  .image-container {
    max-width: 100%;
  }

  .media-container {
    max-width: 100%;
  }

  .media-image {
    max-height: 280px;
  }

  .file-attachment {
    max-width: 100%;
  }

  /* Upload progress */
  .upload-progress {
    bottom: calc(70px + env(safe-area-inset-bottom, 0));
    right: 12px;
    left: 12px;
    min-width: 0;
  }

  /* Sticker */
  .message-content img.sticker {
    max-width: 96px;
    max-height: 96px;
  }

  /* Reactions */
  .reactions-row {
    padding-left: 42px;
  }

  /* Screenshare */
  .screenshare-container {
    bottom: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  /* Admin floating panel */
  .admin-float {
    top: 0 !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0;
  }

  .admin-float.minimized {
    top: auto !important;
    bottom: 0 !important;
    width: 160px !important;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  /* Auth screen */
  .auth-container {
    width: 100vw;
    max-width: 100vw;
    padding: 32px 24px;
    padding-top: calc(32px + env(safe-area-inset-top, 0));
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .auth-logo h1 {
    font-size: 28px;
  }

  .auth-container input {
    min-height: 44px;
    font-size: 16px;
  }

  .auth-container .btn {
    min-height: 48px;
    font-size: 16px;
  }

  /* Hide hint text */
  .chat-input-area + div[style*="font-size:10px"],
  div[style*="font-size:10px"][style*="opacity:0.5"] {
    display: none;
  }

  /* Reply preview */
  .reply-preview {
    max-width: 150px;
  }

  .reply-quote {
    padding-left: 42px;
  }

  /* Empty state */
  .empty-state {
    padding: 32px 24px;
  }

  .empty-state h3 {
    font-size: 18px;
  }

  /* Secure badge */
  .secure-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Download banner */
  #downloadBanner {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .sidebar-user-actions .icon-btn:not(#logoutBtn):not(#notifMuteBtn) {
    display: none;
  }

  .input-actions button:not(.send-btn):not(#emojiBtn) {
    display: none;
  }

  .chat-header-info h3 {
    font-size: 14px;
  }
}

/* ---- Landscape mobile ---- */
@media (max-width: 768px) and (orientation: landscape) {
  .chat-messages {
    padding: 6px 16px;
  }

  .sidebar-nav {
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0));
  }

  .modal {
    max-height: 90vh;
  }
}
