/* ===========================
   Кнопка
=========================== */
#chat-button {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 58px;
  height: 58px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--fb-primary);
  color: #111;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: 0.25s;
  z-index: 1000;
}

#chat-button:hover {
  transform: scale(1.08);
  background: var(--fb-primary);
  color: #111;
}

#forgebit-widget #chat-button img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

/* ===========================
   Окно чата
=========================== */

#chat-window {
  position: fixed;
  right: 30px;
  bottom: 98px;
  width: 380px;
  height: 620px;
  background: var(--fb-window, white);
  border-radius: 22px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#forgebit-widget #send-button img {
  width: 20px;
  height: 20px;
  display: block;
}
/* ===========================
   Скрытое состояние
=========================== */
#chat-window {
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.95);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
}

/* ===========================
   Открытое состояние
=========================== */
#chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ===========================
   Шапка
=========================== */
#forgebit-widget .chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(244, 180, 0, 0.25);
}

#forgebit-widget .chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

#forgebit-widget .chat-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

#forgebit-widget #chat-title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#chat-close {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--fb-text);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

#chat-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ===========================
   Основная область
=========================== */
#chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  color: #374151;
}

/* ===========================
   Нижняя панель
=========================== */
#chat-footer {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(244, 180, 0, 0.2);
}

#chat-footer input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  font-size: 15px;
}

#chat-footer button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--fb-primary);
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-footer button:hover:not(:disabled) {
  background: var(--fb-primary-hover);
}