.ai-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 22, 40, 0.96), rgba(9, 17, 30, 0.9));
  color: #f8fbff;
  cursor: pointer;
  z-index: 1101;
  box-shadow: 0 18px 42px rgba(3, 10, 24, 0.42);
  transition: transform .32s ease, box-shadow .25s ease, border-color .25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.ai-chat-launcher::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02));
}
.ai-chat-launcher:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(146, 168, 255, 0.28);
  box-shadow: 0 22px 54px rgba(5, 12, 28, 0.5);
}
.ai-chat-launcher-icon,
.ai-chat-launcher-dot {
  position: relative;
  z-index: 1;
}
.ai-chat-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-chat-launcher-icon svg {
  width: 22px;
  height: 22px;
  stroke: #eef4ff;
  stroke-width: 2.15;
}
.ai-chat-launcher-dot {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #34d399, #22c55e);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.32);
  animation: aiChatDotPulse 1.7s ease-in-out infinite;
}
@keyframes aiChatDotPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.34);
    opacity: 1;
  }
  55% {
    transform: scale(1.12);
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
    opacity: 0.92;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    opacity: 1;
  }
}
@media (max-width: 768px) {
  .ai-chat-launcher {
    right: 16px;
    bottom: 20px;
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }
}

.ai-chat-widget {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: 388px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  display: none;
  overflow: hidden;
  z-index: 1101;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(10, 18, 34, 0.96), rgba(7, 14, 27, 0.92));
  box-shadow: 0 28px 80px rgba(3, 10, 24, 0.52);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.ai-chat-widget.open {
  display: flex;
  flex-direction: column;
}
.ai-chat-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent 22%, transparent 78%, rgba(255,255,255,0.03));
  pointer-events: none;
}

.ai-chat-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  flex-shrink: 0;
}
.ai-chat-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ai-chat-head-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(135deg, rgba(122, 92, 255, 0.3), rgba(34, 197, 255, 0.16));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.ai-chat-head-icon svg {
  width: 18px;
  height: 18px;
  stroke: #eff5ff;
  stroke-width: 2.2;
}
.ai-chat-head strong {
  display: block;
  font-size: 16px;
  font-weight: 750;
  color: #f8fbff;
  letter-spacing: -0.02em;
}
.ai-chat-sub {
  font-size: 12px;
  color: #98aac8;
  margin-top: 3px;
  line-height: 1.35;
}
.ai-chat-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: #dfe8f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
  flex-shrink: 0;
}
.ai-chat-close:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}
.ai-chat-close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.ai-chat-messages {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  height: 328px;
  overflow: auto;
  padding: 16px 16px 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    rgba(6, 13, 24, 0.26);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.ai-chat-messages::-webkit-scrollbar {
  width: 8px;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.32);
  border-radius: 999px;
}
.ai-chat-msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px;
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px rgba(2, 8, 23, 0.14);
  white-space: pre-wrap;
}
.ai-chat-msg-user {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(127, 86, 217, 0.95), rgba(79, 70, 229, 0.95));
  border-color: rgba(196, 181, 253, 0.18);
  color: #fff;
  border-bottom-right-radius: 8px;
}
.ai-chat-msg-bot {
  margin-right: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.05));
  border-color: rgba(255,255,255,0.08);
  color: #edf4ff;
  border-bottom-left-radius: 8px;
}
.ai-chat-msg a {
  color: #9bc1ff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.ai-chat-msg-user a {
  color: #fff;
  opacity: .96;
}

.ai-chat-input-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  padding: 12px 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.ai-chat-input-row input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #eef4ff;
  background: rgba(255,255,255,0.04);
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ai-chat-input-row input::placeholder {
  color: #7f93b4;
}
.ai-chat-input-row input:focus {
  border-color: rgba(129, 140, 248, 0.42);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.ai-chat-input-row button {
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  min-width: 96px;
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #8471ff, #5f73ff);
  color: #fff;
  box-shadow: 0 10px 20px rgba(89, 109, 255, 0.24);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.ai-chat-input-row button:hover {
  transform: translateY(-1px);
}
.ai-chat-input-row button:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
}
.ai-chat-input-row button svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.35;
}

.ai-chat-quick-replies {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
  flex-shrink: 0;
}
.ai-chat-chip {
  border: 1px solid rgba(147, 197, 253, 0.2);
  background: rgba(255,255,255,0.04);
  color: #d9e7ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: all .2s ease;
}
.ai-chat-chip:hover {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(129, 140, 248, 0.38);
  color: #fff;
}
