/* Scoped to text Copilot: do not alter WhatsApp or the live voice dialog. */
#copilot-pane { overflow-anchor: none; }
#conversation-messages:has(.chat-message) { justify-content: flex-start; }
#conversation-messages .chat-message { gap: 0; align-items: flex-start; }
#conversation-messages .chat-message.assistant { max-width: 100%; }
#conversation-messages .message-content { width: 100%; overflow-wrap: anywhere; }
/* Reserve reading room once, so a short streaming reply can start near the top.
   As the reply grows it fills this space, without dragging the viewport down. */
#conversation-messages .chat-message.assistant:last-child {
  min-height: max(80px, calc(100dvh - var(--copilot-composer-height, 124px) - var(--copilot-reading-top, 12px) - 80px));
}
#copilot-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: none;
  line-height: 1.5;
  resize: none;
  overflow-y: hidden;
}
/* A custom background makes direct pane children relative with z-index: 1.
   This control must stay fixed above the composer in either background mode. */
#copilot-pane #jump-to-latest {
  position: fixed;
  z-index: 8;
  bottom: calc(var(--copilot-composer-height, 124px) + 32px);
}
