:root {
  color-scheme: light;
  --ink: oklch(25% 0.025 220);
  --muted: oklch(55% 0.025 215);
  --muted-strong: oklch(44% 0.03 215);
  --line: oklch(90% 0.01 210);
  --canvas: oklch(97% 0.006 200);
  --surface: oklch(99% 0.004 200);
  --surface-strong: oklch(95% 0.009 205);
  --primary: oklch(57% 0.105 220);
  --primary-hover: oklch(51% 0.1 220);
  --primary-soft: oklch(94% 0.035 215);
  --mint: oklch(64% 0.11 160);
  --mint-soft: oklch(95% 0.032 160);
  --danger: oklch(58% 0.13 20);
  --danger-soft: oklch(95% 0.03 20);
  --warning: oklch(72% 0.12 75);
  --own-bubble: oklch(93% 0.045 210);
  --overlay: color-mix(in oklch, var(--ink) 36%, transparent);
  --shadow-low: 0 10px 30px color-mix(in oklch, var(--ink) 12%, transparent);
  --focus: 0 0 0 3px color-mix(in oklch, var(--primary) 22%, transparent);
  --rail: 76px;
  --list: 340px;
  --detail: 292px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: oklch(92% 0.012 210);
  --muted: oklch(68% 0.02 215);
  --muted-strong: oklch(78% 0.018 215);
  --line: oklch(31% 0.018 215);
  --canvas: oklch(19% 0.018 220);
  --surface: oklch(23% 0.018 220);
  --surface-strong: oklch(27% 0.02 220);
  --primary: oklch(72% 0.105 215);
  --primary-hover: oklch(77% 0.1 215);
  --primary-soft: oklch(31% 0.05 215);
  --mint: oklch(73% 0.1 160);
  --mint-soft: oklch(29% 0.04 160);
  --danger: oklch(72% 0.12 20);
  --danger-soft: oklch(29% 0.04 20);
  --own-bubble: oklch(31% 0.052 210);
  --overlay: color-mix(in oklch, black 60%, transparent);
}

* { box-sizing: border-box; }

html, body, #app { width: 100%; min-width: 320px; height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--focus);
}

.icon {
  display: inline-block;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.sm { width: 17px; height: 17px; }
.icon.lg { width: 26px; height: 26px; }

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 180ms cubic-bezier(.25,1,.5,1), color 180ms cubic-bezier(.25,1,.5,1), transform 180ms cubic-bezier(.25,1,.5,1);
}

.btn:hover { background: var(--surface-strong); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--surface); font-weight: 700; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.soft { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.icon-only { width: 42px; padding: 0; border-radius: 50%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-shell {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(360px, 48%) minmax(420px, 52%);
  background: var(--surface);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 76px);
  background: var(--canvas);
  border-right: 1px solid var(--line);
}

.login-story::before,
.login-story::after {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid color-mix(in oklch, var(--primary) 22%, transparent);
  border-radius: 50%;
  content: "";
}

.login-story::before { top: -190px; right: -70px; }
.login-story::after { bottom: -230px; left: -160px; }

.brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--primary);
  color: var(--surface);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 550; }

.story-copy { position: relative; z-index: 1; max-width: 570px; }
.story-copy h1 { max-width: 12ch; margin: 0; font-size: clamp(40px, 5vw, 72px); line-height: 1.06; letter-spacing: -.055em; }
.story-copy p { max-width: 42ch; margin: 24px 0 0; color: var(--muted-strong); font-size: 16px; line-height: 1.75; }
.story-points { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.story-point { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-strong); background: var(--surface); font-size: 12px; font-weight: 650; }

.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(410px, 100%); }
.login-card h2 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
.login-intro { margin: 10px 0 30px; color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 700; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  transition: border-color 180ms cubic-bezier(.25,1,.5,1), box-shadow 180ms cubic-bezier(.25,1,.5,1);
}
.field input:focus { border-color: var(--primary); outline: 0; box-shadow: var(--focus); }
.login-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.login-actions .primary { min-width: 132px; }
.login-demo { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--canvas); color: var(--muted-strong); font-size: 12px; line-height: 1.55; }
.login-error { margin: 0 0 16px; padding: 11px 13px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }

.app-shell { display: grid; height: 100%; grid-template-columns: var(--rail) minmax(278px, var(--list)) minmax(420px, 1fr) var(--detail); background: var(--surface); }
.app-shell.detail-closed { grid-template-columns: var(--rail) minmax(278px, var(--list)) minmax(420px, 1fr) 0; }

.nav-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--canvas);
}

.rail-brand { display: grid; width: 44px; height: 44px; place-items: center; margin: 1px 0 22px; border-radius: 14px; background: var(--primary); color: var(--surface); }
.rail-items { display: grid; width: 100%; gap: 6px; }
.rail-spacer { flex: 1; }
.rail-button {
  display: grid;
  width: 100%;
  min-height: 54px;
  place-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.rail-button span { font-size: 10px; font-weight: 650; }
.rail-button:hover { background: var(--surface-strong); color: var(--ink); }
.rail-button.active { background: var(--primary-soft); color: var(--primary); }
.rail-avatar { width: 38px; height: 38px; }

.list-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.list-header { padding: 20px 16px 12px; }
.list-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.list-title-row h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.connection-pill.offline .connection-dot { background: var(--danger); }
.search-box { position: relative; }
.search-box .icon { position: absolute; top: 11px; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; height: 42px; padding: 0 12px 0 40px; border: 1px solid transparent; border-radius: 12px; background: var(--canvas); color: var(--ink); }
.search-box input:focus { border-color: var(--primary); outline: 0; box-shadow: var(--focus); }
.filter-row { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.filter-chip:hover { background: var(--canvas); color: var(--ink); }
.filter-chip.active { background: var(--primary-soft); color: var(--primary); }

.conversation-list { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 12px; }
.conversation-row {
  display: grid;
  width: 100%;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms cubic-bezier(.25,1,.5,1);
}
.conversation-row:hover { background: var(--canvas); }
.conversation-row.active { background: var(--primary-soft); }
.avatar {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--muted-strong);
  font-size: 16px;
  font-weight: 750;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.online::after { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border: 2px solid var(--surface); border-radius: 50%; background: var(--mint); content: ""; }
.conversation-row.active .avatar.online::after { border-color: var(--primary-soft); }
.conversation-copy { min-width: 0; overflow: hidden; }
.conversation-name-line { display: flex; min-width: 0; align-items: center; gap: 5px; }
.conversation-name { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-meta {
  display: grid;
  flex-shrink: 0;
  justify-items: end;
  align-self: stretch;
  align-content: space-between;
  gap: 8px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 11px;
}
.unread-badge {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--surface);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}
.list-empty { display: grid; place-items: center; min-height: 220px; padding: 30px; color: var(--muted); text-align: center; line-height: 1.6; }

.main-panel { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--canvas); }
.chat-header { display: flex; height: 72px; flex: 0 0 72px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.chat-identity .avatar { width: 44px; height: 44px; }
.chat-title { min-width: 0; }
.chat-title h1 { margin: 0; overflow: hidden; font-size: 16px; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.chat-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; }
.chat-subtitle.online { color: var(--mint); font-weight: 650; }
.chat-actions { display: flex; gap: 3px; }
.mobile-back { display: none; }

.message-scroll { flex: 1; min-height: 0; overflow: auto; padding: 24px clamp(18px, 4vw, 54px) 18px; scroll-behavior: smooth; }
.day-divider { display: flex; align-items: center; gap: 12px; margin: 7px 0 20px; color: var(--muted); font-size: 11px; font-weight: 650; }
.day-divider::before, .day-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.message-row { display: flex; gap: 9px; margin: 7px 0; align-items: flex-end; }
.message-row.own { justify-content: flex-end; }
.message-row .avatar { width: 32px; height: 32px; font-size: 11px; }
.bubble-wrap { max-width: min(68%, 680px); }
.message-sender { margin: 0 0 4px 3px; color: var(--primary); font-size: 11px; font-weight: 700; }
.message-bubble { padding: 9px 12px 7px; border: 1px solid var(--line); border-radius: 14px 14px 14px 5px; background: var(--surface); box-shadow: 0 1px 0 color-mix(in oklch, var(--ink) 3%, transparent); }
.message-row.own .message-bubble { border-color: color-mix(in oklch, var(--primary) 18%, var(--line)); border-radius: 14px 14px 5px 14px; background: var(--own-bubble); }
.message-text { color: var(--ink); line-height: 1.52; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 4px; color: var(--muted); font-size: 10px; }
.message-meta .delivered { color: var(--primary); }
.empty-chat { display: grid; height: 100%; place-items: center; color: var(--muted); text-align: center; }
.empty-chat-inner { max-width: 340px; }
.empty-orbit { display: grid; width: 84px; height: 84px; place-items: center; margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--primary); }
.empty-chat h2 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.empty-chat p { margin: 0; line-height: 1.65; }

.composer-shell { flex: 0 0 auto; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.composer { display: flex; min-height: 48px; align-items: flex-end; gap: 5px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); }
.composer textarea { min-width: 0; max-height: 120px; flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); line-height: 1.5; padding: 9px 7px; }
.composer .btn { flex: 0 0 auto; }
.composer-hint { display: flex; justify-content: space-between; margin: 6px 4px 0; color: var(--muted); font-size: 10px; }

.detail-panel { min-width: 0; overflow: hidden; border-left: 1px solid var(--line); background: var(--surface); transition: width 220ms cubic-bezier(.16,1,.3,1), opacity 180ms cubic-bezier(.25,1,.5,1); }
.detail-closed .detail-panel { width: 0; opacity: 0; border-left: 0; }
.detail-scroll { width: var(--detail); height: 100%; overflow: auto; padding: 24px 18px; }
.detail-profile { text-align: center; }
.detail-profile .avatar { width: 78px; height: 78px; margin: 0 auto 13px; font-size: 24px; }
.detail-profile h2 { margin: 0; font-size: 18px; }
.detail-profile p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 20px 0 24px; }
.detail-action { display: grid; min-height: 64px; place-items: center; align-content: center; gap: 5px; padding: 7px; border: 0; border-radius: 12px; background: var(--canvas); color: var(--muted-strong); cursor: pointer; }
.detail-action:hover { background: var(--primary-soft); color: var(--primary); }
.detail-action span { font-size: 10px; font-weight: 650; }
.detail-section { padding: 17px 0; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 12px; font-size: 12px; font-weight: 750; }
.detail-row { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted-strong); font-size: 12px; }
.detail-row strong { color: var(--ink); font-weight: 650; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.media-tile { aspect-ratio: 1; border-radius: 8px; background: var(--surface-strong); overflow: hidden; }
.media-tile:nth-child(2) { background: var(--primary-soft); }
.media-tile:nth-child(3) { background: var(--mint-soft); }

.section-page { flex: 1; min-height: 0; overflow: auto; padding: clamp(24px, 5vw, 58px); background: var(--canvas); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.content-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 24px; }
.surface-block { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.surface-block h2 { margin: 0 0 16px; font-size: 15px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.contact-card { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: 14px; background: var(--surface); cursor: pointer; }
.contact-card:hover { border-color: var(--line); background: var(--primary-soft); }
.contact-card .avatar { width: 44px; height: 44px; }
.contact-card-copy { min-width: 0; }
.contact-card-copy strong, .contact-card-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card-copy span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.quick-list { display: grid; gap: 8px; }
.quick-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 10px; border-radius: 12px; }
.quick-row:hover { background: var(--canvas); }
.quick-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.quick-copy { flex: 1; }
.quick-copy strong { display: block; font-size: 13px; }
.quick-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.file-list { display: grid; gap: 9px; }
.file-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.file-kind { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.file-copy { min-width: 0; }
.file-copy strong, .file-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.settings-list { display: grid; gap: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.setting-copy strong { display: block; font-size: 13px; }
.setting-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); content: ""; transition: transform 180ms cubic-bezier(.25,1,.5,1); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.profile-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.profile-hero .avatar { width: 64px; height: 64px; font-size: 21px; }
.profile-hero h2 { margin: 0; }
.profile-hero p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.toast-stack { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-low); color: var(--ink); font-size: 12px; }
.toast.error { background: var(--danger-soft); color: var(--danger); }

.mobile-nav { display: none; }
.mobile-topbar { display: none; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-strong); }
.skeleton::after { position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--surface) 65%, transparent), transparent); content: ""; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (max-width: 1180px) {
  :root { --detail: 272px; --list: 312px; }
  .app-shell { grid-template-columns: var(--rail) minmax(270px, var(--list)) minmax(380px, 1fr); }
  .detail-panel { display: none; }
  .bubble-wrap { max-width: 76%; }
}

@media (max-width: 720px) {
  :root { --mobile-nav: calc(64px + env(safe-area-inset-bottom)); }
  body { background: var(--surface); }
  .login-shell { display: block; min-height: 100%; overflow: auto; }
  .login-story { min-height: auto; padding: 24px 22px 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-copy { margin-top: 50px; }
  .story-copy h1 { max-width: 10ch; font-size: 38px; }
  .story-copy p { font-size: 14px; }
  .story-points { display: none; }
  .login-panel { display: block; padding: 30px 22px 42px; }
  .login-card { margin: 0 auto; }
  .login-actions { align-items: stretch; flex-direction: column-reverse; }
  .login-actions .btn { width: 100%; }

  .app-shell, .app-shell.detail-closed { display: block; height: 100%; }
  .nav-rail, .detail-panel { display: none; }
  .list-panel { position: absolute; inset: 0 0 var(--mobile-nav); border-right: 0; }
  .list-header { padding: max(16px, env(safe-area-inset-top)) 16px 11px; }
  .list-title-row { margin-bottom: 12px; }
  .conversation-list { padding-bottom: 16px; }
  .conversation-row { min-height: 74px; border-radius: 10px; }
  .main-panel { position: absolute; z-index: 10; inset: 0; display: none; background: var(--canvas); }
  .app-shell.mobile-chat-open .main-panel { display: flex; }
  .app-shell.mobile-chat-open .list-panel, .app-shell.mobile-chat-open .mobile-nav { display: none; }
  .mobile-back { display: inline-flex; }
  .chat-header { height: calc(64px + env(safe-area-inset-top)); flex-basis: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 9px 0 7px; }
  .chat-identity { gap: 8px; }
  .chat-identity .avatar { width: 39px; height: 39px; }
  .chat-actions .hide-mobile { display: none; }
  .message-scroll { padding: 16px 10px 12px; }
  .bubble-wrap { max-width: 82%; }
  .message-row .avatar { display: none; }
  .message-bubble { padding: 8px 10px 6px; }
  .composer-shell { padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
  .composer-hint { display: none; }
  .composer { border-radius: 15px; }
  .section-page { position: absolute; inset: 0 0 var(--mobile-nav); padding: max(20px, env(safe-area-inset-top)) 16px 24px; }
  .app-shell.section-active .list-panel { display: none; }
  .app-shell.section-active .main-panel,
  .app-shell.section-active .section-page { display: block; }
  .page-heading { align-items: center; margin-bottom: 20px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { display: none; }
  .content-split { grid-template-columns: 1fr; }
  .surface-block { padding: 16px; border-radius: 15px; }
  .contact-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; height: var(--mobile-nav); grid-template-columns: repeat(5, 1fr); padding: 6px 6px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-nav-button { display: grid; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
  .mobile-nav-button span { font-size: 10px; font-weight: 650; }
  .mobile-nav-button.active { color: var(--primary); }
  .mobile-nav-button.active .icon-wrap { background: var(--primary-soft); }
  .icon-wrap { display: grid; min-width: 42px; height: 28px; place-items: center; border-radius: 999px; }
  .toast-stack { right: 10px; bottom: calc(var(--mobile-nav) + 10px); left: 10px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
