:root {
  --ap-canvas: #f3f1ec;
  --ap-surface: #ffffff;
  --ap-text: #172027;
  --ap-muted: #5f6b73;
  --ap-border: #d1d7db;
  --ap-primary: #a63d00;
  --ap-accent: #f47a2a;
  --ap-graphite: #202931;
  --ap-focus: #147eb3;
  --ap-success: #237a52;
  --ap-danger: #b42318;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
body {
  height: 100dvh;
  overflow: hidden;
  color: var(--ap-text);
  background:
    radial-gradient(circle at 14% 18%, rgba(244,122,42,.13), transparent 25rem),
    linear-gradient(145deg, #14181d, #27313a);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--ap-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.ap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ap-salto { position: fixed; left: 12px; top: -60px; z-index: 100; background: #fff; color: #000; padding: 10px; }
.ap-salto:focus { top: 12px; }

#ai-fone {
  position: relative;
  display: flex;
  flex-direction: column;
  /* A moldura ENCHE a vertical. Estava travada em min(900px, ...) e num ecra de
     desktop alto o tecto era 900px — ficava um telemovel pequeno no meio de um
     ecra grande. Agora a altura manda e a largura DERIVA dela, para continuar a
     parecer um telemovel em vez de uma tira: 0.48 da altura e a proporcao de um
     aparelho moderno. O clamp impede os dois extremos — nem estreito demais num
     ecra baixo, nem largo demais num ecra muito alto. */
  /* `--ap-vv` e a altura do viewport VISUAL, escrita pelo JS a partir do
     `visualViewport`. O `100dvh` e o fallback para quem nao o tem — e e
     exactamente o valor que mente quando o teclado do telemovel sobe. */
  --ap-altura: calc(var(--ap-vv, 100dvh) - 20px);
  width: clamp(320px, min(calc(var(--ap-altura) * 0.48), calc(100vw - 24px)), 560px);
  height: var(--ap-altura);
  margin: 10px auto;
  overflow: hidden;
  color: var(--ap-text);
  background: var(--ap-canvas);
  border-radius: 44px;
  box-shadow: 0 0 0 10px #090b0d, 0 0 0 12px #38434b, 0 28px 80px rgba(0,0,0,.55);
  transform: translateZ(0);
}
#ai-fone::before {
  content: "";
  position: absolute;
  z-index: 30;
  top: 10px;
  left: 50%;
  width: 106px;
  height: 25px;
  border-radius: 999px;
  background: #090b0d;
  transform: translateX(-50%);
}
#ai-fone::after {
  content: "";
  position: absolute;
  z-index: 30;
  bottom: 7px;
  left: 50%;
  width: 116px;
  height: 5px;
  border-radius: 999px;
  background: #222a30;
  opacity: .32;
  transform: translateX(-50%);
}

.ap-topo {
  min-height: 84px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 38px 20px 12px;
  color: #fff;
  background: var(--ap-graphite);
}
.ap-marca { display: flex; align-items: center; gap: 10px; padding: 0; color: inherit; border: 0; background: none; text-align: left; cursor: pointer; }
.ap-marca-sinal { width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid var(--ap-accent); border-radius: 10px; color: var(--ap-accent); font-size: .72rem; font-weight: 900; letter-spacing: -.03em; }
.ap-marca strong, .ap-marca small { display: block; }
.ap-marca strong { font-size: 1rem; line-height: 1.05; }
.ap-marca small { margin-top: 3px; color: #bdc5ca; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.ap-topo-acoes { display: flex; align-items: center; gap: 8px; }
.ap-icone, .ap-carrinho { min-width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; }
.ap-icone { font-size: .68rem; letter-spacing: -2px; }
.ap-carrinho { position: relative; }
.ap-carrinho svg { width: 22px; height: 22px; }
.ap-carrinho span { position: absolute; right: -4px; top: -5px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--ap-graphite); border-radius: 999px; color: #fff; background: #8f3509; font-size: .68rem; font-weight: 800; }

.ap-home, .ap-dados, .ap-assistente { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 20px 150px; }
.ap-kicker, .ap-tela-topo p { margin: 0 0 7px; color: var(--ap-primary); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.ap-home h1 { max-width: 350px; margin: 0; color: var(--ap-graphite); font-size: clamp(1.75rem, 6.3vw, 2.3rem); line-height: 1.04; letter-spacing: -.045em; }
.ap-intro { max-width: 335px; margin: 13px 0 23px; color: var(--ap-muted); font-size: .94rem; line-height: 1.48; }
.ap-retomar { width: 100%; margin: 14px 0 0; padding: 11px 13px; display: block; text-align: left;
  border: 1px solid rgba(244,122,42,.35); border-radius: 15px; color: var(--ap-text);
  background: linear-gradient(135deg, rgba(244,122,42,.13), rgba(244,122,42,.05)); cursor: pointer; }
.ap-retomar strong { display: block; font-size: .82rem; line-height: 1.3; }
.ap-retomar small { display: block; margin-top: 3px; color: var(--ap-muted); font-size: .72rem; }
.ap-menu { display: grid; gap: 10px; }
.ap-menu-item {
  width: 100%; min-height: 70px; display: grid; grid-template-columns: 50px 1fr 18px; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--ap-border); border-radius: 18px; color: var(--ap-text); background: var(--ap-surface); text-align: left; cursor: pointer;
  box-shadow: 0 5px 14px rgba(32,41,49,.05);
}
.ap-menu-item:hover { border-color: #b9a89e; transform: translateY(-1px); }
.ap-menu-item > span:nth-child(2) { min-width: 0; }
.ap-menu-item strong, .ap-menu-item small { display: block; }
.ap-menu-item strong { font-size: .94rem; }
.ap-menu-item small { margin-top: 3px; overflow: hidden; color: var(--ap-muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.ap-menu-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, var(--ap-primary), #732b05); }
.ap-menu-icon svg { width: 25px; height: 25px; }

.ap-dados, .ap-assistente { padding-top: 18px; }
.ap-tela-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ap-tela-topo p { margin-bottom: 3px; }
.ap-tela-topo h2 { margin: 0; color: var(--ap-graphite); font-size: 1.35rem; }
.ap-voltar { width: 46px; height: 46px; flex: 0 0 auto; border: 1px solid var(--ap-border); border-radius: 15px; color: var(--ap-graphite); background: var(--ap-surface); font-size: 2rem; line-height: 1; cursor: pointer; }
.ap-tela-corpo { display: grid; gap: 12px; }
.ap-contexto-aviso { margin: 0; padding: 11px 13px; border: 1px solid var(--ap-border); border-radius: 12px; color: var(--ap-text); background: var(--ap-surface); font-size: .8rem; }
.ap-cart-thread .ap-card-details .ap-btn { margin-top: 10px; }
.ap-loading { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--ap-muted); }
.ap-loading::before { content: ""; width: 18px; height: 18px; border: 2px solid var(--ap-border); border-top-color: var(--ap-accent); border-radius: 50%; animation: ap-spin .8s linear infinite; }

.ap-card { overflow: hidden; border: 1px solid var(--ap-border); border-radius: 18px; background: var(--ap-surface); box-shadow: 0 5px 18px rgba(32,41,49,.06); }
.ap-card-main { display: flex; align-items: center; gap: 13px; padding: 14px; }
.ap-card-img { width: 76px; height: 64px; flex: 0 0 76px; object-fit: contain; border-radius: 12px; background: #f7f7f4; }
.ap-card-fallback { width: 76px; height: 64px; flex: 0 0 76px; display: grid; place-items: center; border-radius: 12px; color: var(--ap-muted); background: #ecebe6; }
.ap-card-copy { min-width: 0; flex: 1; }
.ap-card-copy strong { display: block; line-height: 1.25; }
.ap-card-copy small { display: block; margin-top: 4px; color: var(--ap-muted); line-height: 1.35; }
.ap-tag { display: inline-flex; margin-top: 7px; padding: 4px 8px; border-radius: 999px; color: var(--ap-success); background: #e7f4ed; font-size: .68rem; font-weight: 800; }
.ap-card-details { padding: 0 14px 14px; border-top: 1px solid #ecece8; }
.ap-card-details summary { min-height: 44px; display: flex; align-items: center; color: var(--ap-primary); font-size: .8rem; font-weight: 750; cursor: pointer; }
.ap-item-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #ecece8; }
/* ── FACTO DA FICHA: rótulo em cima, valor em baixo ──────────────────────
   A ficha usava `.ap-item-row`, que é a linha de um cartão COM FOTO: três
   colunas, a primeira de 50 px. Sem foto, o rótulo caía nessa coluna e «Vai
   bem com» partia-se em três linhas ao lado do texto — foi o que o curador
   viu. Um rótulo não é uma miniatura. */
.ap-facto { padding: 9px 0; border-top: 1px solid var(--ap-border); }
.ap-facto:first-child { border-top: 0; }
.ap-facto b { display: block; margin-bottom: 3px; color: var(--ap-muted); font-size: .66rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.ap-facto span { display: block; font-size: .76rem; line-height: 1.4; }
.ap-facto span + span { margin-top: 5px; }
.ap-item-row img { width: 50px; height: 50px; object-fit: contain; border-radius: 9px; background: #f7f7f4; }
.ap-item-row strong { font-size: .8rem; line-height: 1.25; }
.ap-item-row small { color: var(--ap-muted); font-size: .7rem; }
.ap-empty { padding: 24px 18px; border: 1px dashed #b8bec2; border-radius: 18px; color: var(--ap-muted); background: rgba(255,255,255,.55); text-align: center; line-height: 1.5; }
/* ── O PAGAMENTO FINGIDO, E O BOTÃO QUE COMPRA ──────────────────────────
   Um cartão já guardado é o que torna o «um clique» verdadeiro: não há forma
   de pagar nesta demo, e fingir o formulário seria pior do que assumir o
   fingimento. A linha por baixo do botão di-lo à pessoa. */
.ap-pagamento { display: grid; grid-template-columns: 46px 1fr; gap: 11px; align-items: center; margin: 10px 0 12px; padding: 10px 12px; border: 1px solid var(--ap-border); border-radius: 14px; }
.ap-pagamento .ap-cartao { display: grid; place-items: center; height: 30px; border-radius: 6px; background: linear-gradient(135deg,#1a1f71,#436fd6); color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .06em; }
.ap-pagamento strong { display: block; font-size: .8rem; }
.ap-pagamento small { display: block; margin-top: 2px; color: var(--ap-muted); font-size: .68rem; }
.ap-btn-comprar { width: 100%; min-height: 50px; font-size: .95rem; }
.ap-nota-fecho { margin: 8px 2px 0; color: var(--ap-muted); font-size: .66rem; text-align: center; }
.ap-cart-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; font-size: 1rem; }
.ap-error { padding: 14px; border: 1px solid #f1b9b5; border-radius: 14px; color: var(--ap-danger); background: #fff0ef; }
.ap-note { padding: 14px; border-left: 4px solid var(--ap-accent); border-radius: 0 14px 14px 0; color: #3e474e; background: #fff7ee; line-height: 1.45; }

.ap-assistente { display: flex; flex-direction: column; padding-bottom: 132px; }
.ap-conversa-topo { flex: 0 0 auto; }
.ap-feed { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 4px 2px 12px; }
/* A CONVERSA ENCOSTA AO FUNDO. Queixa do curador (2026-09-20): «ainda está com
   um espaço morto enorme entre o fim da conversa e o orbe». Era o feed a crescer
   de cima para baixo dentro de uma caixa alta: com três mensagens, dois terços
   do ecrã ficavam vazios POR BAIXO delas — o contrário do que um chat faz.
   `margin-top:auto` no primeiro filho empurra tudo para baixo e continua a
   rolar quando enche (ao contrário de `justify-content:flex-end`, que corta o
   topo do conteudo transbordado). */
.ap-feed > *:first-child { margin-top: auto; }
.ap-bubble { max-width: 92%; padding: 12px 14px; border-radius: 18px 18px 18px 5px; color: var(--ap-text); background: var(--ap-surface); box-shadow: 0 3px 12px rgba(32,41,49,.08); line-height: 1.43; }
.ap-bubble-user { align-self: flex-end; border-radius: 18px 18px 5px 18px; color: #fff; background: var(--ap-graphite); }
/* TRÊS OPÇÕES TÊM DE CABER NO ECRÃ (curador 2026-09-20). O cartão antigo gastava
   ~160 px: foto de 76, quatro linhas de texto e um botão numa linha só para si.
   Agora são três colunas — número+foto, texto, preço — e o cartão INTEIRO é o
   alvo do toque. O preço vai à direita porque é por ele que se compara. */
.ap-peca { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 11px; max-width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--ap-border); border-radius: 14px; background: #fff; cursor: pointer; }
.ap-peca:hover, .ap-peca:focus-visible { border-color: var(--ap-primary); }
.ap-peca-foto { position: relative; width: 54px; height: 54px; }
.ap-peca img { width: 54px !important; height: 54px !important; max-width: 54px !important; object-fit: contain !important; border-radius: 10px; background: #f7f7f4; }
/* O NÚMERO é a alça da voz: dizer «a segunda» é o gesto de apontar, ao telefone. */
.ap-peca-ordem { position: absolute; left: -4px; top: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; color: #fff; background: var(--ap-primary); font-size: .66rem; font-weight: 800; line-height: 19px; text-align: center; }
.ap-peca-corpo { min-width: 0; }
.ap-peca-nome { font-size: .8rem; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ap-peca-meta { margin-top: 2px; color: var(--ap-muted); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-peca-preco { color: var(--ap-primary); font-weight: 850; font-size: .95rem; white-space: nowrap; }
.ap-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ap-btn { min-height: 44px; padding: 9px 13px; border: 0; border-radius: 12px; color: #fff; background: var(--ap-primary); font-weight: 750; cursor: pointer; }
.ap-btn-sec { border: 1px solid var(--ap-border); color: var(--ap-text); background: #fff; }
/* O teclado e a excecao, nao o estado inicial: a voz e a experiencia de entrada.
   Quem manda abrir e o atributo no body, escrito por UM sitio so no JS. */
.ap-texto-form { flex: 0 0 auto; display: none; gap: 8px; margin-top: 8px; }
body[data-teclado="sim"] .ap-texto-form { display: flex; }
/* COM O TECLADO ABERTO, O ORBE SAI DA FRENTE. Ele flutua por cima do fundo do
   ecra (`position:absolute; bottom:13px`) e, com o teclado virtual a comer
   metade da altura, era ele que ficava sobre o campo de escrever. Quem esta a
   escrever nao esta a falar — e o campo passa a ser o dono do fundo. */
body[data-teclado="sim"] .ap-voice-dock { display: none; }
body[data-teclado="sim"] .ap-assistente { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.ap-texto-form input { min-width: 0; flex: 1; min-height: 46px; padding: 0 14px; border: 1px solid var(--ap-border); border-radius: 14px; color: var(--ap-text); background: #fff; }
.ap-texto-form button { min-height: 46px; padding: 0 15px; border: 0; border-radius: 14px; color: #fff; background: var(--ap-primary); font-weight: 750; cursor: pointer; }

.ap-tabela-wrap { overflow-x: auto; }
.ap-tabela { width: 100%; border-collapse: collapse; font-size: .78rem; }
.ap-tabela caption { text-align: left; padding: 0 0 6px; font-weight: 750; }
.ap-tabela th, .ap-tabela td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--ap-border); vertical-align: top; }
.ap-tabela th { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ap-muted); }
.ap-tabela td small { display: block; color: var(--ap-muted); }
.ap-tabela-fonte { margin: 6px 0 0; font-size: .68rem; color: var(--ap-muted); }
/* O cartao de CONFIRMACAO: a evidencia visual do que se esta a confirmar.
   Carro ou peca, o desenho e o mesmo — confirmar e sempre o mesmo gesto. */
/* A nota de compatibilidade cabe numa linha: ela existe para tirar a dúvida
   «mas isto diz outro modelo», não para ocupar o cartão. O resto lê-se ao tocar. */
.ap-peca .ap-peca-nota { margin-top: 3px; padding: 2px 6px; font-size: .64rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.ap-peca-nota { margin-top: 5px; padding: 5px 7px; border-radius: 8px; background: rgba(77,214,255,.08); border: 1px solid rgba(77,214,255,.18); font-size: .7rem; line-height: 1.35; color: var(--ap-text); }
.ap-confirma { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; padding: 9px; border: 1px solid var(--ap-border); border-radius: 14px; }
.ap-confirma img, .ap-confirma .ap-card-fallback { flex: 0 0 84px; width: 84px; height: 62px; object-fit: cover; border-radius: 10px; }
.ap-confirma-corpo { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-confirma-corpo strong { font-size: .84rem; line-height: 1.25; }
.ap-confirma-corpo small { color: var(--ap-muted); font-size: .72rem; }
.ap-confirma-pergunta { margin: 4px 0 0; font-size: .78rem; }
.ap-confirma-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ap-card--conversa { border-style: dashed; opacity: .92; }
.ap-card--conversa .ap-tag { color: var(--ap-muted); }
.ap-voice-dock { position: absolute; z-index: 20; left: 0; right: 0; bottom: 13px; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ap-voice-dock::before { content: ""; position: absolute; inset: -26px 0 -20px; z-index: -1; background: linear-gradient(transparent, var(--ap-canvas) 35%); }
#ap-voice-hint { margin: 0 0 7px; color: var(--ap-muted); font-size: .72rem; font-weight: 650; }
.ap-dock-linha { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ap-teclado { position: absolute; left: 100%; top: 50%; margin-left: 14px; transform: translateY(-50%); pointer-events: auto; }
.ap-teclado[aria-expanded="true"] { border-color: var(--ap-accent); color: var(--ap-accent); }
.ap-orbe { position: relative; width: 82px; height: 82px; border-radius: 50%; pointer-events: auto; filter: drop-shadow(0 10px 14px rgba(166,61,0,.27)); }
.ap-orbe::before, .ap-orbe-miolo { content: ""; position: absolute; border-radius: 50%; }
.ap-orbe::before { inset: 0; background: conic-gradient(from 20deg, #ffb26f, var(--ap-accent), #7f2c00, #ffcf9f, #d5510a, #ffb26f); animation: ap-turn 9s linear infinite; }
.ap-orbe-miolo { inset: 12px; background: radial-gradient(circle at 38% 30%, #ffc99b, #ef6b20 35%, #712800 72%, #1d2227); box-shadow: inset 0 0 18px rgba(255,255,255,.35); }
#btn-circulo { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
/* ── O ORB PULSA COM A FALA ─────────────────────────────────────────────
   Padrao do Carlo no BP OS, medido em style.css:3235-3238: `--lvl` e o nivel
   da voz que SAI e `--mic` o do microfone que ENTRA; escala e brilho derivam
   deles, e a rotacao acelera com o nivel.
   As cores sao o sinal de QUEM fala, e por isso sao diferentes:
     SAIDA  (falando) — ambar/laranja, a cor da marca desta vertical
     ENTRADA (ouvindo) — verde-agua, para se distinguir de relance
   Quem olha de longe sabe se o balcao esta a falar ou a ouvir, sem ler nada. */
/* ── A ESPERA, COMO AS DUAS CASAS QUE JÁ A RESOLVERAM ────────────────────
   No canal do SFV é `#ai-pensando`: TRÊS PONTOS a pulsar, e mais nada — sem
   relógio, sem barra, sem percentagem. No Carlo do HSFA é o mesmo princípio
   do outro lado: a persona diz «NUNCA invente números» e o que se ouve são
   clipes prontos, escolhidos por INTENÇÃO, nunca uma frase composta na hora.
   O anel que eu tinha posto aqui prometia um fim que ninguém controla, e o
   relógio ao lado dele convidava o modelo a inventar segundos — foi o que
   aconteceu («me dá uns 7 segundinhos»). Sai o anel, sai o relógio. */
.ap-espera-pontos { display: flex; gap: 6px; justify-content: center; margin-top: 6px; height: 8px; }
.ap-espera-pontos i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ap-accent, #4dd6ff);
  opacity: .38; animation: ap-pulso 1.1s ease-in-out infinite;
}
.ap-espera-pontos i:nth-child(2) { animation-delay: .16s; }
.ap-espera-pontos i:nth-child(3) { animation-delay: .32s; }
@keyframes ap-pulso { 0%,100% { transform: translateY(0); opacity: .38; } 50% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ap-espera-pontos i { animation: none; opacity: .6; } }
.ap-espera-linha { color: var(--ap-muted); font-style: italic; margin: 2px 0 0; }
#ap-progresso { position:absolute; inset:-8px; pointer-events:none; }
#ap-progresso svg { width:100%; height:100%; transform:rotate(-90deg); }
#ap-progresso circle { fill:none; stroke:var(--ap-accent); stroke-width:3; stroke-linecap:round; stroke-dasharray:100; stroke-dashoffset:calc(100 - var(--espera, 0)); transition:stroke-dashoffset .2s linear; }
#ap-progresso[data-estado="concluido"] circle { stroke:#54c88a; }
#ap-progresso[data-estado="erro"] circle { stroke:#ff5c5c; stroke-dashoffset:0; opacity:.6; }
#ap-espera-legenda { display:block; margin-top:8px; text-align:center; color:var(--ap-muted); font-size:12px; }
@media (prefers-reduced-motion: reduce) { #ap-progresso circle { transition:none; } }
.ap-orbe { --lvl: 0; --mic: 0; transition: transform .09s ease-out, filter .12s ease-out; }
.ap-orbe.falando {
  transform: scale(calc(1 + var(--lvl) * 0.30));
  filter: drop-shadow(0 0 calc(6px + var(--lvl) * 30px) rgba(255, 150, 60, calc(.45 + var(--lvl) * .55)))
          drop-shadow(0 0 calc(2px + var(--lvl) * 12px) rgba(255, 96, 0, .6));
}
.ap-orbe.ouvindo {
  transform: scale(calc(1 + var(--mic) * 0.16));
  filter: drop-shadow(0 0 calc(5px + var(--mic) * 20px) rgba(60, 220, 180, calc(.4 + var(--mic) * .5)))
          drop-shadow(0 0 calc(2px + var(--mic) * 8px) rgba(0, 200, 150, .55));
}
.ap-orbe.falando::before { animation-duration: 6s; }
.ap-orbe.ouvindo::before { animation-duration: 6s; }
/* as barras de nivel acompanham o mesmo sinal, em vez de animarem sozinhas */
.ap-orbe.falando .ap-orbe-niveis i { transform: scaleY(calc(.3 + var(--lvl) * 2.4)); }
.ap-orbe.ouvindo .ap-orbe-niveis i { transform: scaleY(calc(.3 + var(--mic) * 1.6)); }
@media (prefers-reduced-motion: reduce) {
  .ap-orbe.falando, .ap-orbe.ouvindo { transform: none; transition: none; }
}
.ap-orbe[data-estado="ouvindo"]::before { animation-duration: 1.8s; }
.ap-orbe[data-estado="ouvindo"] { transform: scale(1.04); }
.ap-orbe[data-estado="executando"] { animation: ap-pulse 1.2s ease-in-out infinite; }
.ap-orbe[data-estado="erro"] { filter: grayscale(.5) drop-shadow(0 8px 12px rgba(180,35,24,.25)); }

@keyframes ap-spin { to { transform: rotate(360deg); } }
@keyframes ap-turn { to { transform: rotate(360deg); } }
@keyframes ap-pulse { 50% { transform: scale(.94); opacity: .82; } }

@media (max-width: 759px), (max-height: 699px) {
  body { background: var(--ap-canvas); }
  #ai-fone { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; box-shadow: none; }
  #ai-fone::before, #ai-fone::after { display: none; }
  .ap-topo { min-height: 68px; align-items: center; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  .ap-home, .ap-dados, .ap-assistente { padding-left: 16px; padding-right: 16px; }
  .ap-voice-dock { bottom: max(9px, env(safe-area-inset-bottom)); }
}

@media (max-height: 800px) {
  .ap-home { padding-top: 16px; }
  .ap-home h1 { font-size: 1.72rem; }
  .ap-intro { margin: 9px 0 14px; }
  .ap-menu { gap: 7px; }
  .ap-menu-item { min-height: 62px; }
  .ap-menu-icon { width: 42px; height: 42px; }
  .ap-orbe { width: 70px; height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Oficina noturna de precisão: drift culture só na luz, na pista e no movimento. */
:root {
  --ap-canvas: #090d12;
  --ap-surface: #111821;
  --ap-raised: #18222c;
  --ap-text: #f2f5f7;
  --ap-muted: #98a6b3;
  --ap-border: #2a3743;
  --ap-primary: #f47a2a;
  --ap-accent: #4dd6ff;
  --ap-graphite: #090d12;
  --ap-focus: #7ee6ff;
  --ap-success: #3bd18a;
}

body {
  color: var(--ap-text);
  background: radial-gradient(circle at 15% 15%, #202b36, #090d12 48%, #05070a);
}
#ai-fone {
  isolation: isolate;
  color: var(--ap-text);
  background: var(--ap-canvas);
  box-shadow: 0 0 0 10px #030507, 0 0 0 12px #25313c, 0 28px 90px rgba(0,0,0,.72), 0 0 42px rgba(77,214,255,.08);
}
#ai-fone > :not(.ap-ambiente):not(.ap-motion-stage):not(.ap-simbolos) { position: relative; z-index: 2; }
.ap-ambiente { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: linear-gradient(165deg, rgba(255,255,255,.025), transparent 32%); }
.ap-fumaca { position: absolute; width: 320px; height: 180px; border-radius: 50%; opacity: .15; filter: blur(34px); background: radial-gradient(ellipse, rgba(127,148,164,.38), transparent 68%); }
.ap-fumaca-a { left: -150px; bottom: 18%; transform: rotate(12deg); }
.ap-fumaca-b { right: -190px; top: 24%; opacity: .1; transform: rotate(-18deg); }
.ap-luz { position: absolute; width: 1px; height: 56%; opacity: .18; }
.ap-luz-a { right: 16%; top: 8%; background: linear-gradient(transparent, var(--ap-accent), transparent); box-shadow: 0 0 20px var(--ap-accent); }
.ap-luz-b { left: 8%; bottom: -6%; height: 42%; background: linear-gradient(transparent, var(--ap-primary), transparent); box-shadow: 0 0 18px var(--ap-primary); transform: rotate(24deg); }

.ap-topo {
  min-height: 82px;
  border-bottom: 1px solid rgba(77,214,255,.16);
  background: linear-gradient(180deg, rgba(9,13,18,.97), rgba(9,13,18,.86));
}
.ap-marca { gap: 9px; }
.ap-logo { width: 104px; height: auto; display: block; opacity: .96; }
.ap-vertical { padding-left: 9px; border-left: 1px solid rgba(255,255,255,.22); color: #c8d1d8; font-size: .61rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.ap-icone, .ap-carrinho { border-color: rgba(77,214,255,.2); border-radius: 12px; background: rgba(17,24,33,.88); }
.ap-icone { letter-spacing: normal; }
.ap-icone svg { width: 21px; height: 21px; }
.ap-som-off, .ap-icone[aria-pressed="false"] .ap-som-on { display: none; }
.ap-icone[aria-pressed="false"] .ap-som-off { display: block; }
.ap-carrinho::before { content: ""; position: absolute; inset: -4px; border: 1px solid transparent; border-radius: 15px; opacity: 0; box-shadow: 0 0 16px rgba(77,214,255,.55); transition: opacity .2s ease; }
.ap-carrinho.ap-cart-pulse::before { opacity: 1; }

.ap-kicker, .ap-tela-topo p { color: var(--ap-accent); }
.ap-home h1, .ap-tela-topo h2 { color: var(--ap-text); }
.ap-home h1 { margin-bottom: 27px; }
.ap-intro { color: var(--ap-muted); }
.ap-menu { gap: 0; border-top: 1px solid var(--ap-border); }
.ap-menu-item {
  min-height: 68px;
  grid-template-columns: 38px 1fr 18px;
  gap: 12px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--ap-border);
  border-radius: 0;
  color: var(--ap-text);
  background: transparent;
  box-shadow: none;
}
.ap-menu-item:hover { border-color: var(--ap-accent); background: linear-gradient(90deg, rgba(77,214,255,.06), transparent 62%); transform: none; }
.ap-menu-icon { width: 34px; height: 34px; border: 1px solid rgba(77,214,255,.35); border-radius: 50%; color: var(--ap-accent); background: rgba(77,214,255,.05); }
.ap-menu-icon svg { width: 18px; height: 18px; }
.ap-menu-item small { color: var(--ap-muted); }

.ap-voltar { border-color: var(--ap-border); color: var(--ap-text); background: var(--ap-surface); }
.ap-card { border-color: var(--ap-border); color: var(--ap-text); background: rgba(17,24,33,.94); box-shadow: none; }
.ap-card-img, .ap-item-row img { background: #eef1f2; }
.ap-card-fallback { color: var(--ap-muted); background: var(--ap-raised); }
.ap-card-copy small, .ap-item-row small { color: var(--ap-muted); }
.ap-card-details, .ap-item-row { border-color: var(--ap-border); }
.ap-tag { color: var(--ap-success); background: rgba(59,209,138,.1); }
.ap-empty { border-color: var(--ap-border); color: var(--ap-muted); background: rgba(17,24,33,.72); }
.ap-note { border-color: var(--ap-accent); color: #cbd5dc; background: rgba(77,214,255,.06); }
.ap-error { border-color: rgba(255,92,92,.45); color: #ffb2b2; background: rgba(120,24,24,.2); }

.ap-feed { gap: 2px; padding-inline: 4px; }
.ap-bubble {
  max-width: 94%;
  margin: 5px 0 10px;
  padding: 3px 4px 3px 13px;
  border-left: 1px solid rgba(77,214,255,.45);
  border-radius: 0;
  color: #e3e9ed;
  background: transparent;
  box-shadow: none;
  line-height: 1.52;
}
.ap-bubble::before { display: none; }
.ap-bubble-user { align-self: flex-end; max-width: 82%; padding: 7px 11px; border: 1px solid rgba(244,122,42,.24); border-radius: 14px 14px 3px 14px; color: #f7f7f4; background: rgba(244,122,42,.08); }
.ap-bubble-user::before, .ap-bubble--resultado::before { display: none; }
.ap-bubble--resultado { width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0; }
.ap-peca {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  max-width: 100%;
  margin: 0;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--ap-border);
  border-radius: 0;
  color: var(--ap-text);
  background: transparent;
}
.ap-peca:active { background: rgba(255,255,255,.04); }
.ap-peca-foto { width: 46px; height: 46px; }
.ap-peca img { width: 46px !important; height: 46px !important; max-width: 46px !important; border-radius: 8px; background: #eef1f2; }
.ap-peca-ordem { background: var(--ap-accent); color: #10161c; }
.ap-peca-nome { font-size: .82rem; font-weight: 640; }
.ap-peca-meta { color: var(--ap-muted); }
.ap-peca-preco { color: #fff; font-size: .95rem; }
.ap-btn { border-radius: 10px; background: #b94e0b; }
.ap-btn-sec { border-color: var(--ap-border); color: var(--ap-text); background: var(--ap-raised); }
.ap-btn:disabled { opacity: .42; cursor: default; }
.ap-texto-form { padding-top: 9px; border-top: 1px solid var(--ap-border); }
.ap-texto-form input { border-color: var(--ap-border); color: var(--ap-text); background: rgba(17,24,33,.96); }
.ap-texto-form button { background: #b94e0b; }

.ap-voice-dock::before { background: linear-gradient(transparent, var(--ap-canvas) 40%); }
#ap-voice-hint { color: var(--ap-muted); }
.ap-orbe { width: 72px; height: 72px; border-radius: 50%; filter: none; animation: ap-breathe 4s ease-in-out infinite; }
/* ── O SOPRO TEM DE PARAR PARA A VOZ SE VER ──────────────────────────────
   Medido no harness a 2026-09-20: `--lvl` chegava a 0,929 e `--mic` a 0,806,
   as classes `falando`/`ouvindo` entravam e saíam na hora certa — e o orbe
   ficava em `scale(1.002)`. Estava tudo certo menos o que se vê.
   A causa: `ap-breathe` é uma ANIMAÇÃO, e uma animação a correr ganha a uma
   declaração normal de `transform`. O sopro de repouso sobrepunha-se ao pulso
   da fala, sempre. Era o defeito de sempre noutra roupa — o ponteiro existia,
   o efeito não.
   Enquanto há voz, o sopro cala-se e quem manda no orbe é o som. */
.ap-orbe.falando, .ap-orbe.ouvindo { animation: none; }
/* Os dois NEONS, para se saber de relance quem está a falar:
   SAÍDA (o concierge) — âmbar, a cor da marca.
   ENTRADA (a pessoa)  — verde-água, o complementar. */
.ap-orbe.falando {
  box-shadow: 0 0 calc(8px + var(--lvl) * 42px) rgba(255, 150, 60, calc(.35 + var(--lvl) * .55)),
              0 0 calc(3px + var(--lvl) * 16px) rgba(255, 96, 0, .65);
}
.ap-orbe.ouvindo {
  box-shadow: 0 0 calc(7px + var(--mic) * 28px) rgba(60, 220, 180, calc(.32 + var(--mic) * .5)),
              0 0 calc(2px + var(--mic) * 10px) rgba(40, 190, 150, .6);
}
/* o anel e o arco acompanham: giram mais depressa com o nível, como no Carlo */
.ap-orbe.falando .ap-orbe-anel, .ap-orbe.falando .ap-orbe-arco { animation-duration: 2.6s; }
.ap-orbe.ouvindo .ap-orbe-anel, .ap-orbe.ouvindo .ap-orbe-arco { animation-duration: 2.6s; }
.ap-orbe::before { content: none !important; display: none !important; }
.ap-orbe-disco, .ap-orbe-anel, .ap-orbe-arco { position: absolute; border-radius: 50%; pointer-events: none; }
.ap-orbe-disco { inset: 8px; border: 1px solid #263641; background: #10171f; }
.ap-orbe-anel { inset: 2px; border: 2px solid rgba(244,122,42,.75); box-shadow: 0 0 13px rgba(244,122,42,.16); }
.ap-orbe-arco { inset: 0; border: 2px solid transparent; border-top-color: var(--ap-accent); border-right-color: rgba(77,214,255,.24); transform: rotate(-35deg); }
.ap-orbe-niveis { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; }
.ap-orbe-niveis i { width: 2px; height: 11px; border-radius: 2px; background: var(--ap-accent); opacity: .75; }
.ap-orbe-niveis i:nth-child(2) { height: 19px; background: #fff; }
#btn-circulo { border-radius: 50%; }
.ap-orbe[data-estado="ouvindo"] .ap-orbe-arco { animation: ap-turn 2.2s linear infinite; }
.ap-orbe[data-estado="ouvindo"], .ap-orbe[data-estado="executando"], .ap-orbe[data-estado="erro"] { transform: none; filter: none; animation-name: ap-breathe; }
.ap-orbe[data-estado="ouvindo"] .ap-orbe-niveis i { animation: ap-level .8s ease-in-out infinite alternate; }
.ap-orbe[data-estado="ouvindo"] .ap-orbe-niveis i:nth-child(2) { animation-delay: -.25s; }
.ap-orbe[data-estado="ouvindo"] .ap-orbe-niveis i:nth-child(3) { animation-delay: -.5s; }
.ap-orbe[data-estado="executando"] .ap-orbe-arco { animation: ap-turn .9s linear infinite; }
.ap-orbe[data-estado="erro"] .ap-orbe-anel { border-color: #ff5c5c; box-shadow: none; }
@keyframes ap-breathe { 50% { transform: scale(1.025); } }
@keyframes ap-level { to { transform: scaleY(.35); opacity: .45; } }

.ap-motion-stage { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; contain: layout paint; }
.ap-track-line { position: absolute; display: block; opacity: 0; transition: opacity .18s ease; }
.ap-track-horizontal { left: 18px; right: 30px; bottom: 96px; height: 1px; background: repeating-linear-gradient(90deg, rgba(77,214,255,.45) 0 16px, transparent 16px 28px); }
.ap-track-vertical { right: 28px; top: 76px; bottom: 96px; width: 1px; background: repeating-linear-gradient(180deg, rgba(244,122,42,.42) 0 14px, transparent 14px 25px); }
.ap-motion-stage.is-active .ap-track-line { opacity: .55; }
.ap-portal { position: absolute; right: 7px; top: 42px; width: 58px; height: 58px; border: 1px solid rgba(77,214,255,.18); border-radius: 50%; opacity: 0; transform: scale(.82); }
.ap-portal.is-open { animation: ap-portal 1s ease-out both; }
@keyframes ap-portal { 35% { opacity: .65; transform: scale(1); box-shadow: 0 0 12px rgba(77,214,255,.3); } 100% { opacity: 0; transform: scale(1.1); box-shadow: 0 0 4px rgba(77,214,255,.12); } }
.ap-purchase-run { position: absolute; left: 0; top: 0; width: 1px; height: 1px; will-change: transform, opacity; }
/* O NEON POR BAIXO. Duas sombras: a preta que assenta o carro no chão, e a
   colorida — mais aberta e deslocada para baixo — que é a luz a bater no
   asfalto. A cor vem do carro, por isso os quatro modelos brilham cada um da
   sua maneira sem uma linha de CSS por modelo. */
.ap-fx-car { position: absolute; left: 0; top: 0; width: 104px; height: 44px; color: var(--ap-car-color, #b9c6cf);
  filter: drop-shadow(0 5px 4px rgba(0,0,0,.55))
          drop-shadow(0 9px 11px var(--ap-car-neon, transparent))
          drop-shadow(0 3px 22px var(--ap-car-neon, transparent)); }
.ap-car-body { fill: currentColor; }
.ap-car-roof, .ap-car-rack, .ap-car-detail { fill: none; stroke: #cfd8dd; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap-car-glass { fill: #101820; stroke: rgba(77,214,255,.7); stroke-width: 1; }
.ap-car-wheel { fill: #080a0c; stroke: #7f8b94; stroke-width: 2; }
.ap-car-hub { fill: var(--ap-accent); }
/* O BAGAGEIRO 15% MENOR (curador 2026-09-20): 34x26 -> 29x22. O `left` volta a
   centrar no carro de 104 px — (104-29)/2 = 37 — e o `top` sobe para -24 para a
   caixa continuar POUSADA no tejadilho: a base tem de ficar onde estava. */
.ap-fx-package { position: absolute; left: 37px; top: -24px; width: 29px; height: 22px; overflow: hidden; border: 1px solid #d3a56d; border-radius: 3px; background: #b97938; box-shadow: 0 4px 7px rgba(0,0,0,.35); }
.ap-fx-package img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.ap-fx-package::before, .ap-fx-package::after { content: ""; position: absolute; top: 0; width: 15px; height: 100%; background: #c88d4d; transform-origin: top; }
.ap-fx-package::before { left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 55%); }
.ap-fx-package::after { right: 0; clip-path: polygon(0 0, 100% 0, 100% 55%, 0 100%); }
.ap-fx-package.is-sealed::before, .ap-fx-package.is-sealed::after { animation: ap-seal .28s ease-out both; }
@keyframes ap-seal { from { transform: rotateX(72deg); opacity: .45; } to { transform: rotateX(0); opacity: 1; } }
.ap-confetti { position: absolute; z-index: 18; width: 4px; height: 8px; border-radius: 1px; background: var(--ap-confetti-color); pointer-events: none; }

@media (max-width: 759px), (max-height: 699px) {
  body { background: var(--ap-canvas); }
  .ap-topo { min-height: 66px; }
  .ap-logo { width: 92px; }
  .ap-fumaca { opacity: .1; }
  .ap-track-horizontal { bottom: 86px; }
  .ap-track-vertical { bottom: 86px; top: 64px; }
  .ap-portal { top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-fumaca, .ap-luz, .ap-track-line { display: none !important; }
  .ap-orbe, .ap-orbe * { animation: none !important; }
  .ap-motion-stage { display: none !important; }
}

/* A stable rotation clock; measured audio changes scale/glow, never animation phase. */
.ap-orbe::before { animation-duration: 9s !important; }
.ap-orbe .ap-orbe-anel, .ap-orbe .ap-orbe-arco { animation: ap-turn 2.6s linear infinite !important; }
.ap-orbe.falando, .ap-orbe.ouvindo { animation: none; }
@media (prefers-reduced-motion: reduce) { .ap-orbe::before,.ap-orbe .ap-orbe-anel,.ap-orbe .ap-orbe-arco { animation: none !important; } }
