/* Barra da IA no chat (Assumir / Revisar / Sugerir / Português / Retomar / Follow-up).
   Estilo "abas" plano: ícone + texto, sem vidro, sem borda e sem sombra nos botões.
   Vale pro tema dos clientes e pro tema Virando; #ai-toolbar#ai-toolbar sobe a especificidade
   acima dos temas antigos (chat-ui-shell.css / virando-admin-shell.css). */
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar {
  gap: 2px !important;
  min-height: 46px !important;
  padding: 4px 12px !important;
  background: #ffffff !important;
  border-top: 1px solid #e8eaed !important;
  border-bottom: 1px solid #e8eaed !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* botões: ícone + texto, transparentes */
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar :is(.ai-tool-btn, #ai-chatbot-assumir-btn) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color: #5c5f62 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  width: auto !important;
  cursor: pointer !important;
  transition: background .12s ease, color .12s ease !important;
}
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar :is(.ai-tool-btn, #ai-chatbot-assumir-btn):hover {
  background: #f1f3f4 !important;
  color: #202223 !important;
}
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar :is(.ai-tool-btn, #ai-chatbot-assumir-btn):active {
  background: #e8eaed !important;
}
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar :is(.ai-tool-btn, #ai-chatbot-assumir-btn, #ai-chatbot-toggle):focus-visible {
  outline: 2px solid #2e7d32 !important;
  outline-offset: 1px !important;
}
#screen-dashboard #tab-chat #ai-toolbar .ai-tool-icon {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  stroke-width: 1.9 !important;
}

/* estado da IA: sem caixa, só ponto + texto; separado dos botões por um traço fino */
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-status {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 10px 0 4px !important;
  margin-right: 6px !important;
  border: 0 !important;
  border-right: 1px solid #e8eaed !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  gap: 8px !important;
  color: #5c5f62 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}
#screen-dashboard #tab-chat #ai-toolbar #ai-chatbot-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa0a6;
  flex: 0 0 8px;
}
#screen-dashboard #tab-chat #ai-toolbar #ai-chatbot-status.is-active::before { background: #2e9e5b; }
#screen-dashboard #tab-chat #ai-toolbar #ai-chatbot-status.is-paused::before { background: #d98a1d; }
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-status.is-active #ai-chatbot-status-label { color: #167a45 !important; }
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-status.is-paused #ai-chatbot-status-label { color: #b45309 !important; }
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-assumir-btn {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  background: #eef2f6 !important;
  color: #202223 !important;
}
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-assumir-btn:hover { background: #e2e8ee !important; }

/* chave "IA responde": chip plano */
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-toggle {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #eef0f2 !important;
  color: #5c5f62 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-toggle[data-state="active"] { background: #e3f5ea !important; color: #167a45 !important; }
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar #ai-chatbot-toggle[data-state="paused"] { background: #fff1de !important; color: #b45309 !important; }

/* Follow-up automático ativo */
:is(body[class*="client-"]:not(.client-virandoachave), html.vac-virando-theme body) #screen-dashboard #tab-chat #ai-toolbar#ai-toolbar .ai-tool-btn.ai-followup-on { background: #e3f5ea !important; color: #167a45 !important; }

/* Janela do Follow-up automático */
.fu-modal { max-width: 520px; width: calc(100vw - 32px); }
.fu-list { max-height: 52vh; overflow-y: auto; margin: 8px 0; padding-right: 2px; }
.fu-step { border: 1px solid rgba(128,128,128,.28); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.fu-step.done { opacity: .55; }
.fu-step.next { border-color: #2e9e5b; box-shadow: 0 0 0 1px #2e9e5b inset; }
.fu-step-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12.5px; }
.fu-step-h span { opacity: .75; }
.fu-step-h em { font-style: normal; font-weight: 700; color: #167a45; margin-left: auto; }
.fu-step-t { margin-top: 4px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; opacity: .9; }
.fu-note { font-size: 12px; opacity: .7; margin: 6px 0 2px; }

/* "Iniciar conversa com <número>" (busca do Chat ao vivo) */
#wa-newchat-row { align-items: center; gap: 10px; width: calc(100% - 24px); margin: 8px 12px 0; padding: 9px 12px; border: 1px dashed #2e9e5b; border-radius: 10px; background: #effaf3; color: #14532d; font-size: 13px; cursor: pointer; text-align: left; }
#wa-newchat-row:hover { background: #e1f5e8; }
#wa-newchat-row .wa-newchat-plus { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #2e9e5b; color: #fff; font-weight: 700; flex: 0 0 22px; }

/* Mapa do Follow-up em modo só-texto (tenant sem templates): esconde a Repescagem por template */
#followup-root.fu-text-only [data-fu-repescagem] { display: none !important; }

/* seletor do som: pílula compacta no mesmo estilo dos botões de ícone da linha (sem seta nativa) */
#chat-sound-style {
  -webkit-appearance: none !important; appearance: none !important;
  height: 32px !important; width: 100px !important; max-width: 100px !important;
  padding: 0 22px 0 10px !important;
  border: 1px solid #e3e5ea !important; border-radius: 16px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%2710%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%235c5f62%27 stroke-width=%273%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E") no-repeat right 8px center !important;
  color: #5c5f62 !important; font: 600 12px/1 inherit !important; font-family: inherit !important;
  text-overflow: ellipsis; cursor: pointer; box-shadow: none !important;
}
#chat-sound-style:hover { background-color: #f1f3f4 !important; color: #202223 !important; }
#chat-sound-style:focus-visible { outline: 2px solid #2e7d32; outline-offset: 1px; }

/* menu "Todos/Contatos/Grupos": o botão agora fica na 2ª linha, à esquerda; abrir pra direita (antes cortava na borda) */
#tab-chat .wa-type-wrap .wa-type-menu { left: 0 !important; right: auto !important; top: calc(100% + 4px) !important; }
