#chatbot-panel {
  position: fixed;
  top: 3.5rem;
  right: 1.5rem;
  width: 340px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 999;
  display: flex;
  flex-direction: column;
}

#chatbot-header {
  background: #3273dc;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}

#chatbot-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chatbot-msg-user {
  align-self: flex-end;
  background: #3273dc;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 12px 12px 2px 12px;
  max-width: 85%;
  word-break: break-word;
}

.chatbot-msg-bot {
  align-self: flex-start;
  background: #f5f5f5;
  color: #363636;
  padding: 0.4rem 0.8rem;
  border-radius: 12px 12px 12px 2px;
  max-width: 95%;
  word-break: break-word;
  white-space: pre-wrap;
}

.chatbot-msg-erreur {
  align-self: center;
  color: #cc0f35;
  font-size: 0.82rem;
}

.chatbot-spinner {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.8rem;
}

.chatbot-spinner span {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #aaa;
  border-radius: 50%;
  animation: chatbot-bounce 1.2s infinite ease-in-out;
}

.chatbot-spinner span:nth-child(2) {
  animation-delay: 0.2s;
}
.chatbot-spinner span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chatbot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

#chatbot-input-zone {
  display: flex;
  border-top: 1px solid #dbdbdb;
  padding: 0.5rem;
  gap: 0.4rem;
}

#chatbot-input {
  flex: 1;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
  outline: none;
}

#chatbot-input:focus {
  border-color: #3273dc;
}

#chatbot-send {
  background: #3273dc;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}

#chatbot-send:hover {
  background: #2366d1;
}

@media (max-width: 480px) {
  #chatbot-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    top: 3.25rem;
  }
}
