html, body { height: 100%; overscroll-behavior-y: none; }
body { -webkit-tap-highlight-color: transparent; }
#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.tela { flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.barra { position: sticky; top: 0; z-index: 10; background: var(--bg); display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px; min-height: 56px; padding-top: max(8px, env(safe-area-inset-top)); }
.barra .tit { font-family: var(--display); font-weight: 600; font-size: 20px; flex: 1; padding-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conteudo { flex: 1; padding: 4px 16px 24px; }
.rodape { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; padding: 12px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.rodape .btn { flex: 1; }

/* início */
.ola { padding: 6px 4px 14px; }
.ola .s { color: var(--muted); font-size: 13px; margin-top: 10px; }
.ola .n { font-family: var(--display); font-weight: 600; font-size: 26px; }
.sinc-linha { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.ponto.off { background: var(--warning); }
.ponto.err { background: var(--danger); }
.heroi { width: 100%; border: 0; text-align: left; cursor: pointer; background: var(--accent); color: var(--on-accent); border-radius: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); font: inherit; }
.heroi b { font-family: var(--display); font-size: 21px; font-weight: 600; display: block; }
.heroi small { opacity: .82; font-size: 12.5px; }
.heroi .go { width: 46px; height: 46px; border-radius: 50%; background: var(--on-accent); color: var(--accent); display: grid; place-items: center; }
.modulos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.modulo { background: var(--surface); border: 0; border-radius: 14px; padding: 14px 6px 12px; text-align: center; font: 500 12.5px var(--sans); color: var(--text); box-shadow: var(--shadow); cursor: pointer; }
.modulo .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 7px; position: relative; }
.modulo .ic .cont { position: absolute; top: -6px; right: -8px; background: var(--warning); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 1px 6px; }
.resumo-dia { margin-top: 14px; }
.resumo-dia .r, .resumo .r { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 3px 0; }
.resumo-dia .r span:first-child, .resumo .r span:first-child { color: var(--muted); }
.resumo .tot { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 9px; }
.resumo .tot span:last-child { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--accent); font-variant-numeric: lining-nums; }

/* listas */
.busca-m { position: relative; margin-bottom: 10px; }
.busca-m .ico { position: absolute; left: 12px; top: 11px; width: 20px; height: 20px; color: var(--muted); }
.busca-m .input { padding-left: 40px; }
.item-lista { display: flex; gap: 12px; background: var(--surface); border-radius: 14px; padding: 12px 13px; box-shadow: var(--shadow); margin-bottom: 9px; cursor: pointer; border: 0; width: 100%; text-align: left; font: inherit; color: inherit; }
.item-lista:active { background: #fbf5ec; }
.item-lista .d { flex: 1; min-width: 0; }
.item-lista .d b { font-size: 13.8px; display: block; }
.item-lista .d small { color: var(--muted); font-size: 11.8px; display: block; }
.item-lista .p { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; gap: 8px; }
.item-lista .p .f { font-weight: 700; color: var(--accent); }
.thumb { width: 48px; height: 64px; border-radius: 9px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; color: var(--accent); flex: none; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .ico { width: 22px; height: 22px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; scrollbar-width: none; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font: 600 12.5px var(--sans); color: var(--muted); white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.contagem { font-size: 12px; color: var(--muted); margin: 2px 2px 8px; }

/* pedido */
.abas-m { display: flex; border-bottom: 1px solid var(--border); margin: 0 -16px 12px; padding: 0 16px; position: sticky; top: 56px; background: var(--bg); z-index: 9; }
.abas-m button { flex: 1; background: none; border: 0; padding: 11px 0; font: 500 13.5px var(--sans); color: var(--muted); cursor: pointer; }
.abas-m button.on { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.enviar { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--accent); box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; }
.enviar.off { border-color: var(--border-input); }
.enviar.travado { border-color: var(--border); background: var(--sunken); cursor: default; }
.caixa { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; margin-top: 1px; }
.enviar.off .caixa { background: var(--surface); border: 1.5px solid var(--border-input); }
.enviar.travado .caixa { background: var(--muted); }
.caixa .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.enviar b { font-size: 14.5px; display: block; }
.enviar small { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; margin-top: 2px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cliente-box { border: 1px solid var(--border-input); border-radius: var(--r-md); padding: 9px 12px; background: var(--surface); }
.cliente-box b { font-size: 13.8px; }
.cliente-box div { font-size: 11.8px; color: var(--muted); }
.credito { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 0 2px 8px; }
.credito b { color: var(--text); }
.aviso-m { display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; margin-bottom: 10px; }
.aviso-m.warn { background: var(--warning-soft); color: var(--warning); }
.aviso-m.err { background: var(--danger-soft); color: var(--danger); }
.aviso-m.info { background: var(--accent-soft); color: var(--accent); }
.aviso-m .ico { width: 18px; height: 18px; }

/* folha inferior */
.fundo { position: fixed; inset: 0; background: rgba(43,32,29,.42); z-index: 40; animation: aparece .15s; }
.folha { position: fixed; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; z-index: 41; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--pop);
  padding: 10px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: sobeF .2s ease; }
.folha .alca { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 12px; }
.folha h2 { font-size: 19px; }
@keyframes aparece { from { opacity: 0; } }
@keyframes sobeF { from { transform: translateY(40px); opacity: .5; } }
.passo { display: flex; gap: 6px; margin-top: 10px; }
.passo button { flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--border-input); background: var(--surface); color: var(--accent); font: 600 13px var(--sans); cursor: pointer; }
.passo button.mais { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.foto-folha { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #fff; margin-bottom: 10px; }

.entrar { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; }
.entrar h1 { font-size: 44px; color: var(--accent); }
.vazio-m { text-align: center; color: var(--muted); padding: 36px 12px; }
.vazio-m .ico { width: 34px; height: 34px; margin-bottom: 6px; }
.lido { opacity: .7; }
.fixo-baixo { height: 84px; }
video.scanner { width: 100%; border-radius: 14px; background: #000; max-height: 50vh; object-fit: cover; }

#toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
#toast .toast:nth-last-child(n+3) { display: none; }
