.chatbot-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lift);
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.06);
}

.chatbot-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: calc(100vh - 120px);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-header {
  background: var(--color-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header strong {
  font-size: 0.95rem;
}

.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-bg-alt);
}

.chatbot-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 2px;
}

.chatbot-msg.error {
  align-self: flex-start;
  background: #fff;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.chatbot-msg.typing {
  align-self: flex-start;
  color: var(--color-text-muted);
  font-style: italic;
}

.chatbot-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.chatbot-form input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.chatbot-form button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.chatbot-form button:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 480px) {
  .chatbot-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 80px;
  }

  .chatbot-toggle {
    right: 16px;
    bottom: 16px;
  }
}
