/* The chat launcher stays clear of the existing mobile appointment controls. */
:root { --integra-chat-bottom: 16px; }
@media (max-width: 650px) {
  /* Reserve the mobile bar's 48px button, padding and border before JS measures it. */
  :root:has(body:not(.waiting-list-page) .mobile-appointment-bar) {
    --integra-chat-bottom: calc(87px + env(safe-area-inset-bottom, 0px));
  }
}
html body #integra-chat-launcher,
html body #chatbot-widget-container {
  position: fixed;
  bottom: var(--integra-chat-bottom) !important;
  right: 20px !important;
  z-index: 9999;
}
html body #integra-chat-launcher[hidden] { display: none !important; }
html body #integra-chat-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 56px;
  padding: 12px 19px;
  border: 2px solid #b69a5f;
  border-radius: 30px;
  background: #123d32;
  color: #fff;
  box-shadow: 0 5px 20px #123d3226;
  font: 600 15px/1.3 var(--sans, sans-serif);
  cursor: pointer;
}
html body #integra-chat-open * { color: inherit; }
html body #integra-chat-open:focus-visible,
html body #chatbot-button:focus-visible,
html body #chatbot-close:focus-visible {
  outline: 3px solid #b69a5f;
  outline-offset: 4px;
}
html body #integra-chat-open:disabled { cursor: progress; opacity: .8; }
html body #integra-chat-feedback {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: min(290px, calc(100vw - 40px));
  padding: 15px 18px;
  border: 1px solid #b69a5f;
  border-radius: 10px;
  background: #fff;
  color: #123d32;
  box-shadow: 0 4px 18px #123d3220;
  font: 400 15px/1.5 var(--sans, sans-serif);
}
html body #integra-chat-feedback[hidden] { display: none; }
html body #integra-chat-feedback a { color: inherit; text-decoration: underline; }
html body #chatbot-window {
  max-height: calc(100vh - var(--integra-chat-bottom) - 96px);
  max-height: calc(100dvh - var(--integra-chat-bottom) - 96px);
}
html body #chatbot-input { font-size: 16px; }
/* The vendor's fallback WhatsApp number is not an Integra contact channel. */
html body #chatbot-whatsapp-button { display: none !important; }
@media (max-width: 768px) {
  html body #integra-chat-launcher,
  html body #chatbot-widget-container { right: 12px !important; }
  html body #chatbot-window {
    width: var(--integra-chat-width, min(400px, calc(100vw - 40px)));
    height: min(600px, calc(100dvh - var(--integra-chat-bottom) - 86px));
    max-height: calc(100dvh - var(--integra-chat-bottom) - 86px);
    bottom: 70px;
  }
}
