/* FACTUELBOT - Widget flotante QuickSystem360 */
.factuelbot-launcher{
  position:fixed;
  right:22px;
  bottom:96px;
  z-index:9998;
  width:64px;
  height:64px;
  border:none;
  border-radius:22px;
  display:grid;
  place-items:center;
  cursor:pointer;
  color:#fff;
  font-size:28px;
  background:linear-gradient(135deg,#0d6efd,#0dcaf0);
  box-shadow:0 20px 46px rgba(13,110,253,.35);
  transition:transform .18s ease, box-shadow .18s ease;
}

.factuelbot-launcher:hover{
  transform:translateY(-3px);
  box-shadow:0 25px 56px rgba(13,110,253,.45);
}

.factuelbot-badge{
  position:fixed;
  right:92px;
  bottom:108px;
  z-index:9997;
  background:rgba(10,23,42,.92);
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  font-weight:900;
  font-size:13px;
  box-shadow:0 15px 35px rgba(0,0,0,.20);
  backdrop-filter:blur(12px);
}

.factuelbot-window{
  position:fixed;
  right:22px;
  bottom:170px;
  z-index:9999;
  width:min(390px, calc(100vw - 28px));
  height:590px;
  max-height:calc(100vh - 190px);
  border-radius:26px;
  overflow:hidden;
  display:none;
  grid-template-rows:auto 1fr auto;
  background:#ffffff;
  color:#142033;
  border:1px solid rgba(148,163,184,.28);
  box-shadow:0 30px 90px rgba(15,23,42,.28);
}

.factuelbot-window.is-open{
  display:grid;
}

.factuelbot-header{
  padding:16px;
  display:flex;
  align-items:center;
  gap:12px;
  color:#fff;
  background:linear-gradient(135deg,#1a3a5c,#0d6efd 65%,#0dcaf0);
}

.factuelbot-avatar{
  width:50px;
  height:50px;
  border-radius:18px;
  display:grid;
  place-items:center;
  font-size:26px;
  background:rgba(255,255,255,.16);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
}

.factuelbot-title{
  flex:1;
  min-width:0;
}

.factuelbot-title strong{
  display:block;
  line-height:1.1;
  font-size:16px;
}

.factuelbot-title span{
  display:block;
  margin-top:3px;
  opacity:.88;
  font-size:12px;
  font-weight:750;
}

.factuelbot-close{
  width:38px;
  height:38px;
  border:0;
  border-radius:14px;
  background:rgba(255,255,255,.16);
  color:#fff;
  cursor:pointer;
  font-size:18px;
}

.factuelbot-body{
  padding:16px;
  overflow-y:auto;
  background:
    radial-gradient(circle at top left, rgba(13,110,253,.08), transparent 220px),
    #f4f7fb;
}

.factuelbot-msg{
  width:fit-content;
  max-width:88%;
  padding:11px 13px;
  border-radius:17px;
  margin:0 0 10px;
  line-height:1.48;
  font-size:14px;
  font-weight:700;
  white-space:pre-line;
}

.factuelbot-msg.bot{
  background:#ffffff;
  color:#142033;
  border-top-left-radius:6px;
  border:1px solid rgba(148,163,184,.22);
}

.factuelbot-msg.user{
  margin-left:auto;
  color:#fff;
  background:linear-gradient(135deg,#0d6efd,#0aa7d5);
  border-top-right-radius:6px;
}

.factuelbot-quick{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:2px 0 12px;
}

.factuelbot-quick button{
  border:1px solid rgba(13,110,253,.22);
  background:rgba(13,110,253,.09);
  color:#0d6efd;
  border-radius:999px;
  padding:8px 10px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}

.factuelbot-footer{
  padding:12px;
  display:grid;
  grid-template-columns:1fr 44px;
  gap:8px;
  border-top:1px solid rgba(148,163,184,.22);
  background:#ffffff;
}

.factuelbot-input{
  width:100%;
  border:1px solid rgba(148,163,184,.35);
  outline:none;
  border-radius:999px;
  padding:12px 14px;
  color:#142033;
  background:#f8fafc;
  font:inherit;
  font-weight:700;
}

.factuelbot-send{
  border:none;
  border-radius:16px;
  color:#fff;
  background:linear-gradient(135deg,#0d6efd,#0dcaf0);
  cursor:pointer;
  font-size:18px;
}

.factuelbot-typing{
  opacity:.75;
  font-style:italic;
}

@media (max-width:720px){
  .factuelbot-badge{
    display:none;
  }

  .factuelbot-launcher{
    right:18px;
    bottom:92px;
    width:60px;
    height:60px;
  }

  .factuelbot-window{
    right:10px;
    left:10px;
    width:auto;
    bottom:164px;
    max-height:calc(100vh - 180px);
  }
}
