#chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #00CFFF;
  color: white;
  font-size: 28px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 99999;
}

#close-button {
  position: fixed;
  top: 300px;
  right: 20px;
  font-size: 32px;
  color: #fff;
  background: #00CFFF;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  z-index: 100000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: none;
}

#chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  height: 460px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
}

#chat-header {
  background: #00CFFF;
  color: white;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#clear-chat, #mobile-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 14px;
}

.desktop-only {
  display: inline-block;
}
.mobile-only {
  display: none;
}

#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #fff;
  position: relative;
}

#typing-indicator {
  padding: 6px 12px;
  color: #888;
  font-size: 14px;
}
#typing-indicator .dot {
  animation: blink 1.2s infinite;
}
#typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
#typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

#input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}
#user_input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
}
#send_button {
  margin-left: 10px;
  background: #00CFFF;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.bot-message, .user-message {
  margin: 8px 0;
}
.bot-message {
  display: flex;
  align-items: flex-start;
}
.bot-message img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 8px;
}
.bot-message span, .user-message span {
  background: #F1F1F1;
  color: #333;
  padding: 8px 12px;
  border-radius: 16px;
  max-width: 80%;
  display: inline-block;
  position: relative;
}
.user-message {
  text-align: right;
}
.user-message span {
  background: #00CFFF;
  color: #fff;
}

.timestamp {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* Адаптив для мобильных */
@media (max-width: 600px) {
  #chat-window {
    width: 95vw;
    height: calc(100dvh - 120px);
    top: 100px;
    bottom: auto;
    right: 10px;
    border-radius: 12px;
  }
  #close-button {
    display: none !important;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: inline-block !important;
  }
}
