
/* Floating chatbot launcher */
#ai-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #123b63;
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  font-size: 25px;
  cursor: pointer;
}

/* Chat panel */
#ai-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100dvh - 130px));
  overflow: hidden;
  background: #ffffff;
  color: #172b3a;
  border: 1px solid #d8e1e9;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  font-family: Arial, sans-serif;
}

#ai-chat-panel.is-open {
  display: flex;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background-color: #123b63;
  color: #ffffff;
}

.ai-chat-header h2 {
  margin: 0;
  font-size: 17px;
  color: #ffffff;
  font-weight: 700;
}

.ai-chat-header p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #e3efff;
}

#ai-chat-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
}

#ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f6f8fb;
}

.ai-chat-message {
  width: fit-content;
  max-width: 90%;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  font-size: 14px;
}

.ai-chat-message.assistant {
  background: #ffffff;
  border: 1px solid #e0e7ee;
}

.ai-chat-message.user {
  margin-left: auto;
  background: #dceaf7;
}

#ai-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e0e7ee;
}

#ai-chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px;
  border: 1px solid #c8d4df;
  border-radius: 9px;
  font-size: 14px;
}

#ai-chat-form button {
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #123b63;
  color: #ffffff;
  cursor: pointer;
}

#ai-chat-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ai-chat-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 10px;
}

#ai-chat-clear {
  border: 0;
  background: transparent;
  color: #345a7b;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 480px) {
  #ai-chat-launcher {
    right: 16px;
    bottom: 16px;
  }

  #ai-chat-panel {
    right: 8px;
    bottom: 86px;
    width: calc(100vw - 16px);
  }
}
