* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    background: #02070d;
    color: #e7f4ff;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow: hidden;
}

#app {
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
}

header {
    min-height: 96px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background:
        linear-gradient(
            90deg,
            #05121d,
            #07141d 60%,
            #08170f
        );
    border-bottom: 1px solid #163142;
}

.eyebrow {
    color: #62dbff;
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 700;
}

h1 {
    margin: 4px 0;
    font-size: 28px;
    letter-spacing: 1px;
}

header p {
    margin: 0;
    color: #93aabd;
    font-size: 12px;
}

.status {
    color: #61f59a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: #61f59a;
    box-shadow: 0 0 10px #61f59a;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #06101a;
    border-bottom: 1px solid #163142;
}

.metric {
    min-height: 70px;
    padding: 14px;
    border-right: 1px solid #163142;
}

.metric span {
    display: block;
    color: #698196;
    font-size: 9px;
    letter-spacing: 1px;
}

.metric strong {
    display: block;
    margin-top: 7px;
    color: #ffffff;
    font-size: 19px;
}

main {
    min-height: 0;
    display: grid;
    grid-template-columns: 245px 1fr 295px;
}

.left-panel,
.right-panel {
    padding: 18px;
    overflow-y: auto;
    background: #06101a;
}

.left-panel {
    border-right: 1px solid #163142;
}

.right-panel {
    border-left: 1px solid #163142;
}

.left-panel h2,
.right-panel h2 {
    margin: 0 0 14px;
    color: #78ddff;
    font-size: 11px;
    letter-spacing: 1.5px;
}

.layer-row {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #122432;
    font-size: 11px;
}

.layer-row small {
    color: #506474;
    font-size: 8px;
}

.switch {
    position: relative;
    width: 34px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #1a2a35;
    border: 1px solid #314651;
}

.slider::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #61717b;
}

.panel-note {
    margin-top: 20px;
    color: #627789;
    font-size: 10px;
    line-height: 1.5;
}

#map {
    min-width: 0;
    min-height: 0;
    background: #02070d;
}

.right-panel p {
    color: #8fa8ba;
    font-size: 11px;
    line-height: 1.6;
}

.intel-row {
    padding: 12px 0;
    border-bottom: 1px solid #132733;
}

.intel-row span {
    display: block;
    color: #647d90;
    font-size: 9px;
    margin-bottom: 4px;
}

.intel-row strong {
    color: #d7e9f4;
    font-size: 10px;
}

.source {
    margin-top: 20px;
    padding: 12px;
    border: 1px solid #183b4e;
    background: #071722;
    color: #61cbea;
    font-size: 9px;
    line-height: 1.5;
}

footer {
    min-height: 32px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #030b12;
    border-top: 1px solid #163142;
    color: #647989;
    font-size: 9px;
}

@media (max-width: 1000px) {

    main {
        grid-template-columns: 210px 1fr;
    }

    .right-panel {
        display: none;
    }

    .metrics {
        grid-template-columns: repeat(3, 1fr);
    }

}



.switch input:checked + .slider {
    background: #168458;
    border-color: #49ff9a;
}

.switch input:checked + .slider::before {
    transform: translateX(16px);
    background: #ffffff;
    box-shadow: 0 0 9px #49ff9a;
}

/* FOOD_MOBILE_MAPFIRST_BEGIN */


#food-mobile-filters,
#food-mobile-info,
#food-mobile-fullscreen,
#food-mobile-backdrop {
    display: none;
}


@media (max-width: 700px) {

    html,
    body {
        width: 100% !important;
        height: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: hidden !important;

        background: #02070d !important;
    }


    #app {
        display: block !important;

        position: fixed !important;

        inset: 0 !important;

        width: 100vw !important;
        height: 100dvh !important;

        overflow: hidden !important;
    }


    /*
     * COMPACT HEADER
     */

    header {
        position: fixed !important;

        top: 0 !important;
        left: 0 !important;
        right: 0 !important;

        height: 58px !important;
        min-height: 58px !important;

        box-sizing: border-box !important;

        padding: 6px 10px !important;

        z-index: 40000 !important;

        overflow: hidden !important;
    }


    header h1 {
        margin: 0 !important;

        font-size: 15px !important;
        line-height: 1.05 !important;
    }


    header p,
    header .subtitle,
    header .tagline {
        display: none !important;
    }


    /*
     * DO NOT LET SIX DESKTOP METRIC CARDS
     * EAT THE PHONE DISPLAY.
     */

    .metrics {
        display: none !important;
    }


    footer {
        display: none !important;
    }


    /*
     * MAP OWNS THE PHONE.
     */

    main {
        display: block !important;

        position: fixed !important;

        top: 58px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: 100vw !important;
        height: calc(100dvh - 58px) !important;

        min-width: 0 !important;
        min-height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: hidden !important;

        background: #02070d !important;
    }


    #map {
        display: block !important;

        position: absolute !important;

        inset: 0 !important;

        width: 100% !important;
        height: 100% !important;

        min-width: 0 !important;
        min-height: 0 !important;

        z-index: 1 !important;
    }


    /*
     * SIDEBARS BECOME DRAWERS.
     */

    .left-panel,
    .right-panel {
        display: none !important;

        position: fixed !important;

        top: 58px !important;
        bottom: 0 !important;

        width: min(90vw, 390px) !important;
        max-width: 390px !important;

        height: calc(100dvh - 58px) !important;

        box-sizing: border-box !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        padding: 16px !important;

        z-index: 50000 !important;

        -webkit-overflow-scrolling: touch;
    }


    .left-panel {
        left: 0 !important;
        right: auto !important;

        border-right:
            1px solid #163142 !important;

        box-shadow:
            12px 0 34px
            rgba(0,0,0,.78) !important;
    }


    .right-panel {
        left: auto !important;
        right: 0 !important;

        border-left:
            1px solid #163142 !important;

        box-shadow:
            -12px 0 34px
            rgba(0,0,0,.78) !important;
    }


    .left-panel.food-mobile-open,
    .right-panel.food-mobile-open {
        display: block !important;
    }


    /*
     * MOBILE BUTTONS
     */

    #food-mobile-filters,
    #food-mobile-info,
    #food-mobile-fullscreen {

        display: flex !important;

        position: fixed !important;

        align-items: center !important;
        justify-content: center !important;

        min-height: 42px !important;

        padding: 7px 12px !important;

        border:
            1px solid
            rgba(97,203,234,.90) !important;

        border-radius: 22px !important;

        background:
            rgba(3,14,21,.94) !important;

        color: #ffffff !important;

        font-size: 10px !important;
        font-weight: 900 !important;

        letter-spacing: .7px !important;

        box-shadow:
            0 5px 18px
            rgba(0,0,0,.70) !important;

        cursor: pointer !important;

        touch-action: manipulation !important;
    }


    #food-mobile-filters {
        top: 68px !important;
        left: 10px !important;

        z-index: 45000 !important;
    }


    #food-mobile-info {
        top: 68px !important;
        right: 10px !important;

        z-index: 45000 !important;
    }


    #food-mobile-fullscreen {
        left: 50% !important;

        bottom:
            calc(
                14px
                + env(safe-area-inset-bottom)
            ) !important;

        transform:
            translateX(-50%) !important;

        z-index: 45000 !important;
    }


    #food-mobile-filters.food-mobile-open,
    #food-mobile-info.food-mobile-open {
        z-index: 51000 !important;
    }


    /*
     * DRAWER BACKDROP
     */

    #food-mobile-backdrop {
        display: none !important;

        position: fixed !important;

        inset: 58px 0 0 0 !important;

        z-index: 49000 !important;

        background:
            rgba(0,0,0,.48) !important;
    }


    #food-mobile-backdrop.food-mobile-open {
        display: block !important;
    }


    /*
     * TOUCH-FRIENDLY FOOD LAYER CONTROLS
     */

    .layer-row {
        min-height: 50px !important;

        font-size: 13px !important;
    }


    .layer-row small {
        font-size: 9px !important;
    }


    .switch {
        width: 44px !important;
        height: 24px !important;

        flex: 0 0 auto !important;
    }


    .slider::before {
        width: 18px !important;
        height: 18px !important;

        top: 2px !important;
        left: 2px !important;
    }


    .switch input:checked + .slider::before {
        transform:
            translateX(20px) !important;
    }


    .left-panel h2,
    .right-panel h2 {
        font-size: 13px !important;
    }


    .right-panel p {
        font-size: 13px !important;
    }


    .intel-row span {
        font-size: 10px !important;
    }


    .intel-row strong {
        font-size: 15px !important;
    }


    /*
     * LEAFLET PHONE CONTROLS
     */

    .leaflet-control-zoom a {
        width: 42px !important;
        height: 42px !important;

        line-height: 42px !important;

        font-size: 23px !important;
    }


    .leaflet-control-attribution {
        max-width: 72vw !important;

        font-size: 7px !important;
        line-height: 1.1 !important;
    }


    /*
     * IMMERSIVE FULL SCREEN
     */

    body.food-immersive header {
        display: none !important;
    }


    body.food-immersive main {
        top: 0 !important;

        width: 100vw !important;
        height: 100dvh !important;
    }


    body.food-immersive
    .left-panel,

    body.food-immersive
    .right-panel {

        top: 0 !important;

        height: 100dvh !important;

        padding-top:
            calc(
                62px
                + env(safe-area-inset-top)
            ) !important;
    }


    body.food-immersive
    #food-mobile-backdrop {

        inset: 0 !important;
    }


    body.food-immersive
    #food-mobile-filters,

    body.food-immersive
    #food-mobile-info {

        top:
            calc(
                10px
                + env(safe-area-inset-top)
            ) !important;
    }


    body.food-immersive
    #food-mobile-fullscreen {

        bottom:
            calc(
                10px
                + env(safe-area-inset-bottom)
            ) !important;
    }

}


@media
    (max-width: 900px)
    and (max-height: 520px)
    and (orientation: landscape) {

    header {
        height: 48px !important;
        min-height: 48px !important;
    }


    main {
        top: 48px !important;

        height:
            calc(100dvh - 48px) !important;
    }


    .left-panel,
    .right-panel {
        top: 48px !important;

        height:
            calc(100dvh - 48px) !important;

        width:
            min(72vw, 390px) !important;
    }


    #food-mobile-backdrop {
        inset: 48px 0 0 0 !important;
    }


    #food-mobile-filters,
    #food-mobile-info {
        top: 56px !important;
    }


    body.food-immersive main {
        top: 0 !important;

        height: 100dvh !important;
    }


    body.food-immersive
    .left-panel,

    body.food-immersive
    .right-panel {

        top: 0 !important;
        height: 100dvh !important;
    }

}


/* FOOD_MOBILE_MAPFIRST_END */
