/* Виджет "ИИ-агент для бизнеса" — консультирует про BookMe и его ИИ-продавца,
   ходит на bookme.5bala.kg (см. ai-chat.js). Токены — из site.css (:root),
   этот файл не переопределяет цвета, только берёт var(...). */
#ai-chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(120deg, var(--brand), var(--accent)); color: #fff;
  border: none; border-radius: 999px; padding: 13px 18px 13px 14px; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: .86rem;
  box-shadow: 0 14px 30px -10px rgba(18, 53, 36, .45);
  opacity: 0; transform: translateY(12px) scale(.94); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
#ai-chat-fab.show { opacity: 1; transform: none; pointer-events: auto; }
#ai-chat-fab svg { flex: none; }

#ai-chat-panel {
  position: fixed; right: 18px; bottom: 84px; z-index: 61; width: 350px; max-width: calc(100vw - 36px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(18, 53, 36, .35);
  display: none; flex-direction: column; overflow: hidden;
}
#ai-chat-panel.open { display: flex; }
#ai-chat-head {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand)); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
#ai-chat-head strong { font-family: var(--display); font-size: .92rem; display: block; }
#ai-chat-head span { font-size: .76rem; opacity: .85; }
#ai-chat-close {
  margin-left: auto; background: rgba(255, 255, 255, .18); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: .9rem; line-height: 1;
}
#ai-chat-log {
  flex: 1; max-height: 340px; min-height: 160px; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; background: var(--bg);
}
.ai-chat-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; }
.ai-chat-msg.guest { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.ai-chat-msg.agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-bottom-left-radius: 4px; }
.ai-chat-typing { align-self: flex-start; padding: 11px 14px; border-radius: 12px; border-bottom-left-radius: 4px; background: var(--surface); border: 1px solid var(--border); display: flex; gap: 4px; }
.ai-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: .4; animation: ai-chat-bounce 1.2s infinite ease-in-out; }
.ai-chat-typing span:nth-child(2) { animation-delay: .15s; }
.ai-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-chat-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: .9; } }
#ai-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
#ai-chat-input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: .86rem; }
#ai-chat-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#ai-chat-send { background: var(--brand); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; }
#ai-chat-send:hover { background: var(--brand-dark); }
#ai-chat-send:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
  #ai-chat-panel { right: 10px; left: 10px; width: auto; bottom: 76px; }
  #ai-chat-fab { right: 10px; }
}
