.live-chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 1200;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #275dd2 0%, #1b3f98 100%);
  color: #fff;
  padding: 12px 16px;
  font: 700 14px/1 "DM Sans", "Segoe UI", sans-serif;
  box-shadow: 0 14px 26px rgba(18, 45, 114, 0.3);
  cursor: pointer;
}

.live-chat-panel {
  position: fixed;
  right: 16px;
  bottom: 74px;
  width: min(420px, calc(100vw - 20px));
  max-height: min(82vh, 780px);
  z-index: 1201;
  display: none;
  background: #f9fbff;
  border: 1px solid #d4dff2;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 42px rgba(17, 34, 76, 0.28);
}

.live-chat-panel,
.live-chat-panel * {
  box-sizing: border-box;
}

.live-chat-messages[hidden],
.live-chat-send-form[hidden],
.live-chat-form[hidden] {
  display: none !important;
}

.live-chat-panel.is-open {
  display: flex;
  flex-direction: column;
}

.live-chat-head {
  background: linear-gradient(135deg, #2f63d8 0%, #1d418f 100%);
  color: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-chat-head strong {
  font-size: 14px;
}

.live-chat-head small {
  display: block;
  opacity: 0.92;
}

.live-chat-close {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 8px;
  height: 30px;
  min-width: 30px;
  cursor: pointer;
}

.live-chat-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  background: linear-gradient(180deg, #f9fbff 0%, #f5f8ff 100%);
}

.live-chat-queue {
  font-size: 12px;
  color: #2b3f66;
  background: #eaf1ff;
  border: 1px solid #c7d6f7;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.live-chat-queue-text {
  color: inherit;
}

.live-chat-queue-dot {
  color: #2b3f66;
  font-weight: 700;
}

.live-chat-queue-waiting-label {
  color: #1f4ba3;
  font-weight: 700;
}

.live-chat-queue-count {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  margin-left: 6px;
  color: #1f4ba3;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.live-chat-queue-count span {
  display: inline-block;
  min-width: 8px;
  text-align: center;
  animation: live-chat-queue-bounce 1.2s ease-in-out infinite;
}

.live-chat-queue-count span:nth-child(2) {
  animation-delay: 0.16s;
}

.live-chat-queue-count span:nth-child(3) {
  animation-delay: 0.32s;
}

.live-chat-form,
.live-chat-send-form {
  display: grid;
  gap: 8px;
}

.live-chat-form.is-hidden {
  display: none !important;
}

.live-chat-body input,
.live-chat-body textarea {
  border: 1px solid #cad8f3;
  border-radius: 12px;
  min-height: 40px;
  padding: 10px 12px;
  font: 500 13px/1.3 "DM Sans", "Segoe UI", sans-serif;
  width: 100%;
  color: #213a65;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.live-chat-body input:focus,
.live-chat-body textarea:focus {
  outline: none;
  border-color: #5383e6;
  box-shadow: 0 0 0 3px rgba(56, 109, 220, 0.16);
}

.live-chat-body textarea {
  min-height: 54px;
  max-height: 120px;
  resize: vertical;
}

.live-chat-body button {
  border: 0;
  border-radius: 12px;
  min-height: 40px;
  padding: 0 12px;
  background: linear-gradient(135deg, #2f67da 0%, #275ac4 100%);
  color: #fff;
  font: 700 13px/1 "DM Sans", "Segoe UI", sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(28, 67, 152, 0.2);
}

.live-chat-body button:hover {
  filter: brightness(1.03);
}

.live-chat-body button:active {
  transform: translateY(1px);
}

.live-chat-messages {
  border: 1px solid #d5e0f3;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  min-height: 220px;
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.live-chat-send-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.live-chat-send-row button {
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 52px;
}

.live-chat-send-row textarea {
  min-height: 52px;
}

.live-chat-send-form {
  margin-top: auto;
  padding-top: 2px;
}

.live-chat-msg {
  max-width: 86%;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.live-chat-msg.customer {
  margin-left: auto;
  background: #2f63d8;
  color: #fff;
}

.live-chat-msg.admin {
  margin-right: auto;
  background: #eef3ff;
  color: #1e3159;
}

.live-chat-msg.system {
  margin: 0 auto;
  background: #f4f6fa;
  color: #445c86;
}

.live-chat-feedback {
  color: #a12d3d;
  font-size: 12px;
  min-height: 16px;
}

@media (max-width: 640px) {
  .live-chat-launcher {
    right: 10px;
    bottom: 10px;
    padding: 10px 14px;
  }

  .live-chat-panel {
    right: 10px;
    bottom: 58px;
    width: calc(100vw - 12px);
    max-height: 78vh;
  }

  .live-chat-send-row button {
    min-width: 0;
    padding: 0 10px;
  }
  .live-chat-send-row {
    grid-template-columns: minmax(0, 1fr) 94px;
  }
}

@keyframes live-chat-queue-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}


