.live-chat {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  font-family: inherit;
}

.live-chat__toggle {
  border: 1px solid hsl(var(--border));
  background: linear-gradient(135deg, hsl(var(--gold)), hsl(var(--gold) / 0.75));
  color: hsl(var(--primary-foreground));
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  box-shadow: 0 10px 30px hsl(var(--gold) / 0.25);
}

.live-chat__panel {
  position: absolute;
  right: 0;
  bottom: 3.75rem;
  width: min(92vw, 370px);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 50px hsl(0 0% 0% / 0.35);
}

.live-chat__header {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.45);
}

.live-chat__header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.live-chat__header p {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.live-chat__close {
  border: 1px solid hsl(var(--border));
  background: transparent;
  border-radius: 0.5rem;
  width: 2rem;
  height: 2rem;
  color: hsl(var(--muted-foreground));
}

.live-chat__inactive {
  margin: 0.75rem;
  border: 1px solid hsl(0 75% 50% / 0.35);
  background: hsl(0 75% 50% / 0.09);
  color: hsl(var(--foreground));
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.82rem;
}

.live-chat__start,
.live-chat__body {
  padding: 0.8rem;
}

.live-chat__body-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.live-chat__end-btn {
  border: 1px solid hsl(0 75% 50% / 0.35);
  background: hsl(0 75% 50% / 0.1);
  color: hsl(var(--foreground));
  border-radius: 0.55rem;
  padding: 0.38rem 0.58rem;
  font-size: 0.74rem;
  font-weight: 600;
}

.live-chat__restart-btn {
  width: 100%;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--gold) / 0.15);
  color: hsl(var(--foreground));
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.live-chat__closed {
  margin-bottom: 0.6rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  border-radius: 0.65rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
}

.live-chat__start label {
  display: block;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.65rem;
}

.live-chat__start input,
.live-chat__composer input {
  width: 100%;
  margin-top: 0.3rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.live-chat__start button,
.live-chat__composer button {
  border: 1px solid hsl(var(--border));
  border-radius: 0.65rem;
  background: hsl(var(--gold));
  color: hsl(var(--primary-foreground));
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
}

.live-chat__messages {
  min-height: 180px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid hsl(var(--border));
  border-radius: 0.65rem;
  background: hsl(var(--background));
  padding: 0.55rem;
}

.live-chat__msg {
  margin-bottom: 0.45rem;
}

.live-chat__msg-meta {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.15rem;
}

.live-chat__msg-bubble {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.35;
  border: 1px solid hsl(var(--border));
  border-radius: 0.65rem;
  padding: 0.45rem 0.55rem;
  max-width: 90%;
}

.live-chat__msg--operator .live-chat__msg-bubble {
  background: hsl(var(--gold) / 0.14);
  border-color: hsl(var(--gold) / 0.35);
}

.live-chat__composer {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.4rem;
}

.live-chat__composer input {
  margin-top: 0;
}

@media (max-width: 640px) {
  .live-chat {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
