/* FAB AI-ассистент — публичный виджет лендинга */
/* button#… — выше specificity, чем body.lb-anim-btn-* button { position:relative } */
button#lb-ai-fab.lb-ai-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: auto;
  top: auto;
  z-index: 100000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: lb-ai-pulse 2.2s ease-in-out infinite;
  overflow: visible;
  background-image: none;
  background-size: auto;
  transform: none;
}
.lb-ai-fab--light {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.lb-ai-fab--dark {
  background: #0f172a;
  color: #f8fafc;
}
button#lb-ai-fab.lb-ai-fab::before {
  content: "AI";
  font: 700 14px/1 system-ui, sans-serif;
  pointer-events: none;
}
@keyframes lb-ai-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.lb-ai-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  left: auto;
  top: auto;
  z-index: 100001;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  pointer-events: auto;
}
.lb-ai-panel[hidden] { display: none !important; }
.lb-ai-panel__form button:disabled,
.lb-ai-panel__form input:disabled {
  opacity: 0.65;
  cursor: wait;
}
.lb-ai-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.lb-ai-panel__head button {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.lb-ai-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-ai-msg {
  max-width: 90%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.lb-ai-msg--user {
  align-self: flex-end;
  background: #dbeafe;
}
.lb-ai-msg--assistant {
  align-self: flex-start;
  background: #f1f5f9;
}
.lb-ai-panel__typing {
  padding: 0 12px 6px;
  font-size: 12px;
  color: #64748b;
}
.lb-ai-panel__form {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #e2e8f0;
}
.lb-ai-panel__form input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.lb-ai-panel__form button {
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.lb-ai-panel__consent {
  padding: 8px 10px 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}
.lb-ai-panel__contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.lb-ai-panel__contacts input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
.lb-ai-panel__contacts button {
  grid-column: 1 / -1;
  border: none;
  border-radius: 6px;
  padding: 7px;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .lb-ai-fab { animation: none; }
}
