.live-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: #ff222b;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.live-chat-launcher:hover {
  transform: translateY(-1px);
}

.live-chat-launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.live-chat-unread {
  display: none;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  color: #080b12;
  font-size: 12px;
  line-height: 1;
}

.live-chat-unread.is-visible {
  display: inline-flex;
}

.live-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 901;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 130px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  background: #101521;
  color: #f7f8fb;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.live-chat-panel[hidden] {
  display: none;
}

.live-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #151b28;
}

.live-chat-heading {
  min-width: 0;
}

.live-chat-heading strong {
  display: block;
  font-size: 17px;
}

.live-chat-heading span {
  display: block;
  margin-top: 3px;
  color: #a6adbc;
  font-size: 12px;
}

.live-chat-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #f7f8fb;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.live-chat-status {
  min-height: 20px;
  padding: 8px 16px 0;
  color: #a6adbc;
  font-size: 12px;
}

.live-chat-status.is-error {
  color: #ff7b81;
}

.live-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 18px;
  overscroll-behavior: contain;
}

.live-chat-empty {
  display: flex;
  height: 100%;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: #a6adbc;
  text-align: center;
  line-height: 1.55;
}

.live-chat-message {
  display: flex;
  margin-top: 10px;
}

.live-chat-message:first-child {
  margin-top: 0;
}

.live-chat-message.is-guest {
  justify-content: flex-end;
}

.live-chat-message.is-operator,
.live-chat-message.is-system {
  justify-content: flex-start;
}

.live-chat-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 15px;
  background: #1a2130;
  word-break: break-word;
  white-space: pre-wrap;
}

.live-chat-message.is-guest .live-chat-bubble {
  background: #ff222b;
  color: #fff;
  border-bottom-right-radius: 5px;
}

.live-chat-message.is-operator .live-chat-bubble {
  border-bottom-left-radius: 5px;
}

.live-chat-message.is-system .live-chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  color: #a6adbc;
}

.live-chat-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.live-chat-meta {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.live-chat-message.is-operator .live-chat-meta,
.live-chat-message.is-system .live-chat-meta {
  color: #7f889b;
}

.live-chat-closed {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #a6adbc;
  font-size: 12px;
  line-height: 1.45;
}

.live-chat-form {
  flex: 0 0 auto;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #101521;
}

.live-chat-form textarea {
  display: block;
  width: 100%;
  min-height: 74px;
  max-height: 150px;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  outline: none;
  padding: 11px 12px;
  background: #080b12;
  color: #f7f8fb;
  font: inherit;
  font-size: 14px;
}

.live-chat-form textarea:focus {
  border-color: rgba(255, 34, 43, 0.72);
}

.live-chat-form textarea::placeholder {
  color: #747d90;
}

.live-chat-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.live-chat-counter {
  color: #747d90;
  font-size: 11px;
}

.live-chat-send {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
  background: #ff222b;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.live-chat-send:disabled,
.live-chat-form textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .live-chat-launcher {
    right: 14px;
    bottom: 14px;
    min-height: 50px;
    padding: 0 17px;
  }

  .live-chat-panel {
    right: 10px;
    bottom: 76px;
    width: calc(100vw - 20px);
    height: min(620px, calc(100dvh - 96px));
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-chat-launcher {
    transition: none;
  }
}
