/* Página do mapa (dashboard/mapa.html) e a vista do mapa dentro do painel (#vista-mapa):
  barra translúcida, lateral, balões, pílulas, carrossel, lista de passagens e folha.
  Os tokens da página ficam em html.mapa-raiz; dentro do painel valem os tokens do painel. */
html.mapa-raiz {
  color-scheme: dark;
  --bg: #070A10; --bg-card: #0D121B; --border: rgba(255,255,255,0.12);
  --text-primary: #EDF1F7; --text-secondary: #B6C0CF; --text-muted: #8B96A8;
  --accent: #6EA2FF; --red: #F87171;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
html.mapa-raiz[data-theme="light"] {
  color-scheme: light;
  --bg: #F2F4F7; --bg-card: #FFFFFF; --border: rgba(15,23,42,0.14);
  --text-primary: #0F172A; --text-secondary: #475569; --text-muted: #5B6678;
  --accent: #1D4ED8; --red: #B91C1C;
}
html.mapa-raiz, html.mapa-raiz body { margin: 0; height: 100%; font-family: var(--font-sans); background: var(--bg); color: var(--text-primary); }
.mono { font-family: var(--font-mono); }
.mapa-pagina { position: fixed; inset: 0; background: var(--bg, #0f1520); }
.mapa-pagina #mapa { position: absolute; inset: 0; }

/* Barra de cima: material translúcido sobre o mapa */
.mapa-topo { position: absolute; left: 0; right: 0; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 46px; font-size: 0.8125rem; color: var(--text-primary); background: color-mix(in srgb, var(--bg-card) 88%, transparent); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.mapa-topo .mapa-volta { color: var(--accent); font-weight: 600; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.mapa-topo .mapa-titulo { font-weight: 700; font-size: 0.875rem; letter-spacing: -0.01em; margin: 0; }
.mapa-topo .mapa-dir { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mapa-topo .mapa-ao-vivo { color: var(--text-secondary); font-size: 0.75rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.mapa-topo .mapa-ao-vivo.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green, #22C55E); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green, #22C55E) 25%, transparent); }
.mapa-btn { border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; min-height: 32px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.mapa-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.mapa-btn:focus-visible, .mb-fixar:focus-visible, .mp:focus-visible, .ml-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mapa-btn:active { transform: scale(0.97); }
.mapa-btn[hidden] { display: none; }
.mapa-seg { display: inline-flex; background: color-mix(in srgb, var(--text-primary) 8%, transparent); border-radius: 8px; padding: 2px; }
.mapa-seg button { border: 0; background: none; color: var(--text-primary); font: inherit; font-size: 0.8125rem; padding: 4px 10px; border-radius: 6px; min-height: 28px; cursor: pointer; }
.mapa-seg button[aria-pressed="true"] { background: var(--bg-card); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.mapa-modo { background: #fff3cd; color: #7a5a00; border-radius: 999px; padding: 2px 10px; font-weight: 600; }

.mapa-lateral { position: absolute; left: 0; top: var(--barra-h, 46px); bottom: 0; width: 250px; z-index: 20; overflow: auto; padding: 10px; font-size: 0.8125rem; color: var(--text-primary); background: color-mix(in srgb, var(--bg-card) 78%, transparent); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent); transform: translateX(0); transition: transform 240ms cubic-bezier(.2,.8,.2,1); }
.mapa-lateral[data-aberta="false"] { transform: translateX(-100%); visibility: hidden; }
.mapa-aba { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 21; writing-mode: vertical-rl; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; padding: 12px 6px; background: var(--bg-card); color: var(--accent); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.mapa-aba[hidden] { display: none; }
.ml-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.ml-cab-titulo { margin: 0; font-size: 0.875rem; font-weight: 700; }
.ml-recolher, .ml-voltar, .ml-abrir-painel { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.8125rem; cursor: pointer; min-height: 32px; padding: 0 4px; }
.ml-abrir-painel { display: block; margin-top: 10px; }
.ml-tot { display: flex; gap: 14px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--bg-card) 90%, transparent); margin-bottom: 8px; }
.ml-tot-b b { display: block; font-size: 1.125rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ml-tot-b.v b { color: var(--red); }
.ml-tot-l { color: var(--text-secondary); font-size: 0.6875rem; }
.ml-itens { display: flex; flex-direction: column; gap: 8px; }
.ml-item { display: block; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; background: color-mix(in srgb, var(--bg-card) 90%, transparent); color: var(--text-primary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.ml-item[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.ml-item[disabled] { opacity: .6; cursor: default; }
.ml-item-nome { display: block; }
.ml-k { color: var(--text-secondary); font-size: 0.75rem; }
.ml-estado { margin: 8px 0; color: var(--text-secondary); }
.ml-estado[role="alert"] { color: var(--red); }
.ml-passagens { list-style: none; margin: 0; padding: 0; }
.ml-passagem { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 0.75rem; }
.ml-p-foto { width: 40px; height: 24px; border-radius: 4px; object-fit: cover; flex: none; }
.ml-p-sem-foto, .mb-sem-foto { width: 40px; height: 24px; border-radius: 4px; background: var(--border); color: var(--text-secondary); font-size: 0.5625rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ml-p-placa, .mb-placa { font-family: var(--font-mono, ui-monospace, monospace); font-weight: 700; }
.ml-p-vel, .mb-vel { margin-left: auto; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ml-p-vel.r, .mb-vel.r { color: var(--red); font-weight: 700; }
.ml-p-hora { color: var(--text-secondary); white-space: nowrap; }
.ml-det-status { margin: -2px 0 8px; font-size: 0.75rem; color: var(--text-secondary); }
.ml-det-status.agora { color: var(--red); font-weight: 700; }
.ml-det-h { margin: 12px 0 4px; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.ml-det-lista { display: flex; flex-direction: column; }
.ml-det-ev { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; font: inherit; font-size: 0.75rem; text-align: left; border-radius: 8px; }
button.ml-det-ev { cursor: pointer; }
button.ml-det-ev:hover, button.ml-det-ev:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ml-det-ev .ml-p-foto { width: 56px; height: 34px; }
.ml-det-acoes { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.ml-det-todas { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; min-height: 32px; padding: 0 4px; text-align: left; }

/* Pílulas (conteúdo do Advanced Marker do Google Maps) */
.mp { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 4px 10px; background: var(--accent); color: #fff; font: inherit; font-size: 0.8125rem; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: pointer; white-space: nowrap; position: relative; }
.mp::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--accent); }
.mp .mp-ex { background: #fff; color: var(--red); border-radius: 999px; padding: 0 6px; font-size: 0.75rem; }
/* Vermelho e cinza mais escuros: branco em cima passa AA (4,8:1 e 7,5:1) */
.mp.agora { background: #DC2626; }
.mp.agora::after { border-top-color: #DC2626; }
.mp.parada { background: #4B5563; }
.mp.parada::after { border-top-color: #4B5563; }
.mp .mp-parada { font-weight: 500; font-size: 0.75rem; }
.mp.grupo { padding-left: 12px; padding-right: 12px; }
.mp.pisca { animation: mp-pisca 600ms ease-out 1; }
@keyframes mp-pisca { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.mp-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.mp-rotulo { font-size: 0.6875rem; font-weight: 700; color: var(--text-primary); background: color-mix(in srgb, var(--bg-card) 85%, transparent); padding: 1px 6px; border-radius: 4px; white-space: nowrap; letter-spacing: 0.01em; }
.mp-wrap.pisca .mp { animation: mp-pisca 600ms ease-out 1; }
.mp-wrap.central .mp { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent), 0 2px 6px rgba(0,0,0,.3); }
.mp-wrap.sem-posicao .mp { background: var(--bg-card); color: var(--text-secondary); border: 1px dashed var(--text-secondary); box-shadow: none; }
.mp-wrap.sem-posicao .mp::after { border-top-color: var(--text-secondary); }

.mb { position: absolute; left: 0; top: 0; width: 238px; z-index: 10; background: var(--bg-card); color: var(--text-primary); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: 8px 10px; font-size: 0.75rem; will-change: transform; transform-origin: 0 20px; }
.mb[data-ativo="true"] { z-index: 12; }
.mb-t { display: flex; align-items: center; gap: 6px; }
.mb-nome { flex: 1; min-width: 0; font-weight: 700; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-fixar { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 0.8125rem; cursor: pointer; }
.mb-fixar[aria-pressed="true"] { background: var(--accent); color: #fff; }
.mb-kpi { margin: 4px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-acima { color: var(--red); font-weight: 800; font-size: 0.875rem; }
.mb-resto { color: var(--text-primary); }
.mb-ev { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 0; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; font: inherit; font-size: 0.6875rem; text-align: left; border-radius: 6px; }
button.mb-ev { cursor: pointer; }
button.mb-ev:hover, button.mb-ev:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
button.mb-ev:active { transform: scale(0.99); }
.mb-foto { width: 56px; height: 34px; border-radius: 5px; object-fit: cover; flex: none; }
.mb-hora { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mb-hora.recente { color: var(--accent); font-weight: 600; }
.mb-vel { margin-left: auto; }
.mb-vazio { margin: 4px 0; color: var(--text-secondary); }
.mb-todas { display: block; margin-top: 4px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.6875rem; cursor: pointer; padding: 4px 0; min-height: 28px; }
.mb.guia::before { content: ""; position: absolute; left: -8px; top: 20px; border: 8px solid transparent; border-left: 0; border-right-color: var(--bg-card); }
.mb-seta { position: absolute; width: 0; height: 0; border: 8px solid transparent; }
.mb[data-lado="direita"] .mb-seta, .mb[data-lado="ne"] .mb-seta, .mb[data-lado="se"] .mb-seta { left: -8px; top: 20px; border-left: 0; border-right-color: var(--bg-card); }
.mb[data-lado="esquerda"] .mb-seta, .mb[data-lado="nw"] .mb-seta, .mb[data-lado="sw"] .mb-seta { right: -8px; top: 20px; border-right: 0; border-left-color: var(--bg-card); }
.mb[data-lado="acima"] .mb-seta { left: 50%; bottom: -8px; margin-left: -8px; border-bottom: 0; border-top-color: var(--bg-card); }
.mb[data-lado="abaixo"] .mb-seta { left: 50%; top: -8px; margin-left: -8px; border-top: 0; border-bottom-color: var(--bg-card); }
.mb-linha-guia { position: absolute; left: 0; top: 0; height: 0; border-top: 2px dashed var(--accent); transform-origin: 0 0; z-index: 9; pointer-events: none; }

.mapa-carrossel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 0 12px; overflow: hidden; touch-action: pan-x; }
.mapa-carrossel[hidden] { display: none; }
.mc-trilho { display: flex; gap: 8px; will-change: transform; }
.mc-card { flex: none; width: 160px; }
.mc-card .mb { position: static; width: 100%; transform: none; }
.mc-pontos { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.mc-pontos i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--text-primary) 25%, transparent); }
.mc-pontos i.on { background: var(--accent); }

.mpz { position: absolute; z-index: 25; width: 250px; background: var(--bg-card); color: var(--text-primary); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: 10px 12px; font-size: 0.75rem; }
.mpz b { display: block; font-size: 0.8125rem; }
.mpz p { margin: 4px 0 8px; color: var(--text-secondary); }
.mpz-coord { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.6875rem; color: var(--text-secondary); }
.mpz-aviso { color: #b45309; margin: 4px 0 0; }
.mpz-erro { color: var(--red); margin: 4px 0 0; }
.mpz-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mpz-acoes .mapa-btn.p { background: var(--accent); color: #fff; border-color: var(--accent); }
.mp.sem-posicao { background: var(--bg-card); color: var(--text-secondary); border: 1px dashed var(--text-secondary); box-shadow: none; }
.mp.sem-posicao::after { border-top-color: var(--text-secondary); }
.mp.arrastando { background: #d97706; transform: scale(1.1); }


/* Modo painel: lateral com a lista de passagens */
#vista-mapa { --bg: var(--bg-primary); --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; z-index: 900; font-family: var(--font-sans); color: var(--text-primary); }
.mapa-topo button.mapa-volta { border: 0; background: none; font: inherit; font-size: 0.8125rem; padding: 0 4px; cursor: pointer; }
/* A lateral é o contêiner de medida (cqw): a lista escala com a largura escolhida na alça */
.mapa-lateral.painel { width: 392px; padding: 0; display: flex; flex-direction: column; overflow: hidden; background: color-mix(in srgb, var(--bg-card) 78%, transparent); container-type: inline-size; }
/* Alça de largura na borda direita (role=separator): arrasto, setas, toque duplo */
.mapa-redim { position: absolute; top: 0; right: 0; bottom: 0; width: 12px; cursor: col-resize; touch-action: none; z-index: 2; }
.mapa-redim::before { content: ""; position: absolute; left: 4px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: color-mix(in srgb, var(--text-secondary) 55%, transparent); }
.mapa-redim:hover::before, .mapa-redim:focus-visible::before { background: var(--accent); }
.mapa-redim:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.mapa-lateral.folha .mapa-redim { display: none; }
.mp-lista { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mp-cab { display: flex; justify-content: space-between; align-items: center; padding: clamp(10px, 2cqw, 18px) clamp(12px, 2cqw, 18px) 0; }
.mp-cab h2 { margin: 0; font-size: clamp(0.9375rem, calc(8px + 1.8cqw), 1.875rem); font-weight: 700; letter-spacing: -0.01em; }
.mp-recolher { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; min-height: 32px; padding: 0 4px; }
.mp-sub { margin: 2px 12px 0; color: var(--text-secondary); font-size: clamp(0.75rem, calc(5px + 1.6cqw), 1rem); }
.mp-sub[hidden], .mp-resumo[hidden], .mp-kpis[hidden] { display: none; }
.mp-resumo { margin: 0 12px; text-align: center; color: var(--text-secondary); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.mp-resumo b { color: var(--text-primary); font-weight: 800; }
.mp-resumo b.v { color: var(--red); }
.mp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 10px 0; }
.mp-kpi { border-radius: 10px; padding: clamp(8px, 1.6cqw, 14px) clamp(10px, 2cqw, 16px); border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-card) 92%, transparent); }
.mp-kpi b { display: block; font-size: clamp(1.25rem, calc(8px + 2.6cqw), 2.75rem); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mp-kpi.v b { color: var(--red); }
.mp-kpi small { color: var(--text-secondary); font-size: clamp(0.6875rem, calc(4px + 1.6cqw), 1rem); }
.mp-chips { display: flex; gap: 6px; padding: 10px 10px 6px; flex-wrap: wrap; }
.mp-chip { border: 1px solid var(--border); border-radius: 999px; padding: 4px clamp(10px, 1.8cqw, 16px); min-height: clamp(32px, calc(16px + 4cqw), 48px); display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--bg-card) 92%, transparent); color: var(--text-primary); font: inherit; font-size: clamp(0.75rem, calc(5px + 1.6cqw), 1.0625rem); cursor: pointer; }
.mp-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.mp-chip .mp-n { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; }
.mp-chip[aria-pressed="true"] .mp-n { color: inherit; }
.mp-st { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.mp-st::before { content: ""; width: clamp(7px, 1.2cqw, 11px); height: clamp(7px, 1.2cqw, 11px); border-radius: 50%; background: currentColor; }
.mp-st.agora { color: var(--red); }
.mp-st.parada { color: #FBBF24; }
:root[data-theme="light"] .mp-st.parada { color: #92400E; }
.mp-lista-cab { display: flex; justify-content: flex-end; padding: 0 12px 2px; }
.mp-periodo { color: var(--text-secondary); font-size: 0.75rem; }
.mapa-lateral.painel:not(.folha) .mp-lista-cab { display: none; } /* no computador o período já está na barra */
.mp-linhas { flex: 1; min-height: 0; overflow: auto; padding: 0 6px 10px; }
.mp-linha { display: grid; grid-template-columns: auto 1fr auto 14px; grid-template-rows: auto auto; column-gap: clamp(10px, 2.5cqw, 18px); align-items: center; width: 100%; padding: clamp(7px, 1.5cqw, 12px) 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: clamp(52px, 16cqw, 200px); }
.mp-linha + .mp-linha { margin-top: 2px; }
.mp-linha:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mp-linha:active { transform: scale(0.99); }
.mp-linha.nova { background: color-mix(in srgb, var(--green, #22C55E) 12%, transparent); }
.mp-linha.excesso { background: color-mix(in srgb, var(--red) 10%, transparent); }
.mp-foto, .mp-sem-foto { grid-column: 1; grid-row: 1 / 3; width: clamp(60px, calc(28cqw - 50px), 320px); height: auto; aspect-ratio: 16 / 10; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.mp-sem-foto { display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-secondary); font-size: clamp(0.625rem, calc(4px + 1.4cqw), 1rem); font-weight: 700; }
.mp-l1 { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: clamp(2px, 0.5cqw, 6px) clamp(10px, 2cqw, 18px); min-width: 0; }
.mp-linha .mer { flex: none; }
.mp-linha .mer b { font-size: clamp(0.875rem, calc(0.25rem + 2.5cqw), 2.25rem); padding: clamp(4px, calc(1px + 0.8cqw), 12px) clamp(7px, calc(2px + 1.3cqw), 18px) clamp(5px, calc(2px + 0.9cqw), 13px); }
.mp-linha .mer i { height: clamp(5px, calc(2px + 0.8cqw), 12px); }
.mp-linha .tipo-ia { flex: none; height: auto; min-height: 26px; padding: clamp(2px, 0.8cqw, 8px) clamp(10px, 2cqw, 18px); border-radius: 6px; background: none; border: 1px dashed var(--text-secondary); color: var(--text-secondary); font-weight: 700; font-size: clamp(0.75rem, calc(5px + 1.8cqw), 1.5rem); }
.mp-vel { font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(0.9375rem, calc(6px + 2.4cqw), 2.5rem); letter-spacing: -0.01em; white-space: nowrap; }
.mp-vel small { font-weight: 600; font-size: clamp(0.6875rem, calc(4px + 1.8cqw), 1.5rem); color: var(--text-secondary); margin-left: 2px; }
.mp-vel.sem { color: var(--text-secondary); font-weight: 600; font-size: clamp(0.8125rem, calc(5px + 2cqw), 1.75rem); }
.mp-vel.acima { color: var(--red); }
.mp-hora { grid-column: 3; grid-row: 1; color: var(--text-secondary); font-size: clamp(0.8125rem, calc(5px + 2cqw), 2rem); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-chev { grid-column: 4; grid-row: 1 / 3; color: var(--text-secondary); font-size: clamp(1.125rem, calc(8px + 2cqw), 2.25rem); line-height: 1; }
.mp-l2 { grid-column: 2 / 5; grid-row: 2; display: flex; gap: clamp(8px, 1.6cqw, 14px); align-items: center; margin-top: clamp(3px, 0.8cqw, 8px); color: var(--text-secondary); font-size: clamp(0.75rem, calc(5px + 1.8cqw), 1.625rem); min-width: 0; }
.mp-lomb { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.mp-quem { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-ver-mais { display: block; width: calc(100% - 12px); margin: 8px 6px 0; padding: 10px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 8px; background: none; color: var(--accent); font: inherit; font-size: clamp(0.8125rem, calc(5px + 2cqw), 1.125rem); font-weight: 600; cursor: pointer; min-height: 40px; }
.mp-vazio { margin: 10px 6px; padding: 18px 14px; border-radius: 10px; border: 1px solid var(--border); color: var(--text-secondary); font-size: clamp(0.8125rem, calc(5px + 2cqw), 1.125rem); text-align: center; }
.mp-vazio b { display: block; color: var(--text-primary); margin-bottom: 4px; }
.mp-tentar { display: block; margin: 8px auto 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: clamp(0.8125rem, calc(5px + 2cqw), 1.125rem); font-weight: 700; cursor: pointer; min-height: 32px; }
.mp-esqueleto { height: 52px; border-radius: 10px; margin: 2px 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--text-primary) 5%, transparent), color-mix(in srgb, var(--text-primary) 10%, transparent), color-mix(in srgb, var(--text-primary) 5%, transparent)); }
.mp.realce, .mp-wrap.realce .mp { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.mf-alca { display: none; width: 100%; height: 44px; border: 0; background: none; cursor: pointer; align-items: center; justify-content: center; }
.mf-alca i { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--text-secondary); }
.mp-linha:focus-visible, .mp-chip:focus-visible, .mf-alca:focus-visible, .mapa-volta:focus-visible, .mp-recolher:focus-visible, .mp-ver-mais:focus-visible, .mp-tentar:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) {
  .mp-chip, .mp-recolher, .mapa-btn, .mapa-seg button, .mp-tentar { min-height: 44px; }
}

.mapa-estado { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); z-index: 40; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 0.8125rem; max-width: min(90vw, 480px); display: flex; gap: 10px; align-items: center; }
.mapa-estado[hidden] { display: none; }
.mapa-estado[role="alert"] { color: var(--red); }

@media (max-width: 600px) {
  .mapa-lateral { width: 100%; }
  .mapa-topo { gap: 6px; }
  .mapa-topo .mapa-ao-vivo { display: none; }
  /* Modo painel: a lateral vira a folha que sobe; alvos de 44 px */
  .mapa-lateral.folha { container-type: normal; top: 0; bottom: 0; height: 100%; width: 100%; border-right: 0; border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; background: color-mix(in srgb, var(--bg-card) 94%, transparent); transition: none; will-change: transform; }
  .mapa-lateral.folha[data-aberta="false"] { transform: none; visibility: visible; }
  .mapa-lateral.folha .mf-alca { display: flex; flex: none; }
  .mapa-lateral.folha .mp-linhas { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .mapa-seg button, .mp-chip, .mapa-btn, .mapa-volta { min-height: 44px; }
  .mapa-topo button.mapa-volta { min-width: 44px; justify-content: center; }
  .mapa-topo .mapa-titulo { font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .mapa-topo .mapa-titulo-prefixo, .mapa-topo .mapa-volta-rotulo { display: none; }
  .mapa-topo .mapa-volta { font-size: 1.25rem; }
  .mapa-topo .mapa-dir { flex-wrap: nowrap; gap: 6px; }
  .mapa-topo .mapa-btn, .mapa-topo .mapa-seg button { padding: 4px 8px; font-size: 0.75rem; white-space: nowrap; }
  .mapa-topo .mapa-btn[data-acao="enquadrar"] { display: none; }
  /* Satélite vira botão flutuante sob a barra: sobra espaço para o nome do condomínio */
  .mapa-topo .mapa-btn[data-acao="satelite"] { position: absolute; right: 12px; top: calc(100% + 10px); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
  .mapa-lateral.folha .mp-recolher { display: none; }
  .mapa-lateral.folha .mp-chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 8px; }
  .mapa-lateral.folha .mp-chip { flex: none; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .mapa-lateral { transition: opacity 200ms ease; }
  .mapa-lateral.folha { transition: none; }
  .mp-linha:active { transform: none; }
  .mapa-lateral[data-aberta="false"] { transform: none; opacity: 0; }
  .mp.pisca { animation: none; }
  .mapa-btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .mapa-topo, .mapa-lateral, .mapa-lateral.painel, .mapa-lateral.folha { background: var(--bg-card); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Camada dos balões e do cartão de posição sobre o mapa */
#mapa-cartoes { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
#mapa-cartoes .mb, #mapa-cartoes .mpz { pointer-events: auto; }
#mapa-cartoes .mpz { left: 50%; top: 60px; transform: translateX(-50%); }
.mapa-alvo { display: block; width: 26px; height: 26px; border: 2px solid #d97706; border-radius: 50%; position: relative; }
.mapa-alvo::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: #d97706; border-radius: 50%; transform: translate(-50%, -50%); }
.mp.central { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent), 0 2px 6px rgba(0,0,0,.3); }
