/* =====================================================================
   Spalla — Produção · Apontamento (touch-first)
   Tokens idênticos ao redesign do Dashboard; acento do módulo = #00BFCE
   ===================================================================== */

:root {
  --app-bg:        #F4F6FB;
  --surface:       #FFFFFF;
  --surface-alt:   #F8F9FF;
  --hover:         #F5F8FA;
  --hover-strong:  #EDEFF2;
  --border:        #E4E7EE;
  --border-strong: #DFE2EA;
  --divider:       #C8CCD1;

  --text:          #181C22;
  --text-soft:     #404752;
  --text-mute:     #828B93;

  --mc:            #00BFCE;               /* cor do módulo Produção */
  --mc-ink:        #007E8A;               /* teal escurecido p/ texto sobre fundo claro */
  --mc-press:      #00A9B7;

  --ok:            #18C482;
  --ok-ink:        #0E8A5F;
  --err:           #B42318;
  --warn:          #F59E0B;
  --warn-ink:      #A16207;
  --info:          #06B6D4;

  --r-card: 14px;
  --r-btn:  12px;
  --r-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0,0,0,.03);
  --shadow-sheet: 0 -8px 32px rgba(24,28,34,.14);

  --topbar-h: 76px;

  /* alvos de toque */
  --tap:     56px;
  --tap-lg:  64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--app-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;                        /* tablet: sem scroll de página */
  touch-action: manipulation;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
button:disabled { cursor: default; }
input, textarea { user-select: text; -webkit-user-select: text; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased; user-select: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.ms.filled { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* =====================================================================
   Shell
   ===================================================================== */
.app {
  height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--app-bg);
  position: relative;
  overflow: hidden;
  /* rodada 6: os formatos celular/coletor são molduras de largura fixa —
     os breakpoints medem o CONTÊINER (.app), não a janela do navegador.
     A contenção de layout também ancora sheets/diálogos dentro da moldura. */
  container: app / size;
}

/* molduras de demonstração (painel Tweaks → Formato) */
body.fmt-celular, body.fmt-coletor {
  background: #252A31;
  display: grid; place-items: center;
}
body.fmt-celular .app {
  width: 390px; height: min(844px, calc(100dvh - 36px));
  border-radius: 26px;
  outline: 10px solid #14171B;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}
body.fmt-coletor .app {
  width: 480px; height: min(800px, calc(100dvh - 36px));
  border-radius: 8px;
  outline: 12px solid #3A4048;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

/* Molduras de TESTE de tablet (rodada 8 §7) — resoluções reais de chão de
   fábrica. Como > 640px, ativam o layout tablet normalmente. Em janelas
   menores que a moldura, o fundo rola (place-items safe center) e a altura
   usa min() como nas molduras mobile. O formato "Tablet" (janela cheia) segue
   como opção separada, sem classe. */
body.fmt-t1280, body.fmt-tmini {
  background: #252A31;
  display: grid; place-items: safe center;
  min-height: 100dvh; padding: 18px; overflow: auto;
}
body.fmt-t1280 .app {
  width: 1280px; height: min(800px, calc(100dvh - 36px));
  border-radius: 12px;
  outline: 12px solid #14171B;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}
body.fmt-tmini .app {
  width: 1024px; height: min(768px, calc(100dvh - 36px));
  border-radius: 10px;
  outline: 12px solid #3A4048;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

/* =====================================================================
   "O conteúdo preenche o container" (rodada 6)
   Elementos [data-fit] recebem --fit calculado em JS (ui.js · ajustarFit)
   para o texto ocupar toda a largura disponível; irmãos do mesmo grupo
   usam o mesmo tamanho. Ícones e subtítulos escalam junto (em).
   ===================================================================== */
[data-fit] { white-space: nowrap; overflow: hidden; max-width: 100%; flex-shrink: 0; min-height: 1.15em; }

.topbar {
  flex: none;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-top: 4px solid var(--mc);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.topbar-brand img { width: 34px; height: 34px; display: block; }
.topbar-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar-title b { font-size: 18px; font-weight: 700; }
.topbar-title span { font-size: 13.5px; color: var(--text-mute); font-weight: 500; }

.btn-voltar {
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--tap); padding: 0 22px 0 14px;
  border-radius: var(--r-btn);
  background: color-mix(in srgb, var(--mc) 12%, transparent);
  color: var(--mc-ink);
  font-size: 17px; font-weight: 700;
  transition: background-color 100ms ease-out, transform 60ms ease-out;
}
.btn-voltar .ms { font-size: 28px; }
.btn-voltar:active { background: color-mix(in srgb, var(--mc) 24%, transparent); transform: scale(.98); }

.topbar-spacer { flex: 1; }

.operador-chip {
  display: flex; align-items: center; gap: 12px;
  height: var(--tap); padding: 0 18px 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.operador-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--mc) 16%, transparent);
  color: var(--mc-ink);
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}
.operador-chip .op-txt { display: flex; flex-direction: column; line-height: 1.2; }
.operador-chip .op-nome { font-size: 15px; font-weight: 600; }
.operador-chip .op-sub  { font-size: 12.5px; color: var(--text-mute); font-weight: 500; }

.icon-btn-top {
  width: var(--tap); height: var(--tap);
  border-radius: var(--r-btn);
  display: grid; place-items: center;
  color: var(--text-mute);
  border: 1px solid transparent;
}
.icon-btn-top:active { background: var(--hover-strong); }

.screen {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 20px 24px 24px;
  gap: 16px;
}

/* =====================================================================
   Botões base
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: var(--r-btn);
  font-weight: 700;
  transition: background-color 100ms ease-out, transform 60ms ease-out, opacity 100ms ease-out;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; transform: none; }

.btn-lg { height: var(--tap); padding: 0 22px; font-size: 17px; }
.btn-xl { height: var(--tap-lg); padding: 0 28px; font-size: 18px; }
.btn-xl .ms { font-size: 28px; }

.btn-primario   { background: var(--mc); color: #FFFFFF; }
.btn-primario:active { background: var(--mc-press); }
.btn-sucesso    { background: var(--ok); color: #FFFFFF; }
.btn-sucesso:active { background: color-mix(in srgb, var(--ok) 86%, #000); }
.btn-tonal      { background: color-mix(in srgb, var(--mc) 12%, transparent); color: var(--mc-ink); }
.btn-tonal:active { background: color-mix(in srgb, var(--mc) 24%, transparent); }
.btn-neutro     { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-soft); font-weight: 600; }
.btn-neutro:active { background: var(--hover-strong); }
.btn-perigo-ton { background: color-mix(in srgb, var(--err) 8%, transparent); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 24%, transparent); }
.btn-perigo-ton:active { background: color-mix(in srgb, var(--err) 16%, transparent); }

/* =====================================================================
   Badges de status
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 15px;
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700;
  white-space: nowrap;
}
.badge .ms { font-size: 19px; }
.badge.nao       { background: var(--hover-strong); color: var(--text-soft); }
.badge.iniciado  { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn-ink); }
.badge.concluido { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-ink); }

/* estados de linha de insumo */
.badge.pendente    { background: var(--hover-strong); color: var(--text-soft); }
.badge.confirmada  { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-ink); }
.badge.devolucao   { background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); }
.badge.requisitada { background: color-mix(in srgb, var(--info) 14%, transparent); color: #0E7490; }

/* =====================================================================
   Tela 1 — Agenda
   ===================================================================== */
.agenda-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.agenda-titulo { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.agenda-titulo h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.agenda-titulo p  { margin: 0; font-size: 17px; color: var(--text-mute); font-weight: 500; }

/* banner de contexto da sessão — operador/máquina/estação (rodada 6):
   substitui o alternador de visões; o usuário NÃO escolhe o filtro,
   ele está naquele contexto. O valor preenche o banner (data-fit). */
.ctx-banner {
  display: flex; align-items: center; gap: 14px;
  min-height: var(--tap-lg); padding: 8px 22px;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--mc) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc) 28%, transparent);
  color: var(--mc-ink);
  font-size: var(--fit, 22px);
  flex: 1; min-width: 0; max-width: 560px;
}
.ctx-banner > .ms { font-size: 1.55em; flex: none; }
.ctx-banner .ctxb-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ctx-banner .ctxb-rotulo {
  font-size: max(13px, .5em); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; opacity: .78;
}
.ctx-banner .ctxb-valor { font-weight: 700; letter-spacing: -0.01em; }

.seg {
  display: flex; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-btn); padding: 4px; gap: 4px;
}
.seg button {
  height: 52px; padding: 0 20px; border-radius: 9px;
  font-size: 16.5px; font-weight: 600; color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 8px;
}
.seg button .ms { font-size: 22px; }
.seg button.on { background: color-mix(in srgb, var(--mc) 14%, transparent); color: var(--mc-ink); }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  height: var(--tap); padding: 0 24px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 17.5px; font-weight: 600; color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 10px;
  transition: background-color 100ms ease-out;
}
.chip .chip-n {
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--hover-strong); color: var(--text-soft);
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}
.chip.on { background: var(--mc); border-color: var(--mc); color: #FFFFFF; }
.chip.on .chip-n { background: rgba(255,255,255,.24); color: #FFFFFF; }
.chip:active { transform: scale(.98); }

/* filtro de tipo de processo — visão Processo (sempre um tipo selecionado) */
.tipo-filtro { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tipo-filtro .tf-label { font-size: 16.5px; font-weight: 600; color: var(--text-soft); }
.tf-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pc); flex: none;
}

/* campo de busca textual (abre busca touch em tela cheia) */
.campo-busca {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: var(--tap); min-width: 280px; padding: 0 18px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-btn); text-align: left;
  font-size: 18px; font-weight: 600; color: var(--text);
}
.campo-busca .cb-lupa { font-size: 24px; color: var(--text-mute); }
.campo-busca .cb-valor { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; }
.campo-busca:active { transform: scale(.99); }

/* sheet de opções (dropdown touch) */
.op-lista { display: flex; flex-direction: column; gap: 10px; }
.op-linha {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 0 18px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-btn);
  font-size: 16.5px; font-weight: 600; color: var(--text);
  text-align: left;
}
.op-linha .op-label { margin-right: auto; }
.op-linha .op-check { color: var(--mc-ink); font-size: 26px; }
.op-linha.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 8%, var(--surface)); }
.op-linha:active { transform: scale(.99); }

.agenda-grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
  overflow-y: auto;
  padding-bottom: 4px;
}

.proc-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--pc, var(--mc));
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 20px 20px 18px 22px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
  min-height: 232px;
  transition: transform 80ms ease-out, background-color 100ms ease-out;
}
.proc-card:active { transform: scale(.985); background: var(--surface-alt); }
.proc-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proc-card .pc-op {
  font-size: 15.5px; font-weight: 700; color: var(--text-mute);
  letter-spacing: .04em;
}
.proc-card .pc-nome { font-size: var(--fit, 27px); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.proc-card .pc-prod { font-size: 19px; color: var(--text-soft); font-weight: 500; line-height: 1.3; }
.proc-card .pc-formula { font-size: 15.5px; color: var(--text-mute); font-weight: 500; }
.proc-card .pc-foot {
  margin-top: auto; padding-top: 8px;
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 600; color: var(--text-soft);
}
.proc-card .pc-foot .ms { font-size: 22px; color: var(--text-mute); }
.proc-card.done { opacity: .72; }

.agenda-vazio {
  grid-column: 1 / -1;
  display: grid; place-items: center;
  color: var(--text-mute); font-size: 19px; font-weight: 500;
}

/* =====================================================================
   Tela 2 — Processo (hub)
   ===================================================================== */
.proc-hub {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 5fr) 7fr;
  gap: 16px;
}
.hub-col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }

.hub-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--pc, var(--mc));
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.hub-info .hi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hub-info .hi-op { font-size: 15.5px; font-weight: 700; color: var(--text-mute); letter-spacing: .04em; }
.hub-info h2 { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; }
.hub-info .hi-prod { font-size: 20px; color: var(--text-soft); font-weight: 500; line-height: 1.3; }
.hub-info .hi-meta {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px;
  font-size: 16.5px; color: var(--text-mute); font-weight: 500;
}
.hub-info .hi-meta b { color: var(--text-soft); font-weight: 600; }

/* botão Único de ação (rodada 6: Iniciar/Finalizar nunca coexistem) —
   o rótulo preenche a largura via --fit; ícone e subtítulo escalam em em */
.hub-acoes { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.hub-acao {
  flex: 1;
  border-radius: var(--r-card);
  display: flex; align-items: center; gap: .7em;
  padding: 0 28px;
  font-size: var(--fit, 28px); font-weight: 700; letter-spacing: -0.01em;
  min-height: var(--tap-lg);
  text-align: left;
  transition: transform 80ms ease-out, background-color 100ms ease-out, opacity 100ms ease-out;
}
.hub-acao:active { transform: scale(.985); }
.hub-acao:disabled { opacity: .5; transform: none; }
.hub-acao > .ms { font-size: 1.7em; flex: none; }
.hub-acao .ha-txt { display: flex; flex-direction: column; gap: .12em; min-width: 0; flex: 1; }
.hub-acao .ha-sub { font-size: max(15px, .5em); font-weight: 600; opacity: .85; letter-spacing: 0; }
/* rótulo do botão único (Iniciar/Finalizar) sempre em UMA linha — encolhe via
   --fit (min baixo) até caber, sem truncar e sem quebrar (pedido do usuário). */
.hub-acao .ha-rotulo { white-space: nowrap; overflow: hidden; }
/* Tablet: ícone e gap do botão único têm tamanho FIXO — se escalassem com --fit
   (em), o ícone cresceria junto com a fonte, roubaria a largura do rótulo e o
   texto estouraria/cortaria. Fixos, o cálculo de fit fica exato e o rótulo cabe
   sempre em 1 linha, grande e legível. (Mobile usa .hub-mob, não afetado.) */
.screen:not(.hub-mob) .hub-acao { gap: 16px; }
.screen:not(.hub-mob) .hub-acao > .ms { font-size: 40px; }
.hub-acao.iniciar   { background: var(--mc); color: #FFFFFF; }
.hub-acao.iniciar:active { background: var(--mc-press); }
.hub-acao.finalizar { background: var(--ok); color: #FFFFFF; }
.hub-acao.finalizar:active { background: color-mix(in srgb, var(--ok) 86%, #000); }
.hub-acao.feita {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: var(--fit, 24px);             /* "Processo concluído" encolhe p/ 1 linha */
}
.hub-acao.feita .ms { color: var(--ok-ink); }
.hub-acao.feita .ha-sub { color: var(--text-mute); }

/* ação de correção (Desfazer / Reabrir) — usada em .hub-acao.feita e .hub-feito */
.ha-undo {
  margin-left: auto; flex: none;
  height: var(--tap); padding: 0 22px;
  border-radius: var(--r-btn);
  border: 1px solid color-mix(in srgb, var(--err) 24%, transparent);
  background: color-mix(in srgb, var(--err) 6%, transparent);
  color: var(--err); font-size: 17px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background-color 100ms ease-out, transform 60ms ease-out;
}
.ha-undo .ms { font-size: 24px; color: var(--err); }
.ha-undo:active { background: color-mix(in srgb, var(--err) 14%, transparent); transform: scale(.97); }

/* registro já gravado — faixa compacta (não compete com o botão único) */
.hub-feito {
  flex: none;
  border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; min-height: var(--tap);
}
.hub-feito > .ms { font-size: 30px; color: var(--ok-ink); flex: none; }
.hub-feito .hf-txt { display: flex; flex-direction: column; gap: 1px; margin-right: auto; min-width: 0; }
.hub-feito .hf-txt b { font-size: 17.5px; font-weight: 700; }
.hub-feito .hf-txt span { font-size: 15px; font-weight: 500; color: var(--text-mute); }

/* tiles por LINHAS (rodada 6): tiles ocultos por tipo de usuário apenas
   encurtam a lista — nunca deixam buracos. Rótulos preenchem via --fit. */
.hub-grid {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  gap: 12px;
}
.hub-tile {
  flex: 1 1 0; min-height: 76px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  container: hubtile / size;                /* ícone e textos escalam com a ALTURA do tile (§3 rodada 8) */
  overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: center; column-gap: 16px;
  padding: 8px 24px;
  text-align: left;
  transition: transform 80ms ease-out, background-color 100ms ease-out;
}
.hub-tile:active { transform: scale(.985); background: var(--surface-alt); }
.hub-tile:disabled { opacity: .55; }
.hub-tile:disabled:active { transform: none; background: var(--surface); }
.hub-tile .ht-ic {
  height: clamp(40px, 58cqh, 66px); width: auto; aspect-ratio: 1;
  border-radius: clamp(10px, 14cqh, 16px);
  background: color-mix(in srgb, var(--mc) 12%, transparent);
  color: var(--mc-ink);
  display: grid; place-items: center;
}
.hub-tile .ht-ic .ms { font-size: clamp(24px, 34cqh, 38px); }
.hub-tile .ht-ic.off { background: var(--hover-strong); color: var(--text-mute); }
/* coluna de texto: rótulo em cima, estado abaixo (§2 rodada 8) */
.hub-tile .ht-txt { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.hub-tile .ht-label {
  font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(18px, 24cqh, 30px); line-height: 1.12;
  white-space: normal; overflow: hidden;   /* nunca trunca — quebra/reduz (§1 rodada 8) */
}
.hub-tile .ht-estado {
  font-size: clamp(13px, 15cqh, 17px); font-weight: 600; color: var(--text-mute);
  display: flex; align-items: center; gap: 7px; min-width: 0;
  white-space: normal;                     /* subtítulo também nunca trunca */
}
.hub-tile .ht-estado.ok { color: var(--ok-ink); }
.hub-tile .ht-estado.warn { color: var(--warn-ink); }
.hub-tile .ht-estado .ms { font-size: 1.2em; flex: none; }

/* ---------- Setups rápidos (hub — toggle liga/desliga, rodada 5) ---------- */
.hub-setups { flex: none; display: flex; flex-direction: column; gap: 10px; }
.hub-setups .hs-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hub-setups .hs-titulo {
  font-size: 15px; font-weight: 700; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .06em;
}
.hub-setups .hs-nota { font-size: 14.5px; font-weight: 500; color: var(--text-mute); }
.setups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-btn {
  min-height: 68px;
  border-radius: var(--r-btn);
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: flex; align-items: center; gap: .7em;
  padding: 8px 16px;
  font-size: var(--fit, 17.5px);
  text-align: left;
  transition: background-color 100ms ease-out, transform 60ms ease-out;
}
.setup-btn:active { background: var(--hover); transform: scale(.98); }
.setup-btn:disabled { opacity: .5; }
.setup-btn:disabled:active { background: var(--surface); transform: none; }
.setup-btn > .ms { font-size: 1.7em; color: var(--text-mute); flex: none; }
.setup-btn .sb-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.setup-btn .sb-nome {
  font-weight: 700; color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.setup-btn .sb-sub { font-size: max(13px, .78em); font-weight: 500; color: var(--text-mute); display: flex; align-items: center; gap: 7px; }
/* estado ATIVO: preenchido, legível à distância de braço, com tempo decorrido ao vivo */
.setup-btn.ativo { border-color: var(--warn); background: var(--warn); }
.setup-btn.ativo > .ms,
.setup-btn.ativo .sb-nome { color: #452F02; }
.setup-btn.ativo .sb-sub { color: #6B4A05; font-weight: 700; font-size: max(13.5px, .82em); font-variant-numeric: tabular-nums; }
.setup-btn.ativo:active { background: color-mix(in srgb, var(--warn) 88%, #000); }
.setup-btn .sb-live {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: #452F02;
  animation: pulsar 1.6s ease-in-out infinite;
}
@keyframes pulsar { 50% { opacity: .25; } }

/* ---------- Setups rápidos — rodapé + painel (celular/coletor · rodada 7) ----------
   O FAB foi eliminado (rodada 7 §2.1). O acesso aos setups fica num botão da
   barra de rodapé do hub; o painel é uma lista de toggles dedicada ao toque. */
.setups-rodape {
  background: color-mix(in srgb, var(--mc) 12%, transparent);
  color: var(--mc-ink);
}
.setups-rodape:active { background: color-mix(in srgb, var(--mc) 22%, transparent); }
.setups-rodape.ativo { background: var(--warn); color: #452F02; font-variant-numeric: tabular-nums; }
.setups-rodape.ativo:active { background: color-mix(in srgb, var(--warn) 88%, #000); }
.setups-rodape .sr-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: currentColor; animation: pulsar 1.6s ease-in-out infinite;
}

.setups-painel { display: flex; flex-direction: column; gap: 10px; }
.su-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 66px; padding: 12px 16px;
  border-radius: var(--r-btn);
  border: 2px solid var(--border-strong);
  background: var(--surface); text-align: left;
  transition: background-color 100ms ease-out, border-color 100ms ease-out;
}
.su-item:active { background: var(--hover); }
.su-item:disabled { opacity: .5; }
.su-item:disabled:active { background: var(--surface); }
.su-item > .ms { font-size: 30px; color: var(--text-mute); flex: none; }
.su-item .su-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.su-item .su-nome { font-size: 18px; font-weight: 700; color: var(--text-soft); }
.su-item .su-sub { font-size: 14.5px; font-weight: 600; color: var(--text-mute); }
.su-item .su-sw {
  flex: none; width: 52px; height: 32px; border-radius: 999px;
  background: var(--hover-strong); position: relative;
  transition: background-color 150ms ease-out;
}
.su-item .su-sw::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 150ms ease-out;
}
.su-item.ativo { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, #FFFFFF); }
.su-item.ativo > .ms { color: var(--warn-ink); }
.su-item.ativo .su-nome { color: var(--warn-ink); }
.su-item.ativo .su-sub { color: var(--warn-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.su-item.ativo .su-sw { background: var(--warn); }
.su-item.ativo .su-sw::after { transform: translateX(20px); }

/* =====================================================================
   Sub-telas — moldura comum
   ===================================================================== */
.sub-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sub-head .sh-txt { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.sub-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.sub-head p { margin: 0; font-size: 16.5px; color: var(--text-mute); font-weight: 500; }

/* ---------- Tela 3 — Produto fabricado ---------- */
.prod-wrap {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 5fr) minmax(320px, 4fr);
  gap: 16px;
  align-items: stretch;
}
.prod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--mc);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0;
}
.prod-card .pf-rotulo { font-size: 15px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; }
.prod-card h2 { margin: 0; font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.prod-card .pf-meta { font-size: 17px; color: var(--text-soft); font-weight: 500; }

.valor-display {
  margin-top: auto;
  border: 2px solid var(--border-strong);
  border-radius: var(--r-card);
  background: var(--surface-alt);
  padding: 16px 22px;
  display: flex; align-items: baseline; gap: 12px;
}
.valor-display.ativo { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 6%, #FFFFFF); }
.valor-display .vd-num { font-size: var(--fit, 52px); flex: 1; min-width: 0; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.valor-display .vd-num .cursor { color: var(--mc); animation: blink 1s steps(1) infinite; font-weight: 400; }
@keyframes blink { 50% { opacity: 0; } }
.valor-display .vd-un { font-size: 20px; font-weight: 600; color: var(--text-mute); }

.prod-conf-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.prod-confirmado {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; color: var(--ok-ink);
}
.prod-confirmado .ms { font-size: 24px; }

/* ---------- Ler Balança (rodada 5 — unidades de peso) ---------- */
.balanca { margin-top: 12px; }
.bal-btn {
  width: 100%; min-height: var(--tap-lg);
  border-radius: var(--r-btn);
  border: 2px solid color-mix(in srgb, var(--mc) 40%, transparent);
  background: color-mix(in srgb, var(--mc) 10%, transparent);
  color: var(--mc-ink);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; text-align: left;
  transition: background-color 100ms ease-out, transform 60ms ease-out;
}
.bal-btn:active { background: color-mix(in srgb, var(--mc) 22%, transparent); transform: scale(.985); }
.bal-btn > .ms { font-size: 34px; }
.bal-btn .bb-txt { display: flex; flex-direction: column; gap: 1px; }
.bal-btn .bb-txt > span:first-child { font-size: 19px; font-weight: 700; }
.bal-btn .bb-sub { font-size: 14.5px; font-weight: 500; opacity: .85; }
.bal-estado {
  min-height: var(--tap-lg);
  border-radius: var(--r-btn);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 10px 20px;
}
.bal-estado .be-txt { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.bal-estado.lendo {
  border: 2px solid color-mix(in srgb, var(--mc) 40%, transparent);
  background: color-mix(in srgb, var(--mc) 6%, #FFFFFF);
  color: var(--mc-ink);
}
.bal-estado.lendo > .ms { font-size: 30px; }
.bal-estado.erro {
  border: 2px solid color-mix(in srgb, var(--err) 30%, transparent);
  background: color-mix(in srgb, var(--err) 6%, #FFFFFF);
  color: var(--err);
}
.bal-estado.erro > .ms { font-size: 30px; }
.ms.spin { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* aviso de bloqueio (gate / OP multi-produto) */
.prod-aviso {
  flex: 1; min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--warn);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 40px; text-align: center;
}
.prod-aviso .ms { font-size: 72px; color: var(--warn-ink); }
.prod-aviso h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.prod-aviso p { margin: 0; font-size: 18.5px; color: var(--text-soft); font-weight: 500; max-width: 620px; line-height: 1.5; }

/* =====================================================================
   Teclado numérico (compartilhado — inline e em sheet)
   ===================================================================== */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.numpad button {
  height: 72px;
  border-radius: var(--r-btn);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 27px; font-weight: 600;
  display: grid; place-items: center;
  transition: background-color 80ms ease-out, transform 60ms ease-out;
}
.numpad button:active { background: var(--hover-strong); transform: scale(.96); }
.numpad button .ms { font-size: 30px; }
.numpad .np-back { color: var(--text-soft); }
.numpad-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  justify-content: center;
}

/* =====================================================================
   Sheet (bottom) genérico — teclado, data/hora
   ===================================================================== */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(24,28,34,.34);
  opacity: 0; pointer-events: none;
  transition: opacity 160ms ease-out;
}
.sheet-scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 61;
  left: 50%; bottom: 0;
  transform: translate(-50%, 105%);
  width: min(560px, calc(100cqw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-card) var(--r-card) 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 200ms cubic-bezier(.2,.8,.3,1);
}
.sheet.on { transform: translate(-50%, 0); }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head .st-txt { display: flex; flex-direction: column; gap: 1px; margin-right: auto; }
.sheet-head b { font-size: 19px; font-weight: 700; }
.sheet-head span { font-size: 15px; color: var(--text-mute); font-weight: 500; }
.sheet-fechar {
  width: 48px; height: 48px; border-radius: var(--r-btn);
  display: grid; place-items: center; color: var(--text-mute);
}
.sheet-fechar:active { background: var(--hover-strong); }
.sheet .valor-display { margin-top: 0; }
.sheet .valor-display .vd-num { font-size: var(--fit, 34px); }

/* ---------- Seletor de data/hora ---------- */
.dt-linhas { display: flex; flex-direction: column; gap: 12px; }
.dt-linha {
  display: grid; grid-template-columns: 64px 1fr 64px;
  gap: 10px; align-items: center;
}
.dt-linha .dt-btn {
  height: 64px; border-radius: var(--r-btn);
  background: var(--surface); border: 1px solid var(--border-strong);
  display: grid; place-items: center; color: var(--text-soft);
}
.dt-linha .dt-btn:active { background: var(--hover-strong); transform: scale(.96); }
.dt-linha .dt-btn .ms { font-size: 30px; }
.dt-valor {
  height: 64px; border-radius: var(--r-btn);
  background: var(--surface-alt); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.dt-valor small { font-size: 15px; font-weight: 600; color: var(--text-mute); }
.dt-agora {
  height: var(--tap); border-radius: var(--r-btn);
  background: color-mix(in srgb, var(--mc) 12%, transparent);
  color: var(--mc-ink); font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.dt-agora:active { background: color-mix(in srgb, var(--mc) 24%, transparent); }

/* =====================================================================
   Tela 4 — Insumos
   ===================================================================== */
.ins-lista {
  flex: 1; min-height: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 4px;
}
.ins-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--divider);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) auto auto 1fr;
  gap: 16px; align-items: center;
}
.ins-row.confirmada  { border-left-color: var(--ok); }
.ins-row.devolucao   { border-left-color: var(--err); }
.ins-row.requisitada { border-left-color: var(--info); }
.ins-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ins-id .in-desc { font-size: 20px; font-weight: 700; line-height: 1.25; }
.ins-id .in-meta { font-size: 15.5px; color: var(--text-mute); font-weight: 500; }
.ins-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* devolução = registro removível (badge-botão com quantidade) */
.badge-dev {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 8px 0 14px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--err) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--err) 22%, transparent);
  color: var(--err); font-size: 15px; font-weight: 700;
  white-space: nowrap;
}
.badge-dev > .ms { font-size: 19px; }
.badge-dev .bd-x {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--err) 10%, transparent);
}
.badge-dev .bd-x .ms { font-size: 17px; }
.badge-dev:active { background: color-mix(in srgb, var(--err) 16%, transparent); }

/* nota de config CFG_VERINSUMOAPT (apenas insumos reservados) */
.ins-cfg-nota {
  display: inline-flex; align-items: center; gap: 8px;
  height: var(--tap); padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--hover-strong); color: var(--text-soft);
  font-size: 15.5px; font-weight: 600;
}
.ins-cfg-nota .ms { font-size: 20px; color: var(--text-mute); }

/* ---------- Leitura de código de barras (rodada 5) ---------- */
.ins-head-acoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* (§4 rodada 8: chip "Leitor ativo" removido do protótipo — o leitor segue armado) */
/* linha destacada após leitura de código previsto */
.ins-row.scan-hit {
  border-color: var(--mc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 30%, transparent);
  animation: scanhit 1.2s ease-out;
}
@keyframes scanhit { 0% { background: color-mix(in srgb, var(--mc) 16%, #FFFFFF); } 100% { background: var(--surface); } }
/* opções do sheet de simulação de leitura (demonstração) */
.sim-scan { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sim-scan b { font-size: 16.5px; font-weight: 700; }
.sim-scan small { font-size: 14px; font-weight: 500; color: var(--text-mute); font-variant-numeric: tabular-nums; }

.qtd-campo { display: flex; flex-direction: column; gap: 6px; }
.qtd-campo label { font-size: 15px; font-weight: 600; color: var(--text-mute); }
.qtd-btn {
  min-width: 140px; height: var(--tap);
  border-radius: var(--r-btn);
  border: 2px solid var(--border-strong);
  background: var(--surface-alt);
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px;
}
.qtd-btn small { font-size: 14.5px; font-weight: 600; color: var(--text-mute); }
.qtd-btn.vazio { color: var(--text-mute); font-weight: 500; font-size: 17px; }
.qtd-btn:active { background: var(--hover-strong); }
.qtd-btn.editada { border-color: var(--mc); }

.ins-acoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Tela 5 — Funcionários ---------- */
.func-lista {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 4px;
}
.func-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto auto;
  gap: 16px; align-items: center;
}
.func-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.func-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: color-mix(in srgb, var(--mc) 14%, transparent);
  color: var(--mc-ink);
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700; flex: none;
}
.func-id .fu-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.func-id .fu-nome { font-size: 20px; font-weight: 700; }
.func-id .fu-cargo { font-size: 15.5px; color: var(--text-mute); font-weight: 500; }

.func-remover {
  width: var(--tap); height: var(--tap); border-radius: var(--r-btn);
  display: grid; place-items: center;
  color: var(--err);
  border: 1px solid color-mix(in srgb, var(--err) 22%, transparent);
  background: color-mix(in srgb, var(--err) 6%, transparent);
}
.func-remover:active { background: color-mix(in srgb, var(--err) 14%, transparent); }

/* ---------- Tela 6 — Setups ---------- */
.par-wrap {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 7fr) 5fr;
  gap: 16px;
}
.par-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--mc);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0; overflow: hidden;         /* a grade de motivos absorve o scroll (§6.1 rodada 8) */
}
/* segmented centralizado, ocupando o espaço igualmente (§6.3 rodada 8) */
.par-form .seg { width: 100%; }
.par-form .seg button { flex: 1; justify-content: center; }
/* "Confirmar registro" preserva altura de toque em qualquer densidade (§6.2 rodada 8) */
.par-form > .btn { flex: none; }
.par-form .pf-secao { font-size: 15px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; }
.pf-secao-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* busca sob demanda (rodada 6): a lista de motivos aparece SEMPRE; a lupa
   só abre a barra de pesquisa + teclado quando o usuário quiser buscar */
.btn-buscar-motivo {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft); font-size: 15.5px; font-weight: 700;
  transition: background-color 100ms ease-out;
}
.btn-buscar-motivo .ms { font-size: 22px; color: var(--text-mute); }
.btn-buscar-motivo:active { background: var(--hover-strong); }

/* grade de motivos: 2 colunas fixas (rótulos cabem melhor) + zona de scroll
   vertical interna; minmax(0,1fr) impede estouro → nunca scroll horizontal */
.motivos {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  flex: 1 1 0; min-height: 96px; align-content: start;
  overflow-y: auto; overflow-x: hidden;    /* scroll SÓ vertical (§6.1) */
  scrollbar-gutter: stable;
}
.motivos.compacta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* rótulos longos quebram dentro do botão em vez de estourar a coluna */
.motivos .motivo { overflow-wrap: anywhere; }
/* catálogos maiores: botões mais compactos, ainda ≥ alvo de toque de 56px */
.motivos.compacta .motivo { min-height: var(--tap); font-size: 16px; padding: 8px 14px; gap: 10px; }
.motivos.compacta .motivo .ms { font-size: 24px; }
.motivo {
  min-height: 72px;
  border-radius: var(--r-btn);
  border: 2px solid var(--border-strong);
  background: var(--surface);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 600; color: var(--text-soft);
  text-align: left;
  transition: background-color 100ms ease-out;
}
.motivo .ms { font-size: 30px; color: var(--text-mute); }
.motivo.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 8%, #FFFFFF); color: var(--text); }
.motivo.on .ms { color: var(--mc-ink); }
.motivo:active { background: var(--hover); }

.dt-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dt-campo { display: flex; flex-direction: column; gap: 6px; }
.dt-campo label { font-size: 15px; font-weight: 600; color: var(--text-mute); }
.dt-campo .qtd-btn { width: 100%; min-width: 0; font-size: 19px; }

.par-lista {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; overflow-y: auto;
  padding-bottom: 4px;
}
.par-lista .pl-titulo { font-size: 17px; font-weight: 700; color: var(--text-soft); }
.par-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--warn);
  border-radius: var(--r-card);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.par-item .pi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.par-item b { font-size: 18.5px; font-weight: 700; }
.par-item .pi-txt > span { font-size: 16px; color: var(--text-mute); font-weight: 500; }
.par-vazio {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-card);
  display: grid; place-items: center;
  color: var(--text-mute); font-size: 16.5px; font-weight: 500;
  padding: 32px 16px;
}

/* =====================================================================
   Busca touch (overlay de tela cheia)
   ===================================================================== */
.busca-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: var(--app-bg);
  display: none;
  flex-direction: column;
  padding: 20px 24px 16px;
  gap: 14px;
}
.busca-overlay.on { display: flex; }
.busca-head { display: flex; align-items: center; gap: 14px; }
.busca-head h2 { margin: 0; font-size: 24px; font-weight: 700; margin-right: auto; }
.busca-campo {
  height: var(--tap-lg);
  border: 2px solid var(--mc);
  border-radius: var(--r-btn);
  background: var(--surface);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  font-size: 21px; font-weight: 600;
}
.busca-campo .ms { color: var(--text-mute); }
.busca-campo .bc-texto { flex: 1; white-space: nowrap; overflow: hidden; }
.busca-campo .bc-texto .cursor { color: var(--mc); animation: blink 1s steps(1) infinite; font-weight: 400; }
.busca-campo .bc-texto .ph { color: var(--text-mute); font-weight: 500; }
.busca-resultados {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.busca-item {
  min-height: 68px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  text-align: left;
}
.busca-item:active { background: var(--surface-alt); }
.busca-item .bi-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.busca-item .bi-nome { font-size: 19.5px; font-weight: 700; }
.busca-item .bi-sub  { font-size: 15.5px; color: var(--text-mute); font-weight: 500; }
.busca-item .ms.bi-add { margin-left: auto; color: var(--mc-ink); font-size: 28px; }
.busca-nada { padding: 24px; text-align: center; color: var(--text-mute); font-size: 16px; font-weight: 500; }

/* teclado alfabético virtual */
.vk { display: flex; flex-direction: column; gap: 8px; flex: none; }
.vk-row { display: flex; gap: 8px; justify-content: center; }
.vk-row button {
  flex: 1; max-width: 96px; height: 58px;
  border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: 20px; font-weight: 600;
  display: grid; place-items: center;
}
.vk-row button:active { background: var(--hover-strong); transform: scale(.96); }
.vk-row button.vk-largo { max-width: none; flex: 3; font-size: 15px; font-weight: 600; color: var(--text-soft); }
.vk-row button .ms { font-size: 24px; }

/* =====================================================================
   Toast
   ===================================================================== */
.toast {
  position: fixed; z-index: 80;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 140%);
  background: var(--text);
  color: #FFFFFF;
  border-radius: var(--r-btn);
  padding: 16px 24px;
  font-size: 17px; font-weight: 600;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(24,28,34,.24);
  transition: transform 220ms cubic-bezier(.2,.8,.3,1);
  max-width: min(560px, calc(100cqw - 32px));
}
.toast.on { transform: translate(-50%, 0); }
.toast .ms { color: var(--ok); font-size: 24px; }

/* =====================================================================
   Diálogo de confirmação (touch — centrado, botões grandes)
   ===================================================================== */
.dlg-scrim {
  position: fixed; inset: 0; z-index: 64;
  background: rgba(24,28,34,.4);
  opacity: 0; pointer-events: none;
  transition: opacity 150ms ease-out;
}
.dlg-scrim.on { opacity: 1; pointer-events: auto; }
.dialogo {
  position: fixed; z-index: 65;
  left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.97); opacity: 0;
  width: min(540px, calc(100cqw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(24,28,34,.22);
  padding: 26px 26px 22px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform 170ms cubic-bezier(.2,.8,.3,1), opacity 150ms ease-out;
}
.dialogo.on { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.dlg-titulo { font-size: 25px; font-weight: 700; letter-spacing: -0.01em; }
.dlg-msg { font-size: 17.5px; color: var(--text-soft); font-weight: 500; line-height: 1.45; }
.dlg-linhas {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-btn);
  overflow: hidden;
}
.dlg-linha {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 13px 16px; font-size: 17px;
  background: var(--surface-alt);
}
.dlg-linha + .dlg-linha { border-top: 1px solid var(--border); }
.dlg-linha span { color: var(--text-mute); font-weight: 600; }
.dlg-linha b { font-weight: 700; text-align: right; }
.dlg-acoes { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 4px; }
.dlg-ok.primario { background: var(--mc); color: #FFFFFF; }
.dlg-ok.primario:active { background: var(--mc-press); }
.dlg-ok.sucesso { background: var(--ok); color: #FFFFFF; }
.dlg-ok.sucesso:active { background: color-mix(in srgb, var(--ok) 86%, #000); }
.dlg-ok.perigo { background: var(--err); color: #FFFFFF; }
.dlg-ok.perigo:active { background: color-mix(in srgb, var(--err) 86%, #000); }

/* =====================================================================
   Indicador "Sem conexão" (barra superior — demo via Tweaks)
   ===================================================================== */
.offline-pill {
  display: none; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--err) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--err) 24%, transparent);
  color: var(--err); font-size: 15px; font-weight: 700;
  white-space: nowrap;
}
.offline-pill .ms { font-size: 22px; }
body.offline .offline-pill { display: inline-flex; }

/* =====================================================================
   Entrada nativa (celular) — delega ao teclado do dispositivo
   ===================================================================== */
.valor-input-row {
  border: 2px solid var(--mc);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--mc) 6%, #FFFFFF);
  padding: 14px 18px;
  display: flex; align-items: baseline; gap: 12px;
}
input.valor-input {
  flex: 1; min-width: 0; width: 100%;
  border: none; outline: none; background: transparent;
  font-family: inherit; color: var(--text);
  font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0;
}
input.valor-input::placeholder { color: var(--text-mute); font-weight: 500; font-size: 17px; }
input.busca-input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; color: var(--text);
  font-size: 18px; font-weight: 600;
  padding: 0;
}
input.busca-input::placeholder { color: var(--text-mute); font-weight: 500; }
input.busca-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* =====================================================================
   Insumos — fila de conferência (EXCLUSIVA celular/coletor, rodada 6)
   Dinâmica do Check-out: "Não conferidos" → leitura/toque → "Conferidos"
   ===================================================================== */
.fila-prog { flex: none; display: flex; flex-direction: column; gap: 8px; }
.fila-prog .fp-txt { font-size: 15.5px; font-weight: 700; color: var(--text-soft); }
.fila-prog .fp-bar { height: 10px; border-radius: var(--r-pill); background: var(--hover-strong); overflow: hidden; }
.fila-prog .fp-fill { height: 100%; border-radius: var(--r-pill); background: var(--ok); transition: width 300ms ease-out; }

.fila-lista {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 4px;
}
.fila-sec {
  display: flex; align-items: center; gap: 10px;
  padding-top: 8px;
  font-size: 14px; font-weight: 700; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .06em;
}
.fila-sec .fs-n {
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--hover-strong); color: var(--text-soft);
  display: grid; place-items: center; font-size: 13.5px;
}
.fila-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--divider);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 6px 12px 14px; min-height: 72px;
  cursor: pointer;
  transition: background-color 100ms ease-out;
}
.fila-row:active { background: var(--surface-alt); }
.fila-row.ok { border-left-color: var(--ok); }
.fila-row .fr-ic { flex: none; color: var(--text-mute); display: grid; place-items: center; }
.fila-row .fr-ic .ms { font-size: 28px; }
.fila-row.ok .fr-ic { color: var(--ok-ink); }
.fila-row .fr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fila-row .fr-desc { font-size: 17.5px; font-weight: 700; line-height: 1.25; }
.fila-row.ok .fr-desc { color: var(--text-soft); }
.fila-row .fr-meta { font-size: 14px; font-weight: 500; color: var(--text-mute); }
.fila-menu {
  width: var(--tap); height: var(--tap); flex: none;
  border-radius: var(--r-btn);
  display: grid; place-items: center; color: var(--text-mute);
}
.fila-menu:active { background: var(--hover-strong); }
.fila-row.scan-hit {
  border-color: var(--mc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 30%, transparent);
  animation: scanhit 1.2s ease-out;
}
.fila-zerada {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-card);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--ok-ink); font-size: 16px; font-weight: 600;
  padding: 22px 16px;
}
.fila-zerada .ms { font-size: 26px; }
/* ações primárias fixas na zona do polegar — sticky no fim da tela rolável */
/* rodapé mobile REUTILIZÁVEL (rodada 7 §2.1) — padrão promovido da fila de
   insumos. Cola nas bordas do .screen (padding 14px/20px no mobile), reserva
   altura própria e respeita a safe-area. .fila-acoes especializa a grade. */
.rodape-mob, .fila-acoes {
  flex: none;
  position: sticky; bottom: 0;
  margin: auto -14px -20px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--app-bg);
  box-shadow: 0 -8px 16px -8px rgba(24,28,34,.12);
  display: flex; gap: 10px;
}
.rodape-mob > .btn, .fila-acoes > .btn { flex: 1; min-height: var(--tap-lg); font-size: 18px; }
.fila-acoes { display: grid; grid-template-columns: 1.4fr 1fr; }

/* =====================================================================
   Responsivo
   ===================================================================== */

/* Os breakpoints medem o CONTÊINER .app (container query) — assim as
   molduras celular/coletor do painel Tweaks ativam os layouts móveis
   mesmo com o navegador em tela cheia. */

/* Tablets menores em paisagem (ex.: iPad mini 1024×768) — agenda em 3 colunas */
@container app (901px <= width <= 1180px) {
  .agenda-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Paisagem baixa (ex.: iPad mini 1024×768) — hub compactado p/ caber sem scroll */
@container app (width >= 901px) and (height <= 840px) {
  .screen { padding: 14px 18px 18px; gap: 12px; }
  .proc-hub { gap: 12px; }
  .hub-col { gap: 12px; }
  .hub-info { padding: 16px 20px; gap: 8px; }
  .hub-info h2 { font-size: 26px; }
  .hub-info .hi-prod { font-size: 17px; }
  .hub-info .hi-meta { font-size: 14.5px; gap: 4px 16px; }
  .hub-acao { gap: .6em; padding: 10px 20px; min-height: 76px; }
  .ha-undo { height: 46px; padding: 0 14px; font-size: 14.5px; }
  .hub-grid { gap: 10px; }
  .hub-tile { padding: 8px 20px; min-height: 64px; }
  .hub-setups { gap: 8px; }
  .setups-grid { gap: 8px; }
  .setup-btn { min-height: 58px; padding: 6px 14px; }
}

/* Insumos em tablets pequenos/médios (ex.: iPad mini 1024×768): as ações vão
   para uma linha própria abaixo do card, alinhadas à direita — nunca empilham
   verticalmente dentro da coluna (§5 rodada 8). Acima de 1180px há espaço para
   as ações em linha na própria linha do card. */
@container app (641px <= width <= 1180px) {
  .ins-row { grid-template-columns: 1fr auto auto; }
  .ins-acoes { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Tablet retrato (~800×1280 · iPad mini retrato 768×1024) */
@container app (width <= 900px) {
  .agenda-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(232px, auto); }
  /* hub empilhado: alturas naturais + rolagem como salvaguarda — nunca comprime/sobrepõe */
  .proc-hub { display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 4px; }
  .hub-col { flex: none; }
  .hub-col.esq { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .hub-acao { min-height: 84px; flex: none; }
  .hub-grid { flex: none; }
  .hub-tile { flex: none; }
  .prod-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .par-wrap { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .par-lista { max-height: 320px; }
  .func-row { grid-template-columns: 1fr auto; }
  .func-dts { grid-column: 1 / 2; }
}

/* Retrato baixo (ex.: iPad mini retrato 768×1024) — hub compacto p/ caber sem rolagem */
@container app (641px <= width <= 900px) and (height <= 1100px) {
  .screen { padding: 14px 18px 18px; gap: 12px; }
  .hub-info { padding: 16px 20px; gap: 8px; }
  .hub-info h2 { font-size: 26px; }
  .hub-tile { padding: 8px 20px; min-height: 62px; }
  .hub-grid { gap: 10px; }
  .hub-setups { gap: 8px; }
  .setups-grid { gap: 8px; }
  .setup-btn { min-height: 58px; padding: 6px 14px; }
}

.func-dts { display: flex; gap: 12px; }

/* Celular e coletor — layouts próprios (rodada 6): rolagem vertical dentro
   da tela, ação primária sempre visível, teclado do dispositivo p/ texto */
@container app (width <= 640px) {
  #screen-root { overflow-y: auto; }
  .screen { flex: none; min-height: 100%; padding: 14px 14px 20px; gap: 14px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-title span { display: none; }
  .operador-chip .op-txt { display: none; }
  .operador-chip { padding: 0 8px; }
  .offline-pill { padding: 0 12px; font-size: 0; gap: 0; height: 44px; width: 44px; justify-content: center; }
  .btn-voltar { padding: 0 14px; }
  .btn-voltar .bv-label { display: none; }
  .agenda-titulo h1 { font-size: 25px; }
  .agenda-titulo p { font-size: 15.5px; }
  .ctx-banner { max-width: none; min-height: var(--tap); padding: 8px 16px; }
  .chip { height: 50px; padding: 0 18px; font-size: 16px; }
  /* agenda: lista vertical de 1 coluna — cor, situação e ordenação mantidas */
  .agenda-grid { grid-template-columns: 1fr; overflow: visible; grid-auto-rows: auto; flex: none; }
  .proc-card { min-height: 0; }
  .proc-card .pc-prod { font-size: 17px; }
  .proc-card .pc-foot { padding-top: 12px; }
  /* hub: quadro + Iniciar/Finalizar + 4 acessos SEMPRE visíveis sem scroll
     (setups rápidos ficam no botão flutuante → painel inferior) */
  .proc-hub { overflow: visible; flex: none; gap: 12px; }
  .hub-col { gap: 12px; }
  .hub-col.esq { gap: 12px; }
  .hub-info { padding: 18px 20px; }
  .hub-info h2 { font-size: 26px; }
  .hub-info .hi-prod { font-size: 17.5px; }
  .hub-info .hi-meta { font-size: 15px; gap: 6px 16px; }
  .hub-acao { gap: .6em; padding: 12px 16px; min-height: 76px; }
  .ha-undo { height: 48px; padding: 0 14px; font-size: 15px; }
  .hub-feito { padding: 10px 16px; }
  .hub-grid { gap: 10px; }
  .hub-tile {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: .8em; row-gap: 2px;
    padding: 10px 18px; min-height: 74px;
  }
  .hub-tile .ht-ic { grid-row: 1 / 3; }
  .setups-grid { grid-template-columns: 1fr; }
  .sub-head h1 { font-size: 24px; }
  .sub-head p { font-size: 15px; }
  .prod-card h2 { font-size: 22px; }
  .prod-card .pf-meta { font-size: 15.5px; }
  .prod-aviso { padding: 28px 20px; }
  .prod-aviso .ms { font-size: 56px; }
  .prod-aviso h2 { font-size: 22px; }
  .prod-aviso p { font-size: 16px; }
  .ins-row { grid-template-columns: 1fr; }
  .ins-id .in-desc { font-size: 18px; }
  .func-row { grid-template-columns: 1fr; }
  .func-dts { flex-wrap: wrap; }
  .func-id .fu-nome { font-size: 18px; }
  .motivos, .motivos.compacta { grid-template-columns: 1fr; }
  .dt-campos { grid-template-columns: 1fr; }
  .vk-row button { height: 50px; }
  .busca-campo { font-size: 18px; }
  .busca-item .bi-nome { font-size: 17.5px; }
  /* sheets centralizados na moldura (rodada 7) — abrem como diálogo modal no
     centro, não colados ao topo */
  .sheet {
    top: 50%; bottom: auto; left: 50%;
    border-radius: var(--r-card);
    border-bottom: 1px solid var(--border);
    transform: translate(-50%, -46%); opacity: 0;
    box-shadow: 0 16px 40px rgba(24,28,34,.22);
    max-height: calc(100cqh - 32px); overflow-y: auto;
  }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  /* painel de setups rápidos (sem input — o teclado não cobre): ancora
     embaixo, junto ao botão flutuante que o abriu */
  .sheet.sheet-baixo {
    top: auto; bottom: 0;
    border-radius: var(--r-card) var(--r-card) 0 0;
    border-bottom: none;
    transform: translate(-50%, 105%); opacity: 1;
    box-shadow: 0 -12px 32px rgba(24,28,34,.18);
    max-height: 78cqh; overflow-y: auto;
  }
  .sheet.sheet-baixo.on { transform: translate(-50%, 0); }
  /* diálogo: botões empilhados (ação em cima) */
  .dlg-titulo { font-size: 22px; }
  .dlg-acoes { grid-template-columns: 1fr; }
  .dlg-acoes .btn-neutro { order: 2; }
}

/* =====================================================================
   RODADA 7 — layout mobile fluido (celular ≡ coletor)
   Um único layout para toda a faixa ≤ 640px; nenhum tratamento distinto
   por moldura. Tipografia fluida com clamp()/cqw (sem px fixos grandes),
   sem truncamento: rótulos quebram/reduzem até caber. Este bloco vem por
   último para sobrepor as regras móveis anteriores. TABLET intocado.
   ===================================================================== */
@container app (width <= 640px) {

  /* seg dentro de sheet (painel de filtros) ocupa a largura toda */
  .sheet .seg { width: 100%; }
  .sheet .seg button { flex: 1; justify-content: center; }

  /* telas de altura fixa com rodapé/lista interna rolável (sem scroll de página) */
  .screen.hub-mob, .screen.ins-mob, .screen.func-mob {
    flex: 1; min-height: 0; overflow: hidden;
  }

  /* ---------- §2 Hub: tudo visível sem scroll, sem FAB ---------- */
  .screen.hub-mob { padding: 12px 14px 20px; gap: 8px; }
  .hub-mob .proc-hub {
    flex: 1; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column; gap: 8px;
  }
  .hub-mob .hub-col { display: contents; }
  /* quadro da OP compacto — libera altura para os tiles em telas mais baixas */
  .hub-mob .hub-info { flex: none; padding: 12px 16px; gap: 2px; }
  .hub-mob .hub-info h2 { font-size: clamp(19px, 5cqw, 24px); }
  .hub-mob .hub-info .hi-prod { font-size: 15px; }
  .hub-mob .hub-info .hi-meta { font-size: 13px; gap: 2px 14px; margin-top: 0; }
  .hub-mob .hub-acoes { flex: none; gap: 8px; }
  .hub-mob .hub-acao {
    flex: none; min-height: 58px; padding: 8px 16px;
    font-size: clamp(18px, 5cqw, 27px);
  }
  .hub-mob .hub-acao > .ms { font-size: 1.5em; }
  .hub-mob .hub-acao .ha-rotulo { white-space: normal; overflow: visible; }
  .hub-mob .hub-acao .ha-sub { font-size: max(13px, .46em); }
  .hub-mob .hub-acao.feita { font-size: 19px; min-height: 50px; }
  .hub-mob .hub-feito { min-height: 46px; padding: 8px 14px; }
  /* processo iniciado: faixa "Iniciado" + "Finalizar" na MESMA linha, compactos
     (rodada 7) — Desfazer só ícone, Finalizar sem subtítulo/rótulo curto */
  .hub-mob .hub-acoes.linha { flex-direction: row; align-items: stretch; gap: 8px; }
  .hub-mob .hub-acoes.linha .hub-feito {
    flex: 1 1 0; min-width: 0; padding: 8px 8px 8px 14px; gap: 8px;
  }
  .hub-mob .hub-acoes.linha .hub-feito > .ms { display: none; }
  .hub-mob .hub-acoes.linha .hub-feito .hf-txt b { font-size: 16px; }
  .hub-mob .hub-acoes.linha .hub-feito .hf-txt span { font-size: 13px; }
  .hub-mob .hub-acoes.linha .hub-feito .ha-undo { height: 44px; padding: 0 12px; }
  .hub-mob .hub-acoes.linha .hub-feito .ha-undo .ha-undo-label { display: none; }
  .hub-mob .hub-acoes.linha .hub-acao.finalizar {
    flex: 1 1 0; min-width: 0; justify-content: center;
    padding: 8px 14px; font-size: clamp(17px, 4.6cqw, 24px);
  }
  /* estado concluído: faixa "Concluído" (hub-acao.feita) na linha, Reabrir só ícone */
  .hub-mob .hub-acoes.linha .hub-acao.feita {
    flex: 1 1 0; min-width: 0; min-height: 0;
    padding: 8px 8px 8px 12px; gap: 8px; font-size: 16px;
  }
  .hub-mob .hub-acoes.linha .hub-acao.feita > .ms { display: none; }
  .hub-mob .hub-acoes.linha .hub-acao.feita .ha-sub { font-size: 13px; }
  .hub-mob .hub-acoes.linha .hub-acao.feita .ha-undo { height: 44px; padding: 0 12px; }
  .hub-mob .hub-acoes.linha .hub-acao.feita .ha-undo .ha-undo-label { display: none; }
  /* §2.3 tiles dividem o espaço vertical restante; só ícone + título */
  .hub-mob .hub-grid { flex: 1; min-height: 0; gap: 8px; }
  /* cada tile é um CONTAINER de tamanho: ícone e rótulo escalam com a altura
     disponível do tile (cqh) — crescem quando sobra espaço, encolhem quando
     falta, uniformes entre tiles de mesma altura e sem nunca truncar. */
  .hub-mob .hub-tile {
    flex: 1 1 0; min-height: 0; overflow: hidden;
    container: hubtile / size;
    grid-template-columns: auto 1fr; align-items: center; column-gap: 14px;
    padding: 6px 18px;
  }
  .hub-mob .hub-tile .ht-ic {
    grid-row: auto; width: auto; aspect-ratio: 1;
    height: min(58cqh, calc(100% - 12px)); border-radius: 14px;
  }
  .hub-mob .hub-tile .ht-ic .ms { font-size: 36cqh; }
  .hub-mob .hub-tile .ht-label {
    white-space: normal; overflow: hidden;
    font-size: clamp(16px, 26cqh, 34px); line-height: 1.12;
  }
  /* rodapé do hub é o LIMITE INFERIOR real da tela — não flutua sobre o
     conteúdo (sem sticky/margin-top:auto); os tiles ficam contidos acima) */
  .hub-mob .rodape-mob { position: relative; margin-top: 0; }
  .hub-mob .rodape-mob > .btn { min-height: 56px; }

  /* ---------- §5 Agenda: cabeçalho compacto, filtros no rodapé ---------- */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .filtros-btn { background: color-mix(in srgb, var(--mc) 12%, transparent); color: var(--mc-ink); justify-content: flex-start; gap: 12px; padding: 0 18px; }
  .filtros-btn > .ms { font-size: 26px; flex: none; }
  .filtros-btn .ff-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
  .filtros-btn .ff-txt b { font-size: 16px; }
  .filtros-btn .ff-txt span { font-size: 13.5px; font-weight: 600; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62cqw; }

  /* ---------- §4 Insumos: abas + páginas deslizantes por swipe ---------- */
  .ins-tabs {
    flex: none; display: grid; grid-template-columns: 1fr 1fr;
    border-bottom: 2px solid var(--border);
  }
  .ins-tab {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; font-size: 16px; font-weight: 700; color: var(--text-mute);
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: color 100ms ease-out;
  }
  .ins-tab.on { color: var(--mc-ink); border-bottom-color: var(--mc); }
  .ins-tab .it-n {
    min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--r-pill);
    background: var(--hover-strong); color: var(--text-soft);
    display: grid; place-items: center; font-size: 13px;
  }
  .ins-tab.on .it-n { background: color-mix(in srgb, var(--mc) 16%, transparent); color: var(--mc-ink); }
  .ins-pager {
    flex: 1; min-height: 0;
    display: flex; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .ins-pager::-webkit-scrollbar { display: none; }
  .ins-page {
    flex: 0 0 100%; width: 100%; scroll-snap-align: start;
    overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px 1px 4px;
  }
  .ins-vazia {
    border: 2px dashed var(--border-strong); border-radius: var(--r-card);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: var(--text-mute); font-size: 15.5px; font-weight: 600;
    padding: 26px 16px; text-align: center;
  }
  .ins-vazia.ok { color: var(--ok-ink); }
  .ins-vazia .ms { font-size: 26px; }

  /* ---------- §3 Produto fabricado: tela mobile própria ---------- */
  .prod-mob-info {
    background: var(--surface); border: 1px solid var(--border);
    border-left: 5px solid var(--mc); border-radius: var(--r-card);
    box-shadow: var(--shadow-card); padding: 16px 18px;
    display: flex; flex-direction: column; gap: 4px;
  }
  .prod-mob-info .pm-rot { font-size: 13px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; }
  .prod-mob-info h2 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.2; }
  .prod-mob-info .pm-meta { font-size: 14.5px; color: var(--text-soft); font-weight: 500; }
  .prod-mob-campo { display: flex; flex-direction: column; gap: 8px; }
  .prod-mob-campo > label { font-size: 14px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .05em; }
  .prod-mob-num {
    border: 2px solid var(--mc); border-radius: var(--r-card);
    background: color-mix(in srgb, var(--mc) 6%, #FFFFFF);
    padding: 18px 22px; display: flex; align-items: baseline; gap: 12px;
  }
  .prod-mob-num input {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    font-family: inherit; color: var(--text);
    font-size: clamp(40px, 12cqw, 60px); font-weight: 700; font-variant-numeric: tabular-nums; padding: 0;
  }
  .prod-mob-num input::placeholder { color: var(--text-mute); font-weight: 500; font-size: 18px; }
  .prod-mob-num .vd-un { font-size: 20px; font-weight: 600; color: var(--text-mute); }

  /* ---------- §3 Funcionários: card mobile dedicado ---------- */
  .funcm-lista { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
  .funcm-row {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-card); box-shadow: var(--shadow-card);
    display: flex; align-items: center; gap: 14px; padding: 12px 8px 12px 14px;
    min-height: 72px; text-align: left; width: 100%;
    transition: background-color 100ms ease-out;
  }
  .funcm-row:active { background: var(--surface-alt); }
  .funcm-av {
    width: 46px; height: 46px; border-radius: 50%; flex: none;
    background: color-mix(in srgb, var(--mc) 14%, transparent); color: var(--mc-ink);
    display: grid; place-items: center; font-size: 16px; font-weight: 700;
  }
  .funcm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .funcm-nome { font-size: 17.5px; font-weight: 700; line-height: 1.2; }
  .funcm-cargo { font-size: 14px; color: var(--text-mute); font-weight: 500; }
  .funcm-horas { font-size: 13.5px; color: var(--text-soft); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
  .funcm-chev { flex: none; color: var(--text-mute); }
  .funcm-chev .ms { font-size: 26px; }

  /* ---------- §3 Setups: tela mobile própria ---------- */
  .setm-sec { font-size: 13px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .setm-motivos { display: flex; flex-direction: column; gap: 8px; }
  .setm-motivo {
    display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 16px;
    border-radius: var(--r-btn); border: 2px solid var(--border-strong);
    background: var(--surface); font-size: 16.5px; font-weight: 600; color: var(--text-soft); text-align: left;
    transition: background-color 100ms ease-out;
  }
  .setm-motivo > .ms { font-size: 26px; color: var(--text-mute); flex: none; }
  .setm-motivo .sm-label { flex: 1; min-width: 0; }
  .setm-motivo .sm-check { color: var(--mc-ink); flex: none; font-size: 24px; }
  .setm-motivo.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 8%, #FFFFFF); color: var(--text); }
  .setm-motivo.on > .ms { color: var(--mc-ink); }
  .setm-motivo:active { background: var(--hover); }
  .setm-per { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .setm-per .dt-campo .qtd-btn { width: 100%; min-width: 0; font-size: 18px; }
  .setm-lista { display: flex; flex-direction: column; gap: 8px; }
}
