.lead-chatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  font-family: var(--sans, "Manrope", Arial, sans-serif);
}

.lead-chatbot * {
  box-sizing: border-box;
}

.lead-chatbot__launcher {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #091f1d;
  background: linear-gradient(135deg, #e8c778, #b98c42);
  box-shadow: 0 18px 42px rgba(31, 37, 35, 0.24);
  animation: chatbotLauncherFloat 4200ms ease-in-out infinite;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease;
}

.lead-chatbot__launcher:hover {
  animation: none;
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(31, 37, 35, 0.28);
}

.lead-chatbot__launcher svg {
  width: 28px;
  height: 28px;
}

.lead-chatbot__tooltip {
  position: absolute;
  right: 76px;
  bottom: 11px;
  width: max-content;
  max-width: 220px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(17, 28, 26, 0.9);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(31, 37, 35, 0.18);
}

.lead-chatbot.is-open .lead-chatbot__tooltip {
  display: none;
}

.lead-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(410px, calc(100vw - 28px));
  height: min(680px, calc(100svh - 116px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 250, 246, 0.94)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 26px 80px rgba(17, 28, 26, 0.28);
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1), transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
}

.lead-chatbot.is-open .lead-chatbot__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.lead-chatbot__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(23, 59, 54, 0.98), rgba(66, 19, 31, 0.96)),
    #173b36;
}

.lead-chatbot__avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(228, 194, 123, 0.5);
  border-radius: 12px;
  color: #e8c778;
  background: rgba(255, 255, 255, 0.1);
}

.lead-chatbot__avatar svg {
  width: 22px;
  height: 22px;
}

.lead-chatbot__title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.lead-chatbot__title strong {
  color: #ffffff;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.25rem;
  line-height: 1.1;
}

.lead-chatbot__title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.lead-chatbot__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-chatbot__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.14);
}

.lead-chatbot__close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.lead-chatbot__close svg {
  width: 18px;
  height: 18px;
}

.lead-chatbot__progress {
  height: 6px;
  background: rgba(31, 37, 35, 0.08);
}

.lead-chatbot__progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b98c42, #25d366);
  transition: width 220ms ease;
}

.lead-chatbot__messages {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 18px 16px;
  scroll-behavior: smooth;
}

.lead-chatbot__message {
  display: grid;
  gap: 7px;
  max-width: 86%;
  animation: leadChatMessageIn 180ms ease both;
}

.lead-chatbot__message--bot {
  justify-self: start;
}

.lead-chatbot__message--user {
  justify-self: end;
}

.lead-chatbot__bubble {
  padding: 11px 13px;
  border-radius: 14px;
  color: #26302d;
  background: #ffffff;
  border: 1px solid rgba(31, 37, 35, 0.1);
  box-shadow: 0 10px 22px rgba(31, 37, 35, 0.08);
  font-size: 0.92rem;
  line-height: 1.48;
  white-space: pre-line;
}

.lead-chatbot__message--bot .lead-chatbot__bubble {
  border-top-left-radius: 4px;
}

.lead-chatbot__message--user .lead-chatbot__bubble {
  border-top-right-radius: 4px;
  color: #ffffff;
  background: linear-gradient(135deg, #173b36, #24544d);
  border-color: rgba(255, 255, 255, 0.16);
}

.lead-chatbot__meta {
  color: rgba(31, 37, 35, 0.5);
  font-size: 0.68rem;
  font-weight: 800;
}

.lead-chatbot__message--user .lead-chatbot__meta {
  justify-self: end;
}

.lead-chatbot__typing {
  justify-self: start;
  display: none;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 37, 35, 0.1);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 37, 35, 0.08);
}

.lead-chatbot.is-typing .lead-chatbot__typing {
  display: inline-flex;
}

.lead-chatbot__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b98c42;
  animation: leadChatTyping 900ms ease-in-out infinite;
}

.lead-chatbot__typing span:nth-child(2) {
  animation-delay: 120ms;
}

.lead-chatbot__typing span:nth-child(3) {
  animation-delay: 240ms;
}

.lead-chatbot__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 0 16px 12px;
}

.lead-chatbot__quick-replies:empty {
  display: none;
}

.lead-chatbot__quick {
  flex: 0 1 auto;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid rgba(185, 140, 66, 0.28);
  border-radius: 999px;
  color: #173b36;
  background: #fbfaf6;
  font-size: 0.8rem;
  font-weight: 900;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background 180ms ease, border-color 180ms ease;
}

.lead-chatbot__quick:hover {
  transform: translateY(-2px);
  background: #f3f0e8;
  border-color: rgba(185, 140, 66, 0.48);
}

.lead-chatbot__inputbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid rgba(31, 37, 35, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.lead-chatbot__input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(31, 37, 35, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  color: #1f2523;
  background: #ffffff;
  outline: 0;
}

.lead-chatbot__input:focus {
  border-color: rgba(185, 140, 66, 0.62);
  box-shadow: 0 0 0 3px rgba(185, 140, 66, 0.14);
}

.lead-chatbot__send {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #24190c;
  background: linear-gradient(135deg, #e8c778, #b98c42);
}

.lead-chatbot__send svg {
  width: 18px;
  height: 18px;
}

.lead-chatbot__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 0 14px 12px;
  color: rgba(31, 37, 35, 0.48);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
}

.lead-chatbot__admin {
  display: none;
  gap: 6px;
}

.lead-chatbot.show-admin .lead-chatbot__admin {
  display: flex;
}

.lead-chatbot__admin button,
.lead-chatbot__link-btn {
  border: 0;
  padding: 0;
  color: #742337;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 900;
}

.lead-chatbot__handoff {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.lead-chatbot__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: #062b17;
  background: #25d366;
  font-weight: 900;
}

.lead-chatbot__secondary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.lead-chatbot__secondary-row button,
.lead-chatbot__secondary-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(31, 37, 35, 0.12);
  border-radius: 10px;
  color: #173b36;
  background: #ffffff;
  font-size: 0.74rem;
  font-weight: 900;
}

@keyframes leadChatMessageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes leadChatTyping {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes chatbotLauncherFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-chatbot__launcher,
  .lead-chatbot__message,
  .lead-chatbot__typing span {
    animation: none;
  }

  .lead-chatbot__panel,
  .lead-chatbot__quick,
  .lead-chatbot__launcher {
    transition-duration: 0.01ms;
  }
}

@media (max-width: 640px) {
  .lead-chatbot {
    right: 14px;
    bottom: 14px;
  }

  .lead-chatbot__tooltip {
    display: none;
  }

  .lead-chatbot__panel {
    position: fixed;
    inset: auto 10px 10px;
    width: calc(100vw - 20px);
    height: min(720px, calc(100svh - 20px));
    border-radius: 16px;
    transform-origin: bottom center;
  }

  .lead-chatbot__launcher {
    width: 58px;
    height: 58px;
  }

  .lead-chatbot__message {
    max-width: 92%;
  }

  .lead-chatbot__secondary-row {
    grid-template-columns: 1fr;
  }
}
