.sd-chatbot {
  --sd-chatbot-ink: #f9f5ff;
  --sd-chatbot-muted: #b9a9cb;
  --sd-chatbot-line: rgba(208, 74, 255, 0.28);
  --sd-chatbot-surface: rgba(15, 5, 22, 0.92);
  --sd-chatbot-accent: #c746ff;
  --sd-chatbot-accent-strong: #31d7bd;
  --sd-chatbot-shadow: 0 18px 54px rgba(199, 70, 255, 0.28), 0 18px 60px rgba(0, 0, 0, 0.4);
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  justify-items: start;
  left: max(18px, env(safe-area-inset-left));
  position: fixed;
  z-index: 2147483000;
}

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

.sd-chatbot__panel {
  background:
    linear-gradient(180deg, rgba(199, 70, 255, 0.18), rgba(49, 215, 189, 0.07)),
    var(--sd-chatbot-surface);
  border: 1px solid var(--sd-chatbot-line);
  border-radius: 14px;
  box-shadow: var(--sd-chatbot-shadow);
  color: var(--sd-chatbot-ink);
  display: grid;
  grid-template-rows: auto 1fr;
  height: min(520px, calc(100vh - 96px));
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    transform 220ms ease;
  width: min(386px, calc(100vw - 28px));
}

.sd-chatbot[data-open="true"] .sd-chatbot__panel {
  max-height: min(520px, calc(100vh - 96px));
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.sd-chatbot__header {
  align-items: flex-start;
  backdrop-filter: blur(18px);
  background: rgba(18, 4, 28, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 148px;
  padding: 16px 12px 10px;
}

.sd-chatbot__intro {
  display: grid;
  gap: 3px;
  max-width: 265px;
}

.sd-chatbot__kicker {
  color: #d656ff;
  display: block;
  font: 800 9px/1.1 Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sd-chatbot__title {
  color: var(--sd-chatbot-ink);
  display: block;
  font: 800 13px/1.15 Sora, Manrope, system-ui, sans-serif;
  margin-top: 1px;
  max-width: 240px;
}

.sd-chatbot__subtitle {
  color: var(--sd-chatbot-muted);
  display: block;
  font: 700 10px/1.25 Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin-top: 3px;
  max-width: 250px;
}

.sd-chatbot__meta {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(199, 70, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  font: 800 9px/1.1 Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin-top: 5px;
  padding: 6px 8px;
  width: fit-content;
}

.sd-chatbot__close,
.sd-chatbot__trigger {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sd-chatbot__close {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(49, 215, 189, 0.34);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  margin-top: 2px;
  padding: 0 10px;
  white-space: nowrap;
}

.sd-chatbot__body {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  padding: 6px;
}

.sd-chatbot__messages {
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(8, 3, 17, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px 10px 8px 8px;
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
  min-height: 188px;
  overflow-y: auto;
  padding: 9px;
  scrollbar-color: rgba(199, 70, 255, 0.5) rgba(255, 255, 255, 0.08);
}

.sd-chatbot__message {
  border-radius: 12px;
  font: 700 12.5px/1.42 Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: min(92%, 330px);
  padding: 9px 10px;
  white-space: pre-wrap;
}

.sd-chatbot__paragraph {
  margin: 0;
}

.sd-chatbot__paragraph + .sd-chatbot__paragraph {
  margin-top: 6px;
}

.sd-chatbot__message strong {
  color: #7b1aff;
  font-weight: 900;
}

.sd-chatbot__message--bot {
  background: rgba(255, 255, 255, 0.92);
  color: #141021;
  justify-self: start;
}

.sd-chatbot__message--user {
  background: linear-gradient(135deg, #c746ff, #31d7bd);
  color: #080311;
  justify-self: end;
}

.sd-chatbot__message--loading {
  color: rgba(20, 16, 33, 0.64);
  font-style: italic;
}

.sd-chatbot__form {
  align-items: end;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(49, 215, 189, 0.24);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr auto;
  padding: 6px;
}

.sd-chatbot__field {
  display: block;
}

.sd-chatbot__input {
  background: transparent;
  border: 0;
  color: #ffffff;
  display: block;
  font: 800 13px/1.35 Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-height: 110px;
  min-height: 32px;
  outline: 0;
  padding: 7px 7px;
  resize: none;
  width: 100%;
}

.sd-chatbot__input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.sd-chatbot__input:disabled {
  opacity: 0.72;
}

.sd-chatbot__send {
  appearance: none;
  background: linear-gradient(135deg, #31d7bd, #c746ff);
  border: 0;
  border-radius: 999px;
  color: #080311;
  cursor: pointer;
  font: 900 12px/1 Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 32px;
  min-width: 54px;
  padding: 0 12px;
}

.sd-chatbot__send:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sd-chatbot__sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.sd-chatbot__trigger {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(23, 7, 33, 0.94), rgba(44, 10, 59, 0.94)),
    #170721;
  border: 1px solid rgba(199, 70, 255, 0.58);
  border-radius: 999px;
  box-shadow: 0 14px 38px rgba(199, 70, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #ffffff;
  display: inline-flex;
  gap: 9px;
  min-height: 54px;
  padding: 8px 15px 8px 9px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.sd-chatbot__trigger:hover {
  border-color: rgba(49, 215, 189, 0.78);
  box-shadow: 0 18px 46px rgba(199, 70, 255, 0.36), 0 0 22px rgba(49, 215, 189, 0.16);
  transform: translateY(-2px);
}

.sd-chatbot__trigger:focus-visible,
.sd-chatbot__close:focus-visible,
.sd-chatbot__send:focus-visible,
.sd-chatbot__input:focus-visible {
  outline: 3px solid rgba(199, 70, 255, 0.5);
  outline-offset: 3px;
}

.sd-chatbot__mark {
  align-items: center;
  background: linear-gradient(135deg, #c746ff, #31d7bd);
  border-radius: 999px;
  color: #080311;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 31px;
  justify-content: center;
  width: 31px;
}

.sd-chatbot__label {
  display: grid;
  gap: 2px;
  text-align: left;
}

.sd-chatbot__eyebrow {
  color: #d656ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.sd-chatbot__text {
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.sd-chatbot__proof {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

@media (max-width: 640px) {
  .sd-chatbot {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    right: auto;
  }

  .sd-chatbot__panel {
    border-radius: 14px;
    height: min(450px, calc(100vh - 86px));
    width: calc(100vw - 20px);
  }

  .sd-chatbot[data-open="true"] .sd-chatbot__panel {
    max-height: min(450px, calc(100vh - 86px));
  }

  .sd-chatbot__header {
    min-height: 140px;
    padding: 15px 11px 10px;
  }

  .sd-chatbot__trigger {
    justify-self: start;
    gap: 7px;
    min-height: 44px;
    max-width: calc(100vw - 124px);
    padding: 6px 12px 6px 7px;
  }

  .sd-chatbot__mark {
    font-size: 10px;
    height: 28px;
    width: 28px;
  }

  .sd-chatbot__eyebrow {
    font-size: 8px;
    letter-spacing: 0.07em;
  }

  .sd-chatbot__text {
    font-size: 12px;
  }

  .sd-chatbot__proof {
    display: none;
  }

  .sd-chatbot__title,
  .sd-chatbot__subtitle {
    max-width: min(260px, calc(100vw - 118px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-chatbot__panel,
  .sd-chatbot__trigger {
    transition: none;
  }
}
