/* Layout para CELULAR (até 720 px). No computador nada muda: tudo aqui está dentro do @media. */
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14px; line-height: 1.5; }
  button, input, select, textarea { font-size: 16px; }          /* 16 px evita o zoom automático do iPhone */
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=month], input[type=email], input[type=tel], select, textarea { padding: 9px 8px; min-height: 42px; }
  .btn { padding: 9px 14px; font-size: 13px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .btn.sm { padding: 6px 11px; font-size: 12px; min-height: 34px; }
  .hint, .copy, .small { font-size: 12px; }

  /* topo e abas: faixa rolável que fica presa no alto */
  .top { padding: 10px 12px 6px; } .logo { font-size: 20px; letter-spacing: 2px; } .tagline { display: none; } .top .brand { font-size: 15px; letter-spacing: 2px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 6px 8px 0; position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 2px solid #8fb52f; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 11px 14px 9px; font-size: 12px; white-space: nowrap; }
  .tab .n { font-size: 11px; padding: 0 6px; }

  .stage { padding: 16px 14px 18px; min-height: 0; }
  .stage h1 { font-size: 22px; } .stage .sub { max-width: none; font-size: 13px; }
  .gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .gauge .v { font-size: 19px; } .gauge .l { font-size: 11px; }
  .content { padding: 14px 10px 24px; min-height: 0; }
  .bar { gap: 8px; } .bar > .btn { flex: 1 1 auto; } .bar input, .bar select { flex: 1 1 140px; min-width: 0; width: auto; }
  .box > h3 { font-size: 13px; padding: 6px 10px; }
  .cols, .cols2 { grid-template-columns: 1fr; gap: 12px; }
  .frm { grid-template-columns: 1fr; }
  .frm label { font-size: 12px; }

  /* tabelas viram cartões (os rótulos vêm do cabeçalho, via mobile.js) */
  table.t { border: 0; background: transparent; }
  .t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t thead { display: none; }
  .t tr, .t tr:nth-child(even), .t tr:hover { background: #fff; }
  .t tr { border: 1px solid #a9c455; margin-bottom: 10px; box-shadow: 2px 2px 0 rgba(95,140,11,.18); }
  .t td, .t tr:nth-child(even) td, .t tr:hover td { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; padding: 7px 10px; border-bottom: 1px solid #eef3cf; background: #fff; white-space: normal; font-size: 13px; }
  .t td:first-child, .t tr:nth-child(even) td:first-child { background: #eef7be; font-weight: bold; }
  .t td[data-label]::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-size: 11px; font-weight: bold; color: #4b5d1b; }
  .t td.r { white-space: normal; }
  .t td, .t td[style] { max-width: none !important; }
  .bar .hint.grow, .bar .grow { flex: 1 1 100%; }
  .t td.acts, .t tr:nth-child(even) td.acts { justify-content: flex-start; flex-wrap: wrap; gap: 6px; text-align: left; white-space: normal; }
  .t .acts .btn { margin: 0; }
  .t td[colspan], .t td.empty { display: block; text-align: center; }
  .t.t-plain tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding: 8px 10px; }
  .t.t-plain td, .t.t-plain tr:nth-child(even) td { width: auto; display: block; border: 0; padding: 1px 0; background: transparent; text-align: left; font-weight: normal; }
  .t.t-plain td:first-child, .t.t-plain tr:nth-child(even) td:first-child { font-weight: bold; color: #35550a; background: transparent; }
  .t.t-plain td.r { margin-left: auto; font-weight: bold; }
  .stage .sub, .gauge .l { color: #fff; text-shadow: 0 1px 1px rgba(25,70,0,.65); }
  .scroll { overflow-x: visible; }
  .pill { font-size: 11px; padding: 1px 8px; }

  /* janelas viram folhas de tela cheia */
  .veil { padding: 0; align-items: stretch; }
  .win, .win.wide { max-width: 100%; min-height: 100%; display: flex; flex-direction: column; border-width: 0; box-shadow: none; }
  .win > h2 { font-size: 14px; padding: 10px 12px; position: sticky; top: 0; z-index: 2; }
  .win > h2 button { font-size: 18px; padding: 0 8px; min-height: 32px; }
  .win .body { flex: 1; padding: 12px; overflow-x: hidden; }
  .win .foot { position: sticky; bottom: 0; flex-wrap: wrap; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .win .foot .btn { flex: 1 1 120px; }
  .items, .items tbody { display: block; width: 100%; }
  .items tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; border-bottom: 1px dashed #c4d97a; }
  .items td { flex: 1 1 28%; padding: 0; } .items td:first-child { flex: 1 1 100%; }

  /* conversas: lista -> conversa (uma tela por vez) */
  .chat { grid-template-columns: 1fr; height: calc(100vh - 200px); height: calc(100dvh - 200px); min-height: 380px; }
  .chat .list { border-right: 0; max-height: none; }
  .chat .li { padding: 11px 12px; } .chat .li .pv { font-size: 12px; }
  .chat .pane { display: none; }
  .chat.show-pane .list { display: none; } .chat.show-pane .pane { display: flex; }
  .chat .head { gap: 8px; } .chat .head .back { flex: none; }
  .chat .send { padding: 8px; } .chat .send input { min-width: 0; }
  .bub { max-width: 88%; } .bub img { max-width: 100%; }
  .qr { width: 100%; max-width: 300px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .wa { gap: 14px; }

  /* rodapé e login */
  .foot3 > div { padding: 16px 14px; } .foot3 h4 { font-size: 17px; }
  .copy { text-align: center; padding: 8px 14px 22px; }
  .login-stage { min-height: 0; padding: 20px 12px 28px; }
  .pda { width: 100%; max-width: 340px; }
  .pda .lcd input { min-height: 44px; } .pda .lcd .btn { min-height: 46px; }
}
