.kaia-chatbot,
.kaia-chatbot * {
  box-sizing: border-box;
}

.kaia-chatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  color: #28212a;
  font-family: "Poppins", "Inter", Arial, sans-serif;
}

.kaia-chatbot button,
.kaia-chatbot textarea,
.kaia-chatbot input {
  font: inherit;
}

.kaia-chatbot__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #e93a8b;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 16px 34px rgba(157, 27, 100, 0.28);
}

.kaia-chatbot__launcher svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.4;
}

.kaia-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  display: none;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 106px));
  overflow: hidden;
  border: 1px solid rgba(90, 39, 91, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(52, 24, 49, 0.22);
}

.kaia-chatbot.is-open .kaia-chatbot__panel {
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
}

.kaia-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 14px;
  background:
    linear-gradient(135deg, rgba(233, 58, 139, 0.96), rgba(90, 39, 91, 0.96)),
    #e93a8b;
  color: #fff;
}

.kaia-chatbot__eyebrow {
  display: block;
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kaia-chatbot__header h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.kaia-chatbot__icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: currentColor;
  cursor: pointer;
}

.kaia-chatbot__icon-button svg {
  width: 18px;
  height: 18px;
}

.kaia-chatbot__messages {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(233, 58, 139, 0.08), transparent 24%),
    #fff;
}

.kaia-chatbot__message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.kaia-chatbot__message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.kaia-chatbot__message-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: #e93a8b;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(157, 27, 100, 0.18);
}

.kaia-chatbot__message-action:hover,
.kaia-chatbot__message-action:focus-visible {
  background: #d92f7d;
  color: #fff;
}

.kaia-chatbot__message--assistant {
  align-self: flex-start;
  background: #f7f1f6;
  color: #312531;
}

.kaia-chatbot__message--user {
  align-self: flex-end;
  background: #e93a8b;
  color: #fff;
}

.kaia-chatbot.is-waiting .kaia-chatbot__messages::after {
  content: "Kaia Assistant is typing...";
  align-self: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4edf3;
  color: #776477;
  font-size: 12px;
}

.kaia-chatbot__quick-replies {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px;
  border-top: 1px solid rgba(90, 39, 91, 0.1);
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 58, 139, 0.45) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.kaia-chatbot__quick-replies::-webkit-scrollbar {
  height: 6px;
}

.kaia-chatbot__quick-replies::-webkit-scrollbar-track {
  background: transparent;
}

.kaia-chatbot__quick-replies::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(233, 58, 139, 0.45);
}

.kaia-chatbot__quick-replies button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(233, 58, 139, 0.24);
  border-radius: 999px;
  background: #fff7fb;
  color: #5a275b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.kaia-chatbot__lead-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(90, 39, 91, 0.12);
  background: #fff;
}

.kaia-chatbot__lead-form[hidden] {
  display: none;
}

.kaia-chatbot__lead-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #5a275b;
  font-size: 13px;
}

.kaia-chatbot__lead-head .kaia-chatbot__icon-button {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  background: #f7edf4;
  color: #5a275b;
}

.kaia-chatbot__lead-form label {
  display: grid;
  gap: 5px;
  color: #5a4b5a;
  font-size: 12px;
  font-weight: 700;
}

.kaia-chatbot__lead-form input,
.kaia-chatbot__lead-form textarea,
.kaia-chatbot__composer textarea {
  width: 100%;
  border: 1px solid rgba(90, 39, 91, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #28212a;
  outline: none;
}

.kaia-chatbot__lead-form input,
.kaia-chatbot__lead-form textarea {
  padding: 9px 10px;
  font-size: 13px;
}

.kaia-chatbot__lead-form input:focus,
.kaia-chatbot__lead-form textarea:focus,
.kaia-chatbot__composer textarea:focus {
  border-color: rgba(233, 58, 139, 0.72);
  box-shadow: 0 0 0 3px rgba(233, 58, 139, 0.12);
}

.kaia-chatbot__submit {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: #a7c06b;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.kaia-chatbot__submit svg {
  width: 16px;
  height: 16px;
}

.kaia-chatbot__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid rgba(90, 39, 91, 0.1);
  background: #fff;
}

.kaia-chatbot__composer textarea {
  min-height: 42px;
  max-height: 110px;
  height: 42px;
  overflow: hidden;
  scrollbar-width: none;
  resize: none;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.kaia-chatbot__composer textarea::-webkit-scrollbar {
  display: none;
}

.kaia-chatbot__send {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #e93a8b;
  color: #fff;
  cursor: pointer;
}

.kaia-chatbot__send svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.kaia-chatbot button:focus-visible,
.kaia-chatbot textarea:focus-visible,
.kaia-chatbot input:focus-visible {
  outline: 2px solid rgba(233, 58, 139, 0.5);
  outline-offset: 2px;
}

.kaia-chatbot button:disabled,
.kaia-chatbot textarea:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 560px) {
  .kaia-chatbot {
    right: 16px;
    bottom: 16px;
  }

  .kaia-chatbot__launcher {
    min-height: 50px;
    padding: 0 15px;
  }

  .kaia-chatbot__panel {
    right: -8px;
    bottom: 64px;
    width: calc(100vw - 16px);
    height: min(620px, calc(100vh - 92px));
  }
}
