/* ============================
   chat-toggle
   ============================ */
.chat-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--color-cta);
  border-radius: 50%;
  color: var(--color-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background-color var(--transition-base), transform var(--transition-base);
}

.chat-toggle:hover,
.chat-toggle:focus-visible {
  background: var(--color-cta-hover);
  transform: scale(1.05);
}

.chat-toggle__icon {
  width: 24px;
  height: 24px;
}

.chat-toggle__icon--close {
  display: none;
}

.chat-toggle[aria-expanded="true"] .chat-toggle__icon--open {
  display: none;
}

.chat-toggle[aria-expanded="true"] .chat-toggle__icon--close {
  display: block;
}

/* ============================
   chat-panel
   ============================ */
.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 40px));
  max-height: min(560px, calc(100vh - 120px));
  background: var(--color-white);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-bg-muted);
  flex-shrink: 0;
}

.chat-panel__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-text-secondary);
  border-radius: 50%;
}

.chat-panel__back svg {
  width: 16px;
  height: 16px;
}

.chat-panel__back:hover,
.chat-panel__back:focus-visible {
  background: var(--color-bg-muted);
}

.chat-panel__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(0, 136, 99, 0.12);
  border-radius: 50%;
  color: var(--color-cta);
}

.chat-panel__avatar svg {
  width: 18px;
  height: 18px;
}

.chat-panel__title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.chat-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-text-secondary);
  border-radius: 50%;
}

.chat-panel__close svg {
  width: 16px;
  height: 16px;
}

.chat-panel__close:hover,
.chat-panel__close:focus-visible {
  background: var(--color-bg-muted);
}

.chat-panel__messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.chat-message--user {
  align-items: flex-end;
}

.chat-message__bubble {
  max-width: 100%;
  padding: 12px 14px;
  background: var(--color-bg-muted);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}

.chat-message__bubble a {
  color: var(--color-cta);
  text-decoration: underline;
}

.chat-message--user .chat-message__bubble {
  background: rgba(0, 136, 99, 0.12);
}

.chat-message__meta {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.chat-panel__quick-replies {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
  flex-shrink: 0;
}

.chat-panel__quick-replies[hidden] {
  display: none;
}

.chat-pill {
  padding: 8px 20px;
  background: var(--color-white);
  border: 1.5px solid var(--color-cta);
  border-radius: var(--radius-pill);
  color: var(--color-cta);
  font-size: 13px;
  font-weight: 600;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.chat-pill:hover,
.chat-pill:focus-visible {
  background: var(--color-cta);
  color: var(--color-white);
}

.chat-panel__input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-bg-muted);
  flex-shrink: 0;
}

.chat-panel__input-row[hidden] {
  display: none;
}

.chat-panel__input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: var(--color-bg-muted);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--color-text);
}

.chat-panel__input::placeholder {
  color: var(--color-text-secondary);
}

.chat-panel__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-cta);
  border-radius: 50%;
  color: var(--color-white);
  transition: background-color var(--transition-base);
}

.chat-panel__send:hover,
.chat-panel__send:focus-visible {
  background: var(--color-cta-hover);
}

.chat-panel__send svg {
  width: 16px;
  height: 16px;
}

.chat-panel__disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-bg-muted);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.chat-panel__disclaimer[hidden] {
  display: none;
}

.chat-panel__disclaimer a {
  color: var(--color-cta);
  text-decoration: underline;
}

.chat-panel__disclaimer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
}

.chat-panel__disclaimer-close svg {
  width: 12px;
  height: 12px;
}
