#nexial-chat-root {
  --nx-gold: #e9c46a;
  --nx-bg: #0c0f14;
  --nx-panel: #141a24;
  --nx-ink: #f4f6fa;
  --nx-muted: #9aa3b2;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.nx-toast.nx-toast--hidden {
  display: none;
}

.nx-toast {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 10050;
  width: min(320px, calc(100vw - 40px));
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  pointer-events: none;
}

.nx-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nx-toast-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 36px 14px 14px;
  border-radius: 14px;
  background: var(--nx-panel);
  border: 1px solid rgba(233, 196, 106, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.nx-toast-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a227, var(--nx-gold));
  color: #1a1000;
  font-size: 11px;
  font-weight: 700;
}

.nx-toast-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--nx-ink);
}

.nx-toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--nx-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.nx-toast-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--nx-ink);
}

#nexial-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10050;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #c9a227, var(--nx-gold));
  color: #1a1000;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

#nexial-chat-launcher.nx-launcher-pulse {
  animation: nx-launcher-glow 2s ease-in-out infinite;
}

@keyframes nx-launcher-glow {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(233, 196, 106, 0.45),
      0 0 0 6px rgba(233, 196, 106, 0.12);
  }
}

#nexial-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 10049;
  width: min(380px, calc(100vw - 32px));
  height: 520px;
  display: none;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(233, 196, 106, 0.25);
  background: var(--nx-panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

#nexial-chat-panel.open {
  display: flex;
}

#nexial-chat-header {
  padding: 14px 16px;
  background: var(--nx-bg);
  color: var(--nx-ink);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#nexial-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nx-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.nx-msg.user {
  align-self: flex-end;
  background: rgba(233, 196, 106, 0.2);
  color: var(--nx-ink);
}

.nx-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--nx-muted);
}

.nx-msg.bot strong {
  color: var(--nx-ink);
}

#nexial-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--nx-bg);
}

#nexial-chat-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--nx-panel);
  color: var(--nx-ink);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
}

#nexial-chat-input:focus {
  border-color: var(--nx-gold);
}

#nexial-chat-send {
  border: none;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--nx-gold);
  color: #1a1000;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

#nexial-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nx-typing {
  font-size: 12px;
  color: var(--nx-muted);
  padding: 0 4px;
}

.nx-msg.bot.streaming::after {
  content: "▋";
  display: inline-block;
  margin-left: 2px;
  color: var(--nx-gold);
  animation: nx-blink 0.9s step-end infinite;
}

@keyframes nx-blink {
  50% {
    opacity: 0;
  }
}
