
/* NUJIZ UNIFIED STICKY PREVIEW V9 */

/* Preserve empty workspace state */

html body #toolWorkspace
#editor:not(.visible):not(#nsp9Priority),

html body #toolWorkspace
#videoEditor:not(.visible):not(#nsp9Priority){

    display:none!important;

}

html body #toolWorkspace
:is(#editor,#videoEditor)[hidden]:not(#nsp9Priority){

    display:none!important;

}

html body #toolWorkspace:not(.nsp9-ready)
#nswToolbar:not(#nsp9Priority){

    display:none!important;

}

@media(max-width:767px){

    /* Remove accidental scroll containers */

    html.nsp9-active,

    html.nsp9-active body.tool-page:not(#nsp9Priority),

    html.nsp9-active body main#top:not(#nsp9Priority),

    html.nsp9-active body
    .nsp9-ancestor:not(#nsp9Priority){

        overflow-x:clip!important;
        overflow-y:visible!important;

    }

    html.nsp9-active body
    .nsp9-ancestor:not(#nsp9Priority){

        contain:none!important;

    }

    /* Normal page scrolling */

    

    

    html body main #toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible:not(#nsp9Priority){

        display:flex!important;

        flex-direction:column!important;
        flex-wrap:nowrap!important;

        align-items:stretch!important;
        justify-content:flex-start!important;

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

        overflow:visible!important;

        gap:12px!important;

    }

    /* Sticky preview */

    html body main #toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled
    > .nsw-preview:not(#nsp9Priority){

        position:sticky!important;

        top:var(--nsw-top,12px)!important;

        bottom:auto!important;
        inset-inline:auto!important;

        z-index:45!important;

        order:-1!important;

        flex:0 0 auto!important;
        align-self:stretch!important;

        width:100%!important;
        min-width:0!important;
        max-width:100%!important;

        height:auto!important;
        min-height:0!important;
        max-height:46dvh!important;

        padding:6px!important;
        margin:0!important;

        box-sizing:border-box!important;

        overflow:hidden!important;

        background:var(--nsp9-panel)!important;

        border:1px solid var(--nsp9-border)!important;
        border-radius:14px!important;

        box-shadow:0 5px 18px #00000012;

        overscroll-behavior:auto!important;

    }

    /* Theme colors */

    html body #toolWorkspace{

        --nsp9-panel:#ffffff;
        --nsp9-text:#172033;
        --nsp9-border:#dce3ed;
        --nsp9-card:#edf2f8;

    }

    html[data-theme="dark"] body #toolWorkspace{

        --nsp9-panel:#111827;
        --nsp9-text:#f1f5f9;
        --nsp9-border:#35435a;
        --nsp9-card:#202b3c;

    }

    /* Compact preview header */

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview-label:not(#nsp9Priority){

        position:relative!important;
        inset:auto!important;

        min-height:32px!important;

        padding:5px 8px!important;
        margin:0 0 4px!important;

        background:var(--nsp9-panel)!important;

        color:var(--nsp9-text)!important;
        -webkit-text-fill-color:var(--nsp9-text)!important;

    }

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview-label *{

        font-size:12px!important;

        color:var(--nsp9-text)!important;
        -webkit-text-fill-color:var(--nsp9-text)!important;

    }

    /* Image and video stages */

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview
    :is(.canvas-stage,#videoPlayerStage):not(#nsp9Priority){

        width:100%!important;

        height:auto!important;
        min-height:0!important;
        max-height:31dvh!important;

        padding:4px!important;
        margin:0!important;

        box-sizing:border-box!important;

        overflow:hidden!important;

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

    }

    /* Preserve media proportions */

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview
    :is(#previewCanvas,#videoPreview,#videoCanvas):not(#nsp9Priority){

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

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

        max-width:100%!important;
        max-height:30dvh!important;

        object-fit:contain!important;

        box-sizing:border-box!important;

    }

    /* Compact file information */

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview
    :is(.image-stats,.video-stats):not(#nsp9Priority){

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

        gap:3px!important;

        margin:4px 0 0!important;
        padding:0!important;

    }

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview
    :is(.image-stats,.video-stats) > div{

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

        padding:5px 2px!important;
        margin:0!important;

        background:var(--nsp9-card)!important;

        border-radius:6px!important;

        text-align:center!important;

    }

    html body main #toolWorkspace.nsp9-ready
    .nsw-preview
    :is(.image-stats,.video-stats)
    :is(span,strong,small,b){

        font-size:11px!important;
        line-height:1.4!important;

        color:var(--nsp9-text)!important;
        -webkit-text-fill-color:var(--nsp9-text)!important;

        overflow-wrap:anywhere!important;

    }

    /* Settings scroll with the page */

    html body main #toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled
    > .nsw-controls:not(#nsp9Priority){

        position:relative!important;
        inset:auto!important;

        width:100%!important;

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

        flex:0 0 auto!important;

        overflow:visible!important;

        overscroll-behavior:auto!important;

        z-index:auto!important;

    }

    html body main #toolWorkspace.nsp9-ready
    :is(#dynamicControls,#videoDynamicControls):not(#nsp9Priority){

        height:auto!important;
        max-height:none!important;

        overflow:visible!important;

    }

    /* Keep processing actions accessible */

    html body main #toolWorkspace.nsp9-ready
    .nsw-actions:not(#nsp9Priority){

        position:relative!important;

        inset:auto!important;

        z-index:auto!important;

    }

    /* Preserve collapsed preview */

    html body main #toolWorkspace.nsp9-ready
    .nsw-enabled.nsw-collapsed
    > .nsw-preview:not(#nsp9Priority){

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

    }

    html body main #toolWorkspace.nsp9-ready
    .nsw-enabled.nsw-collapsed
    > .nsw-preview > :not(.nsw-preview-label){

        display:none!important;

    }

    /* Preserve original hidden states */

    html body main #toolWorkspace
    .nsw-preview [hidden]:not(#nsp9Priority),

    html body main #toolWorkspace
    #videoPlayerStage.nsb-hide-original:not(#nsp9Priority){

        display:none!important;

    }

    /* Storyboard preview */

    html body main #toolWorkspace.nsp9-ready
    #nsbLiveCanvas:not([hidden]){

        max-height:29dvh!important;
        max-width:100%!important;

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

        object-fit:contain!important;

    }

    /* Older browser fallback */

    @supports not (overflow:clip){

        html.nsp9-active,

        html.nsp9-active body.tool-page:not(#nsp9Priority),

        html.nsp9-active body main#top:not(#nsp9Priority),

        html.nsp9-active body
        .nsp9-ancestor:not(#nsp9Priority){

            overflow:visible!important;

        }

    }

}


/* NUJIZ V88 START */

@media screen and (min-width:1024px) {

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible:not([hidden]):not(#nsp9Priority)
    :is(.nsw-preview,.nsw-controls) {
        min-width:0!important;
        max-width:100%!important;
        box-sizing:border-box!important;
    }

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible:not([hidden]):not(#nsp9Priority)
    :is(canvas,video,img) {
        max-width:100%!important;
    }

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible:not([hidden]):not(#nsp9Priority)
    :is(.nsw-preview,.nsw-controls) {
        width:100%!important;
    }

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible:not([hidden]):not(#nsp9Priority) {
        display:grid!important;
        grid-template-columns:
            minmax(0,1.5fr)
            minmax(0,1fr)!important;
        grid-template-rows:auto!important;
        grid-auto-flow:row!important;
        align-items:start!important;
        align-content:start!important;
        gap:18px!important;
        height:auto!important;
        min-height:0!important;
        max-height:none!important;
        overflow:visible!important;
    }

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible
    > .nsw-preview {
        grid-column:1!important;
        grid-row:1!important;
        order:0!important;
        position:relative!important;
        top:auto!important;
        height:auto!important;
        max-height:none!important;
        overflow:visible!important;
    }

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible
    > .nsw-controls {
        grid-column:2!important;
        grid-row:1!important;
        order:1!important;
        position:relative!important;
        top:auto!important;
        height:auto!important;
        max-height:none!important;
        overflow:visible!important;
    }

    html body main #toolWorkspace#toolWorkspace.nsp9-ready
    :is(#editor,#videoEditor).nsw-enabled.visible
    > :not(.nsw-preview):not(.nsw-controls) {
        grid-column:1/-1!important;
        grid-row:auto!important;
    }

    html body main #toolWorkspace#toolWorkspace
    .nsw-preview video {
        width:100%!important;
        max-height:65vh!important;
        object-fit:contain!important;
    }
}

/* NUJIZ V88 END */
