/* =====================================================================
   Lyra Messenger — mobile-first stylesheet
   Tokens → base → layout → components → views → responsive
   ===================================================================== */

/* ---------------------------------------------------------------------
   Themes. Six palettes, chosen with <html data-theme="…" data-mode="…">.
   "Auto" resolves to Lyra (light) or Midnight (dark) in theme.js.
   Every colour in the app reads from these tokens.
   --------------------------------------------------------------------- */
:root {
  /* shared, theme-independent */
  --green: #1fb76b;
  --amber: #e9a23b;
  --red: #e5484d;
  --pink: #f0457e;
  --bubble-out-ink: #ffffff;
  --bubble-out-muted: rgba(255, 255, 255, 0.74);

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-bubble: 18px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --t-xs: 12px;
  --t-sm: 13.5px;
  --t-md: 15px;
  --t-lg: 17px;
  --t-xl: 22px;
  --t-2xl: 30px;

  --rail-w: 72px;
  --list-w: 360px;
  --info-w: 340px;
  --header-h: 60px;
  --tabbar-h: 62px;

  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --app-h: 100dvh;
  --focus: 0 0 0 3px rgba(var(--accent-rgb), 0.35);

  /* Lyra — default (light, violet) */
  color-scheme: light;
  --accent: #6c4cf1;
  --accent-rgb: 108, 76, 241;
  --accent-hover: #5d3ee6;
  --badge: #f0457e;
  --tick-read: #a7f3d0;
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f0eff7;
  --surface-3: #e8e6f2;
  --ink: #1c1a2e;
  --ink-2: #4a4763;
  --muted: #7a7792;
  --line: #e4e2ee;
  --rail: #241f3d;
  --rail-ink: #b9b3dc;
  --bubble-in: #ffffff;
  --bubble-in-ink: var(--ink);
  --bubble-out: linear-gradient(135deg, #7656f5 0%, #5a3fe0 55%, #4b36cf 100%);
  --wall: #ecebf5;
  --wall-dot: rgba(108, 76, 241, 0.16);
  --wall-dot-2: rgba(67, 56, 202, 0.1);
  --shadow-1: 0 1px 2px rgba(28, 26, 46, 0.06), 0 1px 1px rgba(28, 26, 46, 0.04);
  --shadow-2: 0 8px 28px rgba(28, 26, 46, 0.14), 0 2px 6px rgba(28, 26, 46, 0.08);
  --shadow-3: 0 24px 60px rgba(28, 26, 46, 0.24);
}

/* dark-mode shadows shared by every dark theme */
:root[data-mode="dark"] {
  color-scheme: dark;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Midnight — dark violet */
:root[data-theme="midnight"] {
  --accent: #8b72ff;
  --accent-rgb: 139, 114, 255;
  --accent-hover: #7a5ff7;
  --badge: #f0457e;
  --tick-read: #a7f3d0;
  --bg: #14121d;
  --surface: #1d1a29;
  --surface-2: #252236;
  --surface-3: #2e2a42;
  --ink: #ecebf6;
  --ink-2: #c4c1da;
  --muted: #9894b2;
  --line: #2d2a3f;
  --rail: #0f0d17;
  --rail-ink: #8f89b4;
  --bubble-in: #262337;
  --bubble-out: linear-gradient(135deg, #7656f5 0%, #5a3fe0 55%, #4b36cf 100%);
  --wall: #17151f;
  --wall-dot: rgba(160, 140, 255, 0.14);
  --wall-dot-2: rgba(120, 110, 230, 0.08);
}

/* Lagoon — light teal */
:root[data-theme="lagoon"] {
  --accent: #0d9488;
  --accent-rgb: 13, 148, 136;
  --accent-hover: #0b7f74;
  --badge: #ef5350;
  --tick-read: #fff3b0;
  --bg: #f1f7f6;
  --surface: #ffffff;
  --surface-2: #e7f2f0;
  --surface-3: #d9ebe7;
  --ink: #10282a;
  --ink-2: #35504f;
  --muted: #688382;
  --line: #d8e8e4;
  --rail: #0d3a3c;
  --rail-ink: #9fcdc8;
  --bubble-in: #ffffff;
  --bubble-out: linear-gradient(135deg, #17b3a3 0%, #0d9488 55%, #0b7568 100%);
  --wall: #e2efec;
  --wall-dot: rgba(13, 148, 136, 0.18);
  --wall-dot-2: rgba(8, 110, 120, 0.1);
}

/* Forest — dark green */
:root[data-theme="forest"] {
  --accent: #3cc47f;
  --accent-rgb: 60, 196, 127;
  --accent-hover: #2fab6c;
  --badge: #f5a524;
  --tick-read: #d9f99d;
  --bg: #0f1612;
  --surface: #16201a;
  --surface-2: #1d2a22;
  --surface-3: #26362c;
  --ink: #e6efe9;
  --ink-2: #bcd0c3;
  --muted: #89a192;
  --line: #24332a;
  --rail: #0a100c;
  --rail-ink: #86a592;
  --bubble-in: #1f2c24;
  --bubble-out: linear-gradient(135deg, #33a96b 0%, #23854f 60%, #1b6c40 100%);
  --wall: #121b16;
  --wall-dot: rgba(120, 220, 160, 0.13);
  --wall-dot-2: rgba(80, 180, 120, 0.08);
}

/* Blossom — light rose */
:root[data-theme="blossom"] {
  --accent: #d23f78;
  --accent-rgb: 210, 63, 120;
  --accent-hover: #bb3268;
  --badge: #7c3aed;
  --tick-read: #fde68a;
  --bg: #fbf4f7;
  --surface: #ffffff;
  --surface-2: #f7e9ef;
  --surface-3: #f0dbe5;
  --ink: #2a1520;
  --ink-2: #5a3a49;
  --muted: #8d6d7c;
  --line: #f0dfe7;
  --rail: #3a1428;
  --rail-ink: #e3b4c9;
  --bubble-in: #ffffff;
  --bubble-out: linear-gradient(135deg, #ea5e93 0%, #d23f78 55%, #b52f66 100%);
  --wall: #f7eaf0;
  --wall-dot: rgba(210, 63, 120, 0.16);
  --wall-dot-2: rgba(160, 40, 100, 0.09);
}

/* Deep Sea — dark navy blue */
:root[data-theme="deepsea"] {
  --accent: #3b9cff;
  --accent-rgb: 59, 156, 255;
  --accent-hover: #2b88ea;
  --badge: #f43f5e;
  --tick-read: #a5f3fc;
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #172236;
  --surface-3: #1f2c44;
  --ink: #e6edf8;
  --ink-2: #b8c6dd;
  --muted: #8193b0;
  --line: #1d2a40;
  --rail: #070c16;
  --rail-ink: #7f95b8;
  --bubble-in: #18243a;
  --bubble-out: linear-gradient(135deg, #3b9cff 0%, #2563eb 60%, #1d4ed8 100%);
  --wall: #0d1626;
  --wall-dot: rgba(120, 180, 255, 0.14);
  --wall-dot-2: rgba(80, 140, 230, 0.08);
}

/* theme picker in Settings */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 4px 20px 12px; }
.theme-card {
  display: grid; gap: 8px; padding: 8px; border-radius: var(--r-md); text-align: left;
  background: var(--surface); border: 2px solid var(--line);
  transition: border-color 0.15s, transform 0.1s;
}
.theme-card:hover { border-color: var(--muted); }
.theme-card:active { transform: scale(0.98); }
.theme-card[aria-checked="true"] { border-color: var(--accent); box-shadow: var(--focus); }
.theme-card .name { display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 600; padding: 0 4px 2px; }
.theme-card .name .icon { margin-left: auto; color: var(--accent); }
.theme-preview {
  position: relative; height: 78px; border-radius: 10px; overflow: hidden;
  display: grid; grid-template-columns: 18px 1fr;
}
.theme-preview .tp-rail { display: grid; align-content: start; justify-items: center; gap: 5px; padding-top: 7px; }
.theme-preview .tp-rail i { width: 8px; height: 8px; border-radius: 3px; opacity: 0.7; }
.theme-preview .tp-wall { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px; }
.theme-preview .tp-in, .theme-preview .tp-out { height: 12px; border-radius: 7px; }
.theme-preview .tp-in { width: 62%; border-bottom-left-radius: 3px; }
.theme-preview .tp-out { width: 52%; align-self: flex-end; border-bottom-right-radius: 3px; }
.theme-preview .tp-badge { position: absolute; top: 7px; right: 8px; width: 10px; height: 10px; border-radius: 50%; }
.theme-preview.auto { grid-template-columns: 1fr 1fr; }
.theme-preview.auto > div { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  overflow-x: clip;
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 15px; height: 15px; }

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

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: var(--t-sm);
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--surface-3); }
.btn-danger { background: rgba(229, 72, 77, 0.12); color: var(--red); }
.btn-danger:hover { background: rgba(229, 72, 77, 0.2); }
.btn-ghost { color: var(--accent); }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--ink-2); flex: none;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.active { color: var(--accent); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: var(--t-xs); color: var(--muted); }
.field .error { font-size: var(--t-xs); color: var(--red); min-height: 0; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 16px; /* prevents iOS zoom */
}
.textarea { resize: vertical; min-height: 84px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input.invalid { border-color: var(--red); }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; color: var(--ink); }
.search:focus-within { box-shadow: var(--focus); }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background 0.2s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-1); transition: transform 0.2s var(--ease);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- avatar ---------- */
.avatar {
  --size: 44px;
  position: relative; flex: none;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--size) * 0.38); color: #fff;
  background: var(--av, var(--accent));
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar .dot {
  position: absolute; right: 0; bottom: 0;
  width: calc(var(--size) * 0.28); height: calc(var(--size) * 0.28); min-width: 10px; min-height: 10px;
  border-radius: 50%; background: var(--green); border: 2px solid var(--surface);
}
.avatar.sm { --size: 34px; }
.avatar.xs { --size: 28px; }
.avatar.lg { --size: 64px; }
.avatar.xl { --size: 104px; }
.avatar.group { border-radius: 30%; }
.avatar.group img { border-radius: 30%; }

.badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--badge); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1;
}
.badge.muted-badge { background: var(--muted); }

/* =====================================================================
   App shell
   ===================================================================== */
#app { height: var(--app-h); }

.app {
  height: var(--app-h);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;
  overflow: hidden;
  overflow: clip; /* panes slide in from off-screen; never let the shell scroll */
}

/* nav rail (desktop) */
.rail {
  display: none;
  flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 0; background: var(--rail); color: var(--rail-ink);
}
.rail .brand { width: 44px; height: 44px; margin-bottom: 14px; }
.rail-btn {
  position: relative; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; color: var(--rail-ink);
  transition: background 0.15s, color 0.15s;
}
.rail-btn:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.rail-btn.active { background: rgba(var(--accent-rgb), 0.24); color: #fff; }
.rail-btn .badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
.rail .spacer { flex: 1; }
.rail .me-btn { border-radius: 50%; padding: 2px; }

/* list pane */
.pane-list {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.pane-head {
  display: flex; align-items: center; gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 16px 8px;
}
.pane-head h1 { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; margin: 0; flex: 1; }
.pane-tools { padding: 4px 16px 10px; display: grid; gap: 10px; }
.pane-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
.conn-banner {
  margin: 0 16px 8px; padding: 8px 12px; border-radius: var(--r-sm);
  background: rgba(233, 162, 59, 0.15); color: #a86a10; font-size: var(--t-sm);
  display: flex; align-items: center; gap: 8px;
}
:root[data-mode="dark"] .conn-banner { color: #f0bd6a; }

/* tab bar (mobile) */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.tab.active { color: var(--accent); }
.tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }

/* chat pane */
.pane-chat {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--wall);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  visibility: hidden;
}
.app[data-pane="chat"] .pane-chat { transform: none; visibility: visible; }

.chat-root { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* info pane */
.pane-info {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.28s var(--ease), visibility 0.28s;
}
.app.info-open .pane-info { transform: none; visibility: visible; }

/* ---------- conversation list ---------- */
.list-section { padding: 6px 16px 4px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.archived-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 16px; color: var(--ink-2); font-weight: 600; text-align: left;
}
.archived-row:hover { background: var(--surface-2); }
.archived-row .avatar { --av: var(--surface-3); color: var(--ink-2); }

.conv {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; margin: 0 4px; width: calc(100% - 8px);
  border-radius: var(--r-md); text-align: left; position: relative;
  transition: background 0.12s;
}
.conv:hover { background: var(--surface-2); }
.conv.active { background: rgba(var(--accent-rgb), 0.1); }
.conv.active::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: var(--t-xs); color: var(--muted); flex: none; }
.conv.unread .conv-time { color: var(--accent); font-weight: 600; }
.conv-preview { font-size: var(--t-sm); color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .conv-preview { color: var(--ink-2); }
.conv-preview .who { color: var(--ink-2); font-weight: 500; }
.conv-preview.typing { color: var(--accent); font-weight: 500; }
.conv-flags { display: inline-flex; gap: 4px; color: var(--muted); }
.ticks { display: inline-flex; color: var(--muted); }
.ticks.read { color: var(--accent); }

.empty {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 48px 28px; color: var(--muted);
}
.empty h2 { margin: 0; color: var(--ink); font-size: var(--t-lg); }
.empty p { margin: 0; max-width: 34ch; }
.empty .icon { width: 44px; height: 44px; color: var(--accent); opacity: 0.8; }

.skeleton { display: flex; gap: 12px; padding: 12px 16px; align-items: center; }
.skeleton i { display: block; border-radius: 8px; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

/* ---------- chat header ---------- */
.chat-head {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--header-h);
  padding: max(8px, env(safe-area-inset-top)) 8px 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.chat-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; padding: 4px; border-radius: var(--r-sm); }
.chat-title:hover { background: var(--surface-2); }
.chat-title .name { font-weight: 650; font-size: var(--t-md); }
.chat-title .status { font-size: var(--t-xs); color: var(--muted); }
.chat-title .status.online, .chat-title .status.typing { color: var(--accent); }

/* ---------- messages ---------- */
.messages {
  flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 14px 12px 10px;
  display: flex; flex-direction: column;
  background-color: var(--wall);
  /* Lyra constellation wallpaper */
  background-image:
    radial-gradient(circle at 12% 18%, var(--wall-dot) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 64% 9%, var(--wall-dot-2) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 82% 58%, var(--wall-dot) 0 1.4px, transparent 2px),
    radial-gradient(circle at 33% 72%, var(--wall-dot-2) 0 2px, transparent 2.6px),
    radial-gradient(circle at 48% 41%, var(--wall-dot) 0 1px, transparent 1.6px),
    radial-gradient(circle at 92% 92%, var(--wall-dot-2) 0 1.3px, transparent 1.9px);
  background-size: 180px 180px, 240px 240px, 200px 200px, 260px 260px, 150px 150px, 220px 220px;
}
.messages-inner { margin-top: auto; display: flex; flex-direction: column; gap: 2px; max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }
.load-older { align-self: center; margin: 6px 0 12px; font-size: var(--t-xs); color: var(--muted); }

.day {
  align-self: center; margin: 12px 0 8px;
  padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink-2); font-size: var(--t-xs); font-weight: 600;
  box-shadow: var(--shadow-1);
  position: sticky; top: 4px; z-index: 2;
}
.sys {
  align-self: center; max-width: 86%; text-align: center;
  margin: 6px 0; padding: 5px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted); font-size: var(--t-xs);
}
.unread-sep {
  align-self: stretch; text-align: center; margin: 10px 0;
  font-size: var(--t-xs); font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 10px;
}
.unread-sep::before, .unread-sep::after { content: ""; flex: 1; height: 1px; background: rgba(var(--accent-rgb), 0.3); }

.msg {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: min(78%, 560px);
  margin-top: 6px;
  position: relative;
}
.msg.cont { margin-top: 1px; }
.msg.out { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar-slot { width: 30px; flex: none; }
.msg.flash .bubble { animation: flash 1.4s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.45); } }

.bubble {
  position: relative; min-width: 64px;
  padding: 7px 11px 6px;
  border-radius: var(--r-bubble);
  background: var(--bubble-in); color: var(--bubble-in-ink);
  box-shadow: var(--shadow-1);
  overflow-wrap: anywhere; word-break: break-word;
  user-select: text;
}
.msg.in:not(.cont) .bubble { border-bottom-left-radius: 6px; }
.msg.out .bubble { background: var(--bubble-out); color: var(--bubble-out-ink); }
.msg.out:not(.cont) .bubble { border-bottom-right-radius: 6px; }
.msg.pending .bubble { opacity: 0.75; }
.msg.failed .bubble { box-shadow: 0 0 0 2px var(--red); }
.bubble .sender { font-size: var(--t-xs); font-weight: 650; margin-bottom: 2px; color: var(--sc, var(--accent)); }
.bubble .text { white-space: pre-wrap; }
.bubble .text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bubble .text.jumbo { font-size: 34px; line-height: 1.15; }
.bubble.deleted .text { font-style: italic; opacity: 0.7; }
.bubble .fwd { font-size: var(--t-xs); opacity: 0.75; display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.meta {
  float: right; display: inline-flex; align-items: center; gap: 3px;
  margin: 6px 0 -2px 10px; font-size: 11px; line-height: 1; white-space: nowrap;
  color: var(--muted); user-select: none;
}
.msg.out .meta { color: var(--bubble-out-muted); }
.msg.out .meta .ticks { color: var(--bubble-out-muted); }
.msg.out .meta .ticks.read { color: var(--tick-read); }
.media-only .meta {
  position: absolute; right: 8px; bottom: 8px; margin: 0; float: none;
  padding: 3px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); color: #fff !important;
}
.media-only .meta .ticks { color: #fff !important; }

.reply-quote {
  display: block; width: 100%; text-align: left;
  margin: 1px 0 5px; padding: 5px 9px; border-radius: 8px;
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.08); font-size: var(--t-sm);
}
.msg.out .reply-quote { border-left-color: #fff; background: rgba(255, 255, 255, 0.16); }
.reply-quote b { display: block; font-size: var(--t-xs); }
.reply-quote span { display: block; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg.out .reactions { justify-content: flex-end; }
.reaction {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-1);
  font-size: 13px; color: var(--ink-2);
}
.reaction.mine { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.4); }

.msg-actions {
  position: absolute; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity 0.12s;
}
.msg.in .msg-actions { right: -44px; }
.msg.out .msg-actions { left: -44px; }
.msg:hover .msg-actions { opacity: 1; }

/* attachments in bubbles */
.att-grid { display: grid; gap: 3px; margin: -3px -7px 4px; border-radius: 14px; overflow: hidden; }
.att-grid.n2 { grid-template-columns: 1fr 1fr; }
.att-grid.n3, .att-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-only .att-grid { margin: -5px -9px -4px; }
.att-img {
  position: relative; background: var(--surface-2); cursor: zoom-in;
  min-height: 120px; max-height: 360px; overflow: hidden;
}
.att-img img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; }
.att-grid.n1 .att-img img { object-fit: contain; height: auto; background: rgba(0,0,0,0.04); }
.att-video { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
.att-video video { width: 100%; max-height: 360px; }
.att-file {
  display: flex; align-items: center; gap: 10px; min-width: 220px;
  padding: 8px; margin: 2px -4px 4px; border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.08); color: inherit; text-decoration: none !important;
}
.msg.out .att-file { background: rgba(255, 255, 255, 0.15); }
.att-file .ficon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.msg.out .att-file .ficon { background: rgba(255, 255, 255, 0.95); color: var(--accent); }
.att-file .fname { font-weight: 600; font-size: var(--t-sm); }
.att-file .fsize { font-size: var(--t-xs); opacity: 0.75; }

.voice { display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 2px 0 4px; }
.voice .play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.msg.out .voice .play { background: #fff; color: var(--accent); }
.voice .wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.voice .wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: 0.3; }
.voice .wave i.on { opacity: 1; }
.voice .dur { font-size: var(--t-xs); opacity: 0.8; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.audio-el { width: 260px; max-width: 100%; height: 40px; margin: 2px 0 4px; }

/* typing dots */
.typing-row { align-self: flex-start; margin: 6px 0 2px 38px; }
.typing-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--bubble-in); box-shadow: var(--shadow-1); }
.typing-bubble i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing-bubble i:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.jump-down {
  position: absolute; right: 16px; bottom: 86px; z-index: 6;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-2);
  display: grid; place-items: center;
}
.jump-down .badge { position: absolute; top: -6px; right: -4px; }

/* ---------- composer ---------- */
.composer-wrap {
  position: relative;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--line);
}
.composer-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 4px 8px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border-left: 3px solid var(--accent);
  font-size: var(--t-sm);
}
.composer-bar .grow b { display: block; color: var(--accent); font-size: var(--t-xs); }
.composer { display: flex; align-items: flex-end; gap: 4px; max-width: 900px; margin: 0 auto; }
.composer-input {
  flex: 1; min-width: 0; display: flex; align-items: flex-end;
  border-radius: 22px; background: var(--surface-2); padding: 2px 4px 2px 14px;
  min-height: 44px;
}
.composer-input textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent;
  max-height: 160px; min-height: 40px; padding: 10px 0; line-height: 1.4; font-size: 16px; color: var(--ink);
}
.send-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:active { transform: scale(0.92); }
.send-btn.recording { background: var(--red); animation: rec 1.2s infinite; }
@keyframes rec { 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0.18); } }
.composer-locked { text-align: center; color: var(--muted); font-size: var(--t-sm); padding: 12px; }

.pending-files { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 10px; }
.pfile {
  position: relative; flex: none; width: 82px; height: 82px; border-radius: 12px;
  background: var(--surface-2); overflow: hidden; display: grid; place-items: center;
  font-size: 11px; text-align: center; color: var(--ink-2);
}
.pfile img { width: 100%; height: 100%; object-fit: cover; }
.pfile .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; }
.pfile .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.6); overflow: hidden; }
.pfile .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.pfile.error { box-shadow: inset 0 0 0 2px var(--red); }
.pfile .fn { padding: 6px; word-break: break-all; line-height: 1.2; }

.rec-panel { display: flex; align-items: center; gap: 12px; flex: 1; padding: 0 12px; min-height: 44px; border-radius: 22px; background: rgba(229, 72, 77, 0.1); color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-panel .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }

.drop-overlay {
  position: absolute; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(var(--accent-rgb), 0.12); border: 3px dashed var(--accent); border-radius: var(--r-lg);
  color: var(--accent); font-weight: 700; font-size: var(--t-lg); pointer-events: none; margin: 8px;
}

/* ---------- popovers / menus / sheets ---------- */
.popover {
  position: fixed; z-index: 1000; min-width: 210px; max-width: calc(100vw - 16px);
  padding: 6px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-3); border: 1px solid var(--line);
  animation: pop 0.14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-sm); text-align: left; font-size: var(--t-sm);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item.danger { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.react-row { display: flex; gap: 2px; padding: 4px 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.react-row button { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; display: grid; place-items: center; transition: transform 0.1s; }
.react-row button:hover { background: var(--surface-2); transform: scale(1.15); }
.react-row button.mine { background: rgba(var(--accent-rgb), 0.16); }

.emoji-panel { width: 320px; max-width: calc(100vw - 16px); }
.emoji-tabs { display: flex; gap: 2px; padding: 0 2px 6px; border-bottom: 1px solid var(--line); }
.emoji-tabs button { flex: 1; height: 34px; border-radius: 8px; font-size: 18px; }
.emoji-tabs button.active { background: var(--surface-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; padding-top: 6px; }
.emoji-grid button { height: 36px; border-radius: 8px; font-size: 22px; }
.emoji-grid button:hover { background: var(--surface-2); }

.backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(20, 16, 36, 0.48);
  display: grid; place-items: center; padding: 16px;
  animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(480px, 100%); max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  animation: rise 0.22s var(--ease);
  overflow: hidden;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 20px; }
.modal-head h2 { margin: 0; font-size: var(--t-lg); flex: 1; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }

.pick-list { display: grid; gap: 2px; margin: 8px -8px; max-height: 340px; overflow-y: auto; }
.pick {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); text-align: left; width: 100%;
}
.pick:hover { background: var(--surface-2); }
.pick .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; flex: none; }
.pick.selected .check { background: var(--accent); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 4px; border-radius: 999px; background: var(--surface-2); font-size: var(--t-sm); }
.chip .avatar { --size: 22px; }

.viewer {
  position: fixed; inset: 0; z-index: 1100; background: rgba(8, 6, 16, 0.94);
  display: flex; flex-direction: column; animation: fade 0.16s;
}
.viewer-head { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 10px 10px; color: #fff; }
.viewer-head .icon-btn { color: #fff; }
.viewer-head .icon-btn:hover { background: rgba(255,255,255,0.12); }
.viewer-body { flex: 1; display: grid; place-items: center; padding: 10px; min-height: 0; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

.toasts { position: fixed; z-index: 1200; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-2);
  font-size: var(--t-sm); animation: rise 0.2s var(--ease);
}
.toast.error { background: var(--red); color: #fff; }
.toast.clickable { cursor: pointer; }
.toast .avatar { --size: 32px; }

/* ---------- info panel ---------- */
.info-head { display: flex; align-items: center; gap: 6px; padding: max(10px, env(safe-area-inset-top)) 8px 6px; border-bottom: 1px solid var(--line); min-height: var(--header-h); }
.info-head h2 { margin: 0; font-size: var(--t-md); flex: 1; }
.info-body { flex: 1; overflow-y: auto; }
.profile-card { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 20px 16px; }
.profile-card h3 { margin: 8px 0 0; font-size: var(--t-xl); letter-spacing: -0.01em; }
.profile-card .sub { color: var(--muted); font-size: var(--t-sm); }
.profile-card .bio { margin-top: 6px; color: var(--ink-2); max-width: 36ch; white-space: pre-wrap; }
.quick-actions { display: flex; justify-content: center; gap: 10px; padding: 4px 16px 16px; }
.qa { display: grid; justify-items: center; gap: 4px; min-width: 70px; padding: 10px 8px; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.qa:hover { background: var(--surface-3); }
.qa.on { color: var(--accent); }
.section { padding: 8px 0; border-top: 8px solid var(--bg); }
.section h4 { margin: 8px 20px; font-size: var(--t-sm); color: var(--muted); font-weight: 600; display: flex; align-items: center; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 20px; text-align: left; min-height: 50px;
}
button.row:hover { background: var(--surface-2); }
.row .icon { color: var(--muted); }
.row.danger, .row.danger .icon { color: var(--red); }
.row .role { font-size: var(--t-xs); color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 0 16px 8px; }
.tabs button { flex: 1; height: 34px; border-radius: 999px; font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.tabs button.active { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 16px 16px; }
.gallery .g { aspect-ratio: 1; background: var(--surface-2); border-radius: 6px; overflow: hidden; position: relative; }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g .play-ov { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,0.25); }
.file-list { padding: 0 8px 12px; }

/* ---------- settings / content pages ---------- */
.page { padding: 0 0 24px; }
.page .group-title { padding: 18px 20px 6px; font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.page .card { background: var(--surface); }
.setting { display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-height: 56px; width: 100%; text-align: left; }
button.setting:hover { background: var(--surface-2); }
.setting .grow small { display: block; color: var(--muted); font-size: var(--t-xs); }
.me-card { display: flex; align-items: center; gap: 14px; padding: 12px 20px 18px; }
.me-card h2 { margin: 0; font-size: var(--t-lg); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button { height: 30px; padding: 0 12px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.notif { display: flex; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; align-items: flex-start; }
.notif:hover { background: var(--surface-2); }
.notif .nicon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), 0.12); color: var(--accent); flex: none; }
.notif.unread .ntitle { font-weight: 650; }
.notif.unread::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); margin-top: 6px; flex: none; }
.notif .ntime { font-size: var(--t-xs); color: var(--muted); }

.welcome {
  flex: 1; display: none; place-items: center; text-align: center; padding: 32px;
  color: var(--muted);
}
.welcome .mark { width: 92px; height: 92px; margin: 0 auto 18px; }
.welcome h2 { color: var(--ink); margin: 0 0 6px; font-size: var(--t-xl); letter-spacing: -0.02em; }

/* ---------- auth ---------- */
.auth {
  min-height: var(--app-h); overflow-y: auto;
  display: grid; place-items: center; padding: 24px 18px;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(var(--accent-rgb), 0.22), transparent 60%),
    radial-gradient(900px 500px at -20% 110%, rgba(67, 56, 202, 0.18), transparent 60%),
    var(--bg);
}
.auth-card { width: min(420px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand svg { width: 48px; height: 48px; }
.auth-brand b { font-size: 26px; letter-spacing: -0.03em; }
.auth h1 { font-size: var(--t-2xl); line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 8px; }
.auth .lede { color: var(--muted); margin: 0 0 24px; }
.auth form { background: var(--surface); padding: 22px; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.auth .alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: var(--t-sm); }
.auth .alt button { color: var(--accent); font-weight: 600; }
.form-error { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(229, 72, 77, 0.1); color: var(--red); font-size: var(--t-sm); }
.form-ok { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(31, 183, 107, 0.12); color: #128a50; font-size: var(--t-sm); word-break: break-all; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 4px; top: 3px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(var(--accent-rgb), 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; height: var(--app-h); }

/* =====================================================================
   Responsive — tablet & desktop
   ===================================================================== */
@media (min-width: 768px) {
  .app { grid-template-columns: var(--list-w) 1fr; }
  .tabbar { display: none; }
  .pane-body { padding-bottom: 12px; }
  .pane-chat {
    position: relative; inset: auto; transform: none; visibility: visible; z-index: 1;
  }
  .app:not([data-pane="chat"]) .pane-chat > :not(.welcome) { display: none; }
  .app:not([data-pane="chat"]) .welcome { display: grid; }
  .chat-head .back { display: none; }
  .toasts { bottom: 24px; left: auto; right: 24px; transform: none; }
  .msg { max-width: min(70%, 560px); }
  .pane-info { width: var(--info-w); left: auto; border-left: 1px solid var(--line); box-shadow: var(--shadow-2); }
}

@media (min-width: 1024px) {
  .app { grid-template-columns: var(--rail-w) var(--list-w) 1fr; }
  .rail { display: flex; }
  .pane-head .me-mini { display: none; }
}

@media (min-width: 1280px) {
  .app.info-open { grid-template-columns: var(--rail-w) var(--list-w) 1fr var(--info-w); }
  .pane-info { position: relative; inset: auto; width: auto; transform: none; box-shadow: none; display: none; }
  .app.info-open .pane-info { display: flex; }
}

@media (max-width: 767px) {
  .msg-actions { display: none; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; align-self: end; width: 100%; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .backdrop { padding: 0; place-items: end stretch; }
  .msg .avatar-slot { width: 26px; }
  .msg .avatar-slot .avatar { --size: 26px; }
}
