.ai-chatbot-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: Arial, sans-serif;
}

.ai-chatbot-assistant__toggle {
  border: 0;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.25);
}

.ai-chatbot-assistant__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(360px, calc(100vw - 32px));
  height: 520px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.ai-chatbot-assistant__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #fff;
}

.ai-chatbot-assistant__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.ai-chatbot-assistant__subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.ai-chatbot-assistant__header-actions {
  display: flex;
  gap: 8px;
}

.ai-chatbot-assistant__header-button {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.ai-chatbot-assistant__messages {
  flex: 1;
  padding: 16px;
  background: #f8fafc;
  overflow-y: auto;
}

.ai-chatbot-assistant__message {
  display: flex;
  margin-bottom: 12px;
}

.ai-chatbot-assistant__message--assistant {
  justify-content: flex-start;
}

.ai-chatbot-assistant__message--user {
  justify-content: flex-end;
}

.ai-chatbot-assistant__bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.ai-chatbot-assistant__message--user .ai-chatbot-assistant__bubble {
  background: #0f766e;
  color: #fff;
}

.ai-chatbot-assistant__message-meta {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #475569;
}

.ai-chatbot-assistant__typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-chatbot-assistant__typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  animation: ai-chatbot-assistant-bounce 1.2s infinite ease-in-out;
}

.ai-chatbot-assistant__typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-chatbot-assistant__typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.ai-chatbot-assistant__context {
  display: grid;
  gap: 8px;
}

.ai-chatbot-assistant__context-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e6fffb;
  color: #115e59;
  font-size: 13px;
  text-decoration: none;
}

.ai-chatbot-assistant__lead {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.ai-chatbot-assistant__lead-info {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #475569;
}

.ai-chatbot-assistant__lead-form {
  display: grid;
  gap: 10px;
}

.ai-chatbot-assistant__lead-form input,
.ai-chatbot-assistant__lead-form textarea,
.ai-chatbot-assistant__composer textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.ai-chatbot-assistant__lead-form button,
.ai-chatbot-assistant__composer button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ai-chatbot-assistant__lead-dismiss {
  border: 0;
  background: transparent;
  color: #475569;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.ai-chatbot-assistant__meta {
  display: flex;
  gap: 12px;
  padding: 0 16px 12px;
  background: #fff;
  font-size: 13px;
}

.ai-chatbot-assistant__meta a {
  color: #0f766e;
  text-decoration: none;
}

.ai-chatbot-assistant__composer {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.ai-chatbot-assistant__composer-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.ai-chatbot-assistant__composer textarea {
  min-height: 46px;
  max-height: 120px;
}

@media (max-width: 600px) {
  .ai-chatbot-assistant {
    right: 0;
    bottom: 0;
    left: 0;
  }

  .ai-chatbot-assistant__toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: auto;
    z-index: 9999;
  }

  .ai-chatbot-assistant.is-open .ai-chatbot-assistant__toggle {
    display: none;
  }

  .ai-chatbot-assistant__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
    z-index: 10000;
    overflow: hidden;
  }

  .ai-chatbot-assistant__header {
    flex-shrink: 0;
    padding: 14px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
  }

  .ai-chatbot-assistant__panel > :first-child + * {
    margin-top: 60px;
  }

  .ai-chatbot-assistant__messages {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ai-chatbot-assistant__bubble {
    max-width: 88%;
    font-size: 14px;
  }

  .ai-chatbot-assistant__lead {
    flex-shrink: 0;
    padding: 12px;
    max-height: 45vh;
    overflow-y: auto;
  }

  .ai-chatbot-assistant__composer {
    flex-shrink: 0;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .ai-chatbot-assistant__meta {
    flex-shrink: 0;
    padding: 0 12px 10px;
  }
}

@keyframes ai-chatbot-assistant-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
