/* Animações de passo a passo do blog (o bloco "::: animacao" de scripts/blog.mjs, com public/site/blog/anim.js).
   Só carrega nas páginas que têm animação. O palco é uma tela de 480×330 que encolhe com a página (--k). As peças
   (.m-…) imitam o app no tema claro, como os prints.
   Regra: o estilo de cada peça é o estado FINAL; a animação (só na cena .ativa) parte do estado inicial. Assim, sem
   JavaScript ou com "menos movimento" ligado no sistema, cada cena aparece pronta. */
.anim { margin: 26px 0 10px !important; border: 1px solid var(--linha); border-radius: 16px; background: var(--bloco); overflow: hidden; box-shadow: var(--sombra); }
.anim-palco { position: relative; aspect-ratio: 480 / 330; overflow: hidden; background-color: var(--faixa); background-image: radial-gradient(var(--linha-forte) 1px, transparent 1px); background-size: 18px 18px; }
.anim-tela { position: absolute; left: 0; top: 0; width: 480px; height: 330px; transform-origin: 0 0; transform: scale(var(--k, 1)); }
.cena { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.cena.ativa, .anim:not(.pronta) .cena:first-child { opacity: 1; visibility: visible; }
.anim-pausa { position: absolute; right: 10px; top: 10px; z-index: 9; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--linha-forte); background: var(--bloco); color: var(--texto); opacity: .85; padding: 0; }
.anim-pausa:hover { opacity: 1; }
.anim-pausa svg { width: 13px; height: 13px; }
.anim-pausa .play, .anim.parada .anim-pausa .pause { display: none; }
.anim.parada .anim-pausa .play { display: block; }
.anim:not(.pronta) .anim-pausa { display: none; }
.anim-passos { list-style: none; margin: 0 !important; padding: 8px !important; display: grid; gap: 2px; border-top: 1px solid var(--linha); }
.anim-passos li { margin: 0 !important; }
.anim-passos button { appearance: none; border: 0; background: none; width: 100%; text-align: left; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 7px 10px; border-radius: 10px; cursor: pointer; position: relative; overflow: hidden; color: var(--fraco); font: 500 .95rem/1.4 var(--sans); }
.anim-passos button:hover { color: var(--texto); }
.anim-passos .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bloco); border: 1.5px solid var(--linha-forte); font: 800 .82rem var(--titulo); color: var(--fraco); }
.anim-passos .res .n { border-color: var(--cor-clara); color: var(--cor); }
.anim-passos button[aria-current="step"] { background: var(--cor-fundo); color: var(--texto); }
.anim-passos button[aria-current="step"] .n { background: var(--cor); border-color: var(--cor); color: var(--botao-texto); }
.anim-passos .res[aria-current="step"] { font-weight: 700; }
.anim-passos .ui { font-weight: 700; color: var(--cor); }
.anim-passos button[aria-current="step"] .ui { color: inherit; }
.anim-passos .prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--cor-clara); }
.anim-passos button[aria-current="step"] .prog { animation: anim-prog var(--dur, 4s) linear forwards; }
.anim.parada .anim-passos .prog { animation: none; width: 0; }
@keyframes anim-prog { to { width: 100%; } }

/* as peças da tela (o app no tema claro) */
.cena { font: 400 14px/1.4 var(--sans); color: #0e1714; text-align: left; }
.m-card { background: #fff; border: 1px solid #e3e8e2; border-radius: 14px; padding: 14px 16px; box-shadow: 0 16px 34px -22px rgba(14, 23, 20, .5); display: grid; gap: 10px; }
.m-cab { display: flex; align-items: center; gap: 10px; }
.m-cresce { flex: 1; min-width: 0; }
.m-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #e5f3ec; color: #0f6e52; flex: none; }
.m-ic svg { width: 18px; height: 18px; }
.m-tit { font: 800 15.5px/1.2 var(--titulo); letter-spacing: -.01em; }
.m-sub { font-size: 12px; line-height: 1.35; color: #56635c; }
.m-rot { font: 700 9.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #56635c; }
.m-linha { display: flex; gap: 8px; align-items: center; }
.m-campo { display: flex; align-items: center; height: 32px; padding: 0 10px; border: 1px solid #cfd8ce; border-radius: 8px; background: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; }
.m-campo.alto { height: auto; min-height: 64px; align-items: flex-start; padding: 8px 10px; white-space: normal; line-height: 1.4; }
.m-campo .ph { color: #a3ada7; }
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid #cfd8ce; background: #fff; font-size: 11.5px; font-weight: 600; color: #0e1714; white-space: nowrap; }
.m-chip.sel { background: #0f6e52; border-color: #0f6e52; color: #fff; }
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border-radius: 9px; border: 1px solid #cfd8ce; background: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: #0e1714; }
.m-btn.pri { background: #0f6e52; border-color: #0f6e52; color: #fff; }
.m-chave { width: 40px; height: 23px; border-radius: 999px; background: #0f6e52; position: relative; flex: none; }
.m-chave::after { content: ""; position: absolute; top: 3px; left: 20px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.m-chave.desl { background: #cfd8ce; }
.m-chave.desl::after { left: 3px; }
.m-abas { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #eaefea; justify-self: start; }
.m-abas span { padding: 4px 11px; border-radius: 7px; font-size: 12px; font-weight: 700; color: #56635c; }
.m-abas span.on { background: #fff; color: #0e1714; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.m-check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.m-check i { width: 16px; height: 16px; border-radius: 4px; background: #0f6e52; flex: none; display: grid; place-items: center; color: #fff; font: normal 800 10px/1 var(--sans); }
.m-check i::before { content: "✓"; }
.m-check.nao i { background: #fff; border: 1.5px solid #cfd8ce; }
.m-check.nao i::before { opacity: 0; }
.m-check.nao span { color: #8a958f; text-decoration: line-through; }
@keyframes m-desmarca { from { background: #0f6e52; border-color: #0f6e52; } }
@keyframes m-volta { from { opacity: 1; } }
@keyframes m-risca { from { color: #0e1714; text-decoration-color: transparent; } }
.cena.ativa .m-check.nao.liga i { animation: m-desmarca .2s var(--t, 0s) both; }
.cena.ativa .m-check.nao.liga i::before { animation: m-volta .2s var(--t, 0s) both; }
.cena.ativa .m-check.nao.liga span { animation: m-risca .2s var(--t, 0s) both; }
.m-pil { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; background: #e5f3ec; color: #0f6e52; white-space: nowrap; }
.m-pil.alerta { background: #fbe4df; color: #b4432f; }
.m-pil.cinza { background: #eef1ee; color: #56635c; }
/* o WhatsApp de quem conversa */
.m-cel { width: 230px; height: 300px; border-radius: 26px; background: #111; padding: 6px; box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .6); flex: none; }
.m-cel-tela { height: 100%; border-radius: 21px; overflow: hidden; background: #efe7de; display: flex; flex-direction: column; }
.m-cel-topo { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f7f7; border-bottom: 1px solid #e3e3e3; font-size: 12px; font-weight: 700; }
.m-cel-topo small { display: block; font-size: 9.5px; font-weight: 500; color: #667781; }
.m-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #0f6e52; color: #fff; font-size: 10.5px; font-weight: 800; flex: none; }
.m-av svg { width: 26px; height: 26px; }
.m-msgs { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; padding: 8px; }
.m-dia-chat { align-self: center; font-size: 9.5px; font-weight: 700; color: #54656f; background: #fff; border-radius: 6px; padding: 2px 8px; }
.m-bal { max-width: 84%; padding: 5px 8px 3px; border-radius: 9px; font-size: 11.5px; line-height: 1.35; background: #fff; align-self: flex-start; box-shadow: 0 1px .5px rgba(0, 0, 0, .13); }
.m-bal.eu { align-self: flex-end; background: #d9fdd3; }
.m-bal small { display: block; text-align: right; font-size: 8.5px; color: #667781; margin-top: 1px; }
.m-digitando { align-self: flex-start; display: flex; gap: 3px; padding: 8px 10px; border-radius: 9px; background: #fff; opacity: 0; }
.m-digitando.eu { align-self: flex-end; background: #d9fdd3; }
.m-digitando i { width: 5px; height: 5px; border-radius: 50%; background: #9aa5a0; }
/* a Semana da agenda */
.m-semana { display: grid; grid-template-columns: 30px repeat(5, 1fr); gap: 3px; font-size: 10px; }
.m-semana .h { color: #8a958f; text-align: right; padding-right: 3px; line-height: 20px; }
.m-semana .d { text-align: center; font-weight: 700; color: #56635c; padding-bottom: 1px; }
.m-semana .d.hoje { color: #0f6e52; }
.m-slot { height: 20px; border-radius: 5px; background: #f3f6f3; border: 1px dashed #dbe2db; }
.m-slot.livre { background: #eaf6f0; border: 1px solid #c7e7d8; }
.m-slot.marc { background: #0f6e52; color: #fff; border: 0; font-weight: 700; padding: 0 5px; display: flex; align-items: center; gap: 3px; font-size: 9.5px; white-space: nowrap; overflow: hidden; }
/* a notificação no celular do dono */
.m-notif { position: absolute; left: 50%; top: 12px; width: 318px; margin-left: -159px; z-index: 4; background: rgba(255, 255, 255, .97); border-radius: 14px; padding: 9px 11px;
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, .45); display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; line-height: 1.35; }
.m-notif b { display: block; font-size: 12px; }
.m-notif small { color: #667781; font-size: 9.5px; }
/* peças de apoio: o alvo do toque (o dedo se posiciona nele), textos que trocam no mesmo lugar, o carregando */
.m-alvo { position: relative; display: inline-flex; }
.m-alvo.cheio { display: flex; }
.m-pilha { display: grid; }
.m-pilha > * { grid-area: 1 / 1; }
.m-gira { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #e3e8e2; border-top-color: #0f6e52; }
.m-opcao { display: grid; gap: 2px; padding: 9px 12px; border: 1px solid #e3e8e2; border-radius: 11px; background: #fff; width: 100%; }
.m-opcao.rec { border-color: #1fa37a; background: #f3fbf7; }
.m-opcao b { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.m-titulo-tela { font: 800 20px/1 var(--titulo); letter-spacing: -.02em; }
/* o teste da conversa (você é o cliente) */
.m-sim { width: 300px; height: 300px; background: #fff; border: 1px solid #e3e8e2; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 16px 34px -22px rgba(14, 23, 20, .5); }
.m-sim .m-cel-topo { background: #fff; }
.m-sim .m-msgs { background-color: #f2f5f1; background-image: radial-gradient(#dfe5de 1px, transparent 1px); background-size: 14px 14px; }
.m-entrada { display: flex; gap: 6px; padding: 7px; border-top: 1px solid #e3e8e2; background: #fff; }
.m-entrada .m-campo { flex: 1; height: 30px; font-size: 11.5px; }
.m-enviar { width: 30px; height: 30px; border-radius: 8px; background: #0f6e52; color: #fff; display: grid; place-items: center; flex: none; }
.m-enviar svg { width: 14px; height: 14px; }
@keyframes m-gira { to { transform: rotate(360deg); } }
.cena.ativa .m-gira { animation: m-gira .8s linear infinite; }

/* o dedo que toca */
.m-dedo { position: absolute; left: var(--x); top: var(--y); width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; z-index: 6; pointer-events: none;
  background: rgba(200, 241, 105, .45); border: 2px solid rgba(14, 23, 20, .7); }
.m-dedo.passa, .m-sai { opacity: 0; }

/* as animações só tocam na cena da vez, cada uma no seu tempo (--t) */
@keyframes m-entra { from { opacity: 0; transform: translateY(8px); } }
@keyframes m-surge { from { opacity: 0; transform: scale(.94); } }
@keyframes m-sai { from { opacity: 1; } to { opacity: 0; } }
@keyframes m-digita { from { clip-path: inset(0 100% 0 0); } }
@keyframes m-chave { from { background: #cfd8ce; } }
@keyframes m-chave-bola { from { left: 3px; } }
@keyframes m-sel { from { background: #fff; border-color: #cfd8ce; color: #0e1714; } }
@keyframes m-dedo { 0% { opacity: 0; transform: translate(80px, 90px); } 30% { opacity: 1; } 68% { transform: none; } 78% { transform: scale(.72); } 100% { opacity: 1; transform: none; } }
@keyframes m-onda { 0% { box-shadow: 0 0 0 0 rgba(31, 163, 122, .55); } 100% { box-shadow: 0 0 0 18px rgba(31, 163, 122, 0); } }
@keyframes m-pontos { 0%, 80%, 100% { opacity: .35; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes m-notif { from { opacity: 0; transform: translateY(-24px); } }
@keyframes m-aparece { from { opacity: 0; } to { opacity: 1; } }
.cena.ativa .m-entra { animation: m-entra .45s var(--suave) var(--t, 0s) both; }
.cena.ativa .m-surge { animation: m-surge .35s var(--suave) var(--t, 0s) both; }
.cena.ativa .m-sai { animation: m-sai .2s linear var(--t, 0s) both; }
.cena.ativa .m-digita { animation: m-digita var(--d, 1s) steps(var(--n, 18)) var(--t, 0s) both; }
.cena.ativa .m-chave.liga { animation: m-chave .25s var(--t, 0s) both; }
.cena.ativa .m-chave.liga::after { animation: m-chave-bola .25s var(--t, 0s) both; }
.cena.ativa .liga.m-chip, .cena.ativa .liga.m-btn { animation: m-sel .2s var(--t, 0s) both; }
.cena.ativa .m-dedo { animation: m-dedo 1.1s var(--suave) var(--t, 0s) both, m-onda .6s ease-out calc(var(--t, 0s) + .85s) both; }
.cena.ativa .m-dedo.passa { animation: m-dedo 1.1s var(--suave) var(--t, 0s) both, m-onda .6s ease-out calc(var(--t, 0s) + .85s), m-sai .3s linear calc(var(--t, 0s) + 1.5s) forwards; }
.cena.ativa .m-digitando { animation: m-aparece .25s var(--t, 0s) both, m-sai .2s linear var(--fim, 1.2s) forwards; }
.cena.ativa .m-digitando i { animation: m-pontos 1s ease-in-out infinite; }
.cena.ativa .m-digitando i:nth-child(2) { animation-delay: .15s; }
.cena.ativa .m-digitando i:nth-child(3) { animation-delay: .3s; }
.cena.ativa .m-notif { animation: m-notif .5s var(--suave) var(--t, 0s) both; }
.cena.ativa .m-pulsa { animation: m-onda 1s ease-out var(--t, 0s) 2; }
.cena.ativa .m-surge.m-pulsa { animation: m-surge .35s var(--suave) var(--t, 0s) both, m-onda 1s ease-out calc(var(--t, 0s) + .35s) 2; }
@media (prefers-reduced-motion: reduce) {
  .cena.ativa *, .cena.ativa *::before, .cena.ativa *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .cena .m-dedo.passa { display: none; }
}
@media (max-width: 640px) { .anim-passos button { font-size: .9rem; } }
