/* ============ AI CHAT WIDGET ============ */
.chat-fab{
  position:fixed;right:22px;bottom:26px;z-index:200;
  width:60px;height:60px;border-radius:50%;border:0;cursor:pointer;
  background:var(--grad);color:var(--ink);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 14px 34px -8px rgba(255,107,26,.55);
  transition:transform .3s,box-shadow .3s;
}
.chat-fab:hover{transform:translateY(-3px) scale(1.04)}
.chat-fab svg{width:26px;height:26px}
.chat-fab .dot{
  position:absolute;top:6px;right:6px;width:11px;height:11px;border-radius:50%;
  background:#3ddc72;border:2px solid var(--ink);
}
.chat{
  position:fixed;right:22px;bottom:98px;z-index:201;
  width:min(380px,92vw);height:min(560px,70vh);
  background:var(--coal);border:1px solid var(--line);border-radius:20px;
  box-shadow:0 30px 70px -20px rgba(0,0,0,.65);
  display:flex;flex-direction:column;overflow:hidden;
  opacity:0;transform:translateY(16px) scale(.97);pointer-events:none;
  transition:opacity .3s,transform .3s;
}
.chat.open{opacity:1;transform:none;pointer-events:auto}
.chat-head{
  display:flex;align-items:center;gap:12px;padding:16px 18px;
  border-bottom:1px solid var(--line);background:var(--coal2);
}
.chat-head i{
  flex:none;width:38px;height:38px;border-radius:50%;background:var(--grad);
  display:flex;align-items:center;justify-content:center;color:var(--ink);font-style:normal;
}
.chat-head i svg{width:19px;height:19px}
.chat-head b{font-family:var(--dsp);font-size:.98rem;display:block}
.chat-head span{font-size:.76rem;color:var(--mut);display:flex;align-items:center;gap:5px}
.chat-head span::before{content:"";width:6px;height:6px;border-radius:50%;background:#3ddc72}
.chat-close{margin-left:auto;background:none;border:0;color:var(--mut);cursor:pointer;font-size:1.3rem;line-height:1;padding:4px}
.chat-close:hover{color:var(--org)}
.chat-body{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:14px}
.cmsg{max-width:86%;font-size:.9rem;line-height:1.55;padding:11px 14px;border-radius:14px;white-space:pre-wrap}
.cmsg.bot{background:var(--coal2);border:1px solid var(--line);align-self:flex-start;border-bottom-left-radius:4px}
.cmsg.user{background:var(--grad);color:var(--ink);font-weight:600;align-self:flex-end;border-bottom-right-radius:4px}
.cmsg a{color:var(--amb);text-decoration:underline}
.cmsg.bot.typing{display:flex;gap:5px;align-items:center;padding:14px}
.cmsg.bot.typing span{width:6px;height:6px;border-radius:50%;background:var(--mut);animation:tdot 1.2s infinite}
.cmsg.bot.typing span:nth-child(2){animation-delay:.15s}
.cmsg.bot.typing span:nth-child(3){animation-delay:.3s}
@keyframes tdot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.chat-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 18px 14px}
.chat-chips button{
  all:unset;cursor:pointer;font-size:.8rem;color:var(--amb);
  border:1px solid rgba(255,194,89,.35);border-radius:100px;padding:7px 13px;
  transition:background .2s;
}
.chat-chips button:hover{background:rgba(255,194,89,.12)}
.chat-in{display:flex;gap:8px;padding:14px 16px;border-top:1px solid var(--line);background:var(--coal2)}
.chat-in input{
  flex:1;background:var(--ink);border:1px solid var(--line);border-radius:100px;
  padding:11px 16px;color:var(--text);font-family:var(--bod);font-size:.9rem;outline:0;
}
.chat-in input:focus{border-color:rgba(255,107,26,.6)}
.chat-in button{
  flex:none;width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;
  background:var(--grad);color:var(--ink);display:flex;align-items:center;justify-content:center;
}
.chat-in button svg{width:17px;height:17px}
.chat-foot{font-size:.68rem;color:var(--mut);text-align:center;padding:8px 0 12px;opacity:.7}
@media(max-width:700px){
  .chat-fab{bottom:92px}
  .chat{bottom:164px;right:12px;height:min(520px,64vh);width:min(380px,94vw)}
}
