[hidden] { display: none !important; }
:root {
  --wa-verde: #008069;
  --wa-verde-escuro: #00664f;
  --wa-envio: #00a884;
  --wa-fundo: #efeae2;
  --wa-bolha-eu: #d9fdd3;
  --wa-bolha: #ffffff;
  --wa-texto: #111b21;
  --wa-mudo: #667781;
  --b-papel: #f7f4e4;
  --b-tinta: #20220f;
  --b-mudo: #5b6150;
  --b-lima: #d9e76a;
  --b-verde: #31703f;
  --b-linha: #c9cdb4;
  --raio: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--b-papel); color: var(--wa-texto); -webkit-font-smoothing: antialiased; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mobile first: a conversa ocupa a tela. */
.palco { height: 100dvh; display: flex; flex-direction: column; }
.pitch { display: none; }
.fone { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--wa-fundo); position: relative; }

.topo { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--wa-verde); color: #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e7f5ee; color: var(--wa-verde-escuro); display: grid; place-items: center; font-weight: 700; letter-spacing: .5px; flex: none; }
.quem { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.quem strong { font-size: 16px; font-weight: 600; }
.quem span { font-size: 12.5px; opacity: .85; }
.tag-demo { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; background: var(--b-lima); color: var(--b-tinta); border-radius: 999px; padding: 3px 8px; }

.chat {
  flex: 1; overflow-y: auto; padding: 12px 4% 16px; display: flex; flex-direction: column; gap: 2px;
  background-color: var(--wa-fundo);
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1.2px), radial-gradient(rgba(0,0,0,.025) 1px, transparent 1.2px);
  background-size: 22px 22px, 22px 22px; background-position: 0 0, 11px 11px;
  scroll-behavior: smooth;
}
.aviso { align-self: center; max-width: 92%; display: flex; gap: 8px; background: #fff5c4; color: #54656f; font-size: 12.5px; line-height: 1.45; border-radius: var(--raio); padding: 8px 12px; margin: 6px 0 10px; box-shadow: 0 1px .5px rgba(11,20,26,.13); text-align: left; }
.aviso strong { color: #3b4a54; }
.dia { align-self: center; margin: 4px 0 10px; }
.dia span { background: #fff; color: var(--wa-mudo); font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); text-transform: uppercase; letter-spacing: .3px; }

.msg { max-width: 82%; padding: 6px 8px 8px 9px; border-radius: var(--raio); font-size: 14.6px; line-height: 1.42; box-shadow: 0 1px .5px rgba(11,20,26,.13); position: relative; word-wrap: break-word; overflow-wrap: anywhere; animation: entra .18s ease-out; }
.msg + .msg.mesmo { margin-top: 0; }
.msg.ia, .msg.equipe { align-self: flex-start; background: var(--wa-bolha); border-top-left-radius: 0; margin-top: 8px; }
.msg.paciente { align-self: flex-end; background: var(--wa-bolha-eu); border-top-right-radius: 0; margin-top: 8px; }
.msg.mesmo { border-radius: var(--raio); margin-top: 2px; }
.msg .autor { display: block; font-size: 12.5px; font-weight: 600; color: #1f7aec; margin-bottom: 2px; }
.msg .meta { float: right; margin: 6px 0 -4px 10px; font-size: 11px; color: var(--wa-mudo); display: inline-flex; align-items: center; gap: 3px; }
.msg .meta svg { color: #53bdeb; }
.msg a { color: #027eb5; }
.sistema { align-self: center; background: #e1f2fb; color: #3b4a54; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; margin: 10px 0; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.digitando { align-self: flex-start; background: #fff; border-radius: var(--raio); border-top-left-radius: 0; padding: 12px 14px; margin-top: 8px; display: inline-flex; gap: 4px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: pulo 1.2s infinite; }
.digitando i:nth-child(2) { animation-delay: .15s; }
.digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.sugestoes { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px 2px; background: var(--wa-fundo); scrollbar-width: none; }
.sugestoes::-webkit-scrollbar { display: none; }
.sugestoes button { flex: none; border: 1px solid #d1d7db; background: #fff; color: var(--wa-verde-escuro); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sugestoes button:hover { background: #f0faf6; }
.sugestoes button:focus-visible, .entrada input:focus-visible, .entrada button:focus-visible { outline: 2px solid var(--wa-verde); outline-offset: 2px; }

.entrada { display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--wa-fundo); }
.entrada input { flex: 1; border: 0; border-radius: 999px; padding: 12px 16px; font: inherit; font-size: 16px; background: #fff; color: var(--wa-texto); box-shadow: 0 1px .5px rgba(11,20,26,.13); min-width: 0; }
.entrada button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--wa-envio); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.entrada button:disabled { opacity: .55; cursor: default; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; background: var(--b-lima); color: var(--b-tinta); margin-left: 4px; }

/* Desktop: texto da demo à esquerda, telefone à direita. */
@media (min-width: 900px) {
  body { background: radial-gradient(1200px 600px at 10% 0%, #fbf9ee 0%, var(--b-papel) 60%); }
  .palco { flex-direction: row; align-items: center; justify-content: center; gap: 64px; padding: 32px; }
  .pitch { display: block; max-width: 440px; color: var(--b-tinta); }
  .kicker { font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--b-verde); display: flex; align-items: center; gap: 8px; margin: 0 0 18px; }
  .marca-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--b-verde); box-shadow: 14px 0 0 var(--b-lima); margin-right: 14px; }
  .pitch h1 { font-size: 46px; line-height: 1.05; letter-spacing: -1px; margin: 0 0 18px; font-weight: 800; }
  .lead { font-size: 18px; line-height: 1.5; color: var(--b-mudo); margin: 0 0 22px; }
  .testes { margin: 0 0 26px; padding: 0; list-style: none; display: grid; gap: 10px; }
  .testes li { padding-left: 28px; position: relative; font-size: 15.5px; }
  .testes li::before { content: ""; position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--b-lima); border: 2px solid var(--b-verde); }
  .rodape-pitch { font-size: 13px; color: var(--b-mudo); border-top: 1px solid var(--b-linha); padding-top: 14px; margin: 0; }
  .fone { flex: none; width: 400px; height: min(820px, calc(100dvh - 64px)); border-radius: 36px; overflow: hidden; border: 10px solid #111; box-shadow: 0 30px 60px -20px rgba(32,34,15,.45), 0 0 0 1px rgba(0,0,0,.06); }
}
@media (prefers-reduced-motion: reduce) { .msg, .digitando i { animation: none; } .chat { scroll-behavior: auto; } }

/* Painel */
.painel-body { background: #f4f6f5; color: #1b1f1d; height: auto; min-height: 100%; }
.painel-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--b-tinta); color: var(--b-papel); }
.painel-topo h1 { font-size: 17px; margin: 0; font-weight: 700; }
.painel-topo small { color: var(--b-lima); font-weight: 600; }
.login { max-width: 360px; margin: 12vh auto; background: #fff; padding: 28px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.08); display: grid; gap: 12px; }
.login h2 { margin: 0; font-size: 20px; }
.login input, .resposta input { font: inherit; padding: 11px 12px; border: 1px solid #cfd6d2; border-radius: 8px; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; background: var(--b-verde); color: #fff; }
.btn.sec { background: #e7ece9; color: #1b1f1d; }
.btn:disabled { opacity: .5; cursor: default; }
.erro { color: #b42318; font-size: 14px; min-height: 1em; }
.grade { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px; }
@media (min-width: 1000px) { .grade { grid-template-columns: 300px 1fr 320px; height: calc(100dvh - 56px); } .grade > section { overflow: auto; } }
.cartao { background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); padding: 14px; }
.cartao h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: #5b6150; margin: 0 0 10px; }
.lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lista button { width: 100%; text-align: left; background: #f7f9f8; border: 1px solid transparent; border-radius: 10px; padding: 10px; font: inherit; cursor: pointer; display: grid; gap: 4px; }
.lista button[aria-current="true"] { border-color: var(--b-verde); background: #eef6ef; }
.lista .linha1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #5b6150; }
.lista .previa { font-size: 14px; color: #1b1f1d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st.ia { background: #e7ece9; color: #2b2e17; }
.st.aguardando_humano { background: #fde68a; color: #6b4f00; }
.st.humano { background: #d1fadf; color: #05603a; }
.conversa-painel { display: flex; flex-direction: column; gap: 10px; }
.conversa-painel .cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.msgs { display: flex; flex-direction: column; gap: 6px; background: var(--wa-fundo); border-radius: 10px; padding: 12px; min-height: 260px; max-height: 60vh; overflow: auto; }
.msgs .msg { font-size: 14px; }
.resposta { display: flex; gap: 8px; }
.resposta input { flex: 1; }
.resumo { white-space: pre-wrap; font-size: 14px; line-height: 1.5; background: #fffbea; border: 1px solid #f5e3a3; border-radius: 10px; padding: 10px; }
.vazio { color: #6b736e; font-size: 14px; }
.eventos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.eventos li { border-left: 3px solid var(--b-verde); padding: 4px 10px; background: #f7f9f8; border-radius: 6px; }
