/* ============================================================
   CFL AI ASSISTANT — FASE 1
   ============================================================ */
.cfl-ai-launcher{
  position:fixed;right:24px;bottom:92px;z-index:99990;
  width:62px;height:62px;border:0;border-radius:50%;
  background:#0b233f;color:#fff;box-shadow:0 12px 35px rgba(0,0,0,.22);
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:transform .2s ease,box-shadow .2s ease;
}
.cfl-ai-launcher:hover{transform:translateY(-3px);box-shadow:0 16px 40px rgba(0,0,0,.28)}
.cfl-ai-launcher svg{width:29px;height:29px}
.cfl-ai-badge{position:absolute;right:-2px;top:-2px;width:15px;height:15px;border-radius:50%;background:#19b36b;border:3px solid #fff}
.cfl-ai-panel{
  position:fixed;right:24px;bottom:158px;z-index:99991;width:min(380px,calc(100vw - 32px));
  height:min(560px,calc(100vh - 190px));background:#fff;border-radius:22px;
  box-shadow:0 24px 70px rgba(8,27,49,.28);overflow:hidden;display:none;
  flex-direction:column;border:1px solid rgba(11,35,63,.1);
  font-family:inherit;
}
.cfl-ai-panel.is-open{display:flex;animation:cflAiIn .2s ease}
@keyframes cflAiIn{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.cfl-ai-head{background:#0b233f;color:#fff;padding:17px 18px;display:flex;align-items:center;gap:12px}
.cfl-ai-avatar{width:42px;height:42px;border-radius:13px;background:#fff;color:#0b233f;display:grid;place-items:center;flex:0 0 auto}
.cfl-ai-head-main{min-width:0;flex:1}
.cfl-ai-head-main strong{display:block;font-size:15px;line-height:1.2}
.cfl-ai-status{font-size:12px;opacity:.78;margin-top:3px;display:flex;align-items:center;gap:5px}
.cfl-ai-status:before{content:"";width:7px;height:7px;background:#36d27e;border-radius:50%}
.cfl-ai-close{border:0;background:transparent;color:#fff;font-size:25px;line-height:1;cursor:pointer;opacity:.8}
.cfl-ai-messages{flex:1;overflow:auto;padding:18px 15px 12px;background:#f6f8fb}
.cfl-ai-msg{display:flex;margin:0 0 12px}
.cfl-ai-msg.user{justify-content:flex-end}
.cfl-ai-bubble{max-width:86%;padding:11px 13px;border-radius:15px 15px 15px 5px;background:#fff;color:#1d2938;font-size:14px;line-height:1.48;box-shadow:0 2px 8px rgba(0,0,0,.04);white-space:pre-wrap}
.cfl-ai-msg.user .cfl-ai-bubble{background:#0b233f;color:#fff;border-radius:15px 15px 5px 15px}
.cfl-ai-bubble strong{font-weight:700}
.cfl-ai-bubble a{color:inherit;text-decoration:underline}
.cfl-ai-quick{display:flex;gap:7px;flex-wrap:wrap;padding:0 15px 10px;background:#f6f8fb}
.cfl-ai-quick button{border:1px solid #d8e0ea;background:#fff;color:#0b233f;border-radius:999px;padding:8px 11px;font:inherit;font-size:12px;cursor:pointer}
.cfl-ai-quick button:hover{background:#edf2f7}
.cfl-ai-form{display:flex;gap:8px;padding:12px;border-top:1px solid #e6ebf1;background:#fff}
.cfl-ai-input{min-width:0;flex:1;border:1px solid #d7dee7;border-radius:13px;padding:11px 12px;outline:none;font:inherit;font-size:14px}
.cfl-ai-input:focus{border-color:#0b233f;box-shadow:0 0 0 3px rgba(11,35,63,.08)}
.cfl-ai-send{width:43px;height:43px;border:0;border-radius:13px;background:#0b233f;color:#fff;cursor:pointer;display:grid;place-items:center}
.cfl-ai-send:disabled{opacity:.5;cursor:wait}
.cfl-ai-typing{display:inline-flex;gap:4px;align-items:center}
.cfl-ai-typing i{width:5px;height:5px;background:#8d98a5;border-radius:50%;animation:cflDot 1s infinite}
.cfl-ai-typing i:nth-child(2){animation-delay:.15s}.cfl-ai-typing i:nth-child(3){animation-delay:.3s}
@keyframes cflDot{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}
@media(max-width:600px){
  .cfl-ai-launcher{right:14px;bottom:max(76px,calc(env(safe-area-inset-bottom) + 68px));width:56px;height:56px}
  .cfl-ai-panel{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;height:min(680px,calc(100dvh - 16px));max-height:calc(100dvh - 16px);border-radius:18px}
  .cfl-ai-head{padding:13px 14px}
  .cfl-ai-avatar{width:38px;height:38px;border-radius:11px}
  .cfl-ai-messages{padding:14px 10px 10px;-webkit-overflow-scrolling:touch}
  .cfl-ai-bubble{max-width:92%;font-size:14px;padding:10px 12px;overflow-wrap:anywhere}
  .cfl-ai-quick{padding:0 10px 8px;gap:6px;max-height:88px;overflow:auto}
  .cfl-ai-quick button{padding:8px 10px;font-size:11px;white-space:nowrap}
  .cfl-ai-form{padding:9px 10px max(9px,env(safe-area-inset-bottom));gap:7px}
  .cfl-ai-input{font-size:16px;min-height:43px}
  .cfl-ai-send{width:43px;height:43px;flex:0 0 43px}
}
@media(max-width:360px){
  .cfl-ai-panel{left:4px;right:4px}
  .cfl-ai-head-main strong{font-size:14px}
  .cfl-ai-quick button{font-size:10px;padding:7px 9px}
}
