/* Apenas a página inicial dentro do APK WebView. As cores vêm da identidade ativa. */
html.proteja-webview body[data-menu-ativo="inicial"] {
    height: 100vh;
    height: 100dvh;
}

html.proteja-webview body[data-menu-ativo="inicial"] .topo-padrao-plataforma {
    display: none !important;
}

html.proteja-webview body[data-menu-ativo="inicial"] .main-content {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

html.proteja-webview body[data-menu-ativo="inicial"] #map {
    min-height: 0;
}

html.proteja-webview body[data-menu-ativo="inicial"] .leaflet-control-zoom,
html.proteja-webview body[data-menu-ativo="inicial"] .leaflet-control-layers {
    display: none !important;
}

html.proteja-webview body[data-menu-ativo="inicial"] .leaflet-top.leaflet-left,
html.proteja-webview body[data-menu-ativo="inicial"] .leaflet-top.leaflet-right {
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
}

html.proteja-webview body[data-menu-ativo="inicial"] .btn-painel-veiculos {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
}

html.proteja-webview body[data-menu-ativo="inicial"] .painel-veiculos-mapa {
    max-height: calc(100dvh - 154px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

html.proteja-webview body[data-menu-ativo="inicial"] .menu-overlay-padrao {
    inset: 0 !important;
}

html.proteja-webview body[data-menu-ativo="inicial"] .menu-lateral-padrao {
    top: env(safe-area-inset-top, 0px) !important;
    height: calc(100dvh - env(safe-area-inset-top, 0px)) !important;
}

.mapa-webview-opcoes-botao,
.mapa-webview-opcoes,
.mapa-webview-barra {
    display: none;
}

html.proteja-webview.sos-login-salvo body[data-menu-ativo="inicial"] .mapa-webview-opcoes-botao {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 4300;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    color: var(--proteja-primaria-texto, #ffffff);
    background: var(--proteja-azul-700);
    border: 1px solid var(--proteja-menu-texto, #ffffff);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    font-size: 1.5rem;
    touch-action: manipulation;
}

html.proteja-webview.sos-login-salvo body[data-menu-ativo="inicial"] .mapa-webview-opcoes:not([hidden]) {
    position: absolute;
    top: calc(68px + env(safe-area-inset-top, 0px));
    left: 12px;
    z-index: 4300;
    display: grid;
    width: min(250px, calc(100vw - 24px));
    padding: 12px;
    gap: 4px;
    color: #17212b;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.mapa-webview-opcoes strong { padding: 5px 8px; }
.mapa-webview-opcoes label,
.mapa-webview-opcoes button {
    display: flex;
    min-height: 44px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    align-items: center;
    gap: 10px;
    color: #17212b;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: inherit;
    text-align: left;
}
.mapa-webview-opcoes label:active,
.mapa-webview-opcoes button:active { background: #eef2f6; }
.mapa-webview-opcoes input { accent-color: var(--proteja-azul-700); }
.mapa-webview-opcoes button:disabled { opacity: 0.5; }

html.proteja-webview.sos-login-salvo body[data-menu-ativo="inicial"] .mapa-webview-barra {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4500;
    display: flex;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: space-between;
    background: var(--proteja-menu);
    border-top: 1px solid color-mix(in srgb, var(--proteja-menu-texto, #ffffff) 20%, transparent);
}

.mapa-webview-barra img {
    display: block;
    width: auto;
    max-width: min(55vw, 210px);
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

html.proteja-webview:not(.identidade-autenticada-resolvida) .mapa-webview-barra {
    background: #17212b;
}

html.proteja-webview:not(.identidade-autenticada-resolvida) .mapa-webview-barra img {
    visibility: hidden !important;
}

.mapa-webview-barra button {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    place-items: center;
    color: var(--proteja-menu-texto, #ffffff);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 12px;
    font-size: 1.6rem;
    touch-action: manipulation;
}

@media (max-width: 760px) {
    html.proteja-webview body[data-menu-ativo="inicial"] .painel-veiculos-mapa {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}
