.bre-chat-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;

  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;

  background: linear-gradient(135deg, #111827, #7c3aed);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bre-chat-button:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

.bre-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 9999;

  width: 360px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);

  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  overflow: hidden;

  display: none;
  flex-direction: column;
  backdrop-filter: blur(14px);
}

.bre-chat-panel.is-open {
  display: flex;
  animation: breChatOpen 0.22s ease-out;
}

@keyframes breChatOpen {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bre-chat-header {
  padding: 18px;
  background: linear-gradient(135deg, #111827, #7c3aed);
  color: #fff;
}

.bre-chat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bre-chat-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.bre-chat-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.82;
}

.bre-chat-close {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

.bre-chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 35%),
    #f8fafc;
}

.bre-chat-message {
  margin-bottom: 12px;
  display: flex;
}

.bre-chat-message.bot {
  justify-content: flex-start;
}

.bre-chat-message.user {
  justify-content: flex-end;
}

.bre-chat-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.bre-chat-message.bot .bre-chat-bubble {
  background: #fff;
  color: #111827;
  border-bottom-left-radius: 5px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.bre-chat-message.user .bre-chat-bubble {
  background: linear-gradient(135deg, #111827, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.bre-chat-form {
  padding: 14px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  background: #fff;
}

.bre-chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 11px 14px;
  outline: none;
  font-size: 14px;
}

.bre-chat-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.bre-chat-send {
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  background: #111827;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 520px) {
  .bre-chat-panel {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    height: 70vh;
  }

  .bre-chat-button {
    right: 18px;
    bottom: 18px;
  }
}