/* Chatbot bubble and panel */
.ai-bubble-btn{position:fixed;right:20px;bottom:20px;z-index:1050;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#2B8CBE,#0C7ADF);color:#fff;border:none;box-shadow:0 14px 40px rgba(12,122,223,.35)}
.ai-bubble-btn i{font-size:22px}
.ai-bubble-btn.pulse{animation:aiPulse 2.2s infinite ease-in-out}
@keyframes aiPulse{0%{transform:scale(1)}50%{transform:scale(1.06);box-shadow:0 18px 48px rgba(12,122,223,.5)}100%{transform:scale(1)}}
.ai-bubble-btn .badge{position:absolute;top:-6px;right:-6px;background:#D57C1E}
.ai-chat-panel{position:fixed;right:20px;bottom:90px;width:min(380px,92vw);max-height:72vh;display:none;flex-direction:column;background:rgba(13,20,28,.98);border:1px solid rgba(255,255,255,.12);border-radius:22px;overflow:hidden;backdrop-filter:blur(12px);z-index:1050;box-shadow:0 22px 60px rgba(0,0,0,.4)}
.ai-chat-panel.open{display:flex}
.ai-chat-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;background:linear-gradient(180deg,#0E1A2B,#0A1320);border-bottom:1px solid rgba(255,255,255,.08)}
.ai-chat-header h6{margin:0;font-weight:700}
.ai-chat-body{padding:12px;overflow:auto;display:flex;flex-direction:column;gap:8px}
.ai-msg{display:flex;gap:10px;align-items:flex-start}
.ai-msg .avatar{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#0F2242;color:#9fd3ff;border:1px solid rgba(255,255,255,.12)}
.ai-msg .avatar.user{background:#11355e;color:#ffd18a}
.ai-msg .bubble{padding:.7rem .9rem;border-radius:16px;max-width:82%;background:#0F1E36;border:1px solid rgba(255,255,255,.08)}
.ai-msg .bubble :where(p,ul,ol,pre,blockquote){margin:0 0 .6rem 0}
.ai-msg .bubble p:last-child{margin-bottom:0}
.ai-msg .bubble strong{color:#fff;font-weight:800}
.ai-msg .bubble em{font-style:italic;color:#e6f0ff}
.ai-msg .bubble code{background:#0b1a33;border:1px solid rgba(255,255,255,.12);padding:.1rem .35rem;border-radius:6px;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-size:.9em;color:#a7e1ff}
.ai-msg .bubble pre{background:#0b1a33;border:1px solid rgba(255,255,255,.12);padding:.75rem;border-radius:10px;overflow:auto}
.ai-msg .bubble pre code{border:none;padding:0}
.ai-msg .bubble blockquote{border-left:3px solid #2B8CBE;padding-left:.75rem;color:#d6e6ff;opacity:.95}
.ai-msg .bubble ul{list-style:disc;padding-left:1.2rem}
.ai-msg .bubble ol{list-style:decimal;padding-left:1.25rem}
.ai-msg .bubble a{color:#79c6ff;text-decoration:none;border-bottom:1px dashed rgba(121,198,255,.6);word-break:break-word}
.ai-msg .bubble a:hover{color:#bfe4ff;border-bottom-color:transparent;text-shadow:0 0 10px rgba(121,198,255,.35)}
.ai-msg .bubble hr{border:0;border-top:1px solid rgba(255,255,255,.12);margin:.6rem 0}
.ai-msg .bubble h1,.ai-msg .bubble h2,.ai-msg .bubble h3,.ai-msg .bubble h4{margin:.1rem 0 .4rem 0;font-weight:800;color:#fefbf4}
.ai-msg .bubble h1{font-size:1.25rem}
.ai-msg .bubble h2{font-size:1.15rem}
.ai-msg .bubble h3{font-size:1.05rem}
.ai-msg .bubble h4{font-size:1rem}
.ai-msg.user{justify-content:flex-end}
.ai-msg.user .bubble{background:#0C7ADF;border-color:rgba(12,122,223,.4)}
.ai-chat-footer{padding:.6rem;border-top:1px solid rgba(255,255,255,.08);background:#0E1726}
.ai-input{display:flex;gap:.5rem;align-items:center}
.ai-input .btn-mic{height:44px;width:44px;display:grid;place-items:center;border-radius:12px}
.ai-input textarea{flex:1;resize:none;height:44px;max-height:120px}
.ai-input .btn{height:44px}
.ai-legend{font-size:.68rem;color:#c6d8ff;opacity:.75;text-align:center}

/* typing indicator */
.ai-typing .dots{display:inline-flex;gap:6px;align-items:center}
.ai-typing .dot{width:6px;height:6px;border-radius:50%;background:#9fd3ff;opacity:.85;animation:aiDots 1.15s infinite ease-in-out}
.ai-typing .dot:nth-child(2){animation-delay:.15s}
.ai-typing .dot:nth-child(3){animation-delay:.3s}
@keyframes aiDots{0%{transform:translateY(0);opacity:.4}50%{transform:translateY(-4px);opacity:1}100%{transform:translateY(0);opacity:.4}}
