.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 30px -6px rgba(34, 211, 238, 0.55);
  border: none;
  cursor: pointer;
  color: #04050a;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 10px 36px -6px rgba(34, 211, 238, 0.7);
}

.chat-launcher svg {
  width: 26px;
  height: 26px;
}

.chat-launcher .chat-launcher-icon-close {
  display: none;
}

.chat-launcher.is-open .chat-launcher-icon-chat {
  display: none;
}

.chat-launcher.is-open .chat-launcher-icon-close {
  display: block;
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 50;
  width: min(370px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #0b0f1a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px -12px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(34,211,238,0.1));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-panel-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: #04050a;
  flex-shrink: 0;
}

.chat-panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.chat-panel-status {
  font-size: 0.72rem;
  color: #67e8f9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-panel-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #34d399;
  display: inline-block;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-msg--bot {
  align-self: flex-start;
  background: #131a2b;
  color: #cbd5e1;
  border-bottom-left-radius: 4px;
}

.chat-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #04050a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.chat-msg--error {
  align-self: flex-start;
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.chat-quick-reply {
  font-size: 0.78rem;
  padding: 6px 11px;
  border-radius: 9999px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
  color: #67e8f9;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.chat-quick-reply:hover {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.4);
}

.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #131a2b;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.chat-typing span {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #64748b;
  animation: chat-typing-bounce 1.1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-panel-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #0b0f1a;
}

.chat-panel-input {
  flex: 1;
  background: #131a2b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9999px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #fff;
  outline: none;
}

.chat-panel-input::placeholder {
  color: #64748b;
}

.chat-panel-input:focus {
  border-color: rgba(34, 211, 238, 0.5);
}

.chat-panel-send {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #04050a;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.chat-panel-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-panel-send svg {
  width: 16px;
  height: 16px;
}

.chat-panel-footer {
  text-align: center;
  font-size: 0.65rem;
  color: #475569;
  padding: 6px 0 10px;
  background: #0b0f1a;
}

@media (max-width: 480px) {
  .chat-launcher {
    right: 16px;
    bottom: 16px;
  }
  .chat-panel {
    right: 12px;
    bottom: 84px;
  }
}
