.support-chat-enabled #back-to-top {
  right: 1.1rem !important;
  bottom: 4.9rem !important;
  z-index: 90;
}

.lux-chat-widget {
  font-family: "Poppins", sans-serif;
}

.lux-chat-toggle {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 84;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.05rem;
  background: linear-gradient(135deg, #111827 0%, #312e81 58%, #4c1d95 100%);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lux-chat-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.34);
}

.lux-chat-presence {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.lux-chat-toggle-label {
  text-transform: uppercase;
  font-size: 0.67rem;
  letter-spacing: 0.11em;
}

.lux-chat-panel {
  position: fixed;
  right: 1.1rem;
  bottom: calc(1.1rem + 3.2rem + 0.7rem);
  z-index: 97;
  width: min(26rem, calc(100vw - 1.6rem));
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid #cfd9e6;
  border-radius: 1rem;
  box-shadow: 0 34px 62px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  transition: bottom 0.2s ease;
}

.hidden {
  display: none;
}

.lux-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.88rem 1rem 0.4rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.18), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
}

.lux-chat-header h3 {
  font-family: "Poppins", sans-serif;
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.15;
}

.lux-chat-eyebrow {
  margin: 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6366f1;
}

.lux-chat-close {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #d5dce5;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}

.lux-chat-status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.45rem 1rem 0.82rem;
  padding: 0.56rem 0.72rem;
  border-radius: 0.55rem;
  background: linear-gradient(180deg, #dbe2ec 0%, #d7dee9 100%);
  color: #334155;
  font-size: 0.77rem;
  line-height: 1.35;
}

.lux-chat-status-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.lux-chat-response-hint {
  font-size: 0.68rem;
  color: #475569;
}

.lux-chat-status-dot {
  width: 0.54rem;
  height: 0.54rem;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.lux-chat-status-bar.is-online {
  background: linear-gradient(180deg, #e7f9ee 0%, #dcf5e6 100%);
  border: 1px solid #bbf7d0;
  color: #166534;
}

.lux-chat-status-bar.is-online .lux-chat-response-hint {
  color: #15803d;
}

.lux-chat-status-bar.is-online .lux-chat-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  animation: lux-status-pulse 1.5s ease-in-out infinite;
}

@keyframes lux-status-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.lux-chat-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0 1rem;
}

.lux-chat-tab {
  border: 1px solid #d5dde8;
  border-radius: 0.6rem;
  background: #f8fafc;
  padding: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.lux-chat-tab.is-active {
  background: linear-gradient(180deg, #d9def0, #e8ecf9);
  color: #3730a3;
  border-color: #b9c5ee;
}

.lux-chat-pane {
  padding: 0.82rem 1rem 1rem;
}

.lux-chat-search,
.lux-chat-grid input,
.lux-chat-message-form textarea {
  width: 100%;
  border: 1px solid #cdd7e3;
  border-radius: 0.6rem;
  background: #fff;
  color: #0f172a;
  padding: 0.58rem 0.7rem;
  font-size: 0.84rem;
}

.lux-chat-search:focus,
.lux-chat-grid input:focus,
.lux-chat-message-form textarea:focus {
  outline: 0;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.lux-faq-list {
  margin-top: 0.7rem;
  max-height: 12.2rem;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.lux-faq-list::-webkit-scrollbar {
  width: 8px;
}

.lux-faq-list::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 8px;
}

.lux-faq-item {
  border: 1px solid #d8e0ea;
  border-radius: 0.65rem;
  padding: 0.62rem 0.7rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  margin-bottom: 0.55rem;
}

.lux-faq-item h4 {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  color: #0f172a;
}

.lux-faq-item p {
  margin: 0;
  font-size: 0.77rem;
  color: #475569;
  line-height: 1.4;
}

.lux-faq-meta {
  margin-top: 0.42rem;
  font-size: 0.65rem;
  color: #64748b;
}

.lux-faq-feedback {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.lux-faq-feedback-label {
  font-size: 0.66rem;
  color: #475569;
  margin-right: 0.15rem;
}

.lux-faq-feedback button {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
}

.lux-faq-feedback button.is-selected {
  border-color: #4f46e5;
  background: #e0e7ff;
  color: #3730a3;
}

.lux-faq-feedback-status {
  font-size: 0.64rem;
  color: #0f766e;
}

.lux-chat-muted {
  margin: 0;
  color: #64748b;
  font-size: 0.74rem;
}

.lux-chat-cta,
.lux-chat-primary,
.lux-chat-secondary {
  border-radius: 0.64rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.56rem 0.76rem;
  border: 0;
}

.lux-chat-cta,
.lux-chat-primary {
  background: linear-gradient(135deg, #1f2a44 0%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(67, 56, 202, 0.22);
}

.lux-chat-cta {
  margin-top: 0.6rem;
  width: 100%;
}

.lux-chat-secondary {
  background: #e2e8f0;
  color: #334155;
}

.lux-chat-identity {
  margin-bottom: 0.62rem;
}

.lux-chat-grid {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.lux-chat-messages {
  min-height: 8rem;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid #d5deea;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  padding: 0.65rem;
}

.lux-chat-bubble {
  margin-bottom: 0.46rem;
  max-width: 92%;
  padding: 0.52rem 0.62rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.36;
  word-break: break-word;
}

.lux-chat-bubble.user {
  margin-left: auto;
  background: linear-gradient(180deg, #1f2937, #334155);
  color: #f8fafc;
}

.lux-chat-bubble.admin {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e1b4b;
}

.lux-chat-bubble.system {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #334155;
}

.lux-chat-time {
  display: inline-block;
  font-size: 0.64rem;
  opacity: 0.7;
}

.lux-chat-meta {
  margin-top: 0.28rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.lux-chat-delivery {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  font-size: 0.61rem;
}

.lux-chat-delivery.delivered {
  color: rgba(226, 232, 240, 0.95);
}

.lux-chat-delivery.read {
  color: #60a5fa;
}

.lux-chat-message-form {
  margin-top: 0.65rem;
}

.lux-chat-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
}

.support-chat-panel-open .lux-chat-panel {
  bottom: calc(1.1rem + 3.2rem + 4.6rem);
}

.support-chat-panel-open #back-to-top {
  bottom: calc(1.1rem + 3.2rem + 0.9rem) !important;
  z-index: 95;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .support-chat-enabled #back-to-top {
    right: 0.8rem !important;
    bottom: 4.4rem !important;
  }

  .support-chat-panel-open #back-to-top {
    bottom: calc(4.4rem + env(safe-area-inset-bottom)) !important;
  }

  .lux-chat-toggle {
    right: 0.8rem;
    bottom: 0.8rem;
  }

  .lux-chat-panel {
    position: fixed;
    left: 0.55rem;
    right: 0.55rem;
    bottom: calc(4.2rem + env(safe-area-inset-bottom));
    width: auto;
    height: min(39rem, calc(100vh - 5rem - env(safe-area-inset-bottom)));
    max-height: calc(100vh - 5rem - env(safe-area-inset-bottom));
    height: min(39rem, calc(100dvh - 5rem - env(safe-area-inset-bottom)));
    max-height: calc(100dvh - 5rem - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
  }

  .support-chat-panel-open .lux-chat-panel {
    bottom: calc(4.2rem + env(safe-area-inset-bottom));
  }

  .lux-chat-pane {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(0.95rem + env(safe-area-inset-bottom));
  }

  #luxLivePane:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow: hidden;
  }

  #luxLivePane .lux-chat-messages {
    flex: 1;
    min-height: 7rem;
    max-height: none;
  }

  #luxLivePane .lux-chat-message-form {
    margin-top: 0;
  }

  .lux-faq-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .lux-faq-item {
    padding: 0.6rem 0.62rem;
  }

  .lux-chat-messages {
    min-height: 5.8rem;
    max-height: 30dvh;
  }

  .lux-chat-actions button {
    min-height: 2.75rem;
  }

  .lux-chat-grid {
    grid-template-columns: 1fr;
  }
}
