.ai-chat-bubble{position:fixed;bottom:20px;right:20px;width:56px;height:56px;border-radius:50%;background:#111827;color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.2);z-index:999999}
.ai-chat-window{position:fixed;bottom:90px;right:20px;width:360px;max-height:70vh;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.15);display:none;flex-direction:column;overflow:hidden;z-index:999999}
.ai-chat-window.ai-open{display:flex}
.ai-chat-window.ai-wide{right:20px;width:min(920px,90vw)}
.ai-chat-header{display:flex;align-items:center;justify-content:space-between;padding:.6rem .8rem;border-bottom:1px solid #e5e7eb;background:#f9fafb}
.ai-chat-title{font-weight:600}
.ai-chat-actions .ai-btn{background:transparent;border:none;cursor:pointer;font-size:16px;margin-left:.25rem}
.ai-chat-body{padding:.6rem;height:48vh;overflow:auto;display:flex;flex-direction:column;gap:.5rem}
/* Quick actions on top with sticky */
.ai-chat-quick{display:flex;gap:.4rem;flex-wrap:wrap;position:sticky;top:0;background:#fff;padding-bottom:.4rem;border-bottom:1px solid #eef2f7;z-index:2}
.ai-pill{padding:.25rem .5rem;border:1px solid #e5e7eb;border-radius:999px;text-decoration:none;color:#111827;background:#f1f5f9}
.ai-chat-messages{display:flex;flex-direction:column;gap:.5rem}
.ai-msg{border:1px solid #e5e7eb;border-radius:10px;padding:.5rem .6rem;max-width:85%}
.ai-msg.user{align-self:flex-end;background:#eff6ff;border-color:#bfdbfe}
.ai-msg.bot{align-self:flex-start;background:#f8fafc}
.ai-msg .srcs{margin-top:.35rem;font-size:.85rem;color:#64748b}
.ai-chat-inputbar{display:flex;gap:.4rem;padding:.6rem;border-top:1px solid #e5e7eb;background:#fff}
.ai-chat-input{flex:1;resize:none;padding:.5rem;border:1px solid #cbd5e1;border-radius:10px}
.ai-chat-send{padding:.5rem .8rem;border:1px solid #cbd5e1;border-radius:10px;background:#fff;cursor:pointer}
.ai-msg.bot .typing{display:inline-block;min-width:24px}
.ai-msg.bot .typing span{animation:blink 1.2s infinite ease-in-out;display:inline-block}
.ai-msg.bot .typing span:nth-child(2){animation-delay:.2s}
.ai-msg.bot .typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:0}40%{opacity:1}}

/* RTL auto support */
.ai-chat-window[dir="rtl"] .ai-chat-header,
.ai-chat-window[dir="rtl"] .ai-chat-body,
.ai-chat-window[dir="rtl"] .ai-chat-inputbar{direction:rtl}
.ai-chat-window[dir="rtl"] .ai-msg{direction:rtl;text-align:right}
.ai-chat-window[dir="rtl"] .ai-chat-input{direction:rtl}
