:root {
  --livechat-fab-bg: linear-gradient(130deg, #2563eb, #0ea5e9);
  --livechat-fab-shadow: 0 16px 36px rgba(37, 99, 235, 0.34);
}

.livechat-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1080;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
  background: var(--livechat-fab-bg);
  box-shadow: var(--livechat-fab-shadow);
  transition: transform 0.15s ease, filter 0.2s ease, opacity 0.18s ease;
}

.livechat-fab-icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.livechat-fab .fab-icon-chat {
  opacity: 1;
  transform: scale(1);
}

.livechat-fab .fab-icon-inbox {
  opacity: 0;
  transform: scale(0.84);
}

.livechat-fab-unread-dot {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fb7185, #f97316);
  box-shadow: 0 0 0 3px rgba(2, 6, 23, 0.42), 0 0 18px rgba(249, 115, 22, 0.42);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.livechat-fab.has-unread .livechat-fab-unread-dot {
  opacity: 1;
  transform: scale(1);
  animation: livechat-fab-unread-pulse 1.6s ease-in-out infinite;
}

.livechat-fab.has-unread .fab-icon-chat {
  animation: livechat-fab-chat-swap 1.9s infinite;
}

.livechat-fab.has-unread .fab-icon-inbox {
  animation: livechat-fab-inbox-swap 1.9s infinite;
}

@keyframes livechat-fab-chat-swap {
  0%,
  44% {
    opacity: 1;
    transform: scale(1);
  }
  56%,
  100% {
    opacity: 0;
    transform: scale(0.84);
  }
}

@keyframes livechat-fab-inbox-swap {
  0%,
  44% {
    opacity: 0;
    transform: scale(0.84);
  }
  56%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes livechat-fab-unread-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(2, 6, 23, 0.42), 0 0 18px rgba(249, 115, 22, 0.42);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(2, 6, 23, 0.46), 0 0 26px rgba(251, 113, 133, 0.56);
  }
}

.livechat-panel-open .livechat-fab {
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  pointer-events: none;
}

.livechat-fab:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.livechat-fab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .livechat-fab {
    right: 0.8rem;
    bottom: 0.8rem;
    width: 52px;
    height: 52px;
  }
}
