#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Poppins', sans-serif;
}

/* Маленький блок (закрытый чат) */
#chat-header {
  background: #f0f6ff;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 12px 16px;
  cursor: pointer;
  max-width: 280px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.header-top {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.header-info {
  display: flex;
  flex-direction: column;
}

.header-name {
  font-weight: 600;
  font-size: 14px;
  color: #2b2b2b;
}

.header-role {
  font-size: 12px;
  color: #5c6b7a;
  margin-top: 2px;
}

#typing-text {
  font-size: 13px;
  color: #007acc;
}

/* Раскрытое окно чата */
#chat-window {
  width: 320px;
  height: 440px;
  background: #f0f6ff;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  margin-top: 10px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#chat-window .header-top {
  padding: 10px;
  background: #ffffff;
  border-bottom: 1px solid #d0d7e2;
}

/* Область сообщений */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #f0f6ff;
}

.user, .bot {
  margin: 6px 0;
  font-size: 14px;
  word-break: break-word;
}

.user {
  text-align: right;
  color: #2b2b2b;
}

.bot {
  text-align: left;
  color: #0066cc;
}

/* Поле ввода */
#input-area {
  display: flex;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #d0d7e2;
}

#user-input {
  flex: 1;
  border: 1px solid #a3bcd4;
  border-radius: 10px;
  padding: 8px;
  font-size: 14px;
}

#send-btn {
  margin-left: 8px;
  background: #3399ff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#send-btn:hover {
  background: #007acc;
}

/* Плавный скроллинг сообщений */
#messages::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-thumb {
  background: rgba(51,153,255,0.5);
  border-radius: 10px;
}

#messages::-webkit-scrollbar-track {
  background: transparent;
}

/* Кнопка закрытия */
.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  color: #999;
  font-weight: bold;
  transition: color 0.2s ease;
  z-index: 10;
}

.close-btn:hover {
  color: #007acc;
}

.chat-header-full {
  position: relative;
  padding: 10px;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  #chatbot-container {
    bottom: 10px;
    right: 10px;
  }
  #chat-header {
    max-width: 90vw;
  }
  #chat-window {
    width: 90vw;
    height: 70vh;
  }
}





