/* Painel ↔ Mapa alternado — shell kiosk abaixo do topnav */

body:has(.pma-shell) {
    overflow: hidden;
}

.pma-shell {
    --pma-navy: #051835;
    --pma-orange: #D84D15;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
    overflow: hidden;
    background: #0B1220;
    margin: 0;
    padding: 0;
}

.pma-status {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.4rem 0.85rem;
    background: var(--pma-navy);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    color: #F8FAFC;
    z-index: 2;
}

.pma-status-left,
.pma-status-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.pma-status-left {
    flex: 1 1 auto;
}

.pma-status-right {
    flex: 0 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pma-status-left .fa-tv {
    color: var(--pma-orange);
    font-size: 1rem;
}

.pma-status-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #CBD5E1;
    white-space: nowrap;
}

.pma-status-screen {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}

.pma-status-next {
    font-size: 0.75rem;
    color: #94A3B8;
    white-space: nowrap;
}

.pma-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #fff;
    color: var(--pma-navy);
    font-size: 0.85rem;
    font-weight: 700;
}

.pma-time-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.2rem;
    padding: 0.12rem 0.28rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
}

.pma-time-value {
    min-width: 2.6rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
}

.pma-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #F8FAFC;
    cursor: pointer;
}

.pma-icon-btn:hover:not(:disabled) {
    background: var(--pma-orange);
    color: #fff;
}

.pma-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pma-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.15rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    color: #E2E8F0;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.pma-lock-btn:hover {
    border-color: rgba(216, 77, 21, 0.55);
    color: #fff;
}

.pma-lock-btn.is-locked {
    background: var(--pma-orange);
    border-color: var(--pma-orange);
    color: #fff;
}

.pma-stage {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #F3F6FB;
}

.pma-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #F3F6FB;
}

body.pl-theme-dark .pma-shell.pl-op-page {
    background: #061428 !important;
}

body.pl-theme-dark .pma-stage,
body.pl-theme-dark .pma-frame {
    background: #061428;
}

/* visibility, não display:none: a tela escondida precisa manter o tamanho para calcular o zoom */
.pma-frame.pma-frame-oculto {
    visibility: hidden;
    pointer-events: none;
}

.pma-frame.fade-in {
    animation: pmaFadeIn 0.45s ease-in;
}

@keyframes pmaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 767.98px) {
    .pma-shell {
        height: calc(100dvh - 56px);
        max-height: calc(100dvh - 56px);
    }

    .pma-status {
        flex-wrap: wrap;
        row-gap: 0.25rem;
        padding: 0.35rem 0.65rem;
    }

    .pma-status-left,
    .pma-status-right {
        flex: 1 1 auto;
    }

    .pma-status-label {
        font-size: 0.7rem;
    }

    .pma-status-screen {
        font-size: 0.85rem;
    }
}
