/* Modelo 2: Conversa. Tela de chat (WhatsApp por padrão; ?estilo=direct para o Direct). */
:root {
  --f: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topo: #008069; --topo-txt: #fff; --fundo: #efeae2; --balao-in: #fff; --balao-out: #d9fdd3; --txt: #111b21; --txt-2: #667781;
  --chip: #fff; --chip-txt: #008069; --chip-borda: #d1d7db; --enviar: #00a884; --wa: #1f8f4e; --ouro: #b8924a; --ouro-d: #8f6f33;
}
.direct {
  --topo: #fff; --topo-txt: #000; --fundo: #fff; --balao-in: #efefef; --balao-out: #3797f0; --txt: #000; --txt-2: #737373;
  --chip: #fff; --chip-txt: #0095f6; --chip-borda: #dbdbdb; --enviar: #0095f6;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 400 15.5px/1.38 var(--f); color: var(--txt); -webkit-font-smoothing: antialiased; background: #d6d1c9; }
.direct body, body.direct { background: #fafafa; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.app { position: fixed; inset: 0; margin: 0 auto; max-width: 480px; display: flex; flex-direction: column; background: var(--fundo); overflow: hidden; }
@media (min-width: 600px) { .app { inset: 16px auto; left: 0; right: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); } }
.app:not(.direct-app) .chat { background-color: var(--fundo); background-image:
  radial-gradient(circle at 20px 20px, rgba(0,0,0,.035) 2px, transparent 3px),
  radial-gradient(circle at 60px 50px, rgba(0,0,0,.03) 3px, transparent 4px),
  radial-gradient(circle at 40px 80px, rgba(0,0,0,.025) 1.5px, transparent 2.5px);
  background-size: 90px 100px; }

/* Topo */
.topo { flex: none; display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px 8px; background: var(--topo); color: var(--topo-txt); }
.direct .topo { border-bottom: 1px solid #efefef; }
.topo .volta { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; flex: none; }
.foto { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.direct .foto { width: 36px; height: 36px; }
.quem { flex: 1; min-width: 0; }
.quem b { display: block; font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quem small { display: block; font-size: .78rem; opacity: .85; min-height: 1.1em; }
.direct .quem small { color: var(--txt-2); opacity: 1; }
.topo .icones { display: flex; gap: 18px; }
.topo .icones svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Conversa */
.chat { flex: 1; overflow-y: auto; padding: 12px 10px 16px; display: flex; flex-direction: column; gap: 3px; scroll-behavior: smooth; }
.dia { align-self: center; margin: 4px 0 10px; font-size: .75rem; padding: 5px 12px; border-radius: 8px; background: #fff; color: var(--txt-2); box-shadow: 0 1px .5px rgba(11,20,26,.13); text-transform: uppercase; letter-spacing: .03em; }
.direct .dia { background: none; box-shadow: none; text-transform: none; }
.aviso-cripto { align-self: center; max-width: 88%; text-align: center; font-size: .74rem; padding: 6px 12px; border-radius: 8px; background: #ffeecd; color: #54656f; margin-bottom: 10px; }
.direct .aviso-cripto { display: none; }
.msg { position: relative; max-width: 82%; padding: 7px 9px 8px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); animation: surge .25s ease-out both; word-wrap: break-word; }
@keyframes surge { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.msg.in { align-self: flex-start; background: var(--balao-in); }
.msg.out { align-self: flex-end; background: var(--balao-out); }
.msg.primeira.in { border-top-left-radius: 0; margin-top: 6px; }
.msg.primeira.out { border-top-right-radius: 0; margin-top: 6px; }
.direct .msg { box-shadow: none; border-radius: 20px; padding: 9px 13px; }
.direct .msg.out { color: #fff; }
.direct .msg.primeira.in, .direct .msg.primeira.out { border-radius: 20px; }
.hora { float: right; margin: 6px 0 -4px 10px; font-size: .68rem; color: var(--txt-2); display: inline-flex; align-items: center; gap: 3px; }
.hora svg { width: 16px; height: 11px; fill: none; stroke: #53bdeb; stroke-width: 1.6; }
.direct .hora { display: none; }
.msg b { font-weight: 700; }
.msg s { color: var(--txt-2); }
.msg.foto-msg { padding: 3px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 250px; max-width: 100%; }
.ba figure { margin: 0; position: relative; aspect-ratio: 3/4; overflow: hidden; border-radius: 6px; }
.ba img { width: 100%; height: 100%; object-fit: cover; }
.ba figcaption { position: absolute; left: 6px; bottom: 6px; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 4px 7px; border-radius: 99px; }
.legenda { padding: 5px 6px 2px; font-size: .78rem; color: var(--txt-2); }
.digitando { align-self: flex-start; background: var(--balao-in); border-radius: 8px; border-top-left-radius: 0; padding: 12px 14px; display: flex; gap: 4px; margin-top: 6px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.direct .digitando { border-radius: 20px; box-shadow: none; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: pula 1.2s infinite; }
.digitando i:nth-child(2) { animation-delay: .15s; } .digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pula { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.btn-msg { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; padding: 11px 14px; border-radius: 8px; background: var(--wa); color: #fff; text-decoration: none; font-weight: 700; }
.btn-msg.ig { background: #fff; color: var(--txt); border: 1px solid var(--chip-borda); }
.btn-msg svg { width: 18px; height: 18px; fill: currentColor; }

/* Respostas prontas e campo de digitar */
.base { flex: none; padding: 8px 8px max(10px, env(safe-area-inset-bottom)); background: transparent; }
.chips { display: flex; flex-direction: column; gap: 6px; }
.chip { width: 100%; border: 1px solid var(--chip-borda); background: var(--chip); color: var(--chip-txt); font-weight: 700; padding: 12px 14px; border-radius: 22px; cursor: pointer; text-align: center; min-height: 46px; box-shadow: 0 1px .5px rgba(11,20,26,.08); transition: transform .12s; animation: surge .25s ease-out both; }
.chip small { display: block; font-weight: 400; font-size: .78rem; color: var(--txt-2); }
.chip:active { transform: scale(.98); }
.digitar { display: flex; gap: 6px; align-items: flex-end; }
.digitar .campo { flex: 1; display: flex; align-items: center; background: #fff; border-radius: 24px; padding: 0 14px; min-height: 48px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.direct .digitar .campo { border: 1px solid #dbdbdb; box-shadow: none; }
.digitar input { flex: 1; border: 0; outline: none; background: none; font-size: 1rem; padding: 12px 0; min-width: 0; }
.digitar button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--enviar); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.digitar button svg { width: 22px; height: 22px; fill: currentColor; }
.digitar button:disabled { opacity: .5; }
.erro { margin: 6px 12px 0; font-size: .8rem; color: #b3261e; min-height: 1em; }
.priv { margin: 6px 12px 0; font-size: .72rem; color: var(--txt-2); }
.oculto { display: none !important; }
@media (prefers-reduced-motion: reduce) { .msg, .chip { animation: none; } .digitando i { animation: none; opacity: .7; } }

/* Respostas com desenho da região (corpo e rosto) */
.chips.com-figura { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chips.com-figura .chip { display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 10px 6px 6px; border-radius: 14px; min-height: 0; font-size: .9rem; line-height: 1.2; }
.chips.com-figura .fig-mini { width: 60px; height: 60px; border-radius: 10px; }
.chips.com-figura .fig-mini.rosto { width: 54px; height: 70px; }
.chips.com-figura .chip:last-child:nth-child(odd) { grid-column: 1 / -1; }
