/* ============================================================
   Quill — "A sunlit collector's cabinet of minds"
   Warm paper & ink UI; color lives only inside bot avatars.
   ============================================================ */

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

:root {
  --paper: #faf8f3;
  --paper-2: #f3efe7;
  --card: #fffdf9;
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #a8a29e;
  --line: #e7e2d8;
  --accent: #7c5cff;
  --accent-soft: #efeaff;
  --green: #3d8b62;
  --red: #c4443c;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 8px 24px -12px rgba(28, 25, 23, 0.12);
  --shadow-lg: 0 2px 6px rgba(28, 25, 23, 0.06), 0 24px 48px -16px rgba(28, 25, 23, 0.18);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font-ui: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
img { display: block; max-width: 100%; }

.serif-em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

::selection { background: var(--accent-soft); }

/* Scrollbars */
.sidebar ::-webkit-scrollbar, .chat-scroll::-webkit-scrollbar { width: 8px; }
.sidebar ::-webkit-scrollbar-thumb, .chat-scroll::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 99px;
}

/* ============ Buttons & fields ============ */
.btn-primary {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn-primary:hover { background: #2e2a27; }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 500;
  font-size: 14px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.btn-ghost:hover { border-color: var(--ink-3); background: var(--paper-2); }

.btn-link {
  display: block;
  margin: 10px auto 0;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.16s var(--ease);
}
.btn-link:hover { color: var(--accent); }

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 22px 0 8px;
}
.field-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input.is-bad { border-color: var(--red); }

.field-error { color: var(--red); font-size: 13px; margin-top: 8px; }

.code-input {
  letter-spacing: 0.55em;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(6px);
  animation: auth-fade 0.24s var(--ease);
}
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }

.auth-close {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 110;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.16s var(--ease), color 0.16s var(--ease);
}
.auth-close:hover { color: var(--ink); transform: scale(1.06); }

.auth-card {
  width: min(1020px, 100%);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: minmax(400px, 1fr) 1.1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: card-pop 0.3s var(--ease);
}
@keyframes card-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.auth-left {
  padding: 44px 48px 28px;
  display: flex;
  flex-direction: column;
}

.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.auth-logo { width: 34px; height: 34px; border-radius: 10px; }
.auth-wordmark { font-family: var(--font-serif); font-size: 26px; letter-spacing: 0.01em; }

.auth-steps { position: relative; flex: 1; overflow: hidden; }

.auth-step {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(48px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  pointer-events: none;
  overflow-y: auto;
  padding-bottom: 8px;
}
.auth-step.is-active { opacity: 1; transform: translateX(0); pointer-events: auto; }
.auth-step.is-left { transform: translateX(-48px); }

.auth-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.auth-title {
  font-size: clamp(34px, 4.5vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 14px;
}
.auth-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.auth-sub { color: var(--ink-2); font-size: 15px; max-width: 40ch; }
.auth-sub strong { color: var(--ink); }

.auth-step .btn-primary { margin-top: 26px; }
.auth-fine { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); }

.auth-progress { display: flex; gap: 8px; padding-top: 22px; }
.auth-progress .dot {
  width: 22px; height: 4px; border-radius: 99px; background: var(--line);
  transition: background 0.24s var(--ease), width 0.24s var(--ease);
}
.auth-progress .dot.is-on { background: var(--ink); width: 34px; }

.auth-right { position: relative; background: var(--paper-2); min-height: 0; }
.auth-art { width: 100%; height: 100%; object-fit: cover; }
.auth-art-caption {
  position: absolute;
  left: 20px; bottom: 20px;
  padding: 10px 16px;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  backdrop-filter: blur(4px);
}
.auth-art-caption .serif-em { color: var(--ink); font-size: 15px; }

/* Avatar step */
.avatar-pick { display: flex; align-items: center; gap: 20px; margin-top: 24px; }
.avatar-preview {
  width: 96px; height: 96px;
  border-radius: 28px;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 44px;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #ff5ca8);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   MAIL TOAST (simulated inbox)
   ============================================================ */
.mail-toast {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 90;
  width: min(360px, calc(100vw - 40px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  animation: mail-in 0.4s var(--ease);
}
@keyframes mail-in {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.mail-toast.is-leaving { transition: transform 0.3s var(--ease), opacity 0.3s; transform: translateX(110%); opacity: 0; }

.mail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mail-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 18px;
}
.mail-from { font-weight: 600; font-size: 14px; }
.mail-subject { font-size: 12.5px; color: var(--ink-3); }
.mail-close { margin-left: auto; font-size: 20px; color: var(--ink-3); line-height: 1; padding: 4px; }
.mail-close:hover { color: var(--ink); }

.mail-body { font-size: 14px; color: var(--ink-2); }
.mail-code {
  display: block;
  margin: 10px 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  transition: transform 0.15s var(--ease);
}
.mail-code:hover { transform: scale(1.02); }
.mail-demo-note { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); font-style: italic; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; height: 100dvh; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  z-index: 40;
}

.sidebar-top { padding: 18px 16px 10px; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brand-logo { width: 30px; height: 30px; border-radius: 9px; }
.brand-name { font-family: var(--font-serif); font-size: 23px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--ink-2);
  transition: background 0.16s var(--ease);
}
.icon-btn:hover { background: var(--paper-2); }
.sidebar-close { display: none; margin-left: auto; }

.new-chat { margin-bottom: 14px; }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-ico {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3); font-size: 15px;
}
.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.explore-link {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.explore-link:hover, .explore-link.is-active { background: var(--paper-2); color: var(--ink); }
.explore-spark { color: var(--accent); }

.bot-nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }

.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 8px 6px;
}

.nav-bot {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.15s var(--ease);
}
.nav-bot:hover { background: var(--paper-2); }
.nav-bot.is-active { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav-bot-name { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bot avatar (the color burst) */
.bav {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.bav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bav.lg { width: 44px; height: 44px; border-radius: 14px; font-size: 19px; }
.bav.xl { width: 64px; height: 64px; border-radius: 19px; font-size: 28px; }
.nav-bot:hover .bav, .bot-card:hover .bav { transform: translateY(-2px); box-shadow: 0 6px 14px -6px rgba(28,25,23,.3); }

.sidebar-user {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.su-avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-serif); font-size: 17px;
  overflow: hidden; flex-shrink: 0;
}
.su-avatar img { width: 100%; height: 100%; object-fit: cover; }
.su-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.su-mail { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.su-out { margin-left: auto; color: var(--ink-3); font-size: 12.5px; font-weight: 500; padding: 6px 8px; border-radius: 8px; }
.su-out:hover { color: var(--red); background: var(--paper-2); }

.su-guest { flex: 1; min-width: 0; }
.su-guest-title { font-size: 13.5px; font-weight: 600; }
.su-guest-sub { font-size: 12px; color: var(--ink-3); }
.su-signin { width: auto; padding: 8px 16px; font-size: 13.5px; flex-shrink: 0; }
.su-signin.top { padding: 8px 18px; font-size: 13.5px; }

.scrim { display: none; }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-title .serif-em { font-size: 19px; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#menu-btn { display: none; }

.view { display: none; flex: 1; min-height: 0; }
.view.is-active { display: flex; flex-direction: column; }

/* ============================================================
   EXPLORE
   ============================================================ */
.explore-view { overflow-y: auto; }

.explore-hero {
  padding: 44px 32px 8px;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
}
.explore-title {
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 600;
}
.explore-title .serif-em { font-weight: 400; }
.explore-sub { margin-top: 10px; color: var(--ink-2); max-width: 56ch; }
.hero-signin {
  width: auto;
  display: inline-block;
  margin-top: 18px;
  padding: 12px 24px;
}
.locked-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px;
  background: var(--card);
  border: 1px dashed var(--ink-3);
  border-radius: 16px;
  color: var(--ink-2);
  font-size: 14px;
}
.locked-note .btn-primary { width: auto; padding: 10px 20px; }

.chip-row {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex; gap: 8px;
  padding: 16px 32px;
  background: linear-gradient(var(--paper) 82%, transparent);
  overflow-x: auto;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px; font-weight: 550;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all 0.16s var(--ease);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 8px 32px 48px;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
}

.bot-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  animation: card-in 0.4s var(--ease) backwards;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.bot-card:hover { border-color: var(--ink-2); transform: translateY(-2px); box-shadow: var(--shadow); }

.bot-card-top { display: flex; align-items: center; gap: 12px; }
.bot-card-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.bot-card-by { font-size: 12px; color: var(--ink-3); }
.bot-card-desc {
  font-size: 13.5px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.bot-card-tag {
  align-self: flex-start;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  text-transform: capitalize;
}
.grid-empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: 60px 0; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.chat-head-info { min-width: 0; }
.chat-head-name { font-weight: 650; font-size: 16px; }
.chat-head-desc { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }

.chat-scroll { flex: 1; overflow-y: auto; }
.chat-col { max-width: 860px; margin: 0 auto; padding: 28px 24px 20px; display: flex; flex-direction: column; gap: 18px; }

.msg { display: flex; gap: 12px; max-width: 100%; animation: msg-in 0.3s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg.user { flex-direction: row-reverse; }
.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 78%;
}
.msg.bot .msg-bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-top-left-radius: 6px;
}
.msg.user .msg-bubble {
  background: var(--ink);
  color: var(--paper);
  border-top-right-radius: 6px;
}

.typing-caret {
  display: inline-block;
  width: 8px; height: 17px;
  margin-left: 3px;
  vertical-align: text-bottom;
  border-radius: 2px;
  background: var(--accent);
  animation: caret-blink 0.9s var(--ease) infinite;
}
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }

.thinking-dots { display: inline-flex; gap: 5px; padding: 4px 2px; }
.thinking-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3);
  animation: dot-pulse 1.1s var(--ease) infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-pulse { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Composer */
.composer-wrap {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 24px 14px;
}
.suggest-row {
  max-width: 860px; margin: 0 auto 10px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.suggest-chip {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px dashed var(--ink-3);
  color: var(--ink-2);
  transition: all 0.16s var(--ease);
}
.suggest-chip:hover { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.composer {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-input { flex: 1; border: none; outline: none; background: none; font-size: 15.5px; color: var(--ink); }
.send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 17px;
  display: grid; place-items: center;
  transition: background 0.16s var(--ease), transform 0.16s var(--ease), opacity 0.16s;
}
.send-btn:hover { background: #2e2a27; transform: scale(1.05); }
.send-btn:disabled { opacity: 0.35; transform: none; cursor: not-allowed; }
.composer-note {
  max-width: 860px; margin: 8px auto 0;
  text-align: center;
  font-size: 11.5px; color: var(--ink-3);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .auth-card { grid-template-columns: 1fr; min-height: 0; }
  .auth-right { display: none; }
  .auth-left { padding: 36px 28px 24px; }
  .auth-steps { min-height: 460px; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(28, 25, 23, 0.35);
    opacity: 0; pointer-events: none;
    transition: opacity 0.24s var(--ease);
    z-index: 35;
  }
  .scrim.is-on { opacity: 1; pointer-events: auto; }
  #menu-btn { display: grid; }
  .explore-hero { padding: 28px 20px 4px; }
  .chip-row { padding: 14px 20px; }
  .bot-grid { padding: 6px 20px 40px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .chat-col { padding: 20px 16px 12px; }
  .composer-wrap { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
  .msg-bubble { max-width: 88%; }
  .chat-head-desc { max-width: 40vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
