/* x-zap — área de ajuda (chat de busca + gaveta flutuante) */
.xh { display: flex; flex-direction: column; min-height: 0; background: var(--branco); }
.xh-topo { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--linha); background: var(--grafite); color: #EEF0F2; }
.xh-topo .xh-av { width: 38px; height: 38px; border-radius: 12px; background: var(--sinal); display: grid; place-items: center; flex: none; }
.xh-topo .xh-av svg { width: 22px; height: 22px; }
.xh-topo strong { display: block; font-size: 16px; letter-spacing: -.01em; }
.xh-topo span { display: block; font-size: 13px; color: #A9B1B9; }
.xh-topo .xh-fechar { margin-left: auto; background: transparent; border: 0; color: #EEF0F2; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.xh-topo .xh-fechar:hover { background: #262B30; }
.xh-topo .xh-limpar { background: transparent; border: 1px solid #3A4148; color: #D5DADF; border-radius: 10px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; margin-left: auto; }
.xh-topo .xh-limpar + .xh-fechar { margin-left: 4px; }

.xh-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--nevoa); scroll-behavior: smooth; }
.xh-msg { max-width: 92%; display: flex; flex-direction: column; gap: 8px; animation: xh-entra .22s ease-out; }
.xh-msg.eu { align-self: flex-end; }
.xh-msg.eu .xh-bolha { background: var(--grafite); color: #F2F4F5; border-radius: 18px 18px 6px 18px; }
.xh-bolha { background: var(--branco); border: 1px solid var(--linha); border-radius: 18px 18px 18px 6px; padding: 11px 14px; font-size: 15px; line-height: 1.5; box-shadow: 0 1px 2px rgba(20,23,26,.05); overflow-wrap: anywhere; }
.xh-bolha p { margin: 0 0 6px; } .xh-bolha p:last-child { margin: 0; }
.xh-bolha code, .xh-card code { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; background: var(--suave); border: 1px solid var(--linha); border-radius: 6px; padding: 1px 5px; }
@keyframes xh-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.xh-digitando { display: inline-flex; gap: 4px; padding: 14px 16px; }
.xh-digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--aco); animation: xh-pulo 1s infinite; }
.xh-digitando i:nth-child(2) { animation-delay: .15s; } .xh-digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes xh-pulo { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.xh-card { background: var(--branco); border: 1px solid var(--linha); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(20,23,26,.07); }
.xh-card-cab { padding: 14px 16px 4px; }
.xh-card-cat { font-size: 13px; color: var(--verde); font-weight: 600; }
.xh-card h3 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.02em; line-height: 1.3; }
.xh-card-corpo { padding: 8px 16px 14px; font-size: 15px; line-height: 1.55; color: var(--texto-2); }
.xh-card-corpo strong { color: var(--grafite); }
.xh-passos { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: p; display: grid; gap: 8px; }
.xh-passos li { counter-increment: p; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.xh-passos li::before { content: counter(p); width: 26px; height: 26px; border-radius: 9px; background: var(--verde-veu); color: var(--verde); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.xh-toggle { margin-top: 10px; background: none; border: 0; color: var(--verde); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; min-height: 44px; }
.xh-codigo { position: relative; margin: 12px 0 0; }
.xh-codigo pre { margin: 0; background: #0C0E10; color: #D5DADF; border-radius: 12px; padding: 14px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; font-family: 'Geist Mono', ui-monospace, monospace; }
.xh-codigo button { position: absolute; top: 8px; right: 8px; background: #262B30; color: #D5DADF; border: 0; border-radius: 8px; min-height: 32px; padding: 0 10px; font: inherit; font-size: 13px; cursor: pointer; }
.xh-acoes { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.xh-acoes a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--grafite); color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; }
.xh-acoes a.sec { background: var(--suave); color: var(--grafite); border: 1px solid var(--linha); }
.xh-util { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--linha); padding: 8px 16px; font-size: 14px; color: var(--texto-3); flex-wrap: wrap; }
.xh-util button { background: var(--suave); border: 1px solid var(--linha); border-radius: 10px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--grafite); }
.xh-util button:hover { border-color: var(--linha-forte); }

.xh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.xh-chip { background: var(--branco); border: 1px solid var(--linha-forte); border-radius: 999px; min-height: 40px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--grafite); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.xh-chip:hover { border-color: var(--verde); background: var(--verde-veu); }
.xh-chip.dica { border-color: var(--aviso-borda); background: var(--aviso-veu); }
.xh-chip.dica.ruim { border-color: var(--erro-borda); background: var(--erro-veu); }
.xh-rotulo { font-size: 13px; color: var(--texto-3); font-weight: 500; margin: 2px 0 -2px; }

.xh-entrada { position: relative; border-top: 1px solid var(--linha); background: var(--branco); padding: 12px; }
.xh-entrada form { display: flex; gap: 8px; }
.xh-entrada input { flex: 1; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--linha-forte); padding: 0 14px; font: inherit; font-size: 16px; background: var(--branco); color: var(--grafite); }
.xh-entrada input:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-veu); }
.xh-entrada button[type=submit] { width: 48px; min-height: 48px; border-radius: 14px; border: 0; background: var(--sinal); color: var(--sinal-texto); cursor: pointer; display: grid; place-items: center; flex: none; }
.xh-sug { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); background: var(--branco); border: 1px solid var(--linha); border-radius: 14px; box-shadow: 0 -8px 24px rgba(20,23,26,.12); padding: 6px; display: none; max-height: 280px; overflow-y: auto; }
.xh-sug.aberta { display: block; }
.xh-sug button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; background: none; border: 0; border-radius: 10px; min-height: 44px; padding: 6px 10px; font: inherit; font-size: 15px; color: var(--grafite); cursor: pointer; }
.xh-sug button span { font-size: 13px; color: var(--texto-3); margin-left: auto; white-space: nowrap; }
.xh-sug button.ativo, .xh-sug button:hover { background: var(--verde-veu); }
.xh-sug mark { background: none; color: var(--verde); font-weight: 600; }

/* Botão flutuante e gaveta */
.xh-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px; border-radius: 999px; border: 0; background: var(--grafite); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 28px rgba(20,23,26,.28); }
.xh-fab svg { width: 22px; height: 22px; }
.xh-fab:hover { background: var(--grafite-2); }
.xh-fundo { position: fixed; inset: 0; background: rgba(12,14,16,.35); z-index: 70; }
.xh-gaveta { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); z-index: 71; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(12,14,16,.3); display: flex; flex-direction: column; animation: xh-desliza .22s ease-out; }
.xh-gaveta .xh { flex: 1; }
@keyframes xh-desliza { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
[hidden].xh-fundo, [hidden].xh-gaveta { display: none !important; }

/* Página de ajuda */
.xh-pagina .xh { border-radius: 22px; border: 1px solid var(--linha); overflow: hidden; height: min(640px, 72vh); box-shadow: 0 10px 30px rgba(20,23,26,.08); }
.xh-assuntos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.xh-assunto h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 17px; }
.xh-assunto h3 svg { width: 22px; height: 22px; color: var(--verde); flex: none; }
.xh-assunto details { border-top: 1px solid var(--linha); }
.xh-assunto summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.xh-assunto summary::after { content: '+'; color: var(--aco); font-size: 20px; }
.xh-assunto details[open] summary::after { content: '–'; }
.xh-assunto .xh-art { padding: 0 0 14px; font-size: 15px; color: var(--texto-2); line-height: 1.55; }

/* Em Conversas o botão sairia em cima do "Enviar": lá a Ajuda fica só no menu */
.xh-fab.xh-fab-alto { display: none; }

@media (max-width: 760px) {
  .xh-fab { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); padding: 0 16px 0 12px; }
  .xh-gaveta { top: 0; right: 0; bottom: 0; left: 0; width: 100%; border-radius: 0; }
  .xh-msg { max-width: 100%; }
  .xh-pagina .xh { height: 70vh; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .xh-msg, .xh-gaveta, .xh-digitando i { animation: none; } }
