.chatbot-widget {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 990;
  color: var(--black-soft, #1a1a1a);
  font-family: var(--font-body, "DM Sans", sans-serif);
}

.chatbot-launcher {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--accent, #ef4e36);
  color: var(--white, #fff);
  box-shadow: var(--shadow-hover, 0 12px 40px rgba(0, 0, 0, 0.1));
  font: 700 0.9rem var(--font-body, "DM Sans", sans-serif);
  cursor: pointer;
}

.chatbot-launcher:focus-visible,
.chatbot-panel button:focus-visible,
.chatbot-panel a:focus-visible,
.chatbot-form input:focus-visible {
  outline: 3px solid var(--black-soft, #1a1a1a);
  outline-offset: 3px;
}

.chatbot-panel[hidden] {
  display: none !important;
}

.chatbot-panel {
  position: absolute;
  left: 0;
  bottom: 76px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 120px));
  overflow: hidden;
  border: 1px solid var(--gray-light, #c5c7c9);
  border-radius: var(--radius, 12px);
  background: var(--card, #fff);
  box-shadow: var(--shadow-hover, 0 12px 40px rgba(0, 0, 0, 0.1));
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--gray-light, #c5c7c9);
}

.chatbot-header h2 {
  font: 600 1rem var(--font-display, "Outfit", sans-serif);
}

.chatbot-close,
.chatbot-form button,
.chatbot-handoff {
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent, #ef4e36);
  color: var(--white, #fff);
  font: 600 0.875rem var(--font-body, "DM Sans", sans-serif);
  text-decoration: none;
  cursor: pointer;
}

.chatbot-history {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 120px;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chatbot-message {
  width: fit-content;
  max-width: 90%;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.45;
}

.chatbot-message--bot {
  align-self: flex-start;
  background: var(--bg, #f7f7f8);
}

.chatbot-message--user {
  align-self: flex-end;
  background: var(--accent, #ef4e36);
  color: var(--white, #fff);
}

.chatbot-handoff {
  display: inline-block;
  margin-top: 0.65rem;
}

.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.8rem;
}

.chatbot-quick-actions button {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--accent, #ef4e36);
  border-radius: 999px;
  background: var(--card, #fff);
  color: var(--black-soft, #1a1a1a);
  font: 500 0.78rem var(--font-body, "DM Sans", sans-serif);
  cursor: pointer;
}

.chatbot-quick-actions button:hover {
  background: var(--bg, #f7f7f8);
}

.chatbot-quick-actions button:disabled,
.chatbot-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chatbot-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem;
  border-top: 1px solid var(--gray-light, #c5c7c9);
}

.chatbot-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-light, #c5c7c9);
  border-radius: 6px;
  background: var(--white, #fff);
  color: var(--black-soft, #1a1a1a);
  font: 400 0.9rem var(--font-body, "DM Sans", sans-serif);
}

.chatbot-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .chatbot-widget {
    left: 14px;
    bottom: 14px;
  }

  .chatbot-panel {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 104px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-widget *,
  .chatbot-widget *::before,
  .chatbot-widget *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}