/* Chat — "Help now, not next month" home layout.
   Scoped under `.chat` like the landing's `.lp`, so these rules never leak
   elsewhere. Fixed hex values keep the landing palette (dark green #17251f,
   cream #f2efe6, coral #c2603e, sage #9fb8a9) consistent regardless of the
   browser's color scheme. */

.chat {
  font-family: 'Gabarito', system-ui, sans-serif;
  background: #17251f;
  color: #f2efe6;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Padding from the browser viewport, like the landing page: safe-area
     insets (notch/home-indicator on viewport-fit=cover devices) so the
     topbar and composer never sit under the OS chrome. */
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
/* App-shell behaviour: the chat is exactly viewport height (100dvh, flex
   column, inner scroll areas), so the document never has room to scroll
   down — but overscroll chaining is intentionally left at the default so a
   pull-down at the top still triggers the browser's native pull-to-refresh. */
:where(.chat) header,
:where(.chat) main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0;
}
.chat h1 { font-family: 'Gabarito', system-ui, sans-serif; }
.chat a { color: #f2efe6; }

/* ── Top bar ── */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 6px;
}
.chat-logo {
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #f2efe6;
  text-decoration: none;
}
.chat-logo:hover { opacity: 0.75; }
.chat-logo-dot { color: #c2603e; }
.chat-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.beta-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #f2efe6;
  background: #c2603e;
  border-radius: 6px;
  padding: 3px 7px;
  transform: translateY(-1px);
}
.beta-version {
  font-family: "Instrument Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: rgba(242, 239, 232, 0.55);
  letter-spacing: 0.02em;
}
.chat-matches-link {
  font-size: 13.5px;
  font-weight: 700;
  color: #9fb8a9;
  background: rgba(242, 239, 232, 0.07);
  border: 1px solid rgba(242, 239, 232, 0.2);
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chat-matches-link:hover {
  color: #f2efe6;
  border-color: #c2603e;
  background: rgba(194, 96, 62, 0.14);
}

/* ── Scroll area ── */
.chat-main {
  flex: 1;
  min-height: 0;
  /* Definite height (the .chat shell is exactly 100dvh), so this flex column
     and its children resolve against a fixed size. #chat-home and
     #messages-wrap are siblings here: they are mutually exclusive (a fresh
     visitor sees home, anyone with history sees the wrap), whichever is
     visible fills the area via flex-grow, and neither is ever painted over
     the other. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 20px 0;
}
.chat-home {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 20px 4px 6px;
}
.chat-home[hidden],
.chat .messages-wrap[hidden] { display: none; }

/* ── Hero ── */
.chat-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-hero-title {
  margin: 0;
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f2efe6;
}
.chat-hero-accent { color: #c2603e; }
.chat-hero-sub {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: #9fb8a9;
  max-width: 340px;
}

/* ── Category cards ── */
.chat-categories {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chat .chat-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #17251f;
  background: #f2efe6;
  border: none;
  border-radius: 999px;
  padding: 15px 24px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.chat .chat-category:hover {
  background: #e8b49a;
  transform: translateY(-1px);
}
.chat-category-arrow { color: #c2603e; font-weight: 700; flex-shrink: 0; }

/* ── Trust bar ── */
.chat-trustbar {
  margin-top: auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  color: #9fb8a9;
}

/* ── Example catalogue: tappable placeholders that auto-fill the input ── */
.composer-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.composer-chips::-webkit-scrollbar { display: none; }
.composer-chip {
  flex-shrink: 0;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #9fb8a9;
  background: rgba(242, 239, 232, 0.05);
  border: 1px solid rgba(242, 239, 232, 0.16);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.composer-chip:hover { border-color: #c2603e; color: #f2efe6; }
.composer-chip:focus-visible { outline: 2px solid #c2603e; outline-offset: 1px; }

/* ── Composer ── */
.chat .composer {
  flex-shrink: 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 24px;
}
.composer-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(242, 239, 232, 0.07);
  border: 1px solid rgba(242, 239, 232, 0.2);
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer-pill:focus-within {
  border-color: #c2603e;
  box-shadow: 0 0 0 3px rgba(194, 96, 62, 0.18);
}
.chat .composer-form {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat #msg-input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: none;
  background: transparent;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 14.5px;
  color: #f2efe6;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
  padding: 8px 0;
}
.chat #msg-input::placeholder { color: #9fb8a9; }
.chat #send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  color: #f2efe6;
  background: #c2603e;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  opacity: 0.5;
}
.chat #send-btn.ready { opacity: 1; }
.chat #send-btn:hover { background: #9e4a2e; transform: translateY(-1px); }
.chat #send-btn:disabled { opacity: 0.5; cursor: wait; }
.chat #send-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Mic / voice */
.chat .mic-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  min-height: 38px;
  max-height: 38px;
  aspect-ratio: 1;
  flex: none;
  padding: 0;
  border-radius: 50%;
  background: rgba(242, 239, 232, 0.07);
  border: 1.5px solid rgba(242, 239, 232, 0.34);
  color: #c7d6cd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.chat .mic-btn:hover { border-color: rgba(242, 239, 232, 0.5); color: #f2efe6; }
.chat .mic-btn:disabled { opacity: 0.5; cursor: wait; }
.chat .mic-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat .mic-btn.connecting,
.chat .mic-btn.listening {
  background: #c2603e;
  border-color: #c2603e;
  color: #f2efe6;
  animation: chatMicPulse 1.3s ease-in-out infinite;
}
.chat .mic-btn.speaking {
  background: #9fb8a9;
  border-color: #9fb8a9;
  color: #17251f;
  box-shadow: 0 0 0 3px #c2603e;
}
@keyframes chatMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194, 96, 62, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(194, 96, 62, 0); }
}

/* ── Contact capture (no-match: Avi asks for the seeker's details) ──
   The free-text pill becomes a small stacked form of name/email/phone fields
   with proper autocomplete attributes, so browsers can autofill them. */
.composer-pill.contact-mode {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border-radius: 20px;
  padding: 12px;
}
.composer-pill.contact-mode #chat-form,
.composer-pill.contact-mode .mic-btn { display: none; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.contact-form[hidden] { display: none; }
.contact-intro {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #9fb8a9;
  padding: 0 2px;
}
.contact-field {
  width: 100%;
  border: 1px solid rgba(242, 239, 232, 0.16);
  background: #1c2d24;
  border-radius: 12px;
  color: #f2efe6;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.4;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-field:focus {
  border-color: #c2603e;
  box-shadow: 0 0 0 3px rgba(194, 96, 62, 0.18);
}
.contact-field::placeholder { color: #9fb8a9; }
/* Chrome paints autofilled inputs pale blue; re-tint them so filled fields
   still read as part of the composer. */
.contact-form input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #1c2d24 inset;
  -webkit-text-fill-color: #f2efe6;
  caret-color: #f2efe6;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contact-row .contact-field { flex: 1; min-width: 0; }
.contact-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  color: #f2efe6;
  background: #c2603e;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.contact-send:hover { background: #9e4a2e; transform: translateY(-1px); }
.contact-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.contact-cancel {
  align-self: center;
  border: none;
  background: transparent;
  color: #9fb8a9;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.contact-cancel:hover { color: #f2efe6; }
.composer-pill.contact-mode.contact-invalid {
  border-color: #d97b5e;
  animation: chatShake 0.3s;
}
@keyframes chatShake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Conversation (after the home state) ── */
.chat .messages-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 8px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.chat .msg {
  display: flex;
  align-items: flex-start;
  max-width: 100%;
  animation: chatMsgIn 0.3s ease-out both;
}
.chat .msg.user {
  justify-content: flex-end;
  align-items: flex-end;
}
.chat .msg.user .msg-bubble { margin-left: auto; }
.chat .messages-wrap::-webkit-scrollbar { width: 6px; }
.chat .messages-wrap::-webkit-scrollbar-track { background: transparent; }
.chat .messages-wrap::-webkit-scrollbar-thumb { background: rgba(242, 239, 232, 0.18); border-radius: 3px; }

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.chat .msg-bubble {
  min-width: 0;
  max-width: 82%;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 13px 18px;
  font-size: 15px;
  line-height: 1.65;
  border-radius: 20px;
}
.chat .msg.avi .msg-bubble {
  font-family: 'Gabarito', system-ui, sans-serif;
  background: rgba(242, 239, 232, 0.09);
  color: #f2efe6;
  border-bottom-left-radius: 6px;
}
.chat .msg.avi .msg-bubble p  { margin: 0 0 0.6em; }
.chat .msg.avi .msg-bubble p:last-child { margin-bottom: 0; }
.chat .msg.avi .msg-bubble h3,
.chat .msg.avi .msg-bubble h4 {
  margin: 0.9em 0 0.35em;
  font-weight: 800;
  line-height: 1.3;
  color: #f2efe6;
}
.chat .msg.avi .msg-bubble h3 { font-size: 17px; }
.chat .msg.avi .msg-bubble h4 { font-size: 16px; }
.chat .msg.avi .msg-bubble ul,
.chat .msg.avi .msg-bubble ol { margin: 0.4em 0 0.6em 1.2em; padding: 0; }
.chat .msg.avi .msg-bubble li { margin-bottom: 0.25em; }
.chat .msg.avi .msg-bubble strong { font-weight: 700; color: #f2efe6; }
.chat .msg.avi .msg-bubble em { font-style: italic; }
.chat .msg.avi .msg-bubble a { color: #c2603e; }
.chat .msg.avi .msg-bubble code {
  font-family: 'Instrument Mono', ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(242, 239, 232, 0.1);
  border-radius: 5px;
  padding: 1px 6px;
}
.chat .msg.user .msg-bubble {
  background: #c2603e;
  color: #f2efe6;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.chat .msg.user .msg-bubble .msg-bubble-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(242, 239, 232, 0.28);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.8;
}

/* ── Chat-ended divider ── */
.chat .chat-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  animation: chatMsgIn 0.3s ease-out both;
}
.chat .chat-divider-line { flex: 1; height: 1px; background: rgba(242, 239, 232, 0.18); }
.chat .chat-divider-content {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #9fb8a9;
}
.chat .chat-divider-topic { font-weight: 700; color: #e8b49a; }

/* Match link surfaced in the stream when a real match is found */
.chat .msg-match {
  display: flex;
  justify-content: flex-start;
  animation: chatMsgIn 0.3s ease-out both;
}
.chat .msg-match-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #17251f;
  background: #f2efe6;
  border-radius: 999px;
  padding: 10px 18px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.chat .msg-match-link:hover { background: #e8b49a; transform: translateY(-1px); }

/* ── Typing indicator ── */
.chat .typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 0;
  width: fit-content;
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}
.chat .typing-indicator.visible { opacity: 1; visibility: visible; }
.chat .typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c2603e;
  animation: chatTyping 1.2s ease-in-out infinite;
}
.chat .typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chat .typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Voice status pill */
.chat .voice-status-pill {
  display: none;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8b49a;
  background: rgba(194, 96, 62, 0.16);
  border-radius: 999px;
  padding: 5px 11px;
  margin: 10px auto 0;
  width: fit-content;
}
.chat .voice-status-pill:not(:empty) { display: inline-flex; align-items: center; gap: 6px; }
.chat .voice-status-pill.speaking { background: rgba(159, 184, 169, 0.18); color: #9fb8a9; }
.chat .voice-status-pill.connecting { background: rgba(194, 96, 62, 0.16); color: #e8b49a; }
.chat .voice-status-pill .vsp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: chatPulse 1.5s ease-in-out infinite;
}
@keyframes chatPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* ── Topbar actions (chats / new chat / install) ── */
.chat-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(242, 239, 232, 0.07);
  border: 1px solid rgba(242, 239, 232, 0.2);
  color: #c7d6cd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.chat-icon-btn:hover {
  border-color: #c2603e;
  background: rgba(194, 96, 62, 0.14);
  color: #f2efe6;
  transform: translateY(-1px);
}
.chat-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The notifications (bell) opt-in: coral when on, so the state is visible at
   a glance without opening a settings page. */
.chat-notif-btn.is-on {
  color: #c2603e;
  border-color: #c2603e;
  background: rgba(194, 96, 62, 0.16);
}

/* ── Current-thread meta strip (topic + outcome badge) ── */
.chat-thread-meta {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 24px 0;
  font-size: 13px;
  color: #9fb8a9;
}
.chat-thread-topic {
  font-weight: 700;
  color: #e8b49a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.chat-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(242, 239, 232, 0.1);
  color: #9fb8a9;
}
.chat-status.flag-matched { background: rgba(159, 184, 169, 0.2); color: #9fb8a9; }
.chat-status.flag-unmatched { background: rgba(242, 239, 232, 0.1); color: #c7d6cd; }
.chat-status.flag-resolved { background: rgba(194, 96, 62, 0.25); color: #e8b49a; }

/* ── Chats drawer ── */
.chats-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.chats-drawer[hidden] { display: none; }
.chats-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 13, 0.55);
  backdrop-filter: blur(2px);
  animation: chatFadeIn 0.2s ease-out;
}
.chats-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(330px, 88vw);
  background: #1c2b23;
  border-left: 1px solid rgba(242, 239, 232, 0.14);
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
  box-sizing: border-box;
  animation: chatDrawerIn 0.25s ease-out;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.35);
}
@keyframes chatFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes chatDrawerIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.chats-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.chats-drawer-title {
  margin: 0;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #f2efe6;
  letter-spacing: -0.02em;
}
.chats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chats-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 12px;
  text-decoration: none;
  background: rgba(242, 239, 232, 0.04);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.chats-item:hover { background: rgba(242, 239, 232, 0.09); }
.chats-item.is-current { border-color: rgba(194, 96, 62, 0.55); background: rgba(194, 96, 62, 0.1); }
.chats-item-topic {
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #f2efe6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chats-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chats-item .chat-status { font-size: 10px; padding: 2px 7px; }
.chats-item-when {
  font-size: 11px;
  color: #9fb8a9;
}
.chats-empty {
  color: #9fb8a9;
  font-size: 13.5px;
  padding: 10px 4px;
}
.chats-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(242, 239, 232, 0.1);
  margin-top: 12px;
}
.chats-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  order: -1;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 18px;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: #f2efe6;
  background: #c2603e;
  transition: background 0.15s, transform 0.15s;
}
.chats-new-btn:hover { background: #9e4a2e; transform: translateY(-1px); }
.chats-new-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.chats-drawer-foot .chat-matches-link {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  font-size: 13.5px;
}

/* ── Save Ask Avi install modal ── */
.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.install-overlay[hidden] { display: none; }
.install-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 13, 0.6);
  backdrop-filter: blur(2px);
  animation: chatFadeIn 0.2s ease-out;
}
.install-card {
  position: relative;
  width: min(400px, 92vw);
  background: #1c2b23;
  border: 1px solid rgba(242, 239, 232, 0.14);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: chatDrawerIn 0.25s ease-out;
  color: #f2efe6;
}
.install-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(242, 239, 232, 0.2);
  color: #9fb8a9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.install-close:hover { color: #f2efe6; border-color: #c2603e; }
.install-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.install-title {
  margin: 0 0 8px;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.install-sub {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: #9fb8a9;
}
.install-steps {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.install-steps[hidden] { display: none; }
.install-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.4;
  color: #e8e4da;
}
.install-step b { color: #f2efe6; }
.install-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(194, 96, 62, 0.2);
  color: #e8b49a;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-share-glyph {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.ios-share-glyph svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-dismiss {
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 18px;
  font-family: 'Gabarito', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: #f2efe6;
  background: #c2603e;
  transition: background 0.15s, transform 0.15s;
}
.install-dismiss:hover { background: #9e4a2e; transform: translateY(-1px); }

/* ── Responsive ── */
@media (max-width: 760px) {
  .chat-topbar { padding: 16px 16px 4px; }
  .chat-main { padding: 4px 16px 0; }
  .chat-hero-title { font-size: 38px; }
  .chat-home { gap: 22px; }
  .chat .composer { padding: 6px 16px 18px; }
  .chat-thread-meta { padding: 2px 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chat .msg,
  .chat .msg-match { animation: none; }
  .chat .typing-dot,
  .chat .mic-btn.connecting,
  .chat .mic-btn.listening { animation: none; }
  .composer-pill.contact-mode.contact-invalid { animation: none; }
  .chats-drawer-backdrop,
  .chats-drawer-panel,
  .install-overlay-backdrop,
  .install-card { animation: none; }
}
