.chat-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a5acd, #836fff);
  color: white;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 10000;
}
.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.chat-window {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 360px;
  max-width: 90vw;
  height: 520px;
  max-height: 80vh;
  background: #2f2c47;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10000;
}
.chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-header {
  background: linear-gradient(135deg, #836fff, #6a5acd);
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
  transition: color 0.3s ease;
}
.chat-close:hover {
  color: #ff6b6b;
}

.chat-messages {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  background: #1e1c30;
}
.chat-message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  animation: fadeIn 0.3s ease;
}
.chat-message.user {
  background: #6a5acd;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-message.bot {
  background: #ececff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-typing {
  font-style: italic;
  font-size: 13px;
  color: #bbb;
  padding-left: 10px;
}

.chat-input-container {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: #3a3650;
  border-top: 1px solid #4a4760;
}
#chat-input {
  flex-grow: 1;
  padding: 10px;
  border-radius: 20px;
  border: none;
  background: #2f2c47;
  color: white;
  outline: none;
  font-size: 14px;
}
.chat-attach {
  border: none;
  background: transparent;
  font-size: 20px;
  margin-right: 8px;
  color: #6a5acd;
  cursor: pointer;
  transition: color 0.3s ease;
  position: relative;
}
.chat-attach:hover {
  color: #836fff;
}
.chat-attach input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.chat-send {
  border: none;
  background: transparent;
  font-size: 20px;
  margin-left: 10px;
  color: #6a5acd;
  cursor: pointer;
  transition: color 0.3s ease;
}
.chat-send:hover {
  color: #836fff;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(10px);}
  to {opacity: 1; transform: translateY(0);}
}

/* Стили для изображений в чате */
.chat-message img {
  max-width: 250px;
  max-height: 350px;
  width: auto;
  height: auto;
  border-radius: 8px;
  margin-top: 5px;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-message img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(106, 90, 205, 0.4);
}
.chat-message a {
  text-decoration: none;
}

/* ... (все ваши существующие стили в chat.css) ... */


/* ❗️ НОВЫЕ СТИЛИ: Для системного сообщения о тарифе */
.chat-message.system.offer {
  background: #ececff;
  color: #333;
  align-self: center; /* Сообщение будет по центру */
  max-width: 90%;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border: 2px dashed #6a5acd;
  text-align: center;
  padding: 12px 16px;
}

/* Стили для input-поля со ссылкой внутри чата */
.chat-message.offer input {
  width: 95%; 
  padding: 5px; 
  border: 1px solid #6a5acd; 
  border-radius: 5px; 
  font-family: monospace; 
  margin-top: 5px;
  font-size: 12px;
  text-align: center;
  /* --- Стили для ИСТЕКШЕГО сообщения с предложением --- */
.chat-message.system.offer-expired {
  background-color: #2a2c4a; /* Темнее, чем активное */
  color: #a0a0c0; /* Более тусклый цвет текста */
  align-self: center;
  max-width: 90%;
  border-radius: 12px;
  border: 1px dashed #4a4c6a; /* Пунктирная, тусклая рамка */
  text-align: center;
  padding: 12px 16px;
  margin: 10px 0;
  font-style: italic; /* Курсив */
}

/* Зачеркиваем старую информацию */
.chat-message.system.offer-expired s {
    text-decoration: line-through; 
    color: #6c757d; /* Серый цвет */
}

/* Имя тарифа делаем тусклым */
.chat-message.system.offer-expired strong {
  color: #888; 
}
}