:root{
  --agent-bg:#efeae2;
  --agent-text:#111b21;
  --agent-muted:#667781;
  --agent-primary:#075e54;
  --agent-border:#d9d9d9;
  --agent-user:#d9fdd3;
  --agent-assistant:#ffffff;
}
#consorcio-agent-root *{box-sizing:border-box}
.agent-launcher{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:999999;
  border:0;
  background:#00a884;
  color:#ffffff;
  border-radius:999px;
  padding:13px 20px;
  font:600 14px/1.2 system-ui,sans-serif;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.18);
  transition:transform .2s ease, box-shadow .2s ease;
}

.agent-launcher:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 22px rgba(0,0,0,.22);
}
.agent-panel{
  position:fixed;right:22px;bottom:82px;z-index:999999;
  width:min(390px,calc(100vw - 28px));height:min(620px,calc(100vh - 120px));
  display:none;flex-direction:column;overflow:hidden;background:var(--agent-bg);
  border:1px solid var(--agent-border);border-radius:20px;
  box-shadow:0 25px 70px rgba(0,0,0,.22);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}
.agent-panel.open{display:flex}
.agent-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background:#075e54;
  border-bottom:0;
}
.agent-title{
  font-size:15px;
  font-weight:700;
  color:#ffffff;
}
.agent-subtitle{
  display:flex;
  align-items:center;
  gap:5px;
  margin-top:2px;
  font-size:12px;
  color:#d7eee9;
}

.agent-online-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#25d366;
  display:inline-block;
  flex-shrink:0;
  box-shadow:0 0 0 2px rgba(37,211,102,.18);
}

/* PERFIL / AVATAR DO AGENTE */
.agent-profile{
  display:flex;
  align-items:center;
  gap:10px;
}

.agent-avatar{
  width:36px;
  height:36px;
  border-radius:50%;
  overflow:hidden;
  flex-shrink:0;
  background:#ffffff;
  box-shadow:0 1px 3px rgba(0,0,0,.18);
}

.agent-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
}


.agent-close{
  border:0;
  background:transparent;
  color:#ffffff;
  font-size:22px;
  cursor:pointer;
}
.agent-messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
}
.agent-message{
  width:fit-content;
  max-width:82%;
  margin:0 0 10px;
  padding:8px 10px;
  border-radius:8px;
  white-space:pre-wrap;
  font-size:14px;
  line-height:1.45;
  box-shadow:0 1px 1px rgba(0,0,0,.08);
}
.agent-message.assistant{
  background:#ffffff;
  color:#111b21;
  border-radius:8px 8px 8px 2px;
}
.agent-message.user{
  margin-left:auto;
  background:#d9fdd3;
  color:#111b21;
  border-radius:8px 8px 2px 8px;
}
.agent-typing{color:var(--agent-muted);font-size:12px;padding:0 16px 8px}
.agent-form{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-top:1px solid #d8d8d8;
  background:#f0f2f5;
}
.agent-input{
  flex:1;
  min-width:0;
  border:0;
  background:#ffffff;
  border-radius:22px;
  padding:11px 14px;
  outline:none;
  font-size:14px;
  color:#111b21;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
}
.agent-send{
  border:0;
  background:#00a884;
  color:#ffffff;
  width:44px;
  height:44px;
  border-radius:50%;
  font-size:0;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 44px;
}
.agent-send::before{
  content:"➤";
  font-size:20px;
  line-height:1;
  transform:rotate(-12deg);
}
#consorcio-agent-root .agent-consent{
  display:block;
  padding:5px 12px 7px;
  background:#f0f2f5;
  color:#667781;
  font-size:10px;
  line-height:1.2;
  text-align:center;
  width:100%;
  box-sizing:border-box;
}

#consorcio-agent-root .agent-message.assistant{
  background:#ffffff !important;
  color:#111b21 !important;
}

#consorcio-agent-root .agent-message.user{
  margin-left:auto !important;
  background:#d9fdd3 !important;
  color:#111b21 !important;
}

/* Esconde o botão quando o chat estiver aberto */
#consorcio-agent-root:has(.agent-panel.open) .agent-launcher{
  display:none;
}

.agent-typing{
  width:fit-content;
  margin:8px 0 10px 12px;
  padding:9px 12px;
  background:#ffffff;
  border-radius:8px 8px 8px 2px;
  box-shadow:0 1px 1px rgba(0,0,0,.08);
  display:flex;
  align-items:center;
  gap:4px;
}

.agent-typing[hidden]{
  display:none;
}

.agent-typing span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#8696a0;
  display:block;
  animation:agentTyping 1.2s infinite ease-in-out;
}

.agent-typing span:nth-child(2){
  animation-delay:.15s;
}

.agent-typing span:nth-child(3){
  animation-delay:.3s;
}

@keyframes agentTyping{
  0%, 60%, 100%{
    transform:translateY(0);
    opacity:.45;
  }

  30%{
    transform:translateY(-4px);
    opacity:1;
  }
}

.agent-panel{
  overflow:hidden;
}

@media(max-width:520px){
  .agent-panel{
    top:var(--agent-vv-top, 0px);
    right:0;
    bottom:auto;
    left:0;

    width:100vw;
    height:var(--agent-vv-height, 100dvh);
    max-height:none;

    border-radius:0;
  }

  .agent-messages{
    flex:1;
    min-height:0;
    overflow-y:auto;
  }

  .agent-launcher{
    right:12px;
    bottom:12px;
  }
}