:root {
  --primary: #c8a84b;
  --secondary: #0f1720;
  --bg: #081015;
  --surface: #111c24;
  --surface-2: #172631;
  --text: #f7f5ef;
  --text-muted: #b6c1ca;
  --border: rgba(255,255,255,0.08);
  --success: #7dd3a7;
  --shadow: 0 22px 60px rgba(0,0,0,0.35);
}

#frf-chatbot-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #c8a84b 0%, #9c7a25 100%);
  color: #050505;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(156,122,37,0.35);
  cursor: pointer;
  z-index: 9998;
  animation: frfPulse 2.8s ease-in-out infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
#frf-chatbot-toggle:hover { transform: translateY(-2px) scale(1.03); }
#frf-chatbot-toggle svg { width: 32px; height: 32px; }
#frf-chatbot-badge {
  position: absolute; top: -4px; right: -2px; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: #fff; color: #111; font-size: 12px; font-weight: 800; display:flex; align-items:center; justify-content:center;
}
#frf-chatbot-badge.hidden { display:none; }

#frf-chatbot-window {
  position: fixed;
  right: 22px;
  bottom: 98px;
  width: 380px;
  height: 520px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 9998;
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.94);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
#frf-chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.frf-chat-header {
  display:flex; align-items:center; gap:12px; padding:16px 16px 14px;
  background: linear-gradient(135deg, rgba(200,168,75,.95), rgba(122,92,18,.95));
  color:#050505;
}
.frf-chat-avatar {
  width:46px; height:46px; border-radius:50%; background:#111; color:var(--primary); display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.frf-chat-avatar svg { width:24px; height:24px; }
.frf-chat-meta { flex:1; min-width:0; }
.frf-chat-name { font-weight:900; font-size:15px; letter-spacing:.02em; }
.frf-chat-status { font-size:12px; opacity:.85; display:flex; align-items:center; gap:6px; }
.frf-chat-status-dot { width:8px; height:8px; border-radius:50%; background:#0f9d58; }
.frf-chat-close { border:0; background:transparent; color:#050505; font-size:24px; cursor:pointer; }
.frf-chat-messages { height: 325px; overflow-y:auto; padding:16px; background:linear-gradient(180deg, #0a1319 0%, #0d171e 100%); }
.frf-msg { display:flex; margin-bottom:12px; animation: frfMessageIn .22s ease both; }
.frf-msg.user { justify-content:flex-end; }
.frf-msg.bot { justify-content:flex-start; }
.frf-bubble {
  max-width: 84%; padding: 12px 14px; border-radius: 16px; line-height: 1.45; font-size: 14px;
}
.frf-msg.user .frf-bubble { background: linear-gradient(135deg, #c8a84b 0%, #9c7a25 100%); color:#050505; border-bottom-right-radius:6px; }
.frf-msg.bot .frf-bubble { background: var(--surface); color: var(--text); border-bottom-left-radius:6px; }
.frf-bubble a { color: var(--primary); }
.frf-typing { display:flex; justify-content:flex-start; margin-bottom:12px; }
.frf-typing-bubble { background: var(--surface); border-radius:16px; padding:12px 14px; display:flex; gap:6px; }
.frf-typing-dot { width:8px; height:8px; border-radius:50%; background:#d8d2bf; animation: frfDot 1.1s infinite ease-in-out; }
.frf-typing-dot:nth-child(2) { animation-delay: .15s; }
.frf-typing-dot:nth-child(3) { animation-delay: .3s; }
.frf-quick-options { display:flex; gap:8px; flex-wrap:wrap; padding:12px 14px 6px; background:var(--bg); border-top:1px solid var(--border); }
.frf-quick-btn {
  border:1px solid rgba(200,168,75,.35); background:transparent; color:var(--text); border-radius:999px; padding:8px 12px; font-size:12px; cursor:pointer;
  transition: all .18s ease;
}
.frf-quick-btn:hover { border-color: var(--primary); background: rgba(200,168,75,.08); transform: translateY(-1px); }
.frf-chat-input-wrap { display:flex; gap:10px; padding:12px 14px 14px; background:var(--bg); border-top:1px solid var(--border); }
.frf-chat-input {
  flex:1; resize:none; min-height:46px; max-height:100px; border-radius:14px; border:1px solid var(--border); background:var(--surface-2); color:var(--text); padding:12px 14px; font:inherit;
}
.frf-chat-send {
  width:46px; height:46px; border-radius:14px; border:0; background:linear-gradient(135deg, #c8a84b 0%, #9c7a25 100%); color:#050505; cursor:pointer; flex-shrink:0;
}
.frf-chat-send svg { width:20px; height:20px; }

@keyframes frfPulse {
  0%, 100% { box-shadow: 0 16px 40px rgba(156,122,37,0.32); }
  50% { box-shadow: 0 16px 50px rgba(156,122,37,0.48); }
}
@keyframes frfDot { 0%, 80%, 100% { transform: scale(.65); opacity:.5; } 40% { transform: scale(1); opacity:1; } }
@keyframes frfMessageIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }

@media (max-width: 767px) {
  #frf-chatbot-toggle { right: 14px; bottom: 14px; }
  #frf-chatbot-window {
    right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0;
  }
  .frf-chat-messages { height: calc(100dvh - 210px); }
}
