/* Chat público do site da AMPLA. Visual do próprio site (preto, prata, Inter); tudo com prefixo ac-. */
.ac-root {
  --ac-bg: #0E0E0E;
  --ac-bg-2: #141414;
  --ac-bg-3: #1A1A1A;
  --ac-line: #2A2A2A;
  --ac-line-2: #424245;
  --ac-ink: #FFFFFF;
  --ac-ink-2: #A1A1A6;
  --ac-silver: #E5E5E7;
  --ac-silver-3: #B8B8BD;
  --ac-silver-5: #86868B;
  --ac-dark: #0A0A0A;
  --ac-ok: #4ADE80;
  --ac-alert: #ff8a73;
  --ac-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ac-font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-family: var(--ac-font);
  line-height: 1.5;
  text-align: left;
}
.ac-root, .ac-root *, .ac-root *::before, .ac-root *::after { box-sizing: border-box; }
.ac-root button, .ac-root input, .ac-root textarea, .ac-root select { font-family: inherit; cursor: pointer; }
.ac-root input, .ac-root textarea, .ac-root select { cursor: text; }
.ac-root select { cursor: pointer; }
.ac-root [hidden] { display: none !important; }
.ac-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botão flutuante. Quando a página já tem um botão próprio no canto (index: "AMPLA AI"), empilha acima dele. */
.ac-abrir {
  position: fixed; right: 16px; bottom: 16px; z-index: 210;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px;
  background: var(--ac-silver); color: var(--ac-dark); font: 600 14px/1 var(--ac-font);
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.6);
  transition: background .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1);
}
.ac-abrir:hover { background: #fff; transform: translateY(-2px); }
.ac-abrir.ac-acima { right: 24px; bottom: 88px; }

.ac-abrir:focus-visible, .ac-fechar:focus-visible, .ac-chip:focus-visible, .ac-enviar:focus-visible, .ac-link:focus-visible,
.ac-campo:focus-visible, .ac-entrada textarea:focus-visible, .ac-check input:focus-visible, .ac-root a:focus-visible {
  outline: 2px solid var(--ac-silver); outline-offset: 2px; box-shadow: none;
}

.ac-painel {
  position: fixed; right: 16px; bottom: 16px; z-index: 320;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ac-bg); color: var(--ac-ink); font-family: var(--ac-font);
  border: 1px solid var(--ac-line); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.8);
}
.ac-topo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--ac-bg-2); border-bottom: 1px solid var(--ac-line); }
.ac-topo-txt { flex: 1; min-width: 0; }
.ac-topo strong { display: block; font-family: var(--ac-font-display); font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.ac-topo small { display: block; font-size: 12.5px; color: var(--ac-ink-2); margin-top: 2px; }
.ac-selo { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--ac-bg-3); border: 1px solid var(--ac-line); color: var(--ac-silver); font: 600 18px/1 var(--ac-font-display); }
.ac-fechar { width: 36px; height: 36px; flex: none; border: 0; border-radius: 999px; background: var(--ac-bg-3); color: var(--ac-ink); font-size: 22px; line-height: 1; }
.ac-fechar:hover { background: var(--ac-line); }

.ac-corpo { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; background: var(--ac-bg); }
.ac-msgs, .ac-cauda { display: flex; flex-direction: column; gap: 10px; }
.ac-msgs:empty, .ac-cauda:empty { display: none; }
.ac-sugestoes { display: flex; flex-direction: column; gap: 8px; }
.ac-chip { text-align: left; padding: 10px 12px; border: 1px solid var(--ac-line); border-radius: 12px; background: var(--ac-bg-2); color: var(--ac-ink); font: inherit; font-size: 14px; line-height: 1.4; }
.ac-chip:hover:not(:disabled) { border-color: var(--ac-silver-5); background: var(--ac-bg-3); }
.ac-chip:disabled { opacity: .5; cursor: not-allowed; }
.ac-chip-forte { border-color: var(--ac-silver-5); font-weight: 600; }

.ac-msg { margin: 0; max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.ac-msg p { margin: 0; white-space: pre-wrap; }
.ac-voce { align-self: flex-end; background: var(--ac-silver); color: var(--ac-dark); border-bottom-right-radius: 4px; }
.ac-contta { align-self: flex-start; background: var(--ac-bg-3); border: 1px solid var(--ac-line); color: var(--ac-ink); border-bottom-left-radius: 4px; }
.ac-aviso { background: var(--ac-bg-2); border-color: var(--ac-line-2); }
.ac-pensando { color: var(--ac-ink-2); font-style: italic; }
.ac-fontes { margin: 8px 0 0; padding: 8px 0 0; list-style: none; border-top: 1px solid var(--ac-line); display: grid; gap: 4px; font-size: 13px; white-space: normal; }
.ac-fontes a, .ac-rodape a, .ac-check a { color: var(--ac-silver); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.ac-marca { display: inline-block; min-width: 26px; padding: 1px 5px; border-radius: 6px; background: var(--ac-line); color: var(--ac-silver); font-weight: 700; font-size: 12px; text-align: center; }
.ac-nota { display: block; margin-top: 6px; font-size: 12px; color: var(--ac-ink-2); }
.ac-link { align-self: flex-start; padding: 4px 0; border: 0; background: none; color: var(--ac-silver); font: 600 14px var(--ac-font); text-decoration: underline; text-underline-offset: 2px; }
a.ac-link { display: inline-block; }

.ac-contato { display: grid; gap: 8px; padding: 12px; background: var(--ac-bg-2); border: 1px solid var(--ac-line); border-radius: 12px; }
.ac-contato strong { font-size: 14.5px; font-weight: 600; }
.ac-campo { width: 100%; min-height: 42px; padding: 0 10px; font: inherit; font-size: 16px; color: var(--ac-ink); background: var(--ac-bg); border: 1px solid var(--ac-line-2); border-radius: 10px; }
.ac-campo::placeholder, .ac-entrada textarea::placeholder { color: var(--ac-silver-5); }
.ac-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--ac-ink-2); cursor: pointer; }
.ac-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ac-silver); cursor: pointer; }
.ac-erro { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ac-alert); }
.ac-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ac-entrada { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--ac-line); background: var(--ac-bg-2); }
.ac-entrada textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ac-ink); border: 1px solid var(--ac-line-2); border-radius: 12px; background: var(--ac-bg); }
.ac-entrada textarea:disabled { opacity: .6; cursor: not-allowed; }
.ac-enviar { flex: none; min-height: 42px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--ac-silver); color: var(--ac-dark); font: 600 14px var(--ac-font); }
.ac-enviar:hover:not(:disabled) { background: #fff; }
.ac-enviar:disabled { opacity: .5; cursor: not-allowed; }

.ac-opcoes { display: grid; gap: 8px; }
.ac-opcoes-linha { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-opcoes-linha .ac-chip { text-align: center; padding: 10px 6px; }
.ac-valor { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--ac-bg-2); border: 1px solid var(--ac-line); border-radius: 12px; }
.ac-valor > span { font-weight: 700; color: var(--ac-ink-2); }
.ac-valor .ac-campo { flex: 1; min-width: 0; width: auto; }
.ac-valor .ac-uf { flex: none; width: 76px; }
.ac-valor .ac-erro { flex-basis: 100%; }
.ac-oferta { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--ac-bg-3); border: 1px solid var(--ac-line-2); }
.ac-oferta p { margin: 0; font-size: 14px; line-height: 1.5; }
.ac-oferta-botoes { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ac-resultado { display: grid; gap: 8px; padding: 14px; background: var(--ac-bg-2); border: 1px solid var(--ac-silver-5); border-radius: 12px; }
.ac-resultado > small { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ac-ink-2); }
.ac-resultado > strong { font-family: var(--ac-font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; color: var(--ac-ink); }
.ac-resultado dl { margin: 0; display: grid; gap: 4px; }
.ac-resultado dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--ac-line); }
.ac-resultado dt { color: var(--ac-ink-2); }
.ac-resultado dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.ac-economia dd { color: var(--ac-ok); }
.ac-resultado p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ac-ink-2); }
.ac-rodape { margin: 0; padding: 0 12px 10px; font-size: 11.5px; line-height: 1.45; color: var(--ac-ink-2); background: var(--ac-bg-2); }

.ac-escrevendo p::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--ac-silver); animation: ac-pisca 1s steps(2) infinite; }
@keyframes ac-pisca { to { opacity: 0; } }

@media (max-width: 560px) {
  .ac-painel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100dvh - 16px); border-radius: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ac-painel { animation: ac-sobe .18s cubic-bezier(.16,1,.3,1); }
  @keyframes ac-sobe { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .ac-escrevendo p::after { animation: none; }
  .ac-abrir { transition: none; }
  .ac-abrir:hover { transform: none; }
}

/* ── 30/11 (noite): conversa de verdade — um campo por vez, respostas rápidas, toque de 44px ─────── */
.ac-entrada .ac-linha { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ac-ink); border: 1px solid var(--ac-line-2); border-radius: 12px; background: var(--ac-bg); cursor: text; }
.ac-entrada .ac-linha::placeholder { color: var(--ac-silver-5); }
.ac-entrada .ac-linha:disabled { opacity: .6; cursor: not-allowed; }
.ac-entrada .ac-linha:focus-visible { outline: 2px solid var(--ac-silver); outline-offset: 2px; }
.ac-entrada textarea[hidden], .ac-entrada .ac-linha[hidden] { display: none; }
.ac-chip, .ac-enviar, .ac-link { min-height: 44px; }
.ac-fechar { width: 44px; height: 44px; }
.ac-chip { overflow-wrap: anywhere; }
.ac-opcoes .ac-chip { display: flex; align-items: center; }
.ac-opcoes-linha { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.ac-opcoes-linha .ac-chip { justify-content: center; }
.ac-msg .ac-nota a { color: var(--ac-silver); text-decoration: underline; text-underline-offset: 2px; }
.ac-corpo { scroll-padding-bottom: 12px; }
@media (max-width: 560px) {
  .ac-entrada { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* 01/12/2026: no celular e no tablet o botão do chat é só o ícone, para não cobrir os campos da página. */
@media (max-width: 1024px) {
  .ac-abrir { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 999px; }
  .ac-abrir span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Rodapé com folga no pé: o botão do chat nunca cobre a última linha (30/11/2026). */
@media (max-width: 1024px) { footer::after { content: ""; display: block; height: 76px; } }

/* ── 01/12/2026: visual v2 — tela de app, estilo mensageiro simplificado ─────────────────────────────
   Painel fixo no computador (sem fundo escurecido); tela inteira no celular (≤ 680px), com Voltar e X sempre à vista. */
.ac-root { --ac-bolha-bot: #232326; --ac-bolha-voce: linear-gradient(135deg, #E5E5E7 0%, #CFCFD3 100%); --ac-raio-chip: 18px; }

.ac-painel { width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 32px)); border-radius: 16px; box-shadow: 0 24px 64px -16px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.04); }

/* cabeçalho */
.ac-topo { gap: 10px; padding: 10px 12px; min-height: 60px; }
.ac-logo { display: block; height: 32px; width: auto; flex: none; }
.ac-topo-txt strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-topo-txt small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-voltar { display: none; align-items: center; gap: 2px; flex: none; min-height: 44px; padding: 0 10px 0 4px; border: 0; border-radius: 999px; background: transparent; color: var(--ac-ink); font: 600 14px var(--ac-font); }
.ac-voltar:hover { background: var(--ac-bg-3); }
.ac-nova { flex: none; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--ac-ink-2); font: 500 12.5px var(--ac-font); }
.ac-nova:hover { color: var(--ac-ink); background: var(--ac-bg-3); }
.ac-fechar { display: grid; place-items: center; padding: 0; }
.ac-voltar:focus-visible, .ac-nova:focus-visible { outline: 2px solid var(--ac-silver); outline-offset: 2px; }

/* mensagens */
.ac-corpo { padding: 14px 12px 8px; gap: 8px; }
.ac-msgs, .ac-cauda { gap: 8px; }
.ac-msg { max-width: 86%; padding: 8px 12px 6px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; }
.ac-contta { background: var(--ac-bolha-bot); border: 0; border-bottom-left-radius: 4px; }
.ac-voce { background: var(--ac-bolha-voce); color: var(--ac-dark); border-bottom-right-radius: 4px; }
.ac-aviso { background: var(--ac-bolha-bot); box-shadow: inset 0 0 0 1px var(--ac-line-2); }
.ac-hora { display: block; margin-top: 2px; text-align: right; font-size: 11px; line-height: 1.2; letter-spacing: .01em; color: var(--ac-ink-2); opacity: .75; white-space: nowrap; }
.ac-voce .ac-hora { color: #3a3a3d; opacity: .8; }
.ac-nota { font-size: 11.5px; }
.ac-msg .ac-nota { margin-top: 6px; }

/* fontes: rodapé discreto dentro do balão */
.ac-fontes { margin: 8px 0 0; padding: 6px 0 0; gap: 3px; border-top: 1px solid rgba(255,255,255,.12); font-size: 11.5px; line-height: 1.4; color: var(--ac-silver-3); }
.ac-fontes a { color: var(--ac-silver-3); }
.ac-marca { min-width: 0; padding: 0 5px; font-size: 10.5px; border-radius: 5px; background: rgba(255,255,255,.1); color: var(--ac-silver-3); }

/* digitando… */
.ac-pensando { font-style: normal; padding: 12px 14px; }
.ac-pontos { display: inline-flex; align-items: center; gap: 4px; height: 12px; }
.ac-pontos i { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-ink-2); animation: ac-ponto 1.2s ease-in-out infinite; }
.ac-pontos i:nth-child(2) { animation-delay: .15s; }
.ac-pontos i:nth-child(3) { animation-delay: .3s; }
@keyframes ac-ponto { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* respostas rápidas: grade, todas com 36px de altura e o mesmo raio (rótulo longo quebra em linhas, sem cortar o sentido) */
.ac-sugestoes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ac-opcoes, .ac-opcoes-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ac-chip, .ac-opcoes .ac-chip, .ac-opcoes-linha .ac-chip { min-height: 36px; padding: 6px 14px; border-radius: var(--ac-raio-chip); font-size: 13.5px; line-height: 1.3; text-align: center; justify-content: center; display: flex; align-items: center; }
.ac-sugestoes .ac-chip { text-align: left; justify-content: flex-start; }
.ac-chip-longo { grid-column: 1 / -1; }
a.ac-link, .ac-link { min-height: 36px; }

/* campo e botão de enviar: mesma altura (44px), alinhados */
.ac-entrada { align-items: center; gap: 8px; padding: 8px 12px; }
.ac-entrada textarea { height: 44px; min-height: 44px; max-height: 44px; padding: 11px 16px; line-height: 20px; border-radius: 22px; overflow-y: auto; }
.ac-entrada .ac-linha { height: 44px; padding: 0 16px; border-radius: 22px; }
.ac-enviar { display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.ac-enviar svg { display: block; }
.ac-rodape { padding: 0 14px 10px; font-size: 11px; }

/* celular: tela inteira, nada do site atrás; altura acompanha o teclado (--ac-vh vem do visualViewport) */
@media (max-width: 680px) {
  html.ac-travado, html.ac-travado body { overflow: hidden; overscroll-behavior: none; }
  .ac-painel {
    position: fixed; z-index: 100000; inset: auto; left: 0; right: 0; top: var(--ac-top, 0px); bottom: auto;
    width: 100%; max-width: none; height: var(--ac-vh, 100dvh);
    border: 0; border-radius: 0; box-shadow: none; background: var(--ac-bg);
  }
  .ac-topo { padding: max(8px, env(safe-area-inset-top)) 8px 8px; }
  .ac-voltar { display: inline-flex; padding: 0 6px; }
  .ac-voltar-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ac-topo-txt small, .ac-so-desk { display: none; }
  .ac-msg { max-width: 90%; }
  .ac-entrada { padding: 8px 12px; }
  .ac-rodape { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-pontos i { animation: none; opacity: .7; }
}
