/* ============================================================
   LUMAYN CHATS — Apple-style messenger
   ============================================================ */

:root {
  --blue:        #007AFF;
  --blue-light:  #5AC8FA;
  --blue-deep:   #0051D5;
  --bg:          #ffffff;
  --bg-soft:     #f2f5f9;
  --bg-tint:     #e9f1ff;
  --ink:         #1d1d1f;
  --ink-2:       #515156;
  --ink-3:       #86868b;
  --ink-4:       #b0b0b6;
  --line:        rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.12);
  --shadow-1:    0 4px 14px -4px rgba(10, 31, 61, 0.08);
  --shadow-2:    0 18px 50px -28px rgba(10, 31, 61, 0.18);
  --radius:      14px;
  --radius-lg:   22px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* Global: HTML hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% 0%, #f4f8ff 0%, #ffffff 60%, #eef4ff 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
input, button, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { background: transparent; border: none; cursor: pointer; }

/* ============================================================
   AUTH (login + register)
   ============================================================ */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}
.auth-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.auth-bg-orb-1 {
  width: 360px; height: 360px;
  top: -120px; right: -100px;
  background: rgba(0, 122, 255, 0.18);
}
.auth-bg-orb-2 {
  width: 280px; height: 280px;
  bottom: -100px; left: -80px;
  background: rgba(90, 200, 250, 0.22);
}
.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: 36px 30px 30px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    var(--shadow-2);
}
.auth-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(160deg, #8FDFFF 0%, #2E9BFF 28%, #0051D5 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 12px 28px -8px rgba(0, 81, 213, 0.45);
}
.auth-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  text-align: center;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.auth-title-accent {
  background: linear-gradient(135deg, #1D1D1F 0%, #0051D5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub {
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 auto 22px;
  max-width: 320px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-2);
  border-radius: 9px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(10, 31, 61, 0.08);
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  margin-left: 2px;
}
.auth-optional {
  font-weight: 400;
  color: var(--ink-3);
}
.auth-field input {
  height: 46px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.auth-field input:focus {
  border-color: rgba(0, 122, 255, 0.45);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}
.auth-submit {
  height: 48px;
  margin-top: 6px;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 10px 24px -6px rgba(0, 81, 213, 0.4);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
  letter-spacing: -0.005em;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(0, 81, 213, 0.55); }
.auth-submit:disabled { opacity: 0.6; cursor: progress; }
.auth-error {
  font-size: 0.86rem;
  color: #d33;
  text-align: center;
  min-height: 18px;
  margin-top: 4px;
}
.auth-foot {
  text-align: center;
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-top: 22px;
}

/* ============================================================
   APP shell (messenger)
   ============================================================ */
.app-body {
  height: 100dvh;
  overflow: hidden;
}
.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100%;
}

/* ===== Sidebar ===== */
.app-side {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.side-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.side-me {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.side-avatar {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #5AC8FA, #007AFF);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 10px -2px rgba(0, 122, 255, 0.4);
}
.side-me-text { flex: 1; min-width: 0; }
.side-me-name { font-weight: 600; font-size: 0.96rem; line-height: 1.1; }
.side-me-nick { font-size: 0.78rem; color: var(--ink-3); margin-top: 2px; }
.side-logout-form { margin: 0; }
.side-logout {
  width: 34px; height: 34px;
  border-radius: 10px;
  color: var(--ink-3);
  transition: background 0.2s, color 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.side-logout:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }

.side-search {
  position: relative;
}
.side-search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 36px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.93rem;
  font-weight: 500;
  outline: none;
  transition:
    background 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.side-search input:focus {
  background: #fff;
  border-color: rgba(0, 122, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}
.side-search-icon {
  position: absolute;
  top: 50%; left: 12px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
  transition: color 0.3s var(--ease);
}
.side-search input:focus + .side-search-clear,
.side-search input:focus ~ .side-search-icon { color: var(--blue); }

.side-search-clear {
  position: absolute;
  top: 50%; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  display: flex;
  align-items: center; justify-content: center;
  /* Smooth appearance via opacity + scale instead of display toggle */
  opacity: 0;
  transform: translateY(-50%) scale(0.6);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.side-search.has-text .side-search-clear {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
}
.side-search-clear:hover { background: rgba(0, 0, 0, 0.28); }

.side-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 24px;
}
.side-list::-webkit-scrollbar { width: 6px; }
.side-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }

.side-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-3);
}
.side-empty svg { color: var(--ink-4); margin-bottom: 14px; }
.side-empty p { font-size: 0.88rem; line-height: 1.55; }

.side-chat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 2px;
  animation: chatRowIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes chatRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Spinner shown while loading the chat list */
.chats-loading {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}
.side-chat:hover { background: rgba(0, 0, 0, 0.04); }
.side-chat.active { background: rgba(0, 122, 255, 0.12); }
.side-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.side-chat-avatar {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #5AC8FA, #007AFF);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.01em;
}
.side-chat-online-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  background: #34C759;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.25), 0 0 6px rgba(52, 199, 89, 0.4);
  animation: dotIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dotIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
/* Active row dims the green slightly for contrast */
.side-chat.active .side-chat-online-dot { border-color: #e7f1ff; }
.side-chat-text { flex: 1; min-width: 0; }
.side-chat-line1 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.side-chat-name {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-chat-time {
  font-size: 0.74rem;
  color: var(--ink-3);
  flex-shrink: 0;
}
.side-chat-line2 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 2px;
}
.side-chat-last {
  font-size: 0.86rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.side-chat-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Search results overlay (inside sidebar) — fade in smoothly */
.side-search-results {
  position: absolute;
  top: 110px; left: 8px; right: 8px; bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px 14px 0 0;
  padding: 8px;
  overflow-y: auto;
  z-index: 5;
  box-shadow: 0 -8px 24px -10px rgba(0, 0, 0, 0.1);
  animation: searchPanelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes searchPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.2s var(--ease);
  animation: searchRowIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes searchRowIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-result:nth-child(1) { animation-delay: 0.02s; }
.search-result:nth-child(2) { animation-delay: 0.05s; }
.search-result:nth-child(3) { animation-delay: 0.08s; }
.search-result:nth-child(4) { animation-delay: 0.11s; }
.search-result:nth-child(5) { animation-delay: 0.14s; }
.search-result:nth-child(n+6) { animation-delay: 0.17s; }
.search-result:hover { background: rgba(0, 122, 255, 0.08); }
.search-result:active { transform: scale(0.98); }
.search-empty {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.88rem;
  padding: 40px 20px;
  animation: searchPanelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Main panel ===== */
.app-main {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.main-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: paneFade 0.3s var(--ease);
}
@keyframes paneFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.main-empty-orb {
  position: absolute;
  width: 480px; height: 480px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center,
    rgba(0, 122, 255, 0.12) 0%,
    rgba(90, 200, 250, 0.05) 40%,
    rgba(0, 0, 0, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
}
.main-empty-content {
  position: relative;
  max-width: 380px;
  padding: 0 24px;
}
.main-empty-content svg { color: var(--blue); margin-bottom: 18px; opacity: 0.85; }
.main-empty-content h2 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 8px;
}
.main-empty-content p {
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.55;
}

.main-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: chatIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes chatIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  flex-shrink: 0;
  z-index: 2;
}
.chat-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.chat-back:hover { background: rgba(0, 0, 0, 0.06); color: var(--blue); }
.chat-back:active { transform: scale(0.94); }
.chat-head-avatar {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #5AC8FA, #007AFF);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.01em;
}
.chat-head-text { flex: 1; min-width: 0; }
.chat-head-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.1;
}
.chat-head-status {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 2px;
  transition: color 0.3s var(--ease);
}
.chat-head-status.online   { color: #2ec05a; }
.chat-head-status.typing   { color: var(--blue); font-weight: 500; }
.chat-head-status.offline  { color: var(--ink-3); }
/* Status dot — static for online, pulsing only for typing */
.chat-head-status.online::before,
.chat-head-status.typing::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: currentColor;
}
.chat-head-status.typing::before {
  animation: statusPulse 1.3s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.78); }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  scrollbar-gutter: stable;
}
/* Suppress per-message entry animation during initial batch render */
.chat-messages.initial .msg { animation: none !important; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 3px; }

/* Spinner shown while messages are loading */
.chat-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}
.chat-spinner {
  width: 32px; height: 32px;
  border: 2.5px solid rgba(0, 122, 255, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: chatSpin 0.8s linear infinite;
}
@keyframes chatSpin { to { transform: rotate(360deg); } }

.msg-day {
  text-align: center;
  font-size: 0.74rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 14px 0 10px;
}
.msg {
  display: flex;
  margin-bottom: 4px;
  animation: msgIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom;
}
.msg.me { transform-origin: bottom right; }
.msg.them { transform-origin: bottom left; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Pending optimistic-render: slightly transparent until server confirms */
.msg.pending .msg-bubble { opacity: 0.7; }
.msg.pending .msg-bubble { transition: opacity 0.25s ease; }
.msg:not(.pending) .msg-bubble { opacity: 1; }
.msg.me { justify-content: flex-end; }
.msg-bubble {
  max-width: min(72%, 540px);
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 0.96rem;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}
.msg.them .msg-bubble {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.msg.me .msg-bubble {
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px -2px rgba(0, 81, 213, 0.3);
}
.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  margin-left: 8px;
  margin-top: 4px;
  vertical-align: bottom;
}
.msg.me .msg-meta { color: rgba(255, 255, 255, 0.9); }
.msg.them .msg-meta { color: var(--ink-3); }
.msg-tick {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.95);
}
/* Read state: brighter cyan tone — visually distinct from unread */
.msg-tick.read {
  color: #7FE0FF;
  filter: drop-shadow(0 0 1px rgba(127, 224, 255, 0.4));
}

/* Group consecutive messages */
.msg.same-as-prev { margin-top: -2px; }
.msg.same-as-prev .msg-bubble {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.msg.same-as-prev:not(.last-of-group) .msg-bubble {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}


.chat-compose {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  flex-shrink: 0;
}
.chat-compose input {
  flex: 1;
  height: 42px;
  padding: 0 18px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.98rem;
  outline: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.chat-compose input:focus {
  background: #fff;
  border-color: rgba(0, 122, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}
.chat-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease), opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 18px -6px rgba(0, 81, 213, 0.45);
}
.chat-send svg { transform: translateX(1px); }
.chat-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(0, 81, 213, 0.6); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ============================================================
   Mobile (single-pane mode)
   ============================================================ */
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side { width: 100%; border-right: none; }
  .app-main { display: none; }
  body.in-chat .app-side { display: none; }
  body.in-chat .app-main { display: flex; }
  .chat-back { display: flex; }
  .side-head { padding-top: calc(14px + var(--safe-top)); }
  .chat-head { padding-top: calc(12px + var(--safe-top)); }
  .side-search-results { top: calc(110px + var(--safe-top)); }
  .auth-card { padding: 28px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .msg { animation: none !important; }
  .chat-typing .t-dot { animation-duration: 3s !important; }
}
