/* Celular (26/10/2026) — só design; o desktop não muda. Carregado depois de app.css e marca-mm.css. */
.trilha-ico, .aba-curta { display: none; }

@media (max-width: 768px) {
  /* nada estoura a largura da página */
  html, body { overflow-x: hidden; }
  .principal { max-width: 100vw; overflow-x: clip; }
  .conteudo, .cartao, .vg-coluna, .grade > *, .vg-linha > * { min-width: 0; }
  .conteudo { padding: 1rem 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
  .conteudo img, .conteudo svg, .conteudo video, .conteudo iframe { max-width: 100%; }
  .conteudo pre, .saida-ia { max-width: 100%; overflow-x: auto; }

  /* ---- topo: uma linha de 56px + faixa Gori | MANY MILLIONS ---- */
  .topo { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "menu voltar titulo usuario" "empresa empresa empresa empresa";
    align-items: center; column-gap: .5rem; row-gap: 0; padding: env(safe-area-inset-top, 0px) max(.75rem, env(safe-area-inset-right, 0px)) 0 max(.75rem, env(safe-area-inset-left, 0px));
    background: rgba(11,11,12,.94); }
  .topo > * { min-height: 56px; }
  .menu-toggle { grid-area: menu; align-self: center; min-height: 0; width: 40px; height: 40px; }
  .btn-voltar { grid-area: voltar; align-self: center; min-height: 0; width: 40px; height: 40px; margin: 0; padding: 0; justify-content: center; font-size: 1.15rem; border-radius: 10px; }
  .voltar-txt { display: none; }
  .trilha { grid-area: titulo; justify-content: center; gap: .45rem; font-size: .95rem; }
  .trilha > span.sep { display: none; }
  .trilha-inicio { display: grid; place-items: center; flex: none; }
  .trilha-ico { display: block; width: 24px; height: 24px; border-radius: 5px; }
  .trilha-txt { display: none; }
  .trilha strong { font-family: "Marcellus", Georgia, serif; font-weight: 400; letter-spacing: .04em; font-size: 1rem; }
  .usuario { grid-area: usuario; gap: .4rem; }
  .sino { width: 40px; height: 40px; }
  .avatar { width: 34px; height: 34px; font-size: .74rem; }
  .abas-empresa { grid-area: empresa; order: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: auto; min-height: 0; margin: 0 calc(-1 * max(.75rem, env(safe-area-inset-left, 0px))) 0;
    border-top: 1px solid #1d1d1d; }
  .aba-empresa { flex: none; min-height: 44px; width: 100%; justify-content: center; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    background: transparent; color: #A9A08C; font-family: "Montserrat", system-ui, sans-serif; font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    overflow: hidden; text-overflow: ellipsis; padding: 0 .5rem; }
  .aba-longa { display: none; }
  .aba-curta { display: inline; }
  .aba-empresa:hover { background: rgba(207,169,68,.06); color: #F4EFE4; border-color: transparent; }
  .aba-empresa.ativa { background: rgba(207,169,68,.10); color: #CFA944; border-bottom-color: #CFA944; }
  .aba-empresa.ativa:hover { border-bottom-color: #CFA944; }

  /* ---- menu lateral ---- */
  .sidebar { padding-top: env(safe-area-inset-top, 0px); padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .marca { padding: 1.1rem 1.2rem 1rem; }
  .sidebar .item { min-height: 44px; }
  .grupo summary { min-height: 40px; }

  /* ---- títulos ---- */
  h1, .heroi h1 { font-size: 1.35rem; line-height: 1.25; }
  h2 { font-size: 1.05rem; }
  .cabecalho { margin-bottom: 1rem; gap: .7rem; }
  .cabecalho p { font-size: .88rem; }
  .sobretitulo { font-size: .66rem; }
  .vg-data { font-size: 1rem; }

  /* ---- painel inicial ---- */
  .vg-topo { margin-bottom: .9rem; }
  .vg-topo .acoes { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; }
  .vg-topo .acoes .btn { min-height: 44px; justify-content: center; padding: 0 .6rem; }
  .selo { gap: .7rem; padding: .65rem .8rem; border-width: 1.5px; border-radius: 12px; margin-bottom: .7rem; align-items: flex-start; }
  .selo .icone { width: 26px; height: 26px; font-size: .9rem; }
  .selo strong { font-size: 15px; line-height: 1.3; letter-spacing: .02em; }
  .selo span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font-size: 13px; line-height: 1.4; }
  .kpis, .kpis.vg-k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
  .kpi { padding: .7rem .8rem; }
  .kpi strong { font-size: 28px; margin-top: 0; }
  .kpi small { font-size: .85rem; }
  .kpi span { display: block; font-size: .76rem; line-height: 1.3; padding-right: 1.6rem; }
  .kpi-ico { width: 24px; height: 24px; top: .6rem; right: .6rem; border-radius: 8px; }
  .kpi-ico .ico { width: 14px; height: 14px; }
  .vg-resumo strong { font-size: 1.25rem; }
  .vg-hab-nums strong { font-size: 1.2rem; }

  /* ---- botões, formulários e filtros ---- */
  .btn, button { min-height: 44px; }
  .btn-mini, button.btn-mini { min-height: 36px; min-width: 36px; justify-content: center; }
  .link-botao { min-height: 0; }
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { font-size: 16px; min-height: 44px; }
  textarea { min-height: 88px; }
  .form-campo { max-width: none; }
  .form-campo input, .form-campo select, .form-campo textarea { width: 100%; }
  .filtros { flex-direction: column; align-items: stretch; }
  .filtros label { flex: 1 1 auto; width: 100%; }
  .filtros label.check { padding-bottom: 0; min-height: 44px; }
  .filtros input, .filtros select { width: 100%; min-width: 0; }
  .filtros > button, .filtros > .btn { width: 100%; justify-content: center; }
  .filtro-tema select { width: 100%; }
  .np-linha { grid-template-columns: 1fr; }
  .abas a { padding: .55rem .9rem; }

  /* ---- tabelas: em cartões (app.js põe data-label) ou rolagem dentro do próprio quadro ---- */
  .tabela-wrap { max-width: 100%; }
  .conteudo table:not(.tabela-cartoes) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabela-wrap > table:not(.tabela-cartoes) { display: table; }
  table.tabela-cartoes, table.tabela-cartoes tbody, table.tabela-cartoes tr, table.tabela-cartoes td { display: block; width: 100%; }
  table.tabela-cartoes thead { display: none; }
  table.tabela-cartoes tr { border: 1px solid var(--borda); border-radius: 10px; background: var(--superficie-2); padding: .35rem .8rem; margin-bottom: .6rem; }
  table.tabela-cartoes tr:hover td { background: transparent; }
  table.tabela-cartoes td { display: block; border-bottom: 1px solid #242424; padding: .45rem 0; text-align: right; overflow-wrap: anywhere; white-space: normal; }
  table.tabela-cartoes td::after { content: ""; display: table; clear: both; }
  table.tabela-cartoes td:last-child { border-bottom: 0; }
  table.tabela-cartoes td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: .8rem; padding-top: .15rem; text-align: left; color: var(--acento); font-size: .68rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase; }
  table.tabela-cartoes td:not([data-label])::before, table.tabela-cartoes td[data-label=""]::before { content: none; }
  table.tabela-cartoes td[colspan] { display: block; text-align: center; }
  table.tabela-cartoes td:first-child[data-label] { font-weight: 600; }

  dl.dados dd { overflow-wrap: anywhere; }
  .linha-tarefa .lado { flex-wrap: wrap; }

  /* ---- login ---- */
  .login-pagina { padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .login-cartao { padding: 1.5rem 1.2rem; }
}

@media (max-width: 768px) {
  .vg-pedido-linha { display: grid !important; grid-template-columns: 1fr; gap: .5rem; }
  .vg-pedido-linha > * { width: 100%; max-width: none; justify-content: center; }
}
