.live-support {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: "Manrope", sans-serif;
}

.live-support-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid rgba(225, 191, 110, 0.32);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 24, 36, 0.95), rgba(56, 33, 12, 0.95));
  color: #f7e6bf;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  cursor: pointer;
}

.live-support-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4dff9a;
  box-shadow: 0 0 0 6px rgba(77, 255, 154, 0.14);
}

.live-support-panel {
  width: min(380px, calc(100vw - 24px));
  border: 1px solid rgba(225, 191, 110, 0.24);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 20, 28, 0.97), rgba(9, 10, 16, 0.96));
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.46);
}

.live-support-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(225, 191, 110, 0.14);
  background: linear-gradient(135deg, rgba(95, 56, 12, 0.42), rgba(17, 25, 43, 0.58));
}

.live-support-header strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  color: #f8e4b1;
}

.live-support-header p {
  margin: 0;
  color: rgba(255, 240, 210, 0.72);
  font-size: 13px;
  line-height: 1.4;
}

.live-support-close {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.live-support-profile,
.live-support-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.live-support-panel[hidden],
.live-support-profile[hidden],
.live-support-chat[hidden] {
  display: none !important;
}

.live-support-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #f4ddaf;
  font-size: 13px;
  font-weight: 700;
}

.live-support-field input,
.live-support-field textarea,
.live-support-composer textarea {
  width: 100%;
  border: 1px solid rgba(225, 191, 110, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff7e5;
  padding: 13px 14px;
  font: inherit;
  outline: none;
  box-sizing: border-box;
}

.live-support-field textarea,
.live-support-composer textarea {
  resize: vertical;
}

.live-support-field input:focus,
.live-support-field textarea:focus,
.live-support-composer textarea:focus {
  border-color: rgba(225, 191, 110, 0.48);
  box-shadow: 0 0 0 3px rgba(225, 191, 110, 0.12);
}

.live-support-start,
.live-support-composer button {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #d3a14c, #f5cd84);
  color: #251608;
  font-weight: 800;
  cursor: pointer;
}

.live-support-status {
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 240, 210, 0.8);
  font-size: 12px;
}

.live-support-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  max-height: 360px;
  padding-right: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(225, 191, 110, 0.55) rgba(255, 255, 255, 0.06);
}

.live-support-messages::-webkit-scrollbar {
  width: 10px;
}

.live-support-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.live-support-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(225, 191, 110, 0.9), rgba(180, 120, 34, 0.9));
  border-radius: 999px;
  border: 2px solid rgba(7, 9, 16, 0.85);
}

.live-support-message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-support-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  min-height: 14px;
}

.live-support-message-author {
  font-weight: 800;
}

.live-support-message-time {
  opacity: 0.78;
}

.live-support-message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.live-support-message.visitor {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, #c78d2b, #f1c978);
  color: #241405;
}

.live-support-message.staff {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7e6;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-support-message.staff .live-support-message-author,
.live-support-message.staff .live-support-message-time {
  color: #f3d18d !important;
}

.live-support-message.system {
  align-self: center;
  max-width: 100%;
  font-size: 12px;
  color: rgba(255, 240, 210, 0.72);
  background: transparent;
  text-align: center;
}

.live-support-message.visitor .live-support-message-author,
.live-support-message.visitor .live-support-message-time {
  color: rgba(36, 20, 5, 0.78) !important;
}

.live-support-composer {
  padding: 0;
}

.live-support-composer textarea {
  min-height: 92px;
}

@media (max-width: 520px) {
  .live-support {
    right: 12px;
    left: 12px;
    bottom: 78px;
    align-items: stretch;
  }

  .live-support-toggle {
    justify-content: center;
  }

  .live-support-panel {
    width: 100%;
  }

  .live-support-messages {
    min-height: 220px;
    max-height: 42vh;
  }
}
