/* TRACELIA_V264_REAL_MOBILE_LAYOUT */

@media (max-width: 760px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body .app-shell {
        display: block !important;
        min-height: 100% !important;
    }

    body .sidebar {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 14px 14px 11px !important;
        border-right: 0 !important;
        border-bottom:
            1px solid rgba(255, 255, 255, 0.10) !important;
    }

    body .brand {
        margin-bottom: 12px !important;
    }

    body .brand-mark {
        width: 42px !important;
        height: 42px !important;
        border-radius: 11px !important;
        font-size: 23px !important;
    }

    body .brand-name {
        font-size: 17px !important;
    }

    body .brand-product {
        font-size: 10px !important;
    }

    body .navigation {
        display: flex !important;
        grid-template-columns: none !important;
        width: 100% !important;
        gap: 7px !important;
        padding: 0 0 4px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body .navigation::-webkit-scrollbar {
        display: none !important;
    }

    body .nav-item {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: max-content !important;
        min-height: 42px !important;
        padding: 9px 13px !important;
        gap: 8px !important;
        border-radius: 11px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
        scroll-snap-align: start !important;
    }

    body .sidebar-footer {
        display: none !important;
    }

    body .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 17px 13px 30px !important;
    }

    body .topbar {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin-bottom: 17px !important;
    }

    body .topbar h1 {
        margin-top: 4px !important;
        font-size: clamp(27px, 8vw, 36px) !important;
        line-height: 1 !important;
    }

    body .topbar-actions {
        display: grid !important;
        flex: 0 0 auto !important;
        gap: 7px !important;
    }

    body .global-status,
    body .topbar-actions .button {
        min-height: 39px !important;
        padding: 8px 11px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    body .kpi-grid {
        display: grid !important;
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    body .kpi-card {
        min-width: 0 !important;
        min-height: 112px !important;
        padding: 13px 11px !important;
        gap: 9px !important;
        align-items: flex-start !important;
    }

    body .kpi-icon {
        flex: 0 0 auto !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
        font-size: 19px !important;
    }

    body .kpi-label {
        font-size: 10px !important;
    }

    body .kpi-card strong {
        font-size: 26px !important;
        line-height: 1 !important;
    }

    body .kpi-card small {
        display: block !important;
        margin-top: 5px !important;
        font-size: 9px !important;
        line-height: 1.3 !important;
        overflow-wrap: anywhere !important;
    }

    body .system-grid,
    body .bottom-grid,
    body .configuration-grid {
        grid-template-columns: 1fr !important;
        gap: 11px !important;
    }

    body .panel {
        padding: 15px !important;
    }

    body .metrics {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body .camera-grid,
    body .camera-grid-large {
        grid-template-columns: 1fr !important;
        gap: 11px !important;
    }

    body .camera-card {
        grid-template-columns:
            108px minmax(0, 1fr) !important;
        min-height: 145px !important;
    }

    body .camera-preview,
    body .camera-preview img {
        min-height: 145px !important;
    }

    body .camera-preview img {
        object-fit: cover !important;
    }

    body .camera-live-backdrop {
        padding: 0 !important;
        align-items: stretch !important;
    }

    body .camera-live-modal-card {
        width: 100vw !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    body .camera-live-modal-header {
        padding:
            calc(13px + env(safe-area-inset-top))
            13px
            11px !important;
        gap: 10px !important;
    }

    body .camera-live-modal-header h2 {
        font-size: 18px !important;
    }

    body .camera-live-header-actions {
        display: grid !important;
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: 7px !important;
    }

    body .camera-live-header-actions .badge {
        grid-column: 1 / -1 !important;
        justify-self: start !important;
    }

    body .camera-live-tool-button,
    body .camera-live-fullscreen-button,
    body #camera-live-close {
        width: 100% !important;
        min-height: 39px !important;
        padding: 8px !important;
        font-size: 10px !important;
    }

    body .camera-live-stage {
        flex: 1 1 auto !important;
        min-height: 45vh !important;
        border-radius: 0 !important;
        background: #000000 !important;
    }

    body .camera-live-image {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
    }

    body .camera-live-footer {
        display: grid !important;
        gap: 5px !important;
        padding:
            10px
            13px
            calc(10px + env(safe-area-inset-bottom)) !important;
        font-size: 10px !important;
    }

    body .camera-live-footer span {
        width: 100% !important;
        text-align: left !important;
    }
}

@media (max-width: 430px) {
    body .topbar {
        display: block !important;
    }

    body .topbar-actions {
        grid-template-columns:
            minmax(0, 1fr) auto !important;
        margin-top: 13px !important;
    }

    body .kpi-card {
        min-height: 106px !important;
        padding: 11px 9px !important;
    }

    body .kpi-card strong {
        font-size: 24px !important;
    }
}
