:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --surface-3: #e6e3dc;
  --line: #e2dfd8;
  --line-forte: #cfcbc2;
  --text: #1c2430;
  --muted: #6b7280;
  --accent: #1f4e79;
  --accent-hover: #183e61;
  --accent-ink: #ffffff;
  --accent-soft: #e3ecf5;
  --hl: #f4c95d;
  --danger: #b23b3b;
  --danger-soft: #f7e3e3;
  --ok: #2e7d4f;
  --ok-soft: #e1f1e7;
  --warn: #a8700f;
  --warn-soft: #f8edd5;
  --sombra: 0 1px 2px rgba(28, 36, 48, .06), 0 4px 16px rgba(28, 36, 48, .06);
  --sombra-forte: 0 12px 40px rgba(28, 36, 48, .18);
  --raio: 10px;
  --raio-p: 7px;
  --nav-l: 212px;
  --fonte: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --surface: #1e2125;
    --surface-2: #25292e;
    --surface-3: #2d3238;
    --line: #32373d;
    --line-forte: #444a52;
    --text: #e8e6e1;
    --muted: #9aa1ab;
    --accent: #7fb0e0;
    --accent-hover: #9cc3ea;
    --accent-ink: #0f1720;
    --accent-soft: #233243;
    --danger: #e07a7a;
    --danger-soft: #3a2324;
    --ok: #6cc591;
    --ok-soft: #1f3328;
    --warn: #e2b04f;
    --warn-soft: #3a3020;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --sombra-forte: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--fonte);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.peq { font-size: 12px; }

/* ---------- ícones ---------- */
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------- estrutura ---------- */
.app { display: flex; min-height: 100%; }
.nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-l);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; padding: 16px 10px;
  z-index: 20;
}
.nav-marca { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; padding: 4px 10px 18px; letter-spacing: -.01em; }
.nav-logo { width: 26px; height: 26px; border-radius: 7px; background: #1f2a37; position: relative; }
.nav-logo::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border: 2.5px solid var(--hl); border-radius: 50%; }
.nav-logo::after { content: ""; position: absolute; left: 16px; top: 16px; width: 6px; height: 2.5px; background: var(--hl); transform: rotate(45deg); transform-origin: left; border-radius: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--raio-p);
  color: var(--muted); text-decoration: none; font-weight: 520;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.ativo { background: var(--accent-soft); color: var(--accent); }

.conteudo { flex: 1; margin-left: var(--nav-l); min-width: 0; outline: none; padding-bottom: 90px; }

.topo {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.topo h1 { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: -.01em; margin-right: auto; }
.pagina { padding: 20px 24px; }

/* ---------- controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: var(--raio-p);
  border: 1px solid var(--line-forte); background: var(--surface); cursor: pointer;
  font-weight: 540; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.prim { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.prim:hover { background: var(--accent-hover); }
.btn.perigo { color: var(--danger); }
.btn.perigo:hover { background: var(--danger-soft); }
.btn.fant { border-color: transparent; background: transparent; }
.btn.fant:hover { background: var(--surface-2); }
.btn.ico-btn { width: 34px; padding: 0; }
.btn.peq { height: 28px; padding: 0 9px; font-size: 13px; }
.btn.ico-btn.peq { width: 28px; padding: 0; }
.btn .ico { width: 16px; height: 16px; }

.campo { display: flex; flex-direction: column; gap: 5px; }
.campo > label, .rotulo { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.entrada, select.entrada, textarea.entrada {
  height: 36px; padding: 0 11px; border-radius: var(--raio-p);
  border: 1px solid var(--line-forte); background: var(--surface); width: 100%;
  outline: none; transition: border-color .12s, box-shadow .12s;
  font-size: 16px; /* evita zoom no iPhone */
}
@media (min-width: 761px) { .entrada, select.entrada, textarea.entrada { font-size: 14px; } }
textarea.entrada { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.entrada:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
select.entrada { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 11px; }
.linha { display: flex; gap: 8px; align-items: center; }
.linha > * { min-width: 0; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; padding: 3px 0; }
.chk input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; flex: none; }

.pilulas { display: flex; flex-wrap: wrap; gap: 6px; }
.pilula {
  height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-forte);
  background: var(--surface); cursor: pointer; font-weight: 540; font-size: 13px;
}
.pilula[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.fichas { display: flex; flex-wrap: wrap; gap: 6px; }
.ficha {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--accent-soft); color: var(--accent); border-radius: 6px;
  padding: 4px 4px 4px 9px; font-size: 13px; font-weight: 540;
}
.ficha span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha button { border: 0; background: transparent; cursor: pointer; color: inherit; padding: 0 3px; font-size: 15px; line-height: 1; opacity: .7; }
.ficha button:hover { opacity: 1; }

.selo {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.selo.ok { background: var(--ok-soft); color: var(--ok); }
.selo.perigo { background: var(--danger-soft); color: var(--danger); }
.selo.aviso { background: var(--warn-soft); color: var(--warn); }
.selo.acento { background: var(--accent-soft); color: var(--accent); }
.selo .ico { width: 12px; height: 12px; }
.selo .bola { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- autocompletar ---------- */
.auto { position: relative; }
.auto-lista {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line-forte); border-radius: var(--raio-p);
  box-shadow: var(--sombra-forte); max-height: 300px; overflow: auto; padding: 4px;
}
.auto-item { padding: 7px 9px; border-radius: 5px; cursor: pointer; }
.auto-item small { display: block; color: var(--muted); font-size: 12px; }
.auto-item[aria-selected="true"], .auto-item:hover { background: var(--surface-2); }
.auto-vazio { padding: 10px; color: var(--muted); }

/* ---------- busca ---------- */
.busca { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; align-items: start; }
.filtros {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 18px 18px 120px; display: flex; flex-direction: column; gap: 18px;
}
.filtros h2 { font-size: 15px; margin: 0; font-weight: 650; }
.filtros .acoes { display: flex; gap: 8px; position: sticky; bottom: -120px; padding: 12px 0 0; background: var(--surface); }
.filtros .acoes .btn.prim { flex: 1; }
.dica { font-size: 12px; color: var(--muted); margin: 0; }

.resultados-topo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 9;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.resultados-topo .contagem { margin-right: auto; font-weight: 600; }
.alternar { display: inline-flex; border: 1px solid var(--line-forte); border-radius: var(--raio-p); overflow: hidden; }
.alternar button { border: 0; background: var(--surface); height: 32px; width: 36px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.alternar button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.alternar button + button { border-left: 1px solid var(--line-forte); }

.resultados { padding: 16px 24px; }
.lista-empresas { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--raio); overflow: hidden; }
.item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item.sel { background: var(--accent-soft); }
.item .nome { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.item .lado { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; font-size: 12.5px; color: var(--muted); }
.item .lado .local { color: var(--text); font-weight: 520; }

.grade-empresas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cartao {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--raio); padding: 14px;
  display: flex; flex-direction: column; gap: 8px; cursor: pointer; position: relative;
  transition: border-color .12s, box-shadow .12s;
}
.cartao:hover { border-color: var(--line-forte); box-shadow: var(--sombra); }
.cartao.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.cartao .topo-c { display: flex; gap: 10px; align-items: flex-start; }
.cartao .nome { font-weight: 640; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cartao .sub { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cartao .rodape-c { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.marcar { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; cursor: pointer; flex: none; }

.mais { display: flex; justify-content: center; padding: 18px 0 8px; }
.vazio { text-align: center; padding: 70px 20px; color: var(--muted); max-width: 460px; margin: 0 auto; }
.vazio h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.vazio .ico { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }
.carregando { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.giro { width: 18px; height: 18px; border: 2px solid var(--line-forte); border-top-color: var(--accent); border-radius: 50%; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.alerta { background: var(--danger-soft); color: var(--danger); padding: 12px 14px; border-radius: var(--raio-p); margin-bottom: 14px; }

.btn-filtros { display: none; }

/* ---------- barra de seleção ---------- */
.selecao {
  position: fixed; left: calc(var(--nav-l) + 24px); right: 24px; bottom: 18px; z-index: 40;
  background: #1f2a37; color: #f3f1ec; border-radius: 12px; box-shadow: var(--sombra-forte);
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; flex-wrap: wrap;
}
.selecao .qtd { font-weight: 650; margin-right: auto; }
.selecao .btn { background: transparent; border-color: #4a5563; color: #f3f1ec; }
.selecao .btn:hover { background: #2c3a4b; }
.selecao .btn.prim { background: var(--hl); border-color: var(--hl); color: #1f2a37; }

/* ---------- gaveta (ficha) ---------- */
.gaveta-fundo { position: fixed; inset: 0; background: rgba(15, 20, 28, .32); z-index: 50; }
.gaveta {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: 51;
  background: var(--bg); box-shadow: var(--sombra-forte); transform: translateX(105%);
  transition: transform .22s ease; display: flex; flex-direction: column;
}
.gaveta.aberta { transform: none; }
.gaveta-topo { padding: 18px 20px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gaveta-topo .linha-1 { display: flex; gap: 10px; align-items: flex-start; }
.gaveta-topo h2 { font-size: 19px; margin: 0; line-height: 1.25; letter-spacing: -.01em; flex: 1; }
.gaveta-topo .razao { color: var(--muted); margin-top: 3px; }
.gaveta-topo .selos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gaveta-corpo { flex: 1; overflow: auto; padding: 16px 20px 40px; -webkit-overflow-scrolling: touch; }

.contatos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.contato {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px;
  border-radius: var(--raio-p); border: 1px solid var(--line); background: var(--surface-2);
  text-decoration: none; color: var(--text); font-size: 12.5px; font-weight: 560; cursor: pointer;
}
.contato:hover { border-color: var(--line-forte); background: var(--surface-3); }
.contato .ico { width: 20px; height: 20px; color: var(--accent); }
.contato[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.contato.whats .ico { color: #1f9d55; }

.acoes-ficha { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.secao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--raio); margin-bottom: 12px; }
.secao > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; padding: 12px 14px 0; font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.secao .conteudo-s { padding: 10px 14px 14px; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 520; overflow-wrap: anywhere; }
.socio { padding: 9px 0; border-bottom: 1px solid var(--line); }
.socio:last-child { border-bottom: 0; padding-bottom: 0; }
.socio:first-child { padding-top: 0; }
.socio .n { font-weight: 600; }
.cnae-sec { padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.cnae-sec:last-child { border-bottom: 0; }
.cnae-sec code { color: var(--muted); font-size: 12px; }

.negocio { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.atividades { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.ativ { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ativ .ico { width: 16px; height: 16px; color: var(--muted); margin-top: 1px; }
.ativ .t { white-space: pre-wrap; overflow-wrap: anywhere; }
.ativ.sistema .t { color: var(--muted); }
.ativ time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ativ .apagar { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 14px; visibility: hidden; }
.ativ:hover .apagar { visibility: visible; }

/* ---------- listas ---------- */
.listas-lay { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 63px); }
.listas-menu { border-right: 1px solid var(--line); background: var(--surface); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.listas-menu a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--raio-p);
  color: var(--text); text-decoration: none;
}
.listas-menu a:hover { background: var(--surface-2); }
.listas-menu a.ativo { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.listas-menu .bola { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.listas-menu .n { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.listas-menu .nome-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- funil ---------- */
.quadro { display: flex; gap: 12px; padding: 16px 24px 30px; overflow-x: auto; align-items: flex-start; min-height: calc(100vh - 63px); -webkit-overflow-scrolling: touch; }
.coluna { flex: 0 0 280px; background: var(--surface-2); border-radius: var(--raio); display: flex; flex-direction: column; max-height: calc(100vh - 110px); border: 1px solid transparent; }
.coluna.alvo { border-color: var(--accent); background: var(--accent-soft); }
.coluna-topo { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.coluna-topo .t { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.coluna-topo .bola { width: 9px; height: 9px; border-radius: 50%; }
.coluna-topo .q { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.coluna-topo .soma { color: var(--muted); font-size: 12px; padding-left: 17px; }
.coluna-cards { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.card-n {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 10px 6px;
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.03);
}
.card-n:hover { border-color: var(--line-forte); }
.card-n .alca { color: var(--muted); cursor: grab; touch-action: none; display: flex; align-items: flex-start; padding-top: 1px; opacity: .55; }
.card-n .alca:hover { opacity: 1; }
.card-n .alca .ico { width: 16px; height: 16px; }
.card-n .nome { font-weight: 620; line-height: 1.3; overflow-wrap: anywhere; }
.card-n .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-n .meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.card-n .ultima { font-size: 12px; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-n.fantasma { position: fixed; z-index: 100; pointer-events: none; box-shadow: var(--sombra-forte); transform: rotate(2deg); opacity: .95; width: 262px; }
.card-n.arrastando { opacity: .35; }
.coluna-vazia { color: var(--muted); font-size: 12.5px; text-align: center; padding: 14px 6px; border: 1px dashed var(--line-forte); border-radius: 8px; }

/* ---------- ajustes ---------- */
.ajustes { max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.bloco { background: var(--surface); border: 1px solid var(--line); border-radius: var(--raio); padding: 18px; }
.bloco h2 { font-size: 15px; margin: 0 0 4px; }
.bloco > p { margin: 0 0 14px; color: var(--muted); }
.etapa-linha { display: grid; grid-template-columns: 36px minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; padding: 6px 0; }
.etapa-linha input[type="color"] { width: 36px; height: 36px; border: 1px solid var(--line-forte); border-radius: var(--raio-p); padding: 3px; background: var(--surface); cursor: pointer; }
.modelo { border: 1px solid var(--line); border-radius: var(--raio-p); padding: 12px; margin-bottom: 8px; }
.modelo .t { font-weight: 620; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.modelo .x { color: var(--muted); white-space: pre-wrap; margin-top: 4px; font-size: 13px; }

/* ---------- modal / menu / avisos ---------- */
.modal-fundo { position: fixed; inset: 0; background: rgba(15, 20, 28, .4); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--sombra-forte); width: min(440px, 100%); max-height: 90vh; overflow: auto; }
.modal header { padding: 18px 20px 6px; }
.modal header h2 { margin: 0; font-size: 17px; }
.modal header p { margin: 6px 0 0; color: var(--muted); }
.modal .corpo-m { padding: 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal footer { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.opcoes-lista { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; }
.opcoes-lista .chk { padding: 7px 8px; border-radius: 6px; }
.opcoes-lista .chk:hover { background: var(--surface-2); }

.menu-flutuante { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line-forte); border-radius: var(--raio-p); box-shadow: var(--sombra-forte); padding: 4px; min-width: 220px; max-width: 320px; }
.menu-flutuante button, .menu-flutuante a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 5px; cursor: pointer; color: var(--text); text-decoration: none; }
.menu-flutuante button:hover, .menu-flutuante a:hover { background: var(--surface-2); }
.menu-flutuante small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-flutuante .sep { height: 1px; background: var(--line); margin: 4px 0; }

.avisos { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.aviso { background: #1f2a37; color: #f3f1ec; padding: 10px 16px; border-radius: 9px; box-shadow: var(--sombra-forte); font-weight: 540; animation: sobe .2s ease; max-width: 90vw; }
.aviso.erro { background: var(--danger); color: #fff; }
@keyframes sobe { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsivo (iPhone) ---------- */
@media (max-width: 760px) {
  :root { --nav-l: 0px; }
  .nav {
    inset: auto 0 0 0; width: auto; height: calc(62px + env(safe-area-inset-bottom)); flex-direction: row;
    border-right: 0; border-top: 1px solid var(--line); padding: 4px 6px env(safe-area-inset-bottom); justify-content: space-around;
  }
  .nav-marca { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; flex: 1; }
  .nav a .ico { width: 22px; height: 22px; }
  .nav a.ativo { background: transparent; }
  .conteudo { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .topo { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .pagina { padding: 16px; }
  .busca { grid-template-columns: 1fr; }
  .filtros {
    position: fixed; inset: 0; height: auto; z-index: 60; border-right: 0; transform: translateY(102%);
    transition: transform .22s ease; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: 30px;
  }
  .filtros.aberto { transform: none; }
  .filtros .acoes { bottom: -30px; padding-bottom: env(safe-area-inset-bottom); }
  .btn-filtros { display: inline-flex; }
  .resultados-topo { padding: 10px 16px; }
  .resultados { padding: 12px 16px; }
  .item { grid-template-columns: 26px minmax(0, 1fr); }
  .item .lado { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .grade-empresas { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cartao { padding: 11px; }
  .topo .entrada { flex: 1 1 160px; width: auto !important; }
  .selecao { left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); padding: 8px; }
  .selecao .qtd { width: 100%; padding-left: 6px; }
  .selecao .btn { flex: 1; padding: 0 8px; }
  .selecao .rot-longo { display: none; }
  .gaveta { width: 100%; }
  .gaveta-topo { padding-top: max(18px, env(safe-area-inset-top)); }
  .dl { grid-template-columns: 1fr; gap: 1px 0; }
  .dl dd { margin-bottom: 8px; }
  .listas-lay { grid-template-columns: 1fr; }
  .listas-menu { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 6px; }
  .listas-menu a { flex: none; border: 1px solid var(--line); }
  .quadro { padding: 12px 16px 30px; scroll-snap-type: x mandatory; }
  .coluna { flex-basis: 84vw; scroll-snap-align: start; max-height: none; }
  .etapa-linha { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .etapa-linha select { grid-column: 2; }
  .avisos { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .grade-empresas { grid-template-columns: 1fr; } }
