/* FamePik Chat Widget */
.fp-chat { position: fixed; bottom: 22px; right: 22px; z-index: 99999; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.fp-chat * { margin: 0; padding: 0; box-sizing: border-box; }

/* launcher */
.fp-chat-launch { position: relative; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #4D7CFF 0%, #2E5BFF 55%, #1E44E0 100%); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(46,91,255,0.4), 0 2px 8px rgba(46,91,255,0.3);
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s cubic-bezier(.22,1,.36,1); }
.fp-chat-launch:hover { transform: scale(1.07); box-shadow: 0 14px 36px rgba(46,91,255,0.5); }
.fp-chat-launch:active { transform: scale(0.96); }
.fp-chat-launch svg { width: 25px; height: 25px; }
.fp-chat-ping { position: absolute; top: 0; right: 0; width: 14px; height: 14px; border-radius: 50%;
  background: #EF4444; border: 2.5px solid #fff; display: none; }
.fp-chat.has-unread .fp-chat-ping { display: block; animation: fpchatPing 1.8s infinite; }
@keyframes fpchatPing { 0%{box-shadow:0 0 0 0 rgba(239,68,68,.4)} 70%{box-shadow:0 0 0 7px rgba(239,68,68,0)} 100%{box-shadow:0 0 0 0 rgba(239,68,68,0)} }

/* window */
.fp-chat-window { position: absolute; bottom: 72px; right: 0; width: 372px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 130px); background: #fff; border: 1px solid rgba(20,20,20,.08);
  border-radius: 22px; box-shadow: 0 20px 52px rgba(20,20,20,.16), 0 6px 18px rgba(46,91,255,.07);
  display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(16px) scale(.96);
  transform-origin: bottom right; pointer-events: none;
  transition: opacity .35s cubic-bezier(.22,1,.36,1), transform .45s cubic-bezier(.22,1,.36,1); }
.fp-chat.is-open .fp-chat-window { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* header */
.fp-chat-head { position: relative; padding: 18px 20px 16px; background: linear-gradient(160deg, #1D1D1D, #141414);
  color: #F5F1E8; flex-shrink: 0; }
.fp-chat-head::after { content: ""; position: absolute; bottom: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46,91,255,.6), transparent); }
.fp-chat-head-row { display: flex; align-items: center; gap: 12px; }
.fp-chat-avatar { width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; background: linear-gradient(135deg, #4D7CFF, #1E44E0); box-shadow: 0 4px 12px rgba(46,91,255,.4); }
.fp-chat-avatar svg { width: 19px; height: 19px; color: #fff; }
.fp-chat-head-info { flex: 1; min-width: 0; }
.fp-chat-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.fp-chat-status { display: flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: rgba(245,241,232,.6); margin-top: 3px; }
.fp-chat-status i { width: 6px; height: 6px; border-radius: 50%; background: #22C55E; animation: fpchatPulse 2.4s infinite; }
@keyframes fpchatPulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.4)} 70%{box-shadow:0 0 0 6px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }
.fp-chat-close { width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(255,255,255,.08);
  color: rgba(245,241,232,.75); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .25s cubic-bezier(.22,1,.36,1); flex-shrink: 0; }
.fp-chat-close:hover { background: rgba(255,255,255,.16); color: #fff; }
.fp-chat-close svg { width: 14px; height: 14px; }

/* messages */
.fp-chat-body { flex: 1; overflow-y: auto; padding: 18px 16px 10px;
  background: radial-gradient(ellipse 80% 30% at 50% 0%, rgba(46,91,255,.03), transparent 70%), #fff;
  display: flex; flex-direction: column; gap: 4px; }
.fp-chat-body::-webkit-scrollbar { width: 4px; }
.fp-chat-body::-webkit-scrollbar-thumb { background: rgba(20,20,20,.12); border-radius: 100px; }
.fp-msg { display: flex; max-width: 85%; animation: fpchatMsg .4s cubic-bezier(.22,1,.36,1); }
@keyframes fpchatMsg { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.fp-msg-bubble { padding: 11px 14px; font-size: 13.5px; line-height: 1.55; border-radius: 16px; word-break: break-word; }
.fp-msg-agent { align-self: flex-start; }
.fp-msg-agent .fp-msg-bubble { background: #F5F6F9; border-bottom-left-radius: 5px; color: #141414; }
.fp-msg-visitor { align-self: flex-end; }
.fp-msg-visitor .fp-msg-bubble { background: linear-gradient(135deg, #4D7CFF, #1E44E0); color: #fff;
  border-bottom-right-radius: 5px; box-shadow: 0 4px 12px rgba(46,91,255,.18); }
.fp-msg-time { display: block; font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: .08em; margin-top: 5px; opacity: .55; }
.fp-msg-visitor .fp-msg-time { text-align: right; }

/* typing */
.fp-typing { align-self: flex-start; display: none; }
.fp-typing.is-visible { display: flex; animation: fpchatMsg .3s cubic-bezier(.22,1,.36,1); }
.fp-typing .fp-msg-bubble { display: flex; gap: 4px; padding: 14px 16px; }
.fp-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8E93A0; animation: fpchatTyping 1.2s infinite; }
.fp-typing span:nth-child(2) { animation-delay: .15s; }
.fp-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes fpchatTyping { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-4px);opacity:1} }

/* chips */
.fp-chat-chips { display: flex; gap: 6px; padding: 10px 16px 4px; flex-wrap: wrap; flex-shrink: 0; background: #fff; }
.fp-chat-chip { font-size: 11.5px; font-weight: 600; color: #1E44E0; padding: 7px 13px;
  background: rgba(46,91,255,.06); border: 1px solid rgba(46,91,255,.3); border-radius: 100px; cursor: pointer;
  transition: all .25s cubic-bezier(.22,1,.36,1); }
.fp-chat-chip:hover { background: rgba(46,91,255,.12); transform: translateY(-1px); }

/* input */
.fp-chat-input-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px 14px; background: #fff;
  border-top: 1px solid rgba(20,20,20,.08); flex-shrink: 0; }
.fp-chat-input { flex: 1; min-width: 0; padding: 12px 15px; font-size: 13.5px; color: #141414; background: #F5F6F9;
  border: 1px solid transparent; border-radius: 100px; outline: none;
  transition: all .3s cubic-bezier(.22,1,.36,1); }
.fp-chat-input:focus { border-color: rgba(46,91,255,.5); background: #fff; box-shadow: 0 0 0 3px rgba(46,91,255,.09); }
.fp-chat-input::placeholder { color: #8E93A0; }
.fp-chat-send { width: 42px; height: 42px; border-radius: 50%; border: none; flex-shrink: 0; cursor: pointer;
  background: linear-gradient(135deg, #4D7CFF, #1E44E0); color: #fff; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 5px 14px rgba(46,91,255,.32); transition: all .3s cubic-bezier(.22,1,.36,1); }
.fp-chat-send:hover { transform: scale(1.07); }
.fp-chat-send:active { transform: scale(.94); }
.fp-chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.fp-chat-send svg { width: 17px; height: 17px; }

/* status warn + system notes */
.fp-chat-status.fp-status-warn { color: #FCD34D; }
.fp-system-note {
  align-self: center;
  max-width: 92%;
  margin: 8px 0;
  padding: 8px 14px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: #92400E;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
}

/* offline */
.fp-chat-offline { display: none; padding: 9px 16px; font-family: 'JetBrains Mono', monospace; font-size: 9px;
  font-weight: 500; letter-spacing: .12em; text-transform: uppercase; text-align: center; color: #B42318;
  background: rgba(239,68,68,.06); border-top: 1px solid rgba(239,68,68,.18); }
.fp-chat.is-offline .fp-chat-offline { display: block; }

@media (max-width: 480px) {
  .fp-chat { bottom: 14px; right: 14px; }
  .fp-chat-window { width: calc(100vw - 28px); height: 70vh; right: 0; border-radius: 20px; }
}

/* proactive popup toast above the launcher */
.fp-chat-toast {
  position: absolute; bottom: 70px; right: 0;
  width: 248px;
  background: #FFFFFF;
  border: 1px solid rgba(20,20,20,0.12);
  border-radius: 15px;
  box-shadow: 0 14px 36px rgba(20,20,20,0.16);
  padding: 11px 13px;
  cursor: pointer;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(.22,1,.36,1);
  z-index: 6;
}
.fp-chat-toast.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fp-chat-toast b { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: #141414; margin-bottom: 3px; }
.fp-chat-toast span { display: block; font-size: 11.5px; line-height: 1.5; color: #3D3D3D; }
.fp-chat-toast:hover { border-color: rgba(46,91,255,0.4); }

@media (prefers-reduced-motion: reduce) {
  .fp-chat * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ===================== v3 — Guide additions ===================== */
.fp-msg-guide .fp-msg-bubble {
  background: #EFF3FF;
  color: #1E44E0;
  border: 1px solid rgba(46, 91, 255, 0.22);
  box-shadow: 0 4px 14px rgba(46, 91, 255, 0.08);
}
.fp-msg-guide .fp-msg-bubble::before {
  content: "GUIDE";
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(46, 91, 255, 0.55);
  margin-bottom: 3px;
}
.fp-msg-guide .fp-msg-time { color: rgba(46, 91, 255, 0.45); }
.fp-quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fp-quick-chip {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1E44E0;
  background: #FFFFFF;
  border: 1px solid rgba(46, 91, 255, 0.35);
  border-radius: 100px;
  padding: 7px 13px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}
.fp-quick-chip:hover:not(:disabled) {
  background: linear-gradient(135deg, #4D7CFF, #1E44E0);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 5px 14px rgba(46, 91, 255, 0.32);
  transform: translateY(-1px);
}
.fp-quick-chip:disabled { opacity: 0.45; cursor: default; }
