/* FBS Capital — camada de celular (14/11/2026).
   Só vale em telas estreitas (até 640 px): no computador NADA muda. Objetivos medidos na auditoria 2:
   alvos de toque >= 40 px, campos sem zoom automático no iPhone, nada passando da borda da tela.
   Uso: <link rel="stylesheet" href="fbs-celular.css"> + <script src="fbs-celular.js" defer></script> no <head> de cada tela. */
@media (max-width: 640px) {
  /* Início: a barra de cima nunca passa da borda (o botão do olho vazava 10 px) */
  #topbar, .topbar { gap: 8px; min-width: 0; }
  .topbar .gsearch-wrap, #topbar .gsearch-wrap { width: auto; flex: 1 1 0; min-width: 0; max-width: 260px; }
  #privacyBtn { flex: 0 0 38px; }

  /* Alvos de toque confortáveis (botões, chips, ícones clicáveis, seletores) */
  button, .btn, .cat-chip, .meta-add, .addbtn, select, summary { min-height: 40px; }
  [role="button"], .cat-chip-edit, .meta-del { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { min-height: 40px; }
  .gi-del, .thm, .meta-del, .fav-star { min-width: 40px; }
  a[href="#"] { display: inline-block; padding: 9px 2px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 40px; align-items: center; }

  /* Campos com pelo menos 16 px: o iPhone não dá zoom sozinho ao tocar */
  input, select, textarea { font-size: max(16px, 1em); }

  /* Tabelas largas rolam dentro da própria caixa, nunca a página inteira */
  table { max-width: 100%; }
  .table-wrap, .tbl-wrap, .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* "Resumo primeiro": avisos longos ficam curtos e blocos grandes recolhidos viram uma barra */
  #waCta { padding: 10px 12px; }
  #waCta .wa-cta-txt span { display: none; }
  .fbs-rec-bar { display: flex; width: 100%; justify-content: space-between; align-items: center; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line, #2a3550); border-radius: 12px; background: var(--card2, transparent); color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }

  /* Organização: cabeçalhos de seção quebram linha em vez de estourar a tela */
  .sec-head { flex-wrap: wrap; gap: 6px; min-width: 0; }
  .sec-head-right { flex: 1 1 100%; max-width: 100%; min-width: 0; margin-left: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .metas-total { display: flex; flex-wrap: wrap; gap: 2px 12px; white-space: normal; max-width: 100%; min-width: 0; }
  .sec-chevron { flex: 0 0 auto; }
}
