body {
  margin: 0;
  background: #ffffff;
  font-family: 'Inter', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}

.chatbot-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 16px;
  box-sizing: border-box;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 40;
}
.chatbot-title {
  font-weight: 600;
  font-size: 16px;
}
.chatbot-actions {
  display: flex;
  gap: 8px;
}
.chatbot-assistant-icon {
  max-width: 200px;
  margin: 0 auto;
}
.chatbot-btn {
  background-color: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.chatbot-btn.primary {
  background-color: #007aff;
  color: #ffffff;
  border-color: #007aff;
}
.chatbot-btn.danger {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.chatbot-window {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 12px;
  min-height: 0;
}
.chatbot-greeting {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#chatMessages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 12px;
}

.chatbot-history {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -8px 0 20px rgba(0,0,0,0.06);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.chatbot-history.open {
  transform: translateX(0);
}
.chatbot-history-header {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}
.chatbot-history-list {
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}
.history-empty {
  padding: 24px 16px;
  text-align: center;
  color: #6b7280;
}
.history-empty-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}
.history-empty-subtitle {
  font-size: 12px;
}
.history-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}
.history-item:hover {
  background: #f9fafb;
}
.history-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-subtitle {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-message {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 16px;
  line-height: 1.5;
}

.chatbot-message.bot {
  background-color: #eeeeee;
  align-self: flex-start;
}

.chatbot-message.user {
  background-color: #dcf2ff;
  align-self: flex-end;
}

.chatbot-message.bot h1,
.chatbot-message.bot h2,
.chatbot-message.bot h3,
.chatbot-message.bot h4,
.chatbot-message.bot h5,
.chatbot-message.bot h6 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-message.bot p { margin: 0 0 20px 0; }
.chatbot-message.bot ul,
.chatbot-message.bot ol { margin: 6px 0 20px 20px; padding: 0; }
.chatbot-message.bot li { margin: 4px 0; }

.chatbot-message a { color: #007aff; text-decoration: none; }
.chatbot-message a:hover { text-decoration: underline; }

.chatbot-message.bot.thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}
.thinking-dots { display: inline-flex; align-items: center; height: 10px; }
.thinking-dots span {
  width: 6px;
  height: 6px;
  background: #9aa0a6;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  animation: thinkingBlink 1.4s infinite both;
}
.bot.typewriter { white-space: pre-wrap; }
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes thinkingBlink { 0% { opacity: .2; } 20% { opacity: 1; } 100% { opacity: .2; } }

.chatbot-input-box {
  display: flex;
  gap: 10px;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5e7eb;
  z-index: 30;
}

.chatbot-input {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 100%;
  box-sizing: border-box;
}

.chatbot-send {
  background-color: #007aff;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

@media (max-width: 768px) {
  .chatbot-message { max-width: 95%; padding: 10px 14px; }
  .chatbot-input { font-size: 15px; }
  .chatbot-send { font-size: 15px; }
  .chatbot-window { padding-bottom: 120px; }
}


