/* Keep the public guide visually quiet and use only brand palette colors. */
.chatbot__launcher { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: inline-flex; min-height: 56px; align-items: center; gap: 10px; padding: 0 18px; border: 2px solid var(--white); border-radius: 999px; background: var(--teal); color: var(--white); font: 500 1rem/1.2 var(--font); cursor: pointer; }

/* The panel sits above the launcher and stays within a phone viewport. */
.chatbot__panel { position: fixed; right: 16px; bottom: 84px; z-index: 69; display: flex; width: min(380px, calc(100vw - 32px)); height: min(560px, 72dvh); flex-direction: column; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); color: var(--ocean); }

/* Give the panel a clear title and one simple close action. */
.chatbot__header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 14px 16px; background: var(--ocean); color: var(--white); }
.chatbot__header h2 { margin: 0; font-size: 1.25rem; }
.chatbot__eyebrow { margin: 0 0 2px; color: #D5E8E4; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.chatbot__close { min-width: 44px; min-height: 44px; border: 1px solid #D5E8E4; border-radius: 8px; background: transparent; color: var(--white); font: inherit; cursor: pointer; }

/* Explain the provider and its free-tier data terms beside the input. */
.chatbot__privacy { margin: 0; padding: 10px 14px; background: var(--sky); color: var(--slate); font-size: 0.75rem; line-height: 1.45; }
.chatbot__privacy a { white-space: nowrap; }

/* Keep messages readable and ensure new answers scroll into view. */
.chatbot__messages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; margin: 0; padding: 14px; list-style: none; }
.chatbot__message { width: fit-content; max-width: 92%; padding: 10px 12px; border-radius: 12px; background: var(--sky); }
.chatbot__message--user { align-self: flex-end; background: var(--sand); }
.chatbot__message p { margin: 0; overflow-wrap: anywhere; font-size: 0.9375rem; line-height: 1.45; }
.chatbot__message a { display: inline-block; margin-top: 6px; }

/* Suggested questions make the first step easy without adding a donation banner. */
.chatbot__prompts { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 10px; }
.chatbot__prompts button { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; border: 1px solid var(--teal); border-radius: 999px; background: var(--white); color: var(--ocean); font: 400 0.8125rem/1.2 var(--font); cursor: pointer; }

/* Keep the labelled input and submit target large enough for touch. */
.chatbot__form { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--rule); }
.chatbot__form input { min-width: 0; min-height: 48px; flex: 1; padding: 10px 12px; border: 2px solid #86AAA6; border-radius: 8px; color: var(--ocean); font: inherit; }
.chatbot__form input:focus { border-color: var(--teal); }
.chatbot__form .button { min-height: 48px; padding: 0 16px; }
.chatbot__form .button:disabled { cursor: wait; opacity: 0.7; }
.chatbot__status { min-height: 1.4em; margin: 0; padding: 0 14px 8px; color: var(--slate); font-size: 0.8125rem; }

/* Leave enough room on the narrowest supported phone screens. */
@media (max-width: 380px) {
  .chatbot__panel { right: 10px; bottom: 80px; width: calc(100vw - 20px); height: min(560px, 74dvh); }
  .chatbot__launcher { right: 12px; bottom: 12px; }
}

/* On phones the launcher is a round icon so it covers less of the page (its
   label stays for screen readers), and the footer ends with room for it, so
   the last line of footer text is never under it. */
@media (max-width: 699px) {
  .chatbot__launcher { width: 56px; padding: 0; justify-content: center; }
  .chatbot__launcher span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-footer__body { padding-bottom: 88px; }
}

/* Honor reduced-motion preferences without adding a separate animation. */
@media (prefers-reduced-motion: reduce) {
  .chatbot__panel, .chatbot__launcher { scroll-behavior: auto; }
}
