/* Boneco "Tire suas dúvidas". Tudo começa com .ajuda para não interferir no resto do site. */
.ajuda { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font: 400 14px/1.45 "Epilogue", system-ui, sans-serif; letter-spacing: 0; text-align: left; pointer-events: none; }
.ajuda *, .ajuda *::before, .ajuda *::after { box-sizing: border-box; margin: 0; padding: 0; }
.ajuda [hidden] { display: none !important; }
.ajuda > * { pointer-events: auto; }

.ajuda__abrir { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font: inherit; }
.ajuda__balao { background: #fff; color: #0f0f0f; font-weight: 600; padding: 10px 14px !important; border-radius: 16px 16px 4px 16px; box-shadow: 0 10px 30px -8px rgb(0 0 0 / .55); }
.ajuda .ajuda__boneco { width: 68px; height: 68px; padding: 6px; border-radius: 50%; background: #17191a; box-shadow: 0 0 0 2px #dafa9c, 0 14px 34px -8px rgb(0 0 0 / .7); animation: ajuda-flutua 3.2s ease-in-out infinite; transition: scale .2s; }
.ajuda__abrir:hover .ajuda__boneco { scale: 1.08; }
.ajuda__olhos { transform-origin: 32px 32px; animation: ajuda-pisca 4s infinite; }
.ajuda__antena { transform-origin: 32px 14px; animation: ajuda-acena 2.4s ease-in-out infinite; }
.ajuda.is-aberta .ajuda__balao { display: none; }
@keyframes ajuda-flutua { 50% { translate: 0 -5px; } }
@keyframes ajuda-pisca { 0%, 92%, 100% { transform: none; } 95% { transform: scaleY(.1); } }
@keyframes ajuda-acena { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }

.ajuda__janela { width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden; background: #fbfaf8; color: #17191a; border-radius: 20px; box-shadow: 0 30px 70px -20px rgb(0 0 0 / .75), 0 0 0 1px rgb(0 0 0 / .12); animation: ajuda-entra .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes ajuda-entra { from { opacity: 0; translate: 0 16px; scale: .96; } }
.ajuda__janela .ajuda__topo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #17191a; color: #fff; flex: none; }
.ajuda .ajuda__mini { width: 40px; height: 40px; flex: none; }
.ajuda__janela .ajuda__topo strong { display: block; font-size: 15px; font-weight: 600; }
.ajuda__janela .ajuda__topo span { display: block; font-size: 12px; color: #b9bdb9; }
.ajuda__fechar { margin-left: auto !important; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

.ajuda__inicio { display: flex; flex-direction: column; gap: 12px; padding: 16px !important; overflow-y: auto; }
.ajuda__inicio label { display: block; font-size: 13px; font-weight: 500; color: #3d4240; }
.ajuda input:not([type=checkbox]) { display: block; width: 100%; min-height: 44px; margin-top: 4px !important; padding: 10px 12px !important; border: 1px solid #cfccc4; border-radius: 10px; background: #fff; color: #17191a; font: 400 16px "Epilogue", system-ui, sans-serif; }
.ajuda__inicio label.ajuda__aceite { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 12.5px; }
.ajuda__aceite input { width: 18px; height: 18px; flex: none; accent-color: #2f6b3f; }
.ajuda__aceite a { color: #1f5a46; text-decoration: underline; }
.ajuda__escondido { position: absolute; left: -9999px; }
.ajuda__erro { color: #a3271a; font-size: 13px; }
.ajuda__inicio > button { min-height: 46px; border: 0; border-radius: 999px; background: #17191a; color: #dafa9c; font: 600 15px "Epilogue", system-ui, sans-serif; cursor: pointer; flex: none; }

.ajuda__conversa { display: flex; flex-direction: column; min-height: 0; }
.ajuda__mensagens { display: flex; flex-direction: column; gap: 8px; height: 300px; min-height: 0; overflow-y: auto; padding: 14px !important; position: relative; overscroll-behavior: contain; }
.ajuda__msg { max-width: 86%; padding: 9px 12px !important; border-radius: 14px; white-space: pre-line; overflow-wrap: anywhere; flex: none; animation: ajuda-entra .22s ease; }
.ajuda__msg--assistente { align-self: flex-start; background: #ecebe6; border-bottom-left-radius: 4px; }
.ajuda__msg--visitante { align-self: flex-end; background: #17191a; color: #fff; border-bottom-right-radius: 4px; }
.ajuda__msg.is-escrevendo { opacity: .6; }
.ajuda__sugestoes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px !important; }
.ajuda__sugestoes button { border: 1px solid #cfccc4; border-radius: 999px; background: #fff; color: #17191a; font: 500 12.5px "Epilogue", system-ui, sans-serif; padding: 7px 11px !important; cursor: pointer; }
.ajuda__sugestoes button:hover { border-color: #17191a; }
.ajuda__pergunta { display: flex; gap: 8px; align-items: center; padding: 10px 12px !important; border-top: 1px solid #e4e2dc; }
.ajuda .ajuda__pergunta input { margin-top: 0 !important; }
.ajuda__pergunta button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #17191a; color: #dafa9c; font-size: 18px; cursor: pointer; }
.ajuda__zap { display: block; text-align: center; padding: 10px !important; font-size: 13px; font-weight: 600; color: #fff; background: #1d7a4a; text-decoration: none; }
.ajuda button:focus-visible, .ajuda input:focus-visible, .ajuda a:focus-visible { outline: 2px solid #5fe3d0; outline-offset: 2px; }

@media (max-width: 639px) {
  .ajuda { right: 10px; bottom: 12px; }
  .ajuda__balao { font-size: 12px; padding: 7px 10px !important; }
  .ajuda .ajuda__boneco { width: 56px; height: 56px; padding: 5px; }
  /* a página inicial tem uma barra fixa embaixo no celular */
  body:has(> nav.actionbar) .ajuda { bottom: calc(74px + env(safe-area-inset-bottom)); }
  body:has(> nav.actionbar) .ajuda__janela { max-height: calc(100dvh - 170px); }
  .ajuda__mensagens { height: min(300px, 40dvh); }
  .ajuda.is-aberta .ajuda__abrir { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ajuda *, .ajuda__janela { animation: none !important; transition: none !important; }
}

/* No celular o nome fica embaixo do boneco, para cobrir menos a página. */
@media (max-width: 639px) {
  .ajuda__abrir { flex-direction: column; gap: 0; }
  .ajuda__balao { order: 1; margin-top: -6px !important; position: relative; font-size: 11px; padding: 4px 9px !important; border-radius: 999px; }
}
