#jully-panel[hidden],#jully-greeting[hidden]{display:none!important}

#jully-root{position:fixed;bottom:20px;z-index:9998;font-family:inherit}
#jully-root.jully-pos-direita{right:20px}
#jully-root.jully-pos-esquerda{left:20px}
#jully-fab{width:62px;height:62px;border:0;border-radius:50%;padding:0;cursor:pointer;background:#0f6b45;box-shadow:0 10px 30px rgba(0,0,0,.22);display:flex;align-items:center;justify-content:center;transition:.2s transform,.2s box-shadow}
#jully-fab:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(0,0,0,.26)}
.jully-avatar-wrap{position:relative;width:54px;height:54px;border-radius:50%;overflow:visible;display:flex;align-items:center;justify-content:center;background:#fff;border:3px solid #d4af37}
.jully-avatar-wrap img,.jully-mini-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.jully-avatar-letter{font-size:24px;font-weight:800;color:#0f6b45}
.jully-online{position:absolute;width:12px;height:12px;border-radius:50%;background:#29c46a;border:2px solid #fff;right:0;bottom:2px}
.jully-greeting{position:absolute;right:0;bottom:76px;width:280px;background:#fff;color:#24332c;border-radius:16px;padding:14px 16px;box-shadow:0 14px 36px rgba(0,0,0,.18);border:1px solid rgba(15,107,69,.12)}
.jully-pos-esquerda .jully-greeting{left:0;right:auto}
.jully-greeting strong,.jully-greeting span{display:block}.jully-greeting span{font-size:13px;margin-top:4px;line-height:1.4}
.jully-panel{position:absolute;right:0;bottom:76px;width:min(390px,calc(100vw - 24px));height:min(610px,calc(100vh - 110px));background:#fff;border-radius:20px;box-shadow:0 20px 55px rgba(0,0,0,.25);overflow:hidden;border:1px solid rgba(15,107,69,.15);display:flex;flex-direction:column}
.jully-pos-esquerda .jully-panel{left:0;right:auto}
.jully-header{background:linear-gradient(135deg,#0f6b45,#174f3b);color:#fff;padding:14px 16px;display:flex;align-items:center;justify-content:space-between}
.jully-profile{display:flex;gap:10px;align-items:center}.jully-profile small{display:block;opacity:.8}
.jully-mini-avatar{width:38px;height:38px;border-radius:50%;background:#fff;color:#0f6b45;display:flex;align-items:center;justify-content:center;font-weight:800;border:2px solid #d4af37;overflow:hidden}
#jully-close{background:transparent;color:#fff;border:0;font-size:30px;line-height:1;cursor:pointer}
.jully-messages{flex:1;overflow:auto;padding:16px;background:#f7faf8}
.jully-msg{max-width:85%;padding:10px 12px;border-radius:14px;margin:0 0 10px;line-height:1.42;font-size:14px;white-space:pre-line;animation:jullyMsgIn .22s ease-out both}
@keyframes jullyMsgIn{from{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.jully-msg.bot{background:#fff;border:1px solid #dce9e2;color:#20372c;border-bottom-left-radius:5px}
.jully-msg.user{background:#0f6b45;color:#fff;margin-left:auto;border-bottom-right-radius:5px}
.jully-quick{display:flex;flex-wrap:wrap;gap:8px;padding:10px 14px;background:#fff;border-top:1px solid #edf2ef}
.jully-quick button{border:1px solid #c9ded2;background:#f6fbf8;color:#0f6b45;border-radius:999px;padding:8px 11px;font-size:12px;cursor:pointer}
.jully-quick button:hover{background:#edf8f2}
.jully-form{display:flex;gap:8px;padding:12px;background:#fff;border-top:1px solid #edf2ef}
.jully-form input{flex:1;border:1px solid #d7e4dc;border-radius:12px;padding:11px 12px;outline:none}
.jully-form input:focus{border-color:#0f6b45}
.jully-form button{border:0;border-radius:12px;background:#0f6b45;color:#fff;padding:0 16px;font-weight:700;cursor:pointer}
.jully-loading{display:flex;gap:4px;align-items:center}.jully-loading i{width:6px;height:6px;border-radius:50%;background:#0f6b45;animation:jullyDot 1s infinite}.jully-loading i:nth-child(2){animation-delay:.15s}.jully-loading i:nth-child(3){animation-delay:.3s}
@keyframes jullyDot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
@media(max-width:640px){
  #jully-root{right:12px!important;left:auto!important;bottom:12px}
  .jully-panel{position:absolute;left:auto!important;right:0!important;bottom:76px;width:min(360px,calc(100vw - 24px));height:min(520px,72vh);max-height:520px;border-radius:18px}
  .jully-greeting{right:0;width:min(280px,calc(100vw - 36px))}
  #jully-fab{width:58px;height:58px}
  .jully-avatar-wrap{width:50px;height:50px}
}
@media(max-width:390px){
  .jully-panel{width:calc(100vw - 24px);height:min(500px,70vh)}
}

#jully-panel[hidden],#jully-greeting[hidden]{display:none!important}
#jully-fab{animation:jullyFloat 3.4s ease-in-out infinite}
#jully-fab:hover,#jully-fab:focus{animation-play-state:paused}
@keyframes jullyFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}

.jully-quick button.jully-primary{background:#0f6b45;color:#fff;border-color:#0f6b45;font-weight:700}.jully-quick button.jully-primary:hover{background:#0b5637}

.jully-loading{min-width:150px;align-items:center}

/* V15.5 — Jully flutuante sem sobrepor navegação */
#jully-root{
  bottom:92px!important;
  right:26px!important;
  left:auto!important;
  pointer-events:none;
}
#jully-root.jully-pos-esquerda{
  left:26px!important;
  right:auto!important;
}
#jully-fab,#jully-panel,#jully-greeting{
  pointer-events:auto;
}
#jully-fab{
  box-shadow:0 14px 32px rgba(0,0,0,.22);
}
#jully-panel{
  bottom:78px!important;
}
#jully-greeting{
  bottom:78px!important;
}
@media (min-width: 769px){
  #jully-root{
    bottom:42px!important;
    right:34px!important;
  }
  #jully-root.jully-pos-esquerda{
    left:34px!important;
    right:auto!important;
  }
}
@media (max-width: 768px){
  #jully-root{
    bottom:92px!important; /* espaço seguro acima do menu mobile */
    right:16px!important;
    left:auto!important;
  }
  #jully-fab{
    width:58px;
    height:58px;
  }
  .jully-avatar-wrap{
    width:50px;
    height:50px;
  }
  .jully-panel{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    bottom:88px!important;
    width:auto!important;
    height:min(520px,calc(100vh - 180px))!important;
    max-height:calc(100vh - 180px)!important;
    border-radius:18px!important;
  }
  .jully-greeting{
    right:0!important;
    bottom:74px!important;
    width:min(270px,calc(100vw - 38px))!important;
  }
}

/* V15.10 — Jully acompanha a rolagem do documento, sem ficar presa ao footer */
#jully-root{
  position:absolute!important;
  right:24px!important;
  left:auto!important;
  bottom:auto!important;
  top:0;
  z-index:9998;
  pointer-events:none;
  will-change:top;
  transition:top .18s ease-out;
}
#jully-root.jully-pos-esquerda{
  left:24px!important;
  right:auto!important;
}
#jully-fab,#jully-panel,#jully-greeting{pointer-events:auto}
#jully-panel{
  position:absolute!important;
  right:0!important;
  left:auto!important;
  bottom:76px!important;
  top:auto!important;
}
#jully-root.jully-pos-esquerda #jully-panel{
  left:0!important;
  right:auto!important;
}
#jully-greeting{
  position:absolute!important;
  right:0!important;
  left:auto!important;
  bottom:76px!important;
  top:auto!important;
}
#jully-root.jully-pos-esquerda #jully-greeting{
  left:0!important;
  right:auto!important;
}
@media(max-width:768px){
  #jully-root{
    right:14px!important;
    left:auto!important;
  }
  #jully-root.jully-pos-esquerda{
    left:14px!important;
    right:auto!important;
  }
  #jully-panel{
    position:absolute!important;
    width:min(360px,calc(100vw - 28px))!important;
    height:min(500px,calc(100vh - 190px))!important;
    max-height:calc(100vh - 190px)!important;
    right:0!important;
    left:auto!important;
    bottom:72px!important;
  }
}


/* V15.18 — avatar pré-carregado e estável desde o primeiro paint */
.jully-avatar-wrap,
.jully-mini-avatar{
  background:#fff!important;
}
.jully-avatar-wrap img,
.jully-mini-avatar img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  opacity:1!important;
}
