/* ============================================================
  SyncWave — Clean Light Collaboration UI
  JetBrains Mono + DM Sans
  ============================================================ */

:root {
  --bg-base:        #f4f7fb;
  --bg-surface:     #ffffff;
  --bg-elevated:    #eef2f8;
  --bg-hover:       #e2e8f3;
  --bg-active:      #d7dfee;
  --accent:         #2563eb;
  --accent-dim:     rgba(37,99,235,0.10);
  --accent-glow:    rgba(37,99,235,0.18);
  --red:            #ff4d6d;
  --green:          #69ff47;
  --yellow:         #ffd60a;
  --purple:         #bd93f9;
  --orange:         #ff9f43;
  --text-primary:   #182033;
  --text-secondary: #54607a;
  --text-muted:     #8b95aa;
  --border:         rgba(17,24,39,0.08);
  --border-accent:  rgba(37,99,235,0.22);
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --sidebar-w:      240px;
  --members-w:      220px;
  --font-mono:      'JetBrains Mono', monospace;
  --font-body:      'DM Sans', sans-serif;
  --transition:     0.15s ease;
}

[data-theme="dark"] {
  --bg-base:        #0d0f12;
  --bg-surface:     #151820;
  --bg-elevated:    #1e2330;
  --bg-hover:       #252c3a;
  --bg-active:      #2a3347;
  --accent:         #00e5ff;
  --accent-dim:     rgba(0,229,255,0.12);
  --accent-glow:    rgba(0,229,255,0.25);
  --text-primary:   #e8eaf0;
  --text-secondary: #8b93a8;
  --text-muted:     #4a5168;
  --border:         rgba(255,255,255,0.06);
  --border-accent:  rgba(0,229,255,0.25);
}

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

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- SCROLLBARS ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; }

/* ---- BUTTONS ---- */
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px 16px;
  background: var(--accent); color: #000;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  border-radius: var(--radius-md);
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: 0.02em;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary.compact { width: auto; padding: 8px 14px; font-size: 12px; }

.btn-ghost {
  padding: 8px 14px; border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-ai { color: var(--accent); }
.btn-ai:hover { background: var(--accent-dim); color: var(--accent); }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; overflow: auto;
}

.auth-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
}
#gridCanvas { position: absolute; inset: 0; opacity: 0.3; }
.auth-glow {
  position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  width: 100%; max-width: 400px; padding: 24px 16px;
}

.auth-card {
  width: 100%; background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.12);
}

.brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.brand-icon { animation: brandPulse 3s ease-in-out infinite; }
@keyframes brandPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text-primary); }
.brand-tag { font-family: var(--font-mono); font-size: 10px; color: var(--accent); letter-spacing: 0.05em; }

.auth-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 8px 0;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.04em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.form-input {
  padding: 9px 12px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--border-accent); }
.form-input::placeholder { color: var(--text-muted); }

.form-error {
  font-size: 12px; color: var(--red);
  min-height: 16px; font-family: var(--font-mono);
}

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 24px; height: 24px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: #fff; transform: scale(1.1); }

.demo-hint {
  text-align: center; font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.demo-hint code { color: var(--accent); font-size: 11px; }

.auth-features {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
}
.feature-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-secondary);
  font-family: var(--font-mono);
}
.feature-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  flex-shrink: 0;
  animation: dotPulse 2s ease-in-out infinite;
}
.feature-item:nth-child(2) .feature-dot { animation-delay: 0.7s; }
.feature-item:nth-child(3) .feature-dot { animation-delay: 1.4s; }
@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-body {
  display: flex; height: 100vh; overflow: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.workspace-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.workspace-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--accent); color: #000;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.workspace-name { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.workspace-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }

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

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; margin-bottom: 2px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}

.channel-list, .dm-list {
  list-style: none; display: flex; flex-direction: column; gap: 1px;
  padding: 0 6px;
}
.channel-item, .dm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary);
  font-size: 13px; position: relative;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.channel-item:hover, .dm-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.channel-item.active, .dm-item.active {
  background: var(--bg-active); color: var(--text-primary);
}
.channel-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; background: var(--accent); border-radius: 99px;
}
.channel-prefix-icon { color: var(--text-muted); font-size: 15px; line-height: 1; }
.channel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge {
  background: var(--red); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.dm-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: #000;
}
.dm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-status { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dm-status.online { background: var(--green); }
.dm-status.offline { background: var(--text-muted); }

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-self {
  display: flex; align-items: center; gap: 8px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.user-self:hover { background: var(--bg-hover); }
.user-self-info { flex: 1; min-width: 0; }
.user-self-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-self-status { font-family: var(--font-mono); font-size: 10px; color: var(--green); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: #000; flex-shrink: 0;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.status-dot.online { background: var(--green); animation: pulse 2.5s ease infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ---- CHAT MAIN ---- */
.chat-main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
  background: var(--bg-base);
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.channel-prefix { font-family: var(--font-mono); font-size: 18px; color: var(--text-muted); }
.channel-title { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.channel-desc { font-size: 12px; color: var(--text-muted); display: none; }
@media (min-width: 768px) { .channel-desc { display: block; } }
.chat-header-actions { display: flex; align-items: center; gap: 4px; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.search-input {
  flex: 1; background: transparent; border: none;
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }

/* ---- MESSAGES ---- */
.messages-container {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  padding: 16px;
}
.messages-list { display: flex; flex-direction: column; gap: 2px; }

.msg {
  display: flex; gap: 10px; padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  position: relative;
}
.msg:hover { background: var(--bg-surface); }
.msg:hover .msg-actions { opacity: 1; pointer-events: all; }

.msg-avatar-col { width: 32px; flex-shrink: 0; padding-top: 2px; }
.msg-content-col { flex: 1; min-width: 0; }

.msg.grouped .msg-avatar-col { visibility: hidden; }

.msg-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px;
}
.msg-author { font-weight: 600; font-size: 13px; }
.msg-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.msg-badge { font-family: var(--font-mono); font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--accent-dim); color: var(--accent); }

.msg-body { font-size: 14px; line-height: 1.55; word-break: break-word; }
.msg-body code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-elevated); padding: 1px 5px; border-radius: 3px;
  color: var(--accent);
}
.msg-body pre {
  background: var(--bg-elevated); padding: 10px 12px;
  border-radius: var(--radius-md); overflow-x: auto; margin-top: 6px;
  border-left: 2px solid var(--accent);
}
.msg-body pre code { background: none; padding: 0; font-size: 12px; }

.msg-file {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); max-width: 300px;
  cursor: pointer; transition: border-color var(--transition);
}
.msg-file:hover { border-color: var(--border-accent); }
.msg-file-icon { font-size: 20px; }
.msg-file-info { min-width: 0; }
.msg-file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-size { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

.msg-image { max-width: 300px; max-height: 200px; border-radius: var(--radius-md); margin-top: 6px; cursor: pointer; }

.msg-reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reaction-pill {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 99px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 12px; cursor: pointer; transition: border-color var(--transition);
}
.reaction-pill:hover { border-color: var(--border-accent); }
.reaction-pill.mine { background: var(--accent-dim); border-color: var(--border-accent); }

.msg-actions {
  position: absolute; right: 8px; top: 4px;
  display: flex; gap: 2px;
  opacity: 0; pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  transition: opacity var(--transition);
}
.msg-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 12px;
  transition: background var(--transition);
}
.msg-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.day-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 8px;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 10px;
}
.day-divider::before, .day-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.typing-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  font-size: 12px; color: var(--text-secondary);
  font-style: italic;
}
.typing-dots { display: flex; gap: 3px; }
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: typingDot 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }

/* ---- INPUT AREA ---- */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
  position: relative;
}

.file-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.file-preview-inner { flex: 1; font-size: 12px; color: var(--text-secondary); }

.input-row {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 8px;
  transition: border-color var(--transition);
}
.input-row:focus-within { border-color: var(--border-accent); }

.message-input {
  flex: 1; background: transparent; border: none;
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  outline: none; resize: none; line-height: 1.5;
  max-height: 120px; overflow-y: auto;
  padding: 3px 0;
}
.message-input::placeholder { color: var(--text-muted); }

.attach-btn, .emoji-btn { color: var(--text-muted); }
.attach-btn:hover, .emoji-btn:hover { color: var(--accent); background: var(--accent-dim); }

.send-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}
.send-btn:hover { opacity: 0.85; transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }

.emoji-picker {
  position: absolute; bottom: 68px; right: 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.14);
  z-index: 200;
}
.emoji-grid {
  display: grid; grid-template-columns: repeat(8, 28px); gap: 2px;
}
.emoji-btn-item {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
}
.emoji-btn-item:hover { background: var(--bg-hover); }

/* ---- MEMBERS PANEL ---- */
.members-panel {
  width: var(--members-w); min-width: var(--members-w);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  overflow-y: auto; padding: 12px 0;
  display: none;
}
.members-panel.open { display: block; }
.members-header {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0 12px 10px;
}
.members-section-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 12px 4px;
}
.members-list { list-style: none; }
.member-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary);
  transition: background var(--transition);
}
.member-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.member-name { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-role { font-family: var(--font-mono); font-size: 9px; color: var(--accent); }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,23,42,0.28);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.16);
  animation: slideUp 0.2s ease;
}
.modal-wide { max-width: 540px; }
@keyframes slideUp { from{transform:translateY(12px);opacity:0} to{transform:translateY(0);opacity:1} }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.modal-footer .btn-primary { width: auto; }

.radio-group { display: flex; gap: 16px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; color: var(--text-secondary); }

.badge-demo {
  font-family: var(--font-mono); font-size: 9px; padding: 2px 6px;
  border-radius: 3px; background: var(--accent-dim); color: var(--accent);
  vertical-align: middle; margin-left: 6px;
}

/* ---- AI CHAT ---- */
.ai-chat {
  max-height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0;
  margin-bottom: 12px;
}
.ai-msg { display: flex; flex-direction: column; gap: 4px; }
.ai-msg-role { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.ai-msg-body {
  font-size: 13px; line-height: 1.55;
  padding: 8px 10px; border-radius: var(--radius-md);
}
.ai-msg.user .ai-msg-body { background: var(--accent-dim); border: 1px solid var(--border-accent); }
.ai-msg.assistant .ai-msg-body { background: var(--bg-elevated); border: 1px solid var(--border); }
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row .form-input { flex: 1; }

/* ---- TOAST ---- */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 13px; color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(15,23,42,0.14);
  animation: toastIn 0.25s ease;
  min-width: 240px; max-width: 320px;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toastIn { from{transform:translateX(20px);opacity:0} to{transform:translateX(0);opacity:1} }

/* ---- MOBILE ---- */
.mobile-menu-btn { display: none; }
.mobile-overlay { display: none; }

@media (max-width: 767px) {
  .mobile-menu-btn { display: flex; }
  .members-panel { display: none !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay {
    display: block;
    position: fixed; inset: 0; z-index: 250;
    background: rgba(15,23,42,0.22);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .mobile-overlay.visible { opacity: 1; pointer-events: all; }
  .channel-desc { display: none !important; }
}

/* ---- IMAGE LIGHTBOX ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(15,23,42,0.82);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius-md); }

/* ---- LOAD ANIMATION ---- */
.msg { animation: msgIn 0.18s ease; }
@keyframes msgIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }
