.sales-ai-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 8490;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 15px 8px 10px;
  border: 1px solid rgba(102, 230, 195, .38);
  border-radius: 999px;
  background: linear-gradient(135deg, #151b38, #0d1229);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .42), 0 0 0 4px rgba(102, 230, 195, .05);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, opacity .18s ease;
}

body.sales-ai-open .sales-ai-launcher {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sales-ai-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .5), 0 0 0 5px rgba(102, 230, 195, .08);
}

.sales-ai-launcher:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sales-ai-launcher.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.sales-ai-launcher img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(73, 119, 255, .35));
}

.sales-ai-launcher i {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid #11172f;
  box-shadow: 0 0 0 4px rgba(102, 230, 195, .11);
  animation: salesAiPulse 2s infinite;
}

@keyframes salesAiPulse {
  50% {
    box-shadow: 0 0 0 8px rgba(102, 230, 195, 0);
  }
}

.sales-ai-section.wrap {
  position: fixed;
  inset: 0;
  z-index: 99990;
  width: 100vw !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(3, 6, 17, .5);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

.sales-ai-section.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sales-ai-shell {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 48px));
  height: min(580px, calc(100dvh - 48px));
  display: block;
  padding: 0;
  border: 1px solid rgba(102, 230, 195, .28);
  border-radius: 22px;
  background: #0b1025;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .025) inset;
  overflow: hidden;
  transform: translateY(18px) scale(.985);
  transform-origin: bottom right;
  transition: transform .24s ease;
}

.sales-ai-section.is-open .sales-ai-shell {
  transform: translateY(0) scale(1);
}

.sales-ai-shell:before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(102, 230, 195, .07);
  filter: blur(65px);
  top: -130px;
  left: -70px;
  pointer-events: none;
}

.sales-ai-copy {
  display: none;
}

.sales-ai-chat {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #111733 0%, #0a0f24 54%, #080d20 100%);
  overflow: hidden;
}

.sales-ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 66px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .085);
  background: linear-gradient(90deg, rgba(102, 230, 195, .045), rgba(255, 255, 255, .018));
}

.sales-ai-head img {
  width: 38px;
  height: 38px;
  padding: 3px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(91, 118, 255, .09);
  box-shadow: 0 0 0 1px rgba(102, 230, 195, .14);
}

.sales-ai-head strong {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
}

.sales-ai-head>div>span {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--mint);
}

.sales-ai-close {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-inline-start: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  color: #aeb7d7;
  cursor: pointer;
  transition: .18s ease;
}

.sales-ai-close:hover {
  color: #fff;
  border-color: rgba(243, 197, 122, .4);
  background: rgba(243, 197, 122, .09);
}

.sales-ai-close span {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 23px;
  line-height: 1;
  color: inherit;
  transform: translateY(-1px);
}

.sales-ai-progress {
  display: flex;
  gap: 5px;
  margin-inline-start: 8px;
}

.sales-ai-progress i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}

.sales-ai-progress i.done {
  background: var(--mint);
  box-shadow: 0 0 8px rgba(102, 230, 195, .5);
}

.sales-ai-messages {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 15px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  background: radial-gradient(circle at 80% 0%, rgba(98, 120, 255, .045), transparent 34%);
}

.sales-ai-message {
  max-width: 93%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  animation: messageSlideIn .32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.sales-ai-message.bot {
  align-self: flex-start;
  background: linear-gradient(145deg, #182042 0%, #121834 100%);
  border: 1px solid rgba(102, 230, 195, .16);
  border-top-right-radius: 4px;
  transform-origin: top right;
}

.sales-ai-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(102, 230, 195, .2), rgba(74, 113, 255, .15));
  border: 1px solid rgba(102, 230, 195, .32);
  border-top-left-radius: 4px;
  transform-origin: top left;
}

@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sales-ai-message.loading {
  color: var(--muted);
}

.sales-ai-limit {
  flex: 0 0 auto;
  text-align: center;
  font-size: 9.5px;
  color: var(--muted);
  padding: 6px 10px 5px;
  background: rgba(255, 255, 255, .01);
}

.sales-ai-limit b {
  color: var(--gold);
}

.sales-ai-compose {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 11px 11px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: #0c1128;
}

.sales-ai-compose input,
.sales-ai-email-form input,
.sales-ai-email-form textarea {
  width: 100%;
  min-width: 0;
  background: #131a35;
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--fg);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 11.5px;
  outline: none;
}

.sales-ai-compose input:focus,
.sales-ai-email-form input:focus,
.sales-ai-email-form textarea:focus {
  border-color: rgba(243, 197, 122, .58);
  box-shadow: 0 0 0 3px rgba(243, 197, 122, .08);
}

.sales-ai-compose button {
  flex: 0 0 auto;
  min-width: 76px;
  border-radius: 11px;
}

.sales-ai-card {
  width: 100%;
  border: 1px solid rgba(243, 197, 122, .3);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(243, 197, 122, .08), rgba(102, 230, 195, .035));
}

.sales-ai-card small {
  color: var(--gold);
  font-weight: 800;
}

.sales-ai-card h3 {
  font-size: 16px;
  margin: 4px 0;
}

.sales-ai-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

.sales-ai-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-weight: 800;
  color: var(--gold);
}

.sales-ai-coupon {
  margin-top: 9px;
  padding: 8px;
  border: 1px dashed rgba(102, 230, 195, .35);
  border-radius: 99px;
  color: var(--mint);
  font-size: 10.5px;
  text-align: center;
}

.sales-ai-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
}

.sales-ai-actions button {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  justify-content: flex-start;
  border-radius: 10px;
  white-space: normal;
  line-height: 1.45;
  border: 1px solid rgba(243, 197, 122, .35);
  color: var(--gold);
  background: rgba(243, 197, 122, .06);
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: optionButtonFadeIn .36s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--opt-index, 0) * 0.05s);
  will-change: transform, opacity;
}

.sales-ai-actions button:hover {
  background: rgba(243, 197, 122, .18);
  border-color: var(--gold);
  transform: translateX(-4px);
  box-shadow: 0 4px 14px rgba(243, 197, 122, .15);
}

@keyframes optionButtonFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.sales-ai-email-form {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .02);
}

.sales-ai-email-form textarea {
  min-height: 74px;
  resize: vertical;
}

@media(max-width:560px) {
  body.sales-ai-open {
    overflow: hidden;
  }

  .sales-ai-launcher {
    right: 12px;
    bottom: 12px;
    min-height: 49px;
    padding: 7px 13px 7px 9px;
  }

  .sales-ai-launcher img {
    width: 32px;
    height: 32px;
  }

  .sales-ai-shell {
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(82dvh, 640px);
    border-radius: 23px 23px 0 0;
    border-bottom: 0;
    transform-origin: bottom center;
    transform: translateY(28px);
  }

  .sales-ai-head {
    min-height: 62px;
    padding: 9px 10px;
  }

  .sales-ai-head img {
    width: 36px;
    height: 36px;
  }

  .sales-ai-messages {
    padding: 12px;
  }

  .sales-ai-message {
    max-width: 96%;
    font-size: 11px;
  }

  .sales-ai-compose {
    padding: 8px;
  }

  .sales-ai-compose button {
    min-width: 66px;
    padding-inline: 8px;
  }
}

@media(max-width:360px) {
  .sales-ai-launcher span {
    display: none;
  }

  .sales-ai-launcher {
    width: 50px;
    padding: 7px;
    justify-content: center;
  }

  .sales-ai-shell {
    height: 90dvh;
  }

  .sales-ai-head img {
    width: 30px;
    height: 30px;
  }

  .sales-ai-close {
    width: 31px;
    height: 31px;
  }
}
