/* Eixo · aplicativo. Tokens de marca em /marca/tokens.css (família Imagem Labs).
   Sala de controle: escuro por padrão, superfícies planas, raio curto, lima só para o que está vivo ou é ação.
   Duas escalas de cor e nada mais: CONDIÇÃO (c1 bom → c5 péssimo) e ESTADO (ok, atenção, crítico, info, neutro).
   Elas são as mesmas no mapa, no diagrama linear, nos selos e nos gráficos. km sempre em mono. */
@import url("/marca/tokens.css");

:root {
  --trilho: 84px; --topo: 52px; --painel: 400px;
  --c1: #2f9e6e; --c2: #8fbf3f; --c3: #e3b21a; --c4: #e07a2d; --c5: #d64545; --c0: #8a97a3;
  --ok: #1d7a52; --atencao: #8a5a00; --critico: #b42318; --info: #1f63ab; --neutro: #5b6a62;
  --ok-f: #e3f3ea; --atencao-f: #fbf0d6; --critico-f: #fbe4e1; --info-f: #e2eefb; --neutro-f: #eef1ee;
  --fundo: #f3f6f1; --sup: #ffffff; --sup-2: #f1f5ee; --sup-3: #e6ece2; --linha: #dde5d9; --linha-forte: #c3cfbf;
  --vidro: rgb(255 255 255 / 0.9); --vivo: #5e7a0a; --plan: #7b8ea0; --real: var(--marca-azul);
}
:root[data-theme="dark"] {
  --ok: #6fd3a3; --atencao: #f2b24c; --critico: #ff8a7a; --info: #7cb8ef; --neutro: #a9b6ae;
  --ok-f: #0e3a28; --atencao-f: #3d2f0c; --critico-f: #45191a; --info-f: #10314f; --neutro-f: #16372a;
  --fundo: #04170f; --sup: #072419; --sup-2: #0b2e20; --sup-3: #113a29; --linha: #15402e; --linha-forte: #255640;
  --vidro: rgb(4 23 15 / 0.88); --vivo: var(--marca-lima); --plan: #7f95a6; --real: var(--marca-azul-claro);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 14px/20px var(--fonte-sans); color: var(--cor-texto); background: var(--fundo); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cor-link); text-underline-offset: 0.2em; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--cor-selecao); }
:focus-visible { outline: 2px solid var(--cor-foco); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.mono, .km { font-family: var(--fonte-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
table.oculto { display: block; } /* tabela ignora width/overflow: como bloco o recorte vale e não estica a área rolável */
.pular { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--cor-acao); color: var(--cor-acao-texto); padding: 8px 12px; border-radius: 4px; }
.pular:focus { left: 8px; }
.ico { width: 18px; height: 18px; flex: none; }
.suave { color: var(--cor-texto-3); }
.rotulo { font: 600 11.5px/16px var(--fonte-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cor-texto-3); }

/* ---------- casca ---------- */
body.app { display: grid; grid-template: var(--topo) 1fr / var(--trilho) 1fr; grid-template-areas: "trilho topo" "trilho main"; height: 100dvh; overflow: hidden; }
.trilho { grid-area: trilho; display: flex; flex-direction: column; align-items: center; background: #031209; color: #cfdcd3; border-right: 1px solid #0f3a29; padding: 8px 0; gap: 4px; min-height: 0; }
.trilho-marca { display: grid; place-items: center; width: 44px; height: 36px; margin-bottom: 6px; }
.trilho-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; width: 100%; padding: 0 6px; }
.trilho-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 5px; border-radius: 4px; color: #9fb3a6; text-decoration: none; font: 500 11.5px/13px var(--fonte-sans); text-align: center; position: relative; transition: background-color .2s var(--curva-saida), color .2s var(--curva-saida); }
.trilho-nav a .ico { width: 20px; height: 20px; }
.trilho-nav a:hover { background: #0b2a1c; color: #fff; }
.trilho-nav a[aria-current="page"] { background: #0f3626; color: #fff; }
.trilho-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -6px; top: 8px; bottom: 8px; width: 3px; background: var(--marca-lima); border-radius: 0 2px 2px 0; }
.trilho-pe { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px; border-top: 1px solid #0f3a29; width: 100%; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--marca-verde); color: var(--marca-floresta); border: 0; cursor: pointer; }
.btn-ico { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 4px; border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer; transition: background-color .2s var(--curva-saida); }
.btn-ico:hover { background: rgb(127 127 127 / .16); }

.topo { grid-area: topo; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--sup); border-bottom: 1px solid var(--linha); min-width: 0; }
.topo-tenant { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topo-tenant strong { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-tenant span { font-size: 12px; color: var(--cor-texto-3); white-space: nowrap; }
.busca-km { flex: 1; max-width: 440px; margin-inline: auto; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: var(--sup-2); border: 1px solid var(--linha); border-radius: 4px; color: var(--cor-texto-3); }
.busca-km:focus-within { border-color: var(--cor-foco); color: var(--cor-texto); }
.busca-km input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-family: var(--fonte-mono); font-size: 13px; }
.busca-km kbd { font: 500 11.5px/16px var(--fonte-mono); padding: 0 5px; border: 1px solid var(--linha-forte); border-radius: 3px; color: var(--cor-texto-2); }
.topo-dir { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sino { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; color: var(--cor-texto-2); }
.sino:hover { background: var(--sup-2); }
.sino b { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--marca-lima); color: var(--marca-floresta); font: 700 11.5px/16px var(--fonte-mono); text-align: center; }
.ao-vivo { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/16px var(--fonte-mono); color: var(--cor-texto-2); padding: 5px 10px; border: 1px solid var(--linha); border-radius: 999px; white-space: nowrap; }
.ao-vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--c0); }
.ao-vivo.on i { background: var(--vivo); box-shadow: 0 0 0 0 rgb(169 223 16 / .7); animation: pulso 2s infinite; }
.ao-vivo time { color: var(--cor-texto-3); }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgb(169 223 16 / 0); } 100% { box-shadow: 0 0 0 0 rgb(169 223 16 / 0); } }

#conteudo { grid-area: main; min-height: 0; min-width: 0; overflow: auto; outline: 0; position: relative; }
/* selo de dado: dentro da barra superior, nunca cobre conteúdo */
.selo-dado { font: 500 11.5px/16px var(--fonte-mono); color: var(--cor-texto-2); border: 1px dashed var(--linha-forte); border-radius: 3px; padding: 3px 8px; white-space: nowrap; }

/* ---------- página e grade ---------- */
.pagina { padding: 20px 24px 56px; max-width: 1560px; margin-inline: auto; }
.cab { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cab h1 { font: 650 22px/28px var(--fonte-sans); letter-spacing: -0.015em; }
.cab p { color: var(--cor-texto-3); max-width: 72ch; }
.cab .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grade { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
/* tela de mapa: mapa ocupa tudo, painel à direita */
.tela-mapa { display: grid; grid-template-columns: minmax(0, 1fr) var(--painel); height: 100%; }
.tela-mapa.sem-painel { grid-template-columns: minmax(0, 1fr); }
.mapa-host { position: relative; min-height: 0; background: var(--sup-2); }
.mapa-host arcgis-map, .mapa-host arcgis-scene { position: absolute; inset: 0; }
.mapa-sobre { position: absolute; z-index: 2; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.mapa-sobre > * { pointer-events: auto; }
.mapa-sobre.tl { top: 12px; left: 12px; } .mapa-sobre.tr { top: 12px; right: 12px; } .mapa-sobre.bl { bottom: 36px; left: 12px; } .mapa-sobre.bc { bottom: 36px; left: 50%; translate: -50% 0; }
.flutua { background: var(--vidro); border: 1px solid var(--linha); border-radius: 4px; backdrop-filter: blur(10px); box-shadow: var(--sombra-2); }
.lateral { display: flex; flex-direction: column; min-height: 0; background: var(--sup); border-left: 1px solid var(--linha); }
.lateral > header { padding: 12px 16px; border-bottom: 1px solid var(--linha); display: flex; align-items: center; gap: 8px; }
.lateral > header h2 { font: 650 15px/20px var(--fonte-sans); }
.lateral .rolagem { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 48px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- superfícies ---------- */
.cartao { background: var(--sup); border: 1px solid var(--linha); border-radius: 4px; padding: 14px 16px; min-width: 0; }
.cartao > h3, .secao-t { font: 650 13px/18px var(--fonte-sans); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cartao > h3 small, .secao-t small { font-weight: 400; color: var(--cor-texto-3); margin-left: auto; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .rotulo { margin-bottom: 2px; }
.kpi b { font: 650 26px/30px var(--fonte-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi b small { font: 500 13px/1 var(--fonte-sans); color: var(--cor-texto-3); margin-left: 3px; letter-spacing: 0; }
.kpi span { font-size: 12px; color: var(--cor-texto-3); }
.kpis { display: grid; gap: 1px; background: var(--linha); border: 1px solid var(--linha); border-radius: 4px; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis > .kpi { background: var(--sup); padding: 12px 14px; }

/* ---------- selos e estado ---------- */
.selo { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 3px; font: 600 11.5px/20px var(--fonte-sans); white-space: nowrap; background: var(--neutro-f); color: var(--neutro); }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.sem-ponto::before { display: none; }
.selo.ok { background: var(--ok-f); color: var(--ok); } .selo.atencao { background: var(--atencao-f); color: var(--atencao); }
.selo.critico { background: var(--critico-f); color: var(--critico); } .selo.info { background: var(--info-f); color: var(--info); }
.selo.vivo { background: transparent; border: 1px solid var(--vivo); color: var(--vivo); }
/* natureza do agente: sempre visível, nunca disfarçada */
.natureza { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--linha-forte); border-radius: 3px; font: 500 11.5px/18px var(--fonte-mono); text-transform: lowercase; color: var(--cor-texto-2); }
.natureza.llm { border-style: dashed; }
.sintetico { font: 500 11.5px/16px var(--fonte-mono); color: var(--cor-texto-3); border: 1px dashed var(--linha-forte); border-radius: 3px; padding: 0 5px; }
.real { font: 500 11.5px/16px var(--fonte-mono); color: var(--ok); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; }
.cond { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c0); vertical-align: -1px; }
.cond.c1 { background: var(--c1); } .cond.c2 { background: var(--c2); } .cond.c3 { background: var(--c3); } .cond.c4 { background: var(--c4); } .cond.c5 { background: var(--c5); }

/* ---------- controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--linha-forte); background: var(--sup); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--cor-texto); white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s var(--curva-saida); }
.btn:hover { background: var(--sup-2); border-color: var(--cor-texto-3); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--cor-acao); color: var(--cor-acao-texto); border-color: transparent; }
.btn.pri:hover { background: var(--cor-acao-hover); }
.btn.perigo { color: var(--critico); border-color: currentColor; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--linha-forte); border-radius: 4px; overflow: hidden; background: var(--sup); }
.seg button { height: 32px; padding: 0 11px; border: 0; background: transparent; cursor: pointer; font-weight: 500; color: var(--cor-texto-2); border-right: 1px solid var(--linha); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--sup-3); color: var(--cor-texto); font-weight: 650; }
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo > span { font: 600 12px/16px var(--fonte-sans); color: var(--cor-texto-2); }
.campo small { color: var(--cor-texto-3); font-size: 12px; }
input:not([type]), input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search], select, textarea { height: 34px; padding: 0 10px; border: 1px solid var(--linha-forte); border-radius: 4px; background: var(--sup); min-width: 0; width: 100%; }
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 72px; }
input[type=range] { accent-color: var(--cor-acao); width: 100%; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--linha); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.abas button, .abas a { height: 38px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; font-weight: 600; color: var(--cor-texto-3); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.abas [aria-selected="true"], .abas [aria-current="true"] { color: var(--cor-texto); border-bottom-color: var(--cor-acao); }

/* ---------- tabela e listas ---------- */
.tabela-rol { overflow: auto; border: 1px solid var(--linha); border-radius: 4px; background: var(--sup); }
table.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { position: sticky; top: 0; background: var(--sup-2); text-align: left; font: 600 11.5px/16px var(--fonte-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--cor-texto-3); padding: 8px 12px; border-bottom: 1px solid var(--linha); white-space: nowrap; z-index: 1; }
.tabela td { padding: 8px 12px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr[data-id] { cursor: pointer; }
.tabela tbody tr[data-id]:hover, .tabela tbody tr[aria-selected="true"] { background: var(--sup-2); }
.tabela .dir { text-align: right; font-variant-numeric: tabular-nums; }
.lista { display: flex; flex-direction: column; }
.lista > * { padding: 10px 0; border-bottom: 1px solid var(--linha); }
.lista > *:last-child { border-bottom: 0; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--linha); cursor: pointer; }
.item b { font-weight: 600; } .item small { grid-column: 2 / -1; color: var(--cor-texto-3); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.dl dt { color: var(--cor-texto-3); } .dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.barra-prog { height: 6px; background: var(--sup-3); border-radius: 3px; overflow: hidden; position: relative; }
.barra-prog i { position: absolute; inset: 0 auto 0 0; background: var(--real); border-radius: 3px; }
.barra-prog i.plan { background: transparent; border-right: 2px solid var(--cor-texto); border-radius: 0; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--cor-texto-2); align-items: center; }
.legenda span { display: inline-flex; align-items: center; gap: 5px; }
.feed { display: flex; flex-direction: column; font-size: 13px; }
.feed li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--linha); list-style: none; }
.feed time { font: 400 11.5px/20px var(--fonte-mono); color: var(--cor-texto-3); }
ul.feed { margin: 0; padding: 0; }

/* ---------- gráficos SVG feitos à mão ---------- */
.graf { width: 100%; height: auto; display: block; overflow: visible; }
.graf text { font: 400 12px var(--fonte-mono); fill: var(--cor-texto-3); }
.graf .eixo { stroke: var(--linha-forte); stroke-width: 1; } .graf .grade-l { stroke: var(--linha); stroke-width: 1; }
.graf .s-plan { stroke: var(--plan); stroke-width: 2; fill: none; stroke-dasharray: 5 4; } .graf .s-real { stroke: var(--real); stroke-width: 2.5; fill: none; }
.graf .limite { stroke: var(--critico); stroke-width: 1.2; stroke-dasharray: 3 3; }

/* ---------- régua de km (diagrama linear): a assinatura do produto ---------- */
.regua { position: relative; background: var(--sup); border: 1px solid var(--linha); border-radius: 4px; overflow: hidden; user-select: none; }
.regua canvas { display: block; width: 100%; cursor: crosshair; }
.regua-leitor { position: absolute; top: 6px; right: 8px; font: 500 12px/18px var(--fonte-mono); background: var(--vidro); border: 1px solid var(--linha); border-radius: 3px; padding: 2px 8px; pointer-events: none; }

/* ---------- vazios, esqueleto, diálogo, toast, menu ---------- */
.vazio { padding: 32px 16px; text-align: center; color: var(--cor-texto-3); border: 1px dashed var(--linha-forte); border-radius: 4px; }
.vazio b { display: block; color: var(--cor-texto); margin-bottom: 4px; }
.esqueleto { display: block; border-radius: 3px; background: linear-gradient(90deg, var(--sup-2), var(--sup-3), var(--sup-2)); background-size: 200% 100%; animation: brilho 1.4s linear infinite; }
@keyframes brilho { to { background-position: -200% 0; } }
dialog { border: 1px solid var(--linha-forte); border-radius: 6px; padding: 0; background: var(--sup); color: var(--cor-texto); width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); box-shadow: var(--sombra-3); }
dialog.largo { width: min(960px, calc(100vw - 24px)); }
dialog::backdrop { background: rgb(2 12 8 / .6); backdrop-filter: blur(2px); }
dialog > header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--linha); }
dialog > header h2 { font: 650 16px/22px var(--fonte-sans); }
dialog .dc { padding: 16px; overflow: auto; max-height: calc(100dvh - 190px); display: flex; flex-direction: column; gap: 12px; }
dialog > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--linha); }
.toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 20px; opacity: 0; z-index: 200; background: var(--marca-noite); color: #eef5ee; padding: 10px 16px; border-radius: 4px; border: 1px solid #1c4634; box-shadow: var(--sombra-3); transition: opacity .2s, translate .3s var(--curva-saida); pointer-events: none; max-width: min(560px, calc(100vw - 32px)); }
.toast.on { opacity: 1; translate: -50% 0; } .toast.erro { background: #5c1512; border-color: #8f2a22; }
.menu { position: fixed; left: calc(var(--trilho) + 6px); bottom: 10px; z-index: 60; min-width: 240px; background: var(--sup); border: 1px solid var(--linha-forte); border-radius: 4px; box-shadow: var(--sombra-3); padding: 4px; }
.menu header { padding: 8px 10px; border-bottom: 1px solid var(--linha); display: flex; flex-direction: column; margin-bottom: 4px; }
.menu header small { color: var(--cor-texto-3); }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 8px 10px; background: transparent; border: 0; border-radius: 3px; cursor: pointer; color: inherit; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--sup-2); }

/* ---------- celular: trilho vira barra inferior, painel vira folha ---------- */
@media (max-width: 820px) {
  body.app { grid-template: var(--topo) 1fr 58px / minmax(0, 1fr); grid-template-areas: "topo" "main" "trilho"; }
  .trilho { flex-direction: row; padding: 0 4px; border-right: 0; border-top: 1px solid #0f3a29; }
  .trilho-marca { display: none; }
  .trilho-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
  .trilho-nav { gap: 0; justify-content: space-around; overflow: visible; width: 100%; }
  .trilho-nav a:not(.prim) { display: none; }
  .trilho-nav a, .trilho-nav .mais { flex: 1 1 0; min-width: 0; min-height: 50px; justify-content: center; }
  .trilho-pe { display: none; }
  .trilho { padding: 0 2px env(safe-area-inset-bottom); }
  .trilho-nav a[aria-current="page"]::before { left: 12px; right: 12px; top: auto; bottom: -4px; width: auto; height: 3px; }
  .trilho-pe { flex-direction: row; width: auto; border-top: 0; padding: 0 4px; }
  .topo { gap: 8px; padding: 0 10px; }
  .topo-tenant span, .busca-km kbd, .ao-vivo b, .ao-vivo time { display: none; }
  .ao-vivo { padding: 5px; border: 0; }
  .tela-mapa { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 46%); }
  .lateral { border-left: 0; border-top: 1px solid var(--linha); border-radius: 10px 10px 0 0; }
  .pagina { padding: 14px 12px 40px; }
  .grade > * { grid-column: 1 / -1 !important; }
  .selo-dado { display: none; }
  .menu { left: auto; right: 8px; bottom: 66px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* botão "Mais" e folha de telas (só no celular) */
.trilho-nav .mais { display: none; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 5px; border: 0; border-radius: 4px; background: transparent; color: #9fb3a6; font: 500 11.5px/13px var(--fonte-sans); cursor: pointer; }
.trilho-nav .mais .ico { width: 20px; height: 20px; }
.trilho-nav .mais[data-ativo] { background: #0f3626; color: #fff; }
.trilho-nav .mais:focus-visible, .trilho-nav a:focus-visible { outline: 2px solid var(--marca-lima); outline-offset: -2px; }
.folha-mais[hidden] { display: none; }
.folha-mais { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; }
.folha-fundo { position: absolute; inset: 0; background: rgb(0 0 0 / 0.5); }
.folha-corpo { position: relative; width: 100%; background: var(--sup); color: var(--cor-texto); border-radius: 14px 14px 0 0; border-top: 1px solid var(--linha-forte); padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); max-height: 80dvh; overflow: auto; }
.folha-corpo header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.folha-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.folha-grade a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px 4px; border: 1px solid var(--linha); border-radius: 8px; background: var(--sup-2); color: inherit; text-decoration: none; font-size: 13px; text-align: center; }
.folha-grade a .ico { width: 22px; height: 22px; }
.folha-grade a[aria-current] { border-color: var(--vivo); box-shadow: inset 0 0 0 1px var(--vivo); font-weight: 700; }
.folha-pe { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.folha-pe .btn { min-height: 44px; flex: 1; }
@media (max-width: 820px) { .trilho-nav .mais { display: flex; } }

/* celular: texto ≥ 11,5 px e alvos de toque ≥ 44 px */
@media (max-width: 820px) {
  .trilho-nav a, .trilho-nav .mais { font-size: 11.5px; }
  .sino { width: 44px; height: 44px; }
  .busca-km { height: 44px; }
  .busca-km input { min-height: 40px; }
  .rotulo { font-size: 11.5px; }
}

/* AA sobre as superfícies alternadas do tema claro (a faixa zebrada ficava em 4,4:1) */
[data-theme="light"] body.app { --cor-texto-3: #4d5d55; }
.feed time { font-size: 11.5px; }
@media (max-width: 820px) { .busca-km input { height: 44px; min-height: 44px; } }
@media (max-width: 820px) { .busca-km { height: 44px; min-height: 44px; box-sizing: border-box; } }

/* piso de 11,5 px em todas as larguras (small herdava 0,83em) */
small { font-size: max(0.83em, 11.5px); }

/* toque (largura ≤ 820 px ou ponteiro grosso): alvos de 44 px em botões, campos e diálogos de todo o app */
@media (max-width: 820px), (pointer: coarse) {
  .btn, .btn.sm { min-height: 44px; height: auto; }
  .btn-ico, dialog > header .btn-ico { width: 44px; height: 44px; }
  input:not([type]), input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search], input[type=time], select { height: 44px; }
  dialog .btn, dialog > footer .btn { min-height: 44px; }
  .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .seg button { height: 44px; }
  .tabs button, .abas button, [role=tab] { min-height: 44px; }
  /* link de texto: área clicável de 44 px sem mexer no desenho (a caixa visível não muda) */
  #conteudo a:not(.btn):not(.g-it):not([class*="kpi"]), dialog a:not(.btn) { position: relative; }
  #conteudo a:not(.btn):not(.g-it):not([class*="kpi"])::after, dialog a:not(.btn)::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%); }
}

/* celular: o nome do tenant (qualquer comprimento) trunca com reticências e a busca de km nunca fica abaixo de ~160 px */
@media (max-width: 820px) {
  .topo-tenant { flex: 0 1 92px; max-width: 92px; }
  .busca-km { flex: 1 1 160px; min-width: 160px; max-width: none; margin-inline: 0; }
  .topo-dir { margin-left: 0; flex: 0 0 auto; gap: 4px; }
  .topo > .selo-dado, .topo-dir .selo-dado { display: none; }
}
.busca-km input#q-km { border: 0; background: transparent; padding: 0; box-shadow: none; height: 100%; min-height: 0; }
@media (min-width: 821px) { .trilho-nav a span { letter-spacing: -0.02em; white-space: nowrap; } .trilho-nav a { padding-inline: 4px; } }

/* selos de natureza com AA também sobre superfícies tingidas (card selecionado) */
.sintetico { color: var(--cor-texto-2); }
[data-theme="light"] .real { color: color-mix(in srgb, var(--ok), #000 30%); }
