#ai-chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 68px;
  height: 68px;
  border-radius: 25%;
  background:white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: visible;
  transition: transform .2s ease, box-shadow .2s ease;
}

.ai-chat-button-online {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #84cc16;
}

#ai-chat-button:hover {
  transform: translateY(-2px);
}

#ai-chat-button svg {
  display: block;
  opacity: 1;
  filter: none;
  shape-rendering: geometricPrecision;
}

#ai-chat-button svg #mouth {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .24s ease;
}

#ai-chat-button:hover svg #mouth {
  transform: translateY(4px) scaleX(1.06) scaleY(0.82);
}

#ai-chat-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: min(380px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 118px));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.97) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.22),
    0 8px 24px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  backdrop-filter: blur(18px);
  z-index: 9999;
}

.ai-chat-header {
  background: #234A84;
  color: white;
  padding: 16px 16px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.ai-avatar svg {
  width: 18px;
  height: 18px;
}

.ai-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ai-status {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.82);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.ai-status-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
}

.ai-chat-new,
.ai-chat-close {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.ai-chat-new {
  appearance: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ai-chat-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-close svg {
  display: none;
}

.ai-chat-close::before,
.ai-chat-close::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 1.75px;
  background: #ffffff;
  border-radius: 999px;
}

.ai-chat-close::before {
  transform: rotate(45deg);
}

.ai-chat-close::after {
  transform: rotate(-45deg);
}

.ai-chat-new:hover,
.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  color: #fff;
}

#chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(circle at top center, rgba(147, 197, 253, 0.14), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #f8fafc 45%, #f1f5f9 100%);
}

.hidden {
  display: none;
}

@media (max-width: 480px) {
  #ai-chat-button {
    right: 16px;
    bottom: 16px;
  }

  #ai-chat-widget {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 104px));
    border-radius: 22px;
  }

  .ai-chat-new {
    padding: 7px 10px;
    font-size: 11px;
  }
}
