/* Quadro Certo — app. Mobile primeiro; tema claro com escuro automático. */
:root {
  --fundo: #f4f5f7;
  --superficie: #ffffff;
  --superficie-2: #f8fafc;
  --borda: #e2e8f0;
  --texto: #0f172a;
  --texto-2: #475569;
  --texto-3: #64748b;
  --marca: #f5b301;
  --marca-forte: #d99a00;
  --marca-texto: #111827;
  --escuro: #111827;
  --ok: #15803d;
  --ok-fundo: #dcfce7;
  --aviso: #a16207;
  --aviso-fundo: #fef3c7;
  --erro: #b91c1c;
  --erro-fundo: #fee2e2;
  --info: #1d4ed8;
  --info-fundo: #dbeafe;
  --fase-a: #dc2626;
  --fase-b: #2563eb;
  --fase-c: #16a34a;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --topo-h: 56px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0b1120;
    --superficie: #131c2e;
    --superficie-2: #0f172a;
    --borda: #24324a;
    --texto: #e5e7eb;
    --texto-2: #b6c2d4;
    --texto-3: #8796ad;
    --ok: #4ade80; --ok-fundo: #052e1a;
    --aviso: #facc15; --aviso-fundo: #3a2c05;
    --erro: #f87171; --erro-fundo: #3b0d0d;
    --info: #93c5fd; --info-fundo: #0c2347;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}
body.deslogado { padding-bottom: 0; }
body.deslogado .nav-baixo, body.deslogado .topo { display: none; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
.sutil { color: var(--texto-3); font-size: .9em; }
.pequeno { font-size: .85em; }
.forte { font-weight: 700; }
.direita { text-align: right; }
.centro { text-align: center; }
.oculto { display: none !important; }
hr { border: 0; border-top: 1px solid var(--borda); margin: 16px 0; }

/* Topo e navegação */
.topo {
  position: sticky; top: 0; z-index: 30; height: calc(var(--topo-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between;
  background: var(--escuro); color: #fff;
}
.marca { display: flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.raio { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--marca); color: var(--marca-texto); }
.sync { font-size: .78rem; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.sync.off { background: #7c2d12; }
.sync.andando { opacity: .8; }
.sync:empty { display: none; }
.nav-baixo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--superficie); border-top: 1px solid var(--borda);
}
.nav-baixo a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--texto-3); font-size: .75rem; font-weight: 600;
}
.nav-baixo a span { font-size: 1.25rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.nav-baixo a.ativo { color: var(--texto); }
.nav-baixo a.ativo span { filter: none; opacity: 1; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav-baixo { position: sticky; top: calc(var(--topo-h) + env(safe-area-inset-top)); height: 48px; justify-content: center; gap: 8px; padding: 0; }
  .nav-baixo a { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 0 18px; font-size: .9rem; }
  .nav-baixo a.ativo { box-shadow: inset 0 -3px 0 var(--marca); }
}

.faixa { padding: 10px 16px; font-size: .9rem; text-align: center; }
.faixa a { font-weight: 700; }
.faixa.aviso { background: var(--aviso-fundo); color: var(--aviso); }
.faixa.erro { background: var(--erro-fundo); color: var(--erro); }
.faixa.ok { background: var(--ok-fundo); color: var(--ok); }

.conteudo { max-width: 980px; margin: 0 auto; padding: 16px; }
.tela { animation: entrar .18s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } }

/* Cartões e layout */
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 14px; }
.cartao > h2:first-child, .cartao > h3:first-child { margin-top: 0; }
.cartao.plano { box-shadow: none; }
.cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cabecalho h1 { margin: 0; }
.linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.linha.espaco { justify-content: space-between; }
.grade { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grade-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grade-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grade-3 { grid-template-columns: 1fr 1fr; } }
.pilha > * + * { margin-top: 12px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--borda); background: var(--superficie); color: var(--texto);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--texto-3); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primario { background: var(--marca); border-color: var(--marca); color: var(--marca-texto); }
.btn.primario:hover { background: var(--marca-forte); border-color: var(--marca-forte); }
.btn.escuro { background: var(--escuro); border-color: var(--escuro); color: #fff; }
.btn.perigo { background: var(--erro); border-color: var(--erro); color: #fff; }
.btn.secundario { background: var(--superficie-2); }
.btn.fantasma { background: transparent; border-color: transparent; }
.btn.pequeno { min-height: 34px; padding: 6px 12px; font-size: .88rem; }
.btn.bloco { width: 100%; }
.btn.grande { min-height: 52px; font-size: 1.05rem; }
button.icone { background: none; border: 0; color: inherit; font-size: 1.1rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; min-width: 36px; min-height: 36px; }
button.icone:hover { background: var(--superficie-2); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 25; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); border-radius: 99px; padding: 0 22px; }
@media (min-width: 900px) { .fab { bottom: 24px; } }

/* Campos */
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo > span, .campo > label { font-size: .82rem; font-weight: 650; color: var(--texto-2); }
.campo small { color: var(--texto-3); font-size: .78rem; }
input, select, textarea {
  font: inherit; color: var(--texto); background: var(--superficie); border: 1px solid var(--borda);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--marca); outline-offset: 0; border-color: var(--marca); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--marca-forte); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check span { font-size: .92rem; }
.contador { display: flex; align-items: stretch; border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; background: var(--superficie); }
.contador button { width: 44px; border: 0; background: var(--superficie-2); font-size: 1.2rem; cursor: pointer; color: var(--texto); }
.contador input { border: 0; border-radius: 0; text-align: center; min-width: 0; }
.erro-campo { color: var(--erro); font-size: .85rem; min-height: 1em; }
.sufixo { position: relative; }
.sufixo input { padding-right: 44px; }
.sufixo::after { content: attr(data-sufixo); position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-size: .85rem; pointer-events: none; }

/* Abas */
.abas { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; border-bottom: 1px solid var(--borda); position: sticky; top: calc(var(--topo-h) + env(safe-area-inset-top)); background: var(--fundo); z-index: 20; }
@media (min-width: 900px) { .abas { top: calc(var(--topo-h) + 48px + env(safe-area-inset-top)); } }
.abas::-webkit-scrollbar { display: none; }
.abas a { padding: 12px 12px; text-decoration: none; color: var(--texto-3); font-weight: 650; white-space: nowrap; border-bottom: 3px solid transparent; font-size: .92rem; }
.abas a.ativo { color: var(--texto); border-bottom-color: var(--marca); }
.abas a .num { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--superficie-2); font-size: .75rem; margin-left: 4px; border: 1px solid var(--borda); }

/* Selos */
.selo { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--superficie-2); color: var(--texto-2); border: 1px solid var(--borda); white-space: nowrap; }
.selo.ok { background: var(--ok-fundo); color: var(--ok); border-color: transparent; }
.selo.aviso { background: var(--aviso-fundo); color: var(--aviso); border-color: transparent; }
.selo.erro { background: var(--erro-fundo); color: var(--erro); border-color: transparent; }
.selo.info { background: var(--info-fundo); color: var(--info); border-color: transparent; }
.selo.marca { background: var(--marca); color: var(--marca-texto); border-color: transparent; }
.fase { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px; color: #fff; font-size: .72rem; font-weight: 800; }
.fase.A { background: var(--fase-a); } .fase.B { background: var(--fase-b); } .fase.C { background: var(--fase-c); }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .78rem; color: var(--texto-3); font-weight: 600; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; text-decoration: none; margin-bottom: 8px; }
.item:hover { border-color: var(--texto-3); }
.item .icone-grande { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--superficie-2); border-radius: 10px; flex: none; }
.item .meio { flex: 1; min-width: 0; }
.item .titulo { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: .84rem; color: var(--texto-3); }

/* Avisos */
.avisos { list-style: none; padding: 0; margin: 0 0 14px; }
.avisos li { padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; font-size: .9rem; display: flex; gap: 8px; }
.avisos li.erro { background: var(--erro-fundo); color: var(--erro); }
.avisos li.alerta { background: var(--aviso-fundo); color: var(--aviso); }
.avisos li.info { background: var(--info-fundo); color: var(--info); }

/* Tabelas */
.tabela-rolagem { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tabela { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tabela th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-3); padding: 8px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 10px 8px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela td.num, .tabela th.num { text-align: right; white-space: nowrap; }
.tabela tfoot td { font-weight: 800; border-top: 2px solid var(--borda); }
.tabela tr.grupo td { background: var(--superficie-2); font-weight: 750; font-size: .8rem; color: var(--texto-2); }
.tabela input { min-height: 36px; padding: 6px 8px; }

/* Circuitos em cartão (celular) */
.circuito { border: 1px solid var(--borda); border-radius: 12px; padding: 12px 14px; background: var(--superficie); margin-bottom: 8px; }
.circuito .topo-c { display: flex; align-items: center; gap: 8px; }
.circuito .numero { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--escuro); color: #fff; font-weight: 800; flex: none; font-size: .88rem; }
.circuito .nome { font-weight: 700; flex: 1; min-width: 0; }
.circuito .dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px 12px; margin-top: 10px; font-size: .84rem; }
.circuito .dados div span { display: block; font-size: .7rem; color: var(--texto-3); text-transform: uppercase; font-weight: 700; letter-spacing: .03em; }
.circuito .dados div b { font-variant-numeric: tabular-nums; }

/* Fases */
.barra-fase { display: grid; grid-template-columns: 28px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .88rem; }
.barra-fase .trilho { height: 14px; background: var(--superficie-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--borda); }
.barra-fase .enchimento { height: 100%; border-radius: 99px; }

/* Diagrama */
.diagrama { width: 100%; overflow-x: auto; background: #fff; border-radius: 12px; border: 1px solid var(--borda); padding: 8px; }
.diagrama svg { display: block; min-width: 560px; width: 100%; height: auto; }

/* Cômodos */
.comodos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.comodo-card { background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; padding: 14px; text-decoration: none; display: block; }
.comodo-card:hover { border-color: var(--texto-3); }
.comodo-card .cab { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comodo-card .emoji { font-size: 1.5rem; }
.comodo-card .nome { font-weight: 750; flex: 1; }
.comodo-card .fatos { display: flex; flex-wrap: wrap; gap: 6px; }

/* Equipamentos no editor de cômodo */
.tue { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border: 1px solid var(--borda); border-radius: 12px; margin-bottom: 8px; background: var(--superficie-2); }
.tue .campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; grid-column: 1 / -1; }

/* Estados */
.carregando { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--texto-3); }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; display: inline-block; }
.spinner.pequeno { width: 14px; height: 14px; }
@keyframes gira { to { transform: rotate(360deg); } }
.vazio { text-align: center; padding: 40px 16px; color: var(--texto-2); }
.vazio .grande { font-size: 3rem; }

/* Toast e modal */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--escuro); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; max-width: calc(100% - 32px); transition: .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.mostrar { opacity: 1; transform: translate(-50%, 0); }
.toast.erro { background: #991b1b; }
.toast.aviso { background: #854d0e; }
.modal-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 23, .55); display: flex; align-items: flex-end; justify-content: center; overflow-y: auto; padding: 16px 0 0; }
@media (min-width: 640px) { .modal-fundo { align-items: center; padding: 24px; } }
.modal { background: var(--superficie); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: subir .2s ease-out; margin: auto auto 0; }
@media (min-width: 640px) { .modal { border-radius: 18px; margin: auto; } }
.modal.largo { max-width: 760px; }
@keyframes subir { from { transform: translateY(24px); opacity: .5; } }
.modal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-topo h2 { margin: 0; }
.modal-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal-acoes .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .modal-acoes .btn { flex: 0 0 auto; } }

/* Telas de entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.entrada .caixa { width: 100%; max-width: 400px; }
.entrada .logo-grande { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 800; font-size: 1.4rem; margin-bottom: 20px; }
.entrada .logo-grande .raio { width: 40px; height: 40px; font-size: 1.3rem; border-radius: 10px; }

/* Guia da norma */
.guia h2 { margin-top: 8px; }
.guia h3 { margin-top: 18px; }
.guia ul { padding-left: 20px; }
.guia li { margin-bottom: 6px; }
.guia .regra { background: var(--superficie-2); border-left: 4px solid var(--marca); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 10px 0; }

.preco-grande { font-size: 2.4rem; font-weight: 850; line-height: 1; }
.preco-grande small { font-size: 1rem; font-weight: 600; color: var(--texto-3); }
.beneficios { list-style: none; padding: 0; margin: 12px 0; }
.beneficios li { padding: 6px 0 6px 28px; position: relative; }
.beneficios li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 900; }

.total-linha { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--borda); }
.total-linha.final { border-bottom: 0; font-size: 1.25rem; font-weight: 850; padding-top: 12px; }
.logo-preview { max-width: 160px; max-height: 80px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--borda); }

/* Ajustes depois do teste visual */
body { overflow-x: clip; }
.selo.bloco { white-space: normal; display: flex; border-radius: 10px; padding: 8px 12px; }
.grade > .btn { white-space: normal; text-align: center; line-height: 1.25; }
.circuito .numero { background: var(--texto); color: var(--superficie); }
@media (min-width: 900px) {
  .nav-baixo { position: fixed; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); width: auto; height: var(--topo-h); background: transparent; border: 0; z-index: 31; }
  .nav-baixo a { color: #94a3b8; }
  .nav-baixo a.ativo { color: #fff; }
  .abas { top: calc(var(--topo-h) + env(safe-area-inset-top)); }
}
@media (max-width: 480px) { .so-largo { display: none; } }

/* Chips (abas da janela de equipamentos e escolha de abas no cadastro) */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; flex-wrap: nowrap; }
.chips::-webkit-scrollbar { display: none; }
.pilha .chips:has(input) { flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--borda); background: var(--superficie); color: var(--texto-2); font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer; }
.chip.ativo { background: var(--escuro); color: #fff; border-color: var(--escuro); }
@media (prefers-color-scheme: dark) { .chip.ativo { background: var(--marca); color: var(--marca-texto); border-color: var(--marca); } }
.chip input[type=checkbox] { width: 16px; height: 16px; }
.chip:has(input:checked) { border-color: var(--marca-forte); background: var(--aviso-fundo); color: var(--texto); }
.lista-eq { max-height: 52vh; overflow-y: auto; }

/* Planta */
.planta-barra { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.planta-area { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
@media (min-width: 900px) { .planta-area { grid-template-columns: 1fr 300px; } }
.planta-tela { height: 62vh; min-height: 360px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.planta-tela:active { cursor: grabbing; }
.planta-tela svg { width: 100%; height: 100%; display: block; }
.planta-painel { background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; padding: 14px; align-self: start; }
.legenda-circuitos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin-top: 10px; }
.legenda-c { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 10px; background: var(--superficie); color: var(--texto); font: inherit; font-size: .85rem; cursor: pointer; text-align: left; min-width: 0; }
.legenda-c.ativo { border-color: var(--marca-forte); box-shadow: 0 0 0 2px var(--marca); }
.legenda-c .cor { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.legenda-c .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Planta: 100% da largura do container e a altura da viewport; o painel do cômodo desliza por cima */
.planta-area { position: relative; display: block; width: 100%; margin: 0 0 14px; overflow: hidden; border-radius: 12px; }
/* altura da viewport menos o que fica fixo na tela: topo, abas da obra e, no celular, a navegação de baixo */
.planta-tela {
  --fixos: calc(var(--topo-h) + 49px + var(--nav-h) + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  height: calc(100vh - var(--fixos)); height: calc(100dvh - var(--fixos)); min-height: 420px;
  border-radius: 12px; border: 1px solid var(--borda); scroll-margin-top: calc(var(--topo-h) + 49px + env(safe-area-inset-top));
}
@media (min-width: 900px) { .planta-tela { --fixos: calc(var(--topo-h) + 49px + 12px); scroll-margin-top: calc(var(--topo-h) + 49px); } }
.planta-painel {
  position: absolute; z-index: 5; top: 12px; right: 12px; bottom: auto; width: 340px; max-height: calc(100% - 24px); overflow-y: auto;
  box-shadow: 0 12px 40px rgba(2, 6, 23, .28); transform: translateX(calc(100% + 24px)); opacity: 0; visibility: hidden;
  transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
}
.planta-painel.aberto { transform: none; opacity: 1; visibility: visible; transition: transform .22s ease, opacity .22s ease; }
@media (max-width: 640px) {
  .planta-painel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 58%; border-radius: 16px 16px 12px 12px; transform: translateY(calc(100% + 16px)); }
  .planta-painel::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--borda); margin: -4px auto 10px; }
}
