/* Cenas animadas das páginas de venda (decisão 0039): o celular de quem escreve e, ao lado, o que a plataforma confere.
   Usa as cores da página que a carrega (--quadro, --giz, --lapis, --tinta...). Sem fonte externa: a CSP não deixa. */
.cena { --cena-fundo: var(--quadro-2); --cena-fundo-2: var(--quadro); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.55fr); gap: clamp(1.5rem, 3vw, 2.75rem) clamp(1.5rem, 4vw, 4.5rem); padding: clamp(3rem, 7vw, 6.5rem) var(--margem); background: var(--cena-fundo); color: var(--giz); align-items: start; }
.cena > h1, .cena > h2 { grid-column: 1 / -1; max-width: 20em; font-size: clamp(2.1rem, 4.6vw, 4.6rem); }
/* A cena como abertura da página (decisão 0040): o robô inteiro cabe na primeira tela. O título desce para a coluna do texto, o celular e a
   plataforma sobem para o alto e a altura dos dois acompanha a da janela (--cena-altura), descontados o menu, a barra e as margens. */
.cena.cena-abertura { --cena-fundo: var(--quadro); --cena-fundo-2: var(--quadro-2); --cena-altura: clamp(400px, calc(100dvh - 10.75rem), 620px); padding-top: clamp(.9rem, 1.8vw, 1.6rem); padding-bottom: clamp(2rem, 4vw, 3.5rem); row-gap: 1rem; }
.cena-abertura > h1 { font-size: clamp(1.8rem, 2.9vw, 2.9rem); max-width: none; }
.cena-abertura > .cena-palco { order: 2; }
.cena-abertura > .cena-texto { order: 3; }
.cena-abertura .cel, .cena-abertura .plat { height: var(--cena-altura); }
.cena-abertura .cena-comandos { margin-top: 1.1rem; }
.cena-abertura .acao.grande { margin-top: 1.25rem; }
@media (min-width: 1181px) {
  .cena.cena-abertura { grid-template-rows: auto 1fr; }
  .cena-abertura > h1 { grid-column: 1; grid-row: 1; }
  .cena-abertura > .cena-texto { grid-column: 1; grid-row: 2; }
  .cena-abertura > .cena-palco { grid-column: 2; grid-row: 1 / span 2; }
}
.cena-lide { font-size: clamp(1.08rem, 1.4vw, 1.3rem); line-height: 1.45; max-width: 30em; }
.cena-comandos { display: grid; gap: .75rem; margin-top: 1.6rem; max-width: 30em; }
.cena-roteiros { display: flex; gap: 2px; padding: 2px; background: var(--cena-fundo-2); }
.cena-roteiros button { flex: 1; min-height: 44px; padding: .5rem .4rem; border: 0; background: transparent; color: var(--giz); font: 600 .95rem/1.15 var(--texto); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.cena-roteiros button[aria-pressed="true"] { background: var(--lapis); color: var(--tinta); }
.cena-quem { min-height: 2.8em; font-size: .97rem; line-height: 1.4; color: var(--giz-suave); }
.cena-botoes { display: flex; flex-wrap: wrap; gap: .5rem; }
.cena-botoes button { min-height: 44px; padding: .5rem 1rem; border: 2px solid var(--giz); background: transparent; color: var(--giz); font: 700 .95rem/1.2 var(--texto); cursor: pointer; transition: transform .12s var(--curva), background-color .15s ease, color .15s ease; }
.cena-botoes button:active { transform: scale(.97); }
.cena-botoes button.forte { border-color: var(--lapis); background: var(--lapis); color: var(--tinta); }
@media (hover: hover) and (pointer: fine) {
  .cena-botoes button:hover { background: var(--giz); color: var(--tinta); }
  .cena-botoes button.forte:hover { border-color: var(--lapis-forte); background: var(--lapis-forte); color: var(--tinta); }
}
.cena-progresso { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; border: 0; background: var(--cena-fundo-2); color: var(--lapis); }
.cena-progresso::-webkit-progress-bar { background: var(--cena-fundo-2); }
.cena-progresso::-webkit-progress-value { background: var(--lapis); transition: width .4s ease; }
.cena-progresso::-moz-progress-bar { background: var(--lapis); }
.cena-nota { margin-top: 1.5rem; padding: .85rem 1rem; background: var(--cena-fundo-2); font-size: .93rem; line-height: 1.45; max-width: 34em; }

.cena-palco { display: grid; grid-template-columns: minmax(290px, 372px) minmax(0, 1fr); gap: clamp(1rem, 2.2vw, 2.25rem); align-items: start; min-width: 0; }
.cena-agora { display: none; }

/* ---- o celular ---------------------------------------------------------------------------------- */
.cel { position: relative; display: flex; flex-direction: column; height: clamp(480px, 62vh, 620px); overflow: hidden; border: 7px solid #0a1512; border-radius: 30px; background: #efe7dd; color: #111b21; font-family: var(--texto); }
.cel-topo { flex: none; display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem .55rem .45rem; background: #075e54; color: #fff; }
.cel-voltar { flex: none; display: grid; }
.cel-voltar svg { width: 1.25rem; height: 1.25rem; }
.cel-foto { flex: none; display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 50%; background: #d9e6e2; color: #075e54; font-size: .8rem; font-weight: 700; }
.cel-nome { display: grid; min-width: 0; line-height: 1.22; }
.cel-nome strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cel-estado { font-size: .76rem; opacity: .88; }
.cel-tela { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: .7rem .6rem; overscroll-behavior: contain; scrollbar-width: thin; }
.cel-tela > :first-child { margin-top: auto; }
.cel-tela:focus-visible { outline-offset: -3px; }
.cel-fala { max-width: 87%; padding: .4rem .55rem .3rem; border-radius: 9px; font-size: .92rem; line-height: 1.35; display: grid; gap: .16rem; overflow-wrap: anywhere; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); animation: fala-entra .28s var(--curva) both; }
.cel-fala.deles { align-self: flex-start; background: #fff; border-top-left-radius: 2px; transform-origin: left bottom; }
.cel-fala.minha { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 2px; transform-origin: right bottom; }
@keyframes fala-entra { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.cel-quem { font-size: .72rem; font-weight: 700; color: #0b6a5e; }
.cel-quem.humano { color: #9a4a12; }
.cel-texto-fala { white-space: pre-wrap; }
.cel-detalhe { font-size: .8rem; color: #54656f; }
.cel-rodape { justify-self: end; display: flex; align-items: center; gap: .22rem; font-size: .68rem; color: #667781; font-variant-numeric: tabular-nums; }
.cel-vistos { display: grid; color: #8696a0; transition: color .3s ease; }
.cel-vistos svg { width: 1.02rem; height: .64rem; }
.cel-vistos.lido { color: #34a7e0; }
.cel-arquivo { display: grid; overflow: hidden; border-radius: 7px; background: #f0f2f5; }
.cel-arquivo img { display: block; width: 100%; height: 92px; object-fit: cover; object-position: top; }
.cel-arquivo-linha { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem; }
.cel-pdf { flex: none; padding: .25rem .4rem; border-radius: 4px; background: #c62828; color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .02em; }
.cel-arquivo-nome { display: grid; font-size: .84rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.cel-arquivo-nome small { font-size: .72rem; font-weight: 400; color: #667781; }
.cel-botoes { display: grid; margin: .3rem -.55rem -.3rem; }
.cel-botao { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.3rem; padding: .4rem; border-top: 1px solid #e9edef; color: #0b6a5e; font-size: .9rem; font-weight: 600; text-align: center; transition: background-color .15s ease, color .3s ease; }
.cel-botao:last-child { border-radius: 0 0 9px 9px; }
.cel-botao-icone { display: grid; }
.cel-botao-icone svg { width: 1rem; height: 1rem; }
.cel-botao.tocado { background: #dcefeb; }
.cel-botao.usado { color: #8696a0; }
.cel-pontos { align-self: flex-start; display: flex; gap: .25rem; padding: .62rem .7rem; border-radius: 9px; border-top-left-radius: 2px; background: #fff; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); animation: fala-entra .2s var(--curva) both; }
.cel-pontos span { width: .42rem; height: .42rem; border-radius: 50%; background: #8696a0; animation: cel-ponto 1.1s ease-in-out infinite; }
.cel-pontos span:nth-child(2) { animation-delay: .15s; }
.cel-pontos span:nth-child(3) { animation-delay: .3s; }
@keyframes cel-ponto { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.cel-marco { align-self: center; margin: .3rem 0; padding: .18rem .65rem; border-radius: 6px; background: #fff3c4; font-size: .76rem; color: #54656f; animation: fala-entra .28s var(--curva) both; }

.cel-barra { flex: none; display: flex; align-items: flex-end; gap: .4rem; padding: .4rem .45rem .5rem; }
.cel-campo { flex: 1; min-width: 0; min-height: 2.5rem; padding: .56rem .85rem; border-radius: 1.25rem; background: #fff; font-size: .92rem; line-height: 1.35; overflow-wrap: anywhere; }
.cel-dica { color: #8696a0; }
.cel-cursor { display: none; width: 2px; height: 1.05em; margin-left: 1px; background: #075e54; vertical-align: text-bottom; animation: cel-pisca 1s steps(1) infinite; }
.cel-barra.com-texto .cel-dica { display: none; }
.cel-barra.com-texto .cel-cursor { display: inline-block; }
@keyframes cel-pisca { 50% { opacity: 0; } }
.cel-enviar { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #00a884; color: #fff; transition: transform .15s var(--curva), background-color .15s ease; }
.cel-enviar svg { width: 1.25rem; height: 1.25rem; }
.cel-enviar .i-enviar, .cel-barra.com-texto .i-microfone { display: none; }
.cel-barra.com-texto .i-enviar { display: block; }
.cel-enviar.tocado { transform: scale(.88); background: #008f72; }
.cel.pausada .cel-cursor, .cel.pausada .cel-pontos span { animation-play-state: paused; }

.toque { position: absolute; z-index: 5; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 50%; background: rgba(17, 27, 33, .24); pointer-events: none; animation: cel-toque .42s ease-out both; }
@keyframes cel-toque { 0% { transform: scale(.35); opacity: 0; } 30% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

.cel-veu { position: absolute; inset: 0; z-index: 2; background: rgba(11, 20, 26, .42); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s .25s; }
.cel.com-folha .cel-veu { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.cel-folha { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; max-height: 80%; border-radius: 16px 16px 0 0; background: #fff; transform: translateY(102%); visibility: hidden; transition: transform .32s var(--curva), visibility 0s .32s; }
.cel.com-folha .cel-folha { transform: none; visibility: visible; transition: transform .32s var(--curva); }
.folha-titulo { padding: .85rem 1rem .6rem; font-size: .96rem; font-weight: 700; text-align: center; }
.folha-itens { min-height: 0; overflow-y: auto; }
.folha-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-top: 1px solid #e9edef; transition: background-color .15s ease; }
.folha-item div { flex: 1; display: grid; line-height: 1.3; }
.folha-item strong { font-size: .93rem; font-weight: 600; }
.folha-item small { font-size: .78rem; color: #667781; }
.folha-radio { flex: none; width: 1.15rem; height: 1.15rem; border: 2px solid #8696a0; border-radius: 50%; }
.folha-item.tocado { background: #f0f2f5; }
.folha-item.escolhido .folha-radio { border-color: #00a884; background: radial-gradient(circle, #00a884 0 42%, transparent 48%); }
.folha-enviar { margin: .65rem 1rem .85rem; padding: .62rem; border-radius: 1.4rem; background: #e9edef; color: #8696a0; font-weight: 700; text-align: center; transition: background-color .2s ease, color .2s ease, transform .15s var(--curva); }
.folha-enviar.pronto { background: #00a884; color: #fff; }
.folha-enviar.tocado { transform: scale(.97); }

.cel-assistir { position: absolute; top: 50%; left: 50%; z-index: 4; transform: translate(-50%, -50%); min-height: 48px; padding: .75rem 1.3rem; border: 0; border-radius: 2rem; background: #075e54; color: #fff; font: 700 1rem/1.2 var(--texto); white-space: nowrap; cursor: pointer; box-shadow: 0 8px 22px rgba(11, 20, 26, .28); transition: transform .15s var(--curva), background-color .15s ease; }
.cel-assistir:active { transform: translate(-50%, -50%) scale(.97); }
@media (hover: hover) and (pointer: fine) { .cel-assistir:hover { background: #0b6a5e; } }

/* ---- a plataforma ------------------------------------------------------------------------------- */
.plat { display: flex; flex-direction: column; min-width: 0; height: clamp(480px, 62vh, 620px); background: var(--giz); color: var(--tinta); }
.plat-topo { flex: none; display: grid; gap: .15rem; padding: 1rem 1.15rem .85rem; background: var(--papel-2); }
.plat-rotulo { font-family: var(--titulo); font-weight: 700; font-size: clamp(1.25rem, 1.7vw, 1.6rem); line-height: 1.1; }
.plat-conversa { font-size: .88rem; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }
.plat-linhas { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: .7rem; margin: 0; padding: 1rem 1.15rem 1.2rem; list-style: none; scrollbar-width: thin; }
.plat-linha { display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); gap: .55rem; align-items: start; font-size: .98rem; line-height: 1.38; animation: fala-entra .3s var(--curva) both; }
.plat-icone { display: grid; place-items: center; width: 1.3rem; height: 1.3rem; margin-top: .04rem; border-radius: 50%; color: #fff; font-size: .78rem; font-weight: 700; line-height: 1; }
.esperando > .plat-icone { border: 2.5px solid var(--papel-2); border-top-color: var(--tinta); animation: cena-gira .7s linear infinite; }
.ok > .plat-icone { background: var(--ok); }
.ok > .plat-icone::before { content: "✓"; }
.nao > .plat-icone { background: var(--erro); }
.nao > .plat-icone::before { content: "✕"; }
.info > .plat-icone { background: var(--tinta); }
.info > .plat-icone::before { content: "i"; font-family: var(--titulo); font-style: italic; }
@keyframes cena-gira { to { transform: rotate(360deg); } }
.plat-linha.esperando .plat-texto { color: var(--tinta-suave); }
.plat-linha.nao .plat-texto { font-weight: 700; color: var(--erro); }
.plat-cartao { padding: .75rem .8rem .8rem; background: #fff; animation: fala-entra .3s var(--curva) both; }
.plat-cartao > strong { display: block; margin-bottom: .4rem; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--tinta-suave); }
.plat-cartao dl { display: grid; gap: 2px; margin: 0; }
.plat-cartao dl > div { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: .6rem; padding: .32rem .45rem; font-size: .92rem; line-height: 1.3; transition: background-color .35s ease; }
.plat-cartao dt { color: var(--tinta-suave); }
.plat-cartao dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.plat-cartao .e-ok { background: #dcf1e3; }
.plat-cartao .e-ok dd::after { content: " ✓"; color: var(--ok); }
.plat-cartao .e-nao { background: #fbe1d9; }
.plat-cartao .e-nao dd::after { content: " ✕"; color: var(--erro); }
.plat-cartao .e-marcado { background: var(--lapis); }
.plat-cartao .e-marcado dt { color: var(--tinta); }
.plat-cartao .e-ocupado dd { font-weight: 400; color: var(--tinta-suave); }
.plat-cartao .e-livre dd { color: var(--ok); }
.plat-cartao .mudou { animation: cena-muda .5s var(--curva); }
@keyframes cena-muda { 0% { transform: none; } 40% { transform: scale(1.035); } 100% { transform: none; } }

/* ---- telas menores ------------------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .cena { grid-template-columns: minmax(0, 1fr); }
  .cena-lide, .cena-comandos, .cena-nota { max-width: 40em; }
}
@media (max-width: 760px) {
  .cena-palco { grid-template-columns: minmax(0, 1fr); }
  .cena-agora { display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); gap: .55rem; align-items: start; min-height: 3.6em; padding: .6rem .75rem; background: var(--giz); color: var(--tinta); font-size: .92rem; line-height: 1.35; }
  .cena-agora.nao { font-weight: 700; color: var(--erro); }
  .cel { height: 540px; }
  .plat { height: auto; }
  /* no celular de quem visita, o título fica curto e o aparelho da cena cabe logo abaixo dele; a plataforma vem em seguida */
  .cena-abertura > h1 { font-size: clamp(1.45rem, 6.2vw, 1.9rem); }
  .cena-abertura .cel { height: clamp(360px, calc(100dvh - 20.5rem), 540px); }
  .cena-abertura .plat { height: auto; }
  .plat-linhas { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .cena *, .cena *::before, .cena *::after { animation: none !important; transition: none !important; }
}
