.fs-ai-chat {
  --fs-ai-launcher-top: 50%;
  --fs-ai-launcher-right: max(14px, calc((100vw - 1408px) / 2 - 130px));
  position: relative;
  z-index: 2147482000;
}

.fs-ai-chat__launcher {
  position: fixed;
  top: var(--fs-ai-launcher-top);
  right: var(--fs-ai-launcher-right);
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  padding: 0;
  box-sizing: border-box;
  border: 2px solid rgba(174, 78, 255, 0.92);
  border-radius: 32px;
  outline: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #f03b4c, #a7192a);
  box-shadow: 0 16px 42px rgba(133, 52, 225, 0.46), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.fs-ai-chat__launcher:hover,
.fs-ai-chat__launcher:focus-visible {
  box-shadow: 0 20px 48px rgba(154, 66, 245, 0.58), 0 0 0 3px rgba(154, 66, 245, 0.16);
  transform: translateY(-50%) scale(1.05);
}

.fs-ai-chat__bot-icon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  user-select: none;
}

.fs-ai-chat.has-bot-icon .fs-ai-chat__bot-icon {
  opacity: 1;
}

.fs-ai-chat__bot-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: none;
}

.fs-ai-chat__bot-fallback svg {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.fs-ai-chat__bot-fallback span {
  position: absolute;
  right: -17px;
  bottom: -13px;
  min-width: 31px;
  padding: 4px 6px;
  border: 2px solid #0d0e12;
  border-radius: 9px;
  background: #fff;
  color: #a7192a;
  font: 900 12px/1 Arial, sans-serif;
}

.fs-ai-chat__pulse {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  z-index: 4;
  border: 2px solid #0d0e12;
  border-radius: 50%;
  background: #4edd91;
}

.fs-ai-chat__tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  z-index: 5;
  width: max-content;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid #343740;
  border-radius: 10px;
  background: #17191f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transform: translate(6px, -50%);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.fs-ai-chat__launcher:hover .fs-ai-chat__tooltip,
.fs-ai-chat__launcher:focus-visible .fs-ai-chat__tooltip {
  opacity: 1;
  transform: translate(0, -50%);
}

.fs-ai-chat__panel {
  position: fixed;
  top: 50%;
  right: 18px;
  width: min(430px, calc(100vw - 36px));
  height: min(690px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid #343740;
  border-radius: 22px;
  background: #0b0c10;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transform: translate(18px, -50%) scale(0.97);
  transform-origin: right center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  visibility: hidden;
}

.fs-ai-chat.is-open .fs-ai-chat__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
  visibility: visible;
}

.fs-ai-chat.is-open .fs-ai-chat__launcher {
  opacity: 0;
  pointer-events: none;
}

.fs-ai-chat__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0c10;
}

@media (max-width: 767px) {
  .fs-ai-chat {
    --fs-ai-launcher-right: 12px;
  }

  .fs-ai-chat__launcher {
    width: 104px;
    height: 104px;
    border-radius: 29px;
  }

  .fs-ai-chat__tooltip {
    display: none;
  }

  .fs-ai-chat__panel {
    inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    border-radius: 18px;
    transform: translateY(12px) scale(0.98);
  }

  .fs-ai-chat.is-open .fs-ai-chat__panel {
    transform: translateY(0) scale(1);
  }

  body.fs-ai-chat-open {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fs-ai-chat__launcher,
  .fs-ai-chat__panel,
  .fs-ai-chat__tooltip {
    transition: none;
  }
}
