/* ================== Кнопка-триггер ================== */
#chat-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #800020;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-family: Roboto, sans-serif;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
  z-index: 9999;
  transition: all 0.2s ease;
  white-space: nowrap;
}
#chat-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.4);
}

/* ================== Окно чата ================== */
#chat-box {
  display: none;
  flex-direction: column;
  position: fixed;
  bottom: 70px;
  right: 20px;               /* окно теперь справа */
  width: 320px;
  max-width: 90vw;
  height: 70vh;
  max-height: 70vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  font-family: Roboto, sans-serif;
  z-index: 9998;
  overflow: hidden;
}

/* Хедер */
#chat-header {
  background: #800020;
  color: #fff;
  padding: 10px;
  font-weight: bold;
  position: relative;
}
#chat-close {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
}

/* Сообщения */
#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 14px;
}
#chat-messages .user { 
  color: #000; 
  margin-bottom: 5px; 
}
#chat-messages .admin { 
  color: #800020; 
  margin-bottom: 5px; 
  font-weight: bold; 
}

/* Форма ввода */
#chat-form { 
  display: flex; 
  border-top: 1px solid #ddd; 
  padding: 5px; 
}
#chat-input { 
  flex: 1; 
  border: 1px solid #ccc; 
  border-radius: 8px; 
  padding: 8px; 
}
#chat-form button { 
  background: #800020; 
  color: #fff; 
  border: none; 
  padding: 8px 14px; 
  cursor: pointer; 
  border-radius: 8px; 
  margin-left: 5px; 
}

/* ================== Адаптив для мобильных ================== */
@media (max-width: 480px) {
  #chat-trigger {
    left: 10px;               /* кнопка внизу слева */
    right: auto;
    font-size: 13px;
    padding: 10px 12px;
    max-width: 60vw;
    white-space: normal;
    text-align: center;
  }

  #chat-box {
    width: 100vw;
    height: 100vh;
    bottom: 0;
    left: 0;
    right: auto;
    transform: none;
    border-radius: 0;
  }
}