/* ==========================================================
   STREAMCORE R177
   Consolidated Dashboard Layout Core
   ========================================================== */


/* ----------------------------------------------------------
   DESKTOP SHELL
   ---------------------------------------------------------- */

@media(min-width:841px){

    .sc-shell.client{
        grid-template-columns:
            clamp(196px,11.4vw,218px)
            minmax(0,1fr) !important;
    }

    .sc-shell.client .sidebar{
        width:
            clamp(196px,11.4vw,218px)
            !important;

        padding-left:11px;
        padding-right:11px;
    }


    /* Readable sidebar */

    .sc-shell.client
    .sidebar
    .brand-copy strong{
        font-size:17px;
        line-height:21px;
        font-weight:760;
    }

    .sc-shell.client
    .sidebar
    .brand-copy small{
        font-size:9px;
    }

    .sc-shell.client
    .sidebar
    .workspace-label{
        font-size:9.5px;
        font-weight:650;
    }

    .sc-shell.client
    .sidebar
    .workspace-select{
        min-height:43px;
    }

    .sc-shell.client
    .sidebar
    .workspace-select span{
        font-size:13px;
        font-weight:720;
    }

    .sc-shell.client
    .sidebar
    .nav{
        gap:3px;
    }

    .sc-shell.client
    .sidebar
    .nav-btn{
        min-height:40px;
    }

    .sc-shell.client
    .sidebar
    .nav-btn
    span:not(.nav-badge){
        font-size:12.8px;
        font-weight:560;
    }


    /* Actual responsive container */

    .sc-shell.client
    .content.client-home{
        container-type:inline-size;
        container-name:sc-dashboard;

        width:100%;
        min-width:0;
        max-width:none;

        margin:0;

        padding-left:
            clamp(14px,1.25vw,24px);

        padding-right:
            clamp(14px,1.25vw,24px);

        padding-bottom:30px;

        overflow:visible;
    }


    .sc-shell.client
    .premium-dashboard-v142{
        width:100%;
        min-width:0;
        max-width:100%;
    }


    /*
     * Remove historical fixed-height architecture.
     * Vertical scrolling is preferable to crushing content.
     */

    .sc-shell.client
    .premium-dashboard-v142
    .client-layout{
        width:100%;
        min-width:0;

        height:auto !important;

        grid-template-rows:
            auto !important;

        gap:
            clamp(10px,1vw,14px);

        align-items:start;
    }


    .sc-shell.client
    .premium-dashboard-v142
    .client-layout>*{
        min-width:0;
        max-width:100%;
    }


    .sc-shell.client
    .premium-dashboard-v142
    .channels-panel,

    .sc-shell.client
    .premium-dashboard-v142
    .premium-player,

    .sc-shell.client
    .premium-dashboard-v142
    .premium-activity,

    .sc-shell.client
    .premium-dashboard-v142
    .actions-column{
        min-width:0 !important;
        min-height:0 !important;

        height:auto !important;

        max-width:100%;
    }


    /* Metrics adapt naturally */

    .sc-shell.client
    .premium-dashboard-v142
    .metric-grid{
        width:100%;

        gap:
            clamp(9px,.8vw,12px);

        margin-bottom:
            clamp(10px,.9vw,14px);
    }

    .sc-shell.client
    .premium-dashboard-v142
    .metric-card{
        min-width:0;
        min-height:92px;

        height:auto !important;
    }


    /* Player: true single 16:9 surface */

    .sc-shell.client
    .premium-dashboard-v142
    .premium-player{
        overflow:hidden;
    }

    .sc-shell.client
    .premium-dashboard-v142
    .premium-player>.video-wrap{
        position:relative;

        width:100% !important;

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

        aspect-ratio:
            16 / 9 !important;

        overflow:hidden;
        background:#02050a;
    }

    .sc-shell.client
    .premium-dashboard-v142
    .premium-player video{
        display:block;

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

        max-width:100%;

        object-fit:contain;

        background:#02050a;
    }

    .sc-shell.client
    .premium-dashboard-v142
    .premium-player
    video::-webkit-media-controls,

    .sc-shell.client
    .premium-dashboard-v142
    .premium-player
    video::-webkit-media-controls-enclosure{
        display:none !important;
    }


    /* No historical fixed action heights */

    .sc-shell.client
    .premium-dashboard-v142
    .actions-column{
        height:auto !important;

        grid-template-rows:
            auto auto !important;

        gap:
            clamp(10px,.9vw,14px);
    }


    /* Activity gets natural panel height + internal scroll */

    .sc-shell.client
    .premium-dashboard-v142
    .premium-activity{
        height:auto !important;
    }

    .sc-shell.client
    .premium-dashboard-v142
    .premium-activity
    .activity-list{
        height:auto !important;

        max-height:280px;

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

        scrollbar-width:thin;
    }


    /* Channel table cannot break its grid cell */

    .sc-shell.client
    .premium-dashboard-v142
    .channels-panel
    .channel-table-wrap{
        min-width:0;

        overflow-x:auto;
        overflow-y:visible;
    }


    /* Premium surface, no layout effect */

    .sc-shell.client
    .premium-dashboard-v142
    .panel,

    .sc-shell.client
    .premium-dashboard-v142
    .metric-card{
        border-radius:12px;

        box-shadow:
            0 10px 30px
            rgba(0,0,0,.12),
            inset 0 1px
            rgba(255,255,255,.018);
    }
}


/* ==========================================================
   CONTAINER-DRIVEN DASHBOARD
   Uses actual content width, not monitor resolution.
   ========================================================== */

@media(min-width:841px){

    /*
     * Actual dashboard width below 760:
     * one column.
     */

    @container sc-dashboard (max-width:759px){

        .premium-dashboard-v142
        .metric-grid{
            grid-template-columns:
                repeat(
                    2,
                    minmax(0,1fr)
                ) !important;
        }

        .premium-dashboard-v142
        .client-layout{
            display:grid !important;

            grid-template-columns:
                minmax(0,1fr)
                !important;
        }

        .premium-dashboard-v142
        .channels-panel,

        .premium-dashboard-v142
        .premium-player,

        .premium-dashboard-v142
        .premium-activity,

        .premium-dashboard-v142
        .actions-column{
            grid-column:
                1 !important;

            grid-row:
                auto !important;
        }
    }


    /*
     * 760..1119 actual content:
     * two balanced columns.
     */

    @container sc-dashboard (min-width:760px) and (max-width:1119px){

        .premium-dashboard-v142
        .metric-grid{
            grid-template-columns:
                repeat(
                    3,
                    minmax(0,1fr)
                ) !important;
        }

        .premium-dashboard-v142
        .client-layout{
            display:grid !important;

            grid-template-columns:
                minmax(0,.95fr)
                minmax(0,1.05fr)
                !important;
        }

        .premium-dashboard-v142
        .channels-panel{
            grid-column:1 !important;
            grid-row:1 !important;
        }

        .premium-dashboard-v142
        .premium-player{
            grid-column:2 !important;
            grid-row:1 !important;
        }

        .premium-dashboard-v142
        .premium-activity{
            grid-column:1 !important;
            grid-row:2 !important;
        }

        .premium-dashboard-v142
        .actions-column{
            grid-column:2 !important;
            grid-row:2 !important;
        }
    }


    /*
     * 1120..1539 actual dashboard width:
     * three columns.
     */

    
    @container sc-dashboard (min-width:1120px) and (max-width:1539px){

        .premium-dashboard-v142
        .metric-grid{
            grid-template-columns:
                repeat(5,minmax(0,1fr))
                !important;
        }

        .premium-dashboard-v142
        .client-layout{
            display:grid !important;

            grid-template-columns:
                minmax(250px,.78fr)
                minmax(430px,1.28fr)
                minmax(310px,.94fr)
                !important;

            grid-template-rows:
                auto auto !important;

            gap:12px !important;
        }

        .premium-dashboard-v142
        .channels-panel{
            grid-column:1 !important;
            grid-row:1 / 3 !important;
        }

        .premium-dashboard-v142
        .premium-player{
            grid-column:2 !important;
            grid-row:1 / 3 !important;
        }

        .premium-dashboard-v142
        .premium-activity{
            grid-column:3 !important;
            grid-row:1 !important;
        }

        .premium-dashboard-v142
        .actions-column{
            grid-column:3 !important;
            grid-row:2 !important;
        }
    }



    /*
     * 1540+ actual dashboard width:
     * four-column premium desktop.
     */

    
    @container sc-dashboard (min-width:1540px){

        .premium-dashboard-v142
        .metric-grid{
            grid-template-columns:
                repeat(5,minmax(0,1fr))
                !important;
        }

        .premium-dashboard-v142
        .client-layout{
            display:grid !important;

            grid-template-columns:
                minmax(320px,.88fr)
                minmax(560px,1.34fr)
                minmax(350px,.88fr)
                !important;

            grid-template-rows:
                auto auto !important;

            gap:14px !important;
        }

        .premium-dashboard-v142
        .channels-panel{
            grid-column:1 !important;
            grid-row:1 / 3 !important;
        }

        .premium-dashboard-v142
        .premium-player{
            grid-column:2 !important;
            grid-row:1 / 3 !important;
        }

        .premium-dashboard-v142
        .premium-activity{
            grid-column:3 !important;
            grid-row:1 !important;
        }

        .premium-dashboard-v142
        .actions-column{
            grid-column:3 !important;
            grid-row:2 !important;
        }
    }

}


/* Mobile remains owned by existing mobile implementation. */


/* ==========================================================
   STREAMCORE R177B
   Exact DOM corrections.
   ========================================================== */

@media(min-width:841px){

    /*
     * Prevent ultrawide dashboards from stretching forever.
     */

    .sc-shell.client
    .content.client-home{
        box-sizing:border-box !important;

        max-width:2000px !important;

        margin-left:auto !important;
        margin-right:auto !important;
    }


    /*
     * EXACT PLAYER
     *
     * Do not use the historical grid whose final
     * minmax(0,1fr) depends on a fixed parent height.
     *
     * Four actual vertical components:
     * header / video / metrics / graph.
     */

    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432{
        display:flex !important;
        flex-direction:column !important;

        width:100% !important;

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

        overflow:hidden !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432
    >.player-head{
        flex:
            0 0 auto !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432
    >.video-wrap{
        flex:
            0 0 auto !important;

        width:100% !important;

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

        aspect-ratio:
            16 / 9 !important;

        overflow:hidden !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432
    >.exact-player-metrics{
        flex:
            0 0 auto !important;

        width:100% !important;
    }


    /*
     * THIS is the real graph wrapper from the active app.
     *
     * BitrateAreaGraph is absolutely positioned inside it,
     * therefore this parent MUST have a concrete height.
     */

    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432
    >.exact-player-graph-wrap{
        position:relative !important;

        flex:
            0 0 132px !important;

        width:100% !important;

        height:132px !important;
        min-height:132px !important;
        max-height:132px !important;

        padding:0 !important;

        overflow:hidden !important;

        background:
            linear-gradient(
                180deg,
                #0b1425,
                #09111f
            ) !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432
    >.exact-player-graph-wrap
    >.exact-bitrate-graph{
        position:absolute !important;

        inset:0 !important;

        width:auto !important;
        height:auto !important;

        padding:
            18px 17px 12px !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .exact-player-v1432
    .exact-bitrate-graph svg{
        display:block !important;

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


    /*
     * Channel table: it is a fixed desktop card,
     * not a horizontal-scroll surface.
     */

    .sc-shell.client
    .exact-dashboard-v1432
    .channels-panel
    .channel-table-wrap{
        width:100% !important;

        min-width:0 !important;

        overflow-x:hidden !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .channels-panel
    .desktop-table-only{
        width:100% !important;

        min-width:0 !important;

        overflow:hidden !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .channels-panel
    .channel-table{
        width:100% !important;

        min-width:0 !important;

        table-layout:fixed !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .channels-panel
    .channel-identity{
        min-width:0 !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .channels-panel
    .channel-identity>div{
        min-width:0 !important;
    }


    /*
     * Right operational column.
     */

    .sc-shell.client
    .exact-dashboard-v1432
    .premium-activity,

    .sc-shell.client
    .exact-dashboard-v1432
    .actions-column{
        min-width:0 !important;

        overflow:hidden;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .premium-activity
    .panel-head{
        min-width:0;

        padding-left:15px;
        padding-right:15px;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .premium-activity
    .panel-head h2{
        min-width:0;

        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .premium-activity
    .panel-head .link{
        flex:0 0 auto;

        margin-left:12px;

        white-space:nowrap;
    }


    /*
     * Six actions = 2 × 3, not 3 tiny controls per row.
     */

    .sc-shell.client
    .exact-dashboard-v1432
    .quick-grid{
        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            ) !important;

        height:auto !important;

        gap:8px !important;
    }


    .sc-shell.client
    .exact-dashboard-v1432
    .quick-action{
        min-width:0;

        min-height:42px;

        height:auto !important;
    }
}
