: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;
  }
}

/* =========================================================
   CTA SETECON — V2 FINO / DISCRETO
   Branco + WhatsApp verde + tipografia/seta preta
   ========================================================= */
#consorcio-agent-root .agent-launcher{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:999999;
  width:auto;
  min-width:270px;
  height:58px;
  min-height:58px;
  padding:7px 48px 7px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  border-radius:999px;
  background:#ffffff;
  color:#111111;
  box-shadow:0 8px 24px rgba(17,24,39,.13);
  cursor:pointer;
  text-align:left;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}

#consorcio-agent-root .agent-launcher:hover{
  transform:translateY(-2px);
  border-color:#d5d7da;
  box-shadow:0 11px 28px rgba(17,24,39,.16);
}

#consorcio-agent-root .agent-launcher:active{
  transform:translateY(0);
}

#consorcio-agent-root .agent-launcher-icon{
  width:44px;
  height:44px;
  flex:0 0 44px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#25D366;
  color:#ffffff;
  box-shadow:0 0 0 5px rgba(37,211,102,.10);
}

#consorcio-agent-root .agent-launcher-icon svg{
  width:28px;
  height:28px;
  display:block;
}

#consorcio-agent-root .agent-launcher-divider{
  width:1px;
  height:34px;
  flex:0 0 1px;
  background:#dedede;
}

#consorcio-agent-root .agent-launcher-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
}

#consorcio-agent-root .agent-launcher-copy strong{
  display:block;
  color:#111111;
  font:700 14px/1.05 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:-.1px;
  white-space:nowrap;
}

#consorcio-agent-root .agent-launcher-copy small{
  display:flex;
  align-items:center;
  gap:6px;
  color:#747b84;
  font:500 11px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  white-space:nowrap;
}

#consorcio-agent-root .agent-launcher-copy small i{
  width:7px;
  height:7px;
  display:block;
  flex:0 0 7px;
  border-radius:50%;
  background:#25D366;
}

#consorcio-agent-root .agent-launcher-arrow{
  position:absolute;
  right:17px;
  top:50%;
  transform:translateY(-52%);
  color:#111111;
  font:400 30px/1 Arial,sans-serif;
}

/* Mobile: mantém boa área de toque, sem ficar pesado visualmente */
@media(max-width:520px){
  #consorcio-agent-root .agent-launcher{
    right:12px;
    bottom:14px;
    min-width:278px;
    height:60px;
    min-height:60px;
    padding:7px 48px 7px 10px;
  }

  #consorcio-agent-root .agent-launcher-icon{
    width:46px;
    height:46px;
    flex-basis:46px;
  }

  #consorcio-agent-root .agent-launcher-icon svg{
    width:29px;
    height:29px;
  }

  #consorcio-agent-root .agent-launcher-copy strong{
    font-size:14px;
  }
}


/* =========================================================
   VITÓRIA — FUNIL GUIADO POR CLIQUES
   ========================================================= */

#consorcio-agent-root .agent-title-role{
  font-weight:500;
  opacity:.82;
}

#consorcio-agent-root .agent-messages{
  padding:14px 14px 8px;
}

#consorcio-agent-root .agent-form.agent-form-hidden{
  display:none !important;
}

#consorcio-agent-root .agent-guided-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  width:100%;
  margin:2px 0 14px;
}

#consorcio-agent-root .agent-guided-option{
  appearance:none;
  border:1px solid rgba(7,94,84,.20);
  background:#ffffff;
  color:#123b35;
  border-radius:12px;
  min-height:48px;
  padding:11px 12px;
  font:600 13px/1.25 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
  text-align:left;
  box-shadow:0 1px 2px rgba(0,0,0,.05);
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}

#consorcio-agent-root .agent-guided-option:hover{
  transform:translateY(-1px);
  border-color:#075e54;
  box-shadow:0 4px 12px rgba(7,94,84,.10);
}

#consorcio-agent-root .agent-contact-card{
  width:100%;
  margin:2px 0 14px;
  padding:14px;
  border:1px solid #e3e7e5;
  border-radius:14px;
  background:#ffffff;
  box-shadow:0 3px 12px rgba(0,0,0,.06);
}

#consorcio-agent-root .agent-contact-card label{
  display:block;
  margin:0 0 11px;
}

#consorcio-agent-root .agent-contact-card label > span{
  display:block;
  margin:0 0 5px;
  color:#34433f;
  font:600 12px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

#consorcio-agent-root .agent-contact-card input{
  width:100%;
  height:44px;
  border:1px solid #d8dfdc;
  border-radius:10px;
  background:#fff;
  padding:0 12px;
  color:#111b21;
  outline:none;
  font:500 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

#consorcio-agent-root .agent-contact-card input:focus{
  border-color:#00a884;
  box-shadow:0 0 0 3px rgba(0,168,132,.10);
}

#consorcio-agent-root .agent-contact-submit{
  width:100%;
  min-height:46px;
  border:0;
  border-radius:11px;
  background:#00a884;
  color:#fff;
  font:700 14px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
  margin-top:2px;
}

#consorcio-agent-root .agent-contact-submit:disabled{
  opacity:.65;
  cursor:wait;
}

#consorcio-agent-root .agent-contact-doubt{
  width:100%;
  border:0;
  background:transparent;
  color:#53625e;
  padding:11px 8px 2px;
  font:600 12px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
}

#consorcio-agent-root .agent-field-error{
  display:block;
  color:#b42318;
  margin:5px 2px 0;
  font:500 11px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

@media(max-width:520px){
  #consorcio-agent-root .agent-guided-options{
    grid-template-columns:1fr;
  }

  #consorcio-agent-root .agent-guided-option{
    min-height:50px;
    font-size:14px;
  }

  #consorcio-agent-root .agent-contact-card{
    padding:13px;
  }
}

/* =========================================================
   SETECON — CABEÇALHO RESPONSIVO
   Ajusta a identificação e os botões sem alterar o chat.
   ========================================================= */
#consorcio-agent-root .agent-header{
  gap:10px;
  padding:12px 13px;
  min-height:78px;
}
#consorcio-agent-root .agent-profile{
  flex:1 1 auto;
  min-width:0;
  gap:9px;
}
#consorcio-agent-root .agent-profile > div:last-child{
  flex:1 1 auto;
  min-width:0;
}
#consorcio-agent-root .agent-title{
  font-size:13px;
  line-height:1.3;
  overflow-wrap:normal;
}
#consorcio-agent-root .agent-subtitle{
  font-size:10.5px;
  line-height:1.25;
  white-space:normal;
}
#consorcio-agent-root .agent-header > div:last-child{
  flex:0 0 auto;
  gap:6px !important;
}
#consorcio-agent-root .agent-new{
  max-width:66px;
  text-align:center;
  line-height:1.2;
  white-space:normal;
}
#consorcio-agent-root .agent-close{
  flex:0 0 22px;
  min-width:22px;
}
@media(max-width:380px){
  #consorcio-agent-root .agent-header{padding:11px 9px;gap:6px;}
  #consorcio-agent-root .agent-avatar{width:32px;height:32px;}
  #consorcio-agent-root .agent-profile{gap:7px;}
  #consorcio-agent-root .agent-title{font-size:12px;}
  #consorcio-agent-root .agent-subtitle{font-size:10px;}
  #consorcio-agent-root .agent-new{max-width:55px;font-size:10px !important;}
}

/* Cabeçalho: título em linha única */
#consorcio-agent-root .agent-profile { min-width: 0; flex: 1 1 auto; }
#consorcio-agent-root .agent-profile > div:last-child { min-width: 0; }
#consorcio-agent-root .agent-title { white-space: nowrap; font-size: 13px; letter-spacing: -.2px; }
#consorcio-agent-root .agent-header { gap: 6px; padding-left: 12px; padding-right: 10px; }
#consorcio-agent-root .agent-avatar { width: 32px; height: 32px; }
@media(max-width: 380px) {
  #consorcio-agent-root .agent-title { font-size: 12px; }
  #consorcio-agent-root .agent-profile { gap: 6px; }
}

/* Cabeçalho: nova comunicação de encaminhamento ao especialista */
#consorcio-agent-root .agent-title { white-space:nowrap; font-size:13px; }
#consorcio-agent-root .agent-subtitle { font-size:10px; line-height:1.3; white-space:normal; }
@media(max-width:380px){ #consorcio-agent-root .agent-title { font-size:12px; } #consorcio-agent-root .agent-subtitle { font-size:9px; } }
