.live-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.live-chat-toast {
  background: #0b1d33;
  color: #fff4cf;
  border: 1px solid rgba(242, 207, 114, 0.4);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  max-width: 220px;
}

.live-chat-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 15px;
  font-weight: 700;
  color: #2b1a00;
  background: linear-gradient(180deg, #f8dfa0 0%, #f2cf72 45%, #c08d2a 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.live-chat-widget > .live-chat-launcher {
  display: none !important;
}

.floating-tools .live-chat-launcher {
  display: grid !important;
  place-items: center !important;
  width: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0 !important;
  pointer-events: auto;
}

.floating-tools .live-chat-launcher span:not(.live-chat-badge) {
  display: none;
}

.floating-tools .live-chat-launcher i {
  font-size: 20px;
}

.live-chat-launcher i {
  font-size: 16px;
}

.live-chat-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  padding: 0 5px;
  border: 2px solid #fff;
}

.live-chat-panel {
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 140px));
  background: linear-gradient(180deg, #08162b 0%, #0b213f 100%);
  border: 1px solid rgba(242, 207, 114, 0.25);
  border-radius: 16px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.live-chat-widget.open .live-chat-panel {
  display: flex;
}

.live-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(242, 207, 114, 0.18);
  color: #fff;
  background: rgba(4, 12, 25, 0.45);
}

.live-chat-header small {
  display: block;
  color: #cfddeb;
  font-size: 11px;
}

.live-chat-close {
  background: transparent;
  color: #fff;
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
}

.live-chat-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.live-chat-status {
  padding: 8px 12px;
  color: #d6e4ef;
  font-size: 12px;
  border-bottom: 1px solid rgba(242, 207, 114, 0.12);
}

.live-chat-messages {
  flex: 1 1 auto;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(242, 207, 114, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(7, 20, 40, 0.25), rgba(7, 20, 40, 0.1));
}

.live-chat-empty {
  margin: auto;
  text-align: center;
  color: #c8d8e6;
  font-size: 13px;
  line-height: 1.35;
}

.live-chat-msg {
  max-width: 88%;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.live-chat-msg .meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 10px;
  opacity: 0.85;
}

.live-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #f6d78e 0%, #e7b84a 100%);
  color: #2c1c03;
}

.live-chat-msg.admin {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ebf3fa;
}

.live-chat-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "name name"
    "email phone"
    "message message"
    "send send";
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(242, 207, 114, 0.14);
  background: rgba(4, 12, 25, 0.4);
}

.live-chat-form input,
.live-chat-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 10px 11px;
  font: inherit;
}

.live-chat-form input {
  grid-area: name;
}

.live-chat-form #liveChatEmail {
  grid-area: email;
}

.live-chat-form #liveChatPhone {
  grid-area: phone;
}

.live-chat-form textarea {
  grid-area: message;
  resize: vertical;
  min-height: 64px;
  max-height: 120px;
}

.live-chat-form input::placeholder,
.live-chat-form textarea::placeholder {
  color: #bdd0e0;
}

.live-chat-form button {
  grid-area: send;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  color: #2b1a00;
  background: linear-gradient(180deg, #f8dfa0 0%, #f2cf72 45%, #c08d2a 100%);
  cursor: pointer;
}

.live-chat-form button[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .live-chat-widget {
    right: 10px;
    bottom: 12px;
  }

  .live-chat-panel {
    width: min(360px, calc(100vw - 16px));
    height: min(70vh, 520px);
  }

  .floating-tools .live-chat-launcher {
    width: 46px;
    height: 46px;
  }
}
