/* css/app.css */

/* ── Tokens ─────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:        #070810;
  --bg-2:      #0d0e1a;
  --bg-3:      #111224;
  --bg-4:      #16182e;
  --bg-5:      #1b1d38;
  --bg-hover:  #202342;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);
  --text:      #eef0f8;
  --text-2:    #8890b0;
  --text-3:    #525870;
  --accent:    #1a56ff;
  --accent-2:  #487fff;
  --accent-bg: rgba(26,86,255,0.12);
  --accent-glow: 0 0 24px rgba(26,86,255,0.35);
  --bubble-out: #1a56ff;
  --bubble-out-text: #fff;
  --bubble-in:  #16182e;
  --bubble-in-text: #eef0f8;
  --online:    #4ade80;
  --danger:    #ef4444;
  --danger-bg: rgba(239,68,68,0.1);
  --success:   #4ade80;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
}

:root[data-theme="light"] {
  --bg:        #f0f2fa;
  --bg-2:      #ffffff;
  --bg-3:      #f8f9ff;
  --bg-4:      #eef0fa;
  --bg-5:      #e4e7f5;
  --bg-hover:  #dde2f5;
  --border:    rgba(0,0,0,0.08);
  --border-2:  rgba(0,0,0,0.15);
  --text:      #0d0f1e;
  --text-2:    #5560a0;
  --text-3:    #a0a8c8;
  --accent:    #1a56ff;
  --accent-2:  #0033f5;
  --accent-bg: rgba(26,86,255,0.08);
  --accent-glow: 0 0 24px rgba(26,86,255,0.25);
  --bubble-out: #1a56ff;
  --bubble-out-text: #fff;
  --bubble-in:  #eef0fa;
  --bubble-in-text: #0d0f1e;
  --online:    #22c55e;
  --danger:    #ef4444;
  --danger-bg: rgba(239,68,68,0.08);
  --success:   #22c55e;
  --shadow:    0 8px 32px rgba(0,0,0,0.12);
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { height: 100%; overflow: hidden; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }

/* ── Splash ─────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-icon { font-size: 52px; margin-bottom: 20px; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--accent-bg);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout ─────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 300px;
  min-width: 300px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  box-shadow: var(--accent-glow);
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}
.logo-text span { color: var(--accent-2); }
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text-3); }
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
  opacity: 0.5;
}
.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.contact-item:hover { background: var(--bg-hover); }
.contact-item.active { background: var(--accent-bg); }
.contact-item.active .contact-name { color: var(--accent); }
.contact-meta { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-status { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.contact-status.online { color: var(--online); }
.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.footer-profile:hover { background: var(--bg-hover); }
.footer-name { font-size: 13px; font-weight: 600; }
.footer-id { font-size: 11px; color: var(--accent-2); font-family: 'JetBrains Mono', monospace; }

/* ── Avatar ─────────────────────────────────────────── */
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-4);
  display: block;
}
.avatar.sz-xs { width: 28px; height: 28px; border-radius: 8px; }
.avatar.sz-sm { width: 36px; height: 36px; border-radius: 10px; }
.avatar.sz-md { width: 44px; height: 44px; border-radius: 12px; }
.avatar.sz-lg { width: 56px; height: 56px; border-radius: 14px; }
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent);
  background: var(--accent-bg);
  border-radius: 12px;
}
.avatar-fallback.sz-xs { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.avatar-fallback.sz-sm { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.avatar-fallback.sz-md { width: 44px; height: 44px; border-radius: 12px; font-size: 16px; }
.avatar-fallback.sz-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }
.status-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  background: var(--text-3);
}
.status-dot.online { background: var(--online); }

/* ── Icon buttons ───────────────────────────────────── */
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 15px;
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-2); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  border-radius: 8px;
  border: 2px solid var(--bg-2);
  font-size: 9px; font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ── Chat area ──────────────────────────────────────── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.chat-header {
  padding: 14px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-weight: 700; font-size: 15px; }
.chat-header-status {
  font-size: 12px;
  display: flex; align-items: center; gap: 6px;
  margin-top: 1px;
}
.chat-header-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}
.chat-header-status .dot.online { background: var(--online); }
.status-online { color: var(--online); }
.status-offline { color: var(--text-3); }
.e2e-badge {
  font-size: 10.5px;
  background: rgba(74,222,128,0.1);
  color: var(--success);
  border: 1px solid rgba(74,222,128,0.2);
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

/* ── Messages ───────────────────────────────────────── */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}
.date-divider::before, .date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  animation: msgIn 0.2s ease-out;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.msg-row.out { flex-direction: row-reverse; }
.msg-avatar { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-4); }
.bubble {
  max-width: 68%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.bubble.in {
  background: var(--bubble-in);
  color: var(--bubble-in-text);
  border-bottom-left-radius: 4px;
}
.bubble.out {
  background: var(--bubble-out);
  color: var(--bubble-out-text);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(26,86,255,0.25);
}
.bubble-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 3px;
  display: block;
  font-family: 'JetBrains Mono', monospace;
}
.bubble.out .bubble-time { text-align: right; }
.bubble.pending { opacity: 0.65; }

/* ── Input area ─────────────────────────────────────── */
.input-area {
  padding: 12px 16px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.2s;
  position: relative;
}
.input-row:focus-within { border-color: var(--accent); }
.msg-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  resize: none;
  max-height: 120px;
  min-height: 22px;
  line-height: 1.55;
  padding: 3px 0;
}
.msg-input::placeholder { color: var(--text-3); }
.send-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.send-btn:hover { filter: brightness(1.1); box-shadow: var(--accent-glow); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.emoji-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 17px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.emoji-btn:hover { background: var(--bg-hover); color: var(--text); }
.emoji-picker-wrap {
  position: absolute;
  bottom: 52px; right: 8px;
  z-index: 100;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.emoji-fallback {
  background: var(--bg-2);
  padding: 10px;
  width: 240px;
}
.emoji-fallback-title { font-size: 11px; color: var(--text-3); margin-bottom: 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 3px; }
.emoji-grid button { font-size: 20px; padding: 5px; border-radius: 8px; transition: background 0.1s; text-align: center; }
.emoji-grid button:hover { background: var(--bg-hover); }
.blocked-bar {
  padding: 10px 20px;
  background: var(--danger-bg);
  border-top: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-shrink: 0;
}
.blocked-bar button { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; }

/* ── Empty state ────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-3);
}
.empty-icon { font-size: 56px; opacity: 0.15; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text-2); }
.empty-sub { font-size: 13px; text-align: center; max-width: 260px; line-height: 1.7; }

/* ── Auth page ──────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 56px; height: 56px;
  background: var(--accent);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: var(--accent-glow);
  margin-bottom: 12px;
}
.auth-logo h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.auth-logo h1 span { color: var(--accent-2); }
.auth-logo p { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-2); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-3); }
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
  margin-top: 6px;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: var(--accent-glow); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary {
  width: 100%;
  padding: 12px;
  background: var(--bg-4);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
  margin-top: 8px;
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-2); }
.divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 12px; color: var(--text-3); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 16px; }
.auth-switch button { color: var(--accent); font-weight: 600; font-size: 13px; }
.err-msg { padding: 10px 13px; background: var(--danger-bg); border: 1px solid rgba(239,68,68,0.3); border-radius: 10px; color: var(--danger); font-size: 13px; margin-bottom: 14px; }
.ok-msg { padding: 10px 13px; background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.25); border-radius: 10px; color: var(--success); font-size: 13px; margin-bottom: 14px; }

/* ── OTP input ──────────────────────────────────────── */
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.otp-box {
  width: 50px; height: 58px;
  text-align: center;
  font-size: 24px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-4);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.otp-box:focus { border-color: var(--accent); }
.otp-box::-webkit-outer-spin-button, .otp-box::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Avatar picker ──────────────────────────────────── */
.avatar-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 9px; margin-top: 8px; }
.avatar-opt {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-4);
}
.avatar-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-opt:hover { border-color: var(--accent); transform: scale(1.04); }
.avatar-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-4);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  font-size: 13px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg-hover); }

/* ── Settings ───────────────────────────────────────── */
.settings-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.settings-header {
  padding: 16px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-header h2 { font-size: 16px; font-weight: 700; }
.settings-body { flex: 1; overflow-y: auto; padding: 16px; }
.settings-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.settings-section-label {
  padding: 12px 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { background: var(--bg-hover); }
.settings-row-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.settings-row-info { flex: 1; }
.settings-row-label { font-size: 13.5px; font-weight: 600; }
.settings-row-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.settings-row-ctrl { flex-shrink: 0; }
.toggle {
  width: 42px; height: 23px;
  border-radius: 12px;
  background: var(--bg-hover);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on::after { transform: translateX(19px); }
.form-select {
  padding: 7px 11px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
.form-select:focus { border-color: var(--accent); }
.btn-danger {
  padding: 9px 18px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.code-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-2);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ── Request item ───────────────────────────────────── */
.request-item {
  display: flex; align-items: center; gap: 11px;
  padding: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 9px;
}
.request-item:last-child { margin-bottom: 0; }
.request-actions { display: flex; gap: 7px; margin-left: auto; }
.btn-accept { padding: 7px 14px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; transition: filter 0.15s; }
.btn-accept:hover { filter: brightness(1.1); }
.btn-decline { padding: 7px 14px; border-radius: 9px; background: var(--bg-hover); color: var(--text-2); font-size: 12px; font-weight: 600; transition: all 0.15s; }
.btn-decline:hover { background: var(--danger); color: #fff; }

/* ── Toast ──────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  max-width: 320px;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); }

/* ── Misc ───────────────────────────────────────────── */
.hidden { display: none !important; }
.no-select { user-select: none; }
@media (max-width: 700px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100%; z-index: 100; transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
}

/* ── Mobile responsive fixes ────────────────────────────── */
@media (max-width: 700px) {
  .auth-page { padding: 16px; align-items: flex-start; padding-top: 40px; }
  .auth-card { padding: 24px 20px; border-radius: 20px; }
  .auth-logo h1 { font-size: 22px; }
  .otp-row { gap: 7px; }
  .otp-box { width: 44px; height: 52px; font-size: 20px; }
  .avatar-grid { grid-template-columns: repeat(5,1fr); gap: 7px; }

  .app-layout { position: relative; }
  .sidebar {
    position: fixed; left: 0; top: 0;
    height: 100%; width: 100%;
    max-width: 320px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .chat-area { width: 100%; }
  #mobile-back { display: flex !important; }

  .messages-area { padding: 12px; }
  .bubble { max-width: 82%; }
  .input-area { padding: 8px; }
  .chat-header { padding: 12px; }

  .settings-body { padding: 12px; }
}

/* Prevent input zoom on iOS */
@media (max-width: 700px) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* Touch targets - ensure buttons are big enough on mobile */
@media (max-width: 700px) {
  .icon-btn { width: 40px; height: 40px; }
  .contact-item { padding: 13px 10px; }
  .send-btn { width: 40px; height: 40px; }
}
