#chat-btn {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 1000;
  width: auto; min-width: 56px; height: 56px; border-radius: 999px;
  padding: 0 1.15rem;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border: none; cursor: pointer;
  box-shadow: 0 8px 30px rgba(59,130,246,0.45);
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
#chat-btn:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(59,130,246,0.55); }
#chat-btn svg { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
.chat-btn-label {
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
#chat-btn .icon-close { display: none; }
#chat-btn.open .icon-chat { display: none; }
#chat-btn.open .chat-btn-label { display: none; }
#chat-btn.open .icon-close { display: block; }

#chat-panel {
  position: fixed; bottom: 5.5rem; right: 2rem; z-index: 999;
  width: 360px; max-height: 520px;
  background: rgba(255,255,255,0.72);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(100,120,255,0.15), 0 2px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.95);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#chat-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

.chat-header {
  padding: 1rem 1.2rem 0.8rem;
  border-bottom: 1px solid rgba(120,150,255,0.15);
  display: flex; align-items: center; gap: 0.75rem;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 1rem; color: #fff; letter-spacing: 0.05em;
}
.chat-header-info { flex: 1; }
.chat-header-name { font-size: 0.88rem; font-weight: 700; color: #0f172a; }
.chat-header-status { font-size: 0.7rem; color: #64748b; display: flex; align-items: center; gap: 0.4rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; display: inline-block; }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 1rem 1rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.3); border-radius: 10px; }

.msg { max-width: 82%; font-size: 0.83rem; line-height: 1.55; animation: msgIn 0.2s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border-radius: 16px 16px 4px 16px;
  padding: 0.6rem 0.9rem;
}
.msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(120,150,255,0.18);
  color: #0f172a; border-radius: 16px 16px 16px 4px;
  padding: 0.6rem 0.9rem;
}
.msg.typing span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #94a3b8; margin: 0 2px;
  animation: bounce 1.2s ease infinite;
}
.msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.msg.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }

.chat-input-row {
  padding: 0.75rem 1rem 1rem;
  display: flex; gap: 0.5rem; align-items: center;
  border-top: 1px solid rgba(120,150,255,0.12);
}
#chat-input {
  flex: 1; border: 1px solid rgba(120,150,255,0.25); border-radius: 100px;
  padding: 0.55rem 1rem; font-family: 'Manrope', sans-serif; font-size: 0.82rem;
  background: rgba(255,255,255,0.7); color: #0f172a; outline: none;
  transition: border-color 0.2s;
}
#chat-input:focus { border-color: #3b82f6; }
#chat-input::placeholder { color: #94a3b8; }
#chat-send {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.15s;
}
#chat-send:hover { transform: scale(1.08); }
#chat-send svg { width: 16px; height: 16px; }

.play-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 0.4rem; margin-left: 0.2rem;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.25);
  color: #2563eb; font-size: 0.6rem; cursor: pointer;
  transition: background 0.15s;
}
.play-btn:hover { background: rgba(59,130,246,0.22); }

@media (max-width: 420px) {
  #chat-panel { width: calc(100vw - 2rem); right: 1rem; }
}
