.support-chat-widget {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.support-chat-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(6, 6, 10, 0.42);
  z-index: 1190;
}

.support-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 999px;
  background: linear-gradient(140deg, #8b5cf6, #7c3aed);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.support-chat-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(124, 58, 237, 0.45);
}

.support-chat-launcher:focus-visible,
.support-chat-minimize:focus-visible,
.support-chat-close:focus-visible,
.support-chat-form textarea:focus-visible,
.support-chat-form button:focus-visible,
.support-chat-prompt:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.9);
  outline-offset: 2px;
}

.support-chat-launcher-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.75);
  animation: support-chat-pulse 2.4s ease-out infinite;
}

@keyframes support-chat-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.support-chat-panel {
  width: min(24.5rem, calc(100vw - 1.5rem));
  max-height: min(75vh, 38rem);
  display: flex;
  flex-direction: column;
  border: 1px solid #2d2a3a;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 15, 22, 0.98), rgba(10, 10, 15, 0.98));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1201;
}

.support-chat-header {
  padding: 0.8rem 0.95rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid #2a2538;
  background: linear-gradient(140deg, rgba(60, 33, 112, 0.55), rgba(26, 21, 48, 0.55));
}

.support-chat-header h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.support-chat-subtitle {
  margin: 0.2rem 0 0;
  color: rgba(230, 228, 240, 0.78);
  font-size: 0.77rem;
}

.support-chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.support-chat-minimize {
  border: 1px solid #4a435e;
  background: rgba(10, 10, 15, 0.55);
  color: #efecfb;
  border-radius: 0.55rem;
  font-size: 0.73rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.4rem 0.52rem;
}

.support-chat-close {
  border: 1px solid #4a435e;
  background: rgba(10, 10, 15, 0.55);
  color: #efecfb;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.support-chat-quick-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid #242031;
}

.support-chat-prompt {
  border: 1px solid #3a3351;
  color: #ddd8f4;
  background: rgba(126, 92, 233, 0.15);
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  font-size: 0.74rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.support-chat-prompt:hover {
  background: rgba(126, 92, 233, 0.26);
}

.support-chat-messages {
  min-height: 9rem;
  max-height: 21rem;
  overflow: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.support-chat-msg {
  max-width: 85%;
  border-radius: 0.85rem;
  padding: 0.58rem 0.7rem;
  line-height: 1.32;
  font-size: 0.86rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-chat-msg-assistant {
  align-self: flex-start;
  background: rgba(165, 139, 248, 0.14);
  border: 1px solid rgba(165, 139, 248, 0.3);
  color: #f3f0ff;
}

.support-chat-msg-user {
  align-self: flex-end;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #e9fff6;
}

.support-chat-msg-system {
  align-self: center;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: #fff6d0;
  max-width: 100%;
}

.support-chat-form {
  border-top: 1px solid #242031;
  padding: 0.7rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
}

.support-chat-input-label {
  display: none;
}

.support-chat-form textarea {
  resize: none;
  border: 1px solid #393349;
  border-radius: 0.7rem;
  background: rgba(10, 10, 15, 0.8);
  color: #f6f3ff;
  padding: 0.58rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  min-height: 2.8rem;
}

.support-chat-form textarea::placeholder {
  color: rgba(194, 189, 209, 0.74);
}

.support-chat-form button {
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 0.65rem;
  padding: 0.6rem 0.82rem;
  background: linear-gradient(140deg, #8b5cf6, #7c3aed);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
  font-family: var(--font-sans);
  cursor: pointer;
}

.support-chat-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .support-chat-widget {
    right: 0.7rem;
    bottom: 0.7rem;
  }
  .support-chat-backdrop {
    background: rgba(6, 6, 10, 0.52);
  }
  .support-chat-panel {
    width: min(24rem, calc(100vw - 1rem));
    max-height: 72vh;
  }
  .support-chat-launcher-label {
    display: none;
  }
}
