.live-chat-root {
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

.live-chat-launcher {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1080;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--c-primary, #13293D);
  color: #fff;
  box-shadow: 0 12px 28px rgba(19, 41, 61, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.live-chat-launcher svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: currentColor;
  display: block;
}

.live-chat-launcher[hidden],
.live-chat-panel[hidden] { display: none !important; }

.live-chat-launcher.is-open {
  background: var(--c-gold, #D4A854);
  color: var(--c-primary-dark, #0B1F30);
}

.live-chat-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--c-error, #DC2626);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.live-chat-launcher.has-unread .live-chat-badge { display: inline-flex; }

.live-chat-launcher.has-unread {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.28), 0 12px 28px rgba(19, 41, 61, 0.28);
}

.live-chat-launcher.is-alerting {
  animation: live-chat-shake 0.55s ease-in-out 3;
}

@keyframes live-chat-shake {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  20% { transform: translate3d(-5px, -2px, 0) rotate(-8deg); }
  40% { transform: translate3d(6px, 1px, 0) rotate(7deg); }
  60% { transform: translate3d(-4px, 2px, 0) rotate(-5deg); }
  80% { transform: translate3d(4px, -1px, 0) rotate(4deg); }
}

.live-chat-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 4.85rem;
  z-index: 1080;
  width: min(23.5rem, calc(100vw - 1.5rem));
  max-height: min(34rem, calc(100vh - 6.2rem));
  background: var(--c-surface, #fff);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(19, 41, 61, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-border, #E5E7EB);
}

.live-chat-head {
  background: var(--c-primary, #13293D);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.live-chat-head h2,
.live-chat-panel .live-chat-head h2 {
  font-size: 1rem !important;
  margin: 0 !important;
  font-weight: 800;
  color: #fff !important;
  line-height: 1.3;
}

.live-chat-head p {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82) !important;
  line-height: 1.4;
}

.live-chat-head button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  width: 1.75rem;
  height: 1.75rem;
}

.live-chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  background: var(--c-bg, #FAFAF8);
}

.live-chat-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0.5rem 0 0.2rem;
  color: var(--c-text, #1F2937);
}

.live-chat-form input,
.live-chat-form textarea {
  width: 100%;
  border: 1px solid var(--c-border, #E5E7EB);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: var(--c-text, #1F2937);
}

.live-chat-form textarea { min-height: 4.6rem; resize: vertical; }

.live-chat-form .btn,
.live-chat-form button[type="submit"] {
  margin-top: 0.85rem;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--c-gold, #D4A854);
  color: var(--c-primary-dark, #0B1F30);
  font-weight: 800;
  padding: 0.7rem 1rem;
}

.live-chat-error {
  color: var(--c-error, #DC2626);
  font-size: 0.8rem;
  margin-top: 0.45rem;
}

.live-chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.live-chat-bubble {
  max-width: 86%;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--c-text, #1F2937);
}

.live-chat-bubble small {
  display: block;
  margin-top: 0.25rem;
  opacity: 0.7;
  font-size: 0.7rem;
}

.live-chat-bubble.is-visitor {
  align-self: flex-end;
  background: var(--c-primary, #13293D);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.live-chat-bubble.is-agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--c-border, #E5E7EB);
  border-bottom-left-radius: 4px;
}

.live-chat-bubble.is-system {
  align-self: center;
  background: transparent;
  border: 0;
  color: var(--c-text-muted, #64748B);
  font-size: 0.75rem;
  padding: 0;
}

.live-chat-compose {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem;
  border-top: 1px solid var(--c-border, #E5E7EB);
  background: #fff;
}

.live-chat-compose textarea {
  flex: 1;
  border: 1px solid var(--c-border, #E5E7EB);
  border-radius: 8px;
  min-height: 2.6rem;
  max-height: 6rem;
  padding: 0.5rem 0.7rem;
  resize: none;
}

.live-chat-compose button {
  border: 0;
  background: var(--c-gold, #D4A854);
  color: var(--c-primary-dark, #0B1F30);
  font-weight: 800;
  border-radius: 8px;
  padding: 0 0.95rem;
}

@media (max-width: 575px) {
  .live-chat-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 4.5rem;
  }
}

.offline-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.offline-page__icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: var(--c-primary, #13293D);
  color: var(--c-gold, #D4A854);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
