/* Chat-only presentation. Preserve the shared navigation and media/map surfaces. */
[data-panel="messages"].qcf-chat {
  --qcf-surface: var(--qmx-surface, var(--surface, #fffdf8));
  --qcf-soft: var(--qmx-soft, var(--soft, #ebe6da));
  --qcf-ink: var(--qmx-ink, var(--ink, #173330));
  --qcf-muted: var(--qmx-muted, var(--muted, #62736c));
  --qcf-line: var(--qmx-line, var(--line, #ddd7ca));
  min-width: 0;
  min-height: 0;
}
body [data-panel="messages"].qcf-chat .chat-head {
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  min-height: 54px !important;
  padding: 5px 10px !important;
  flex: 0 0 auto;
  background: var(--qcf-surface) !important;
  border-color: var(--qcf-line);
}
body .qcf-chat .chat-head .person { flex: 1 1 0; min-width: 0; gap: 8px; }
body .qcf-chat .chat-head .person > div { min-width: 0; }
body .qcf-chat .chat-head h2 { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 16px; line-height: 1.3; }
body .qcf-chat .chat-head #chatName { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body .qcf-chat .chat-head #chatStatus { margin: 2px 0 0; font-size: 11px; line-height: 1.35; }
body .qcf-chat .chat-head .avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; font-size: 15px; }
body .qcf-chat .chat-head :is(.chat-return, .ycs-details-toggle, .qcf-ai-trigger) {
  box-sizing: border-box;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 !important;
  border-radius: 12px;
}
body .qcf-chat .chat-head .qcf-ai-trigger {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--qcf-line);
  background: var(--qcf-soft);
  color: var(--qcf-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: .02em;
  cursor: pointer;
}
body .qcf-chat .chat-head .qcf-ai-trigger:disabled { opacity: .55; cursor: default; }
body .qcf-chat .qcf-ai-trigger:focus-visible { outline: 2px solid var(--qmx-modal-action, var(--accent, #173330)); outline-offset: 2px; }
body .qcf-chat .qcf-ai-trigger[hidden],
body .qcf-chat .qcf-ai-original,
body .qcf-chat .qcf-ai-launcher-row,
body .qcf-chat #accountNotice.is-ready { display: none !important; }
/* Only the successfully authenticated banner is hidden; errors retain their UI. */
body .qcf-chat #accountNotice:not(.is-ready) { margin: 4px 8px; padding: 8px 10px; font-size: 13px; }
body .qcf-chat .communication-tabs { gap: 4px !important; padding: 2px 8px 0 !important; flex: 0 0 auto; }
body .qcf-chat .communication-tab[data-ycs-label] { min-height: 40px !important; padding: 4px 6px !important; }
body .qcf-chat .communication-tab[data-ycs-label]::before { font-size: 11px; line-height: 1.25; }
body .qcf-chat .chat-column { min-height: 0; min-width: 0; }
body .qcf-chat #chat {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-height: none;
  padding: 12px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 12px;
}
body .qcf-chat #chat .message-stack { min-width: 0; max-width: min(84%, 46rem); }
body .qcf-chat #chat .bubble { overflow-wrap: anywhere; line-height: 1.55; }
body .qcf-chat #chat .message-meta { font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
body .qcf-chat .communication-ready { flex: 0 0 auto; gap: 4px 8px; padding: 3px 8px !important; font-size: 10px; line-height: 1.35; }
body .qcf-chat #composer {
  flex: 0 0 auto;
  min-width: 0;
  padding: 6px 8px !important;
  border-color: var(--qcf-line);
  background: var(--qcf-surface) !important;
}
body .qcf-chat #composer .compose-box { min-width: 0; gap: 5px; padding: 5px; align-items: end; border-radius: 16px; }
body .qcf-chat #composer #input {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 44px !important;
  height: 44px !important;
  max-height: min(136px, 22dvh) !important;
  padding: 10px 4px !important;
  font: inherit;
  font-size: 16px;
  line-height: 22px;
  color: var(--qcf-ink);
  caret-color: var(--qcf-ink);
  overflow-y: auto;
  resize: none;
}
body .qcf-chat #composer #input::placeholder { color: var(--qcf-muted); opacity: 1; }
/* Keep touch targets intact even when the existing compact stylesheet loads later. */
body .qcf-chat #composer :is(#send, .plus),
body.ycs-space [data-panel="messages"].qcf-chat #composer #send,
body.ycs-space [data-panel="messages"].qcf-chat #composer .plus { min-height: 44px !important; }
body .qcf-chat #composer #send { flex: 0 0 auto; min-width: 52px; padding-inline: 10px; }
body .qcf-chat #composer .hint { margin: 2px 2px 0; font-size: 10px; line-height: 1.35; }
@media (max-width: 680px) {
  body .qcf-chat .chat-head { min-height: 50px !important; padding: 3px 6px !important; gap: 4px !important; }
  body .qcf-chat .chat-head h2 { font-size: 15px; }
  body .qcf-chat .chat-head .member-tag { display: none; }
  body .qcf-chat .chat-head .avatar { width: 28px; height: 28px; flex-basis: 28px; }
  body .qcf-chat #chat { padding: 8px; }
  body .qcf-chat #chat .message-stack { max-width: 91%; }
  body .qcf-chat #composer { padding: 5px 6px !important; }
  body .qcf-chat #composer .compose-box { padding: 4px; gap: 4px; }
  body .qcf-chat #composer #send { min-width: 48px; padding-inline: 8px; }
}
