/* ===================================================
   ChatApp — Apple-inspired Design System
   Inspired by macOS Sonoma / iOS 17 HIG
   =================================================== */

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

/* --- CSS Variables — Apple Dark Palette --- */
:root {
  /* Backgrounds (iOS Dark) */
  --bg-primary:        #000000;
  --bg-secondary:      #1C1C1E;
  --bg-tertiary:       #2C2C2E;
  --bg-quaternary:     #3A3A3C;
  --bg-elevated:       #1C1C1E;

  /* Glass / Vibrancy */
  --glass-bg:          rgba(28, 28, 30, 0.72);
  --glass-border:      rgba(255, 255, 255, 0.08);
  --glass-hover:       rgba(255, 255, 255, 0.04);

  /* Apple Blue */
  --accent:            #0A84FF;
  --accent-hover:      #409CFF;
  --accent-light:      rgba(10, 132, 255, 0.15);
  --accent-gradient:   linear-gradient(135deg, #0A84FF 0%, #5E5CE6 100%);

  /* Text */
  --text-primary:      rgba(255, 255, 255, 0.92);
  --text-secondary:    rgba(235, 235, 245, 0.60);
  --text-tertiary:     rgba(235, 235, 245, 0.30);
  --text-placeholder:  rgba(235, 235, 245, 0.25);

  /* Separators */
  --separator:         rgba(84, 84, 88, 0.65);
  --separator-subtle:  rgba(84, 84, 88, 0.30);

  /* Message Bubbles */
  --bubble-sent:       #0A84FF;
  --bubble-received:   #3A3A3C;

  /* Sidebar */
  --sidebar-width:     280px;

  /* Radius */
  --radius-sm:         8px;
  --radius-md:         12px;
  --radius-lg:         18px;
  --radius-xl:         22px;
  --radius-pill:       100px;

  /* Shadows */
  --shadow-sm:         0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.6);
  --shadow-md:         0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-lg:         0 20px 60px rgba(0,0,0,0.7);
  --shadow-glow:       0 0 0 3px rgba(10, 132, 255, 0.35);

  /* Transitions */
  --ease-spring:       cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-fast:     150ms;
  --duration-normal:   250ms;
  --duration-slow:     400ms;

  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* --- Scrollbar (macOS style) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ===================================================
   AUTH PAGES (Login / Register)
   =================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

/* Animated background orbs */
.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.15) 0%, transparent 70%);
  top: -200px; right: -100px;
  animation: float-orb 8s ease-in-out infinite;
  pointer-events: none;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 92, 230, 0.12) 0%, transparent 70%);
  bottom: -150px; left: -100px;
  animation: float-orb 10s ease-in-out infinite reverse;
  pointer-events: none;
}

@keyframes float-orb {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 400px;
  margin: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: card-enter 0.5s var(--ease-spring);
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0.75rem;
}

.auth-logo-icon {
  width: 48px; height: 48px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.4);
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.auth-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  text-align: center;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-form { display: flex; flex-direction: column; gap: 0.875rem; }

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
  outline: none;
}

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

.form-input:focus {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.06);
  box-shadow: var(--shadow-glow);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) ease;
  box-shadow: 0 4px 15px rgba(10, 132, 255, 0.35);
  letter-spacing: -0.01em;
}

.btn-primary:hover { opacity: 0.9; box-shadow: 0 6px 20px rgba(10, 132, 255, 0.45); }
.btn-primary:active { transform: scale(0.97); opacity: 0.85; }

.auth-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: var(--radius-md);
  color: #FF453A;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--separator-subtle);
}
.auth-divider span { font-size: 0.8rem; color: var(--text-tertiary); }

.auth-link {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.auth-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-fast) ease;
}
.auth-link a:hover { color: var(--accent-hover); }

/* ===================================================
   CHAT APP LAYOUT
   =================================================== */

.chat-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: rgba(28, 28, 30, 0.85);
  border-right: 1px solid var(--separator-subtle);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--separator-subtle);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3);
}

.sidebar-brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.sidebar-section-title {
  padding: 1.25rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.625rem;
  overflow-y: auto;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring);
  position: relative;
  user-select: none;
}

.room-item:hover { background: var(--glass-hover); }
.room-item:active { transform: scale(0.98); }

.room-item.active {
  background: var(--accent-light);
}

.room-item.active .room-name { color: var(--accent); font-weight: 600; }

.room-emoji {
  font-size: 1.125rem;
  width: 32px; height: 32px;
  background: var(--bg-quaternary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.room-item:hover .room-emoji { transform: scale(1.1); }
.room-item.active .room-emoji { background: var(--accent-light); }

.room-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Footer (user) */
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--separator-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.user-status {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.725rem; color: var(--text-tertiary);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #30D158; /* Apple Green */
  box-shadow: 0 0 5px rgba(48, 209, 88, 0.6);
}

.logout-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.logout-btn:hover { background: rgba(255, 69, 58, 0.12); color: #FF453A; }

/* --- Main Chat Area --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--separator-subtle);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.chat-header-icon {
  font-size: 1.25rem;
  width: 38px; height: 38px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.chat-header-info { flex: 1; }
.chat-header-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.chat-header-members { font-size: 0.775rem; color: var(--text-tertiary); }

/* --- Messages Area --- */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scroll-behavior: smooth;
}

.messages-container.no-scroll-behavior { scroll-behavior: auto; }

.load-more-sentinel {
  height: 1px;
  flex-shrink: 0;
}

.load-more-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  gap: 0.5rem;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* Message bubble */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 2px 0;
  animation: msg-in 0.3s var(--ease-spring);
}
.msg-row.sent { flex-direction: row-reverse; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Group consecutive messages */
.msg-row.grouped { padding-top: 1px; }
.msg-row.grouped .msg-avatar { visibility: hidden; }

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  align-self: flex-end;
}

.msg-content-wrap { max-width: 65%; display: flex; flex-direction: column; gap: 2px; }
.msg-row.sent .msg-content-wrap { align-items: flex-end; }

.msg-username {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  padding: 0 6px;
  margin-bottom: 1px;
}
.msg-row.sent .msg-username { display: none; }

.msg-bubble {
  padding: 0.55rem 0.875rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
  position: relative;
}

/* Received bubble */
.msg-row:not(.sent) .msg-bubble {
  background: var(--bubble-received);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

/* Sent bubble */
.msg-row.sent .msg-bubble {
  background: var(--bubble-sent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Image bubble */
.msg-bubble.image-bubble {
  padding: 3px;
  background: transparent;
  border: 1px solid var(--separator);
  overflow: hidden;
}
.msg-bubble.image-bubble img {
  max-width: 280px;
  max-height: 300px;
  object-fit: contain;
  border-radius: 15px;
  display: block;
  cursor: pointer;
  transition: opacity var(--duration-fast) ease;
}
.msg-bubble.image-bubble img:hover { opacity: 0.92; }

.msg-time {
  font-size: 0.675rem;
  color: var(--text-tertiary);
  padding: 0 6px;
  margin-top: 1px;
}
.msg-row.sent .msg-time { text-align: right; }

/* Date separator */
.date-separator {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}
.date-separator::before, .date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--separator-subtle);
}
.date-separator span {
  font-size: 0.725rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  background: var(--bg-tertiary);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--separator-subtle);
}

/* Typing indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  min-height: 28px;
  flex-shrink: 0;
}

.typing-indicator.visible { display: flex; animation: fade-in 0.2s ease; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: bounce-dot 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* --- Input Bar --- */
.input-bar {
  padding: 0.875rem 1.25rem 1rem;
  border-top: 1px solid var(--separator-subtle);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-xl);
  padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.input-wrapper:focus-within {
  border-color: rgba(10, 132, 255, 0.4);
  box-shadow: var(--shadow-glow);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.925rem;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  padding: 2px 0;
}

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

/* Input action buttons */
.input-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.input-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring);
}

.input-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.input-btn:active { transform: scale(0.9); }

.send-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
  transition: background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) ease;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4);
}

.send-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(10, 132, 255, 0.5); }
.send-btn:active { transform: scale(0.9); }
.send-btn:disabled { background: var(--bg-quaternary); color: var(--text-tertiary); box-shadow: none; cursor: not-allowed; }

/* Image paste preview */
.paste-preview {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--accent-light);
  border: 1px solid rgba(10, 132, 255, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 0.625rem;
  animation: slide-up 0.25s var(--ease-spring);
}
.paste-preview.visible { display: flex; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.paste-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--separator); }
.paste-preview-info { flex: 1; font-size: 0.825rem; color: var(--text-secondary); }
.paste-preview-name { font-weight: 500; color: var(--text-primary); }
.paste-cancel {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  transition: background var(--duration-fast) ease;
}
.paste-cancel:hover { background: rgba(255, 69, 58, 0.2); color: #FF453A; }

/* Emoji picker container */
.emoji-picker-wrap {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  animation: picker-enter 0.25s var(--ease-spring);
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8));
}

@keyframes picker-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ===================================================
   LIGHTBOX
   =================================================== */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}
.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: zoom-in 0.3s var(--ease-spring);
}

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

.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast) ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ===================================================
   EMPTY STATE
   =================================================== */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-tertiary);
  padding: 2rem;
}
.empty-state-icon { font-size: 3rem; opacity: 0.4; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); }
.empty-state-desc { font-size: 0.875rem; text-align: center; max-width: 260px; line-height: 1.5; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 640px) {
  .sidebar { width: 220px; min-width: 220px; }
  .msg-content-wrap { max-width: 80%; }
}
