
/* NUJIZ SMART WORKSPACE V1 */

#toolWorkspace{
    --nsw-bg:#ffffff;
    --nsw-text:#182238;
    --nsw-muted:#475569;
    --nsw-line:#dce1ec;
    --nsw-accent:#7045e8;
    --nsw-soft:#f5f3ff;
    --nsw-top:100px;
}

html[data-theme="dark"] #toolWorkspace{
    --nsw-bg:#171c27;
    --nsw-text:#f8fafc;
    --nsw-muted:#cbd5e1;
    --nsw-line:#394255;
    --nsw-accent:#c4b5fd;
    --nsw-soft:#252039;
}

/* Workspace toolbar */

#nswToolbar{
    display:none;
}

@media(min-width:1100px) and (min-height:650px){

    html body #nswToolbar{
        display:flex;
        align-items:center;
        justify-content:space-between;
        flex-wrap:wrap;
        gap:12px;
        padding:12px 16px;
        margin:12px 0;
        border:1px solid var(--nsw-line);
        border-radius:13px;
        background:var(--nsw-bg)!important;
    }

    html body #nswToolbar strong{
        display:block;
        font-size:16px!important;
        font-weight:900!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
    }

    html body #nswToolbar small{
        display:block;
        margin-top:4px;
        font-size:13px!important;
        color:var(--nsw-muted)!important;
        -webkit-text-fill-color:var(--nsw-muted)!important;
    }

    html body #nswToggle{
        min-height:40px;
        padding:9px 15px;
        border:1px solid var(--nsw-line);
        border-radius:10px;
        background:var(--nsw-soft)!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
        font-size:14px!important;
        font-weight:800!important;
        cursor:pointer;
    }

    html body #nswToggle[aria-pressed="true"]{
        background:linear-gradient(
            135deg,#5530bd,#7952e9
        )!important;
        color:#fff!important;
        -webkit-text-fill-color:#fff!important;
        border-color:#9676ee!important;
    }

    /* Align columns without stretching preview */

    html body #toolWorkspace .nsw-layout.nsw-enabled{
        align-items:start!important;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-preview{
        position:sticky!important;
        top:var(--nsw-top)!important;
        align-self:start!important;
        min-height:0!important;
        height:auto!important;
        max-height:calc(
            100vh - var(--nsw-top) - 24px
        )!important;
        overflow:auto!important;
        overscroll-behavior:contain;
        scrollbar-width:thin;
    }

    /* Independent settings scrolling */

    html body #toolWorkspace
    .nsw-enabled > .nsw-controls{
        position:relative!important;
        align-self:start!important;
        min-height:0!important;
        height:auto!important;
        max-height:calc(
            100vh - var(--nsw-top) - 24px
        )!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        overscroll-behavior-y:contain;
        scrollbar-width:thin;
        scrollbar-color:#9274e5 transparent;
        scroll-padding-bottom:100px;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-controls::-webkit-scrollbar{
        width:7px;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-controls::-webkit-scrollbar-thumb{
        background:#9274e5;
        border-radius:10px;
    }

    /* Keep existing action buttons accessible */

    html body #toolWorkspace
    .nsw-enabled .nsw-actions{
        position:sticky!important;
        bottom:0!important;
        z-index:12!important;
        padding:12px 6px!important;
        margin-top:12px!important;
        background:var(--nsw-bg)!important;
        border-top:1px solid var(--nsw-line)!important;
        box-shadow:0 -8px 18px #0000000c;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-actions
    :is(button,a){
        font-size:15px!important;
        font-weight:800!important;
    }

    /* Preview label */

    html body #toolWorkspace .nsw-preview-label{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:8px;
        padding:12px 14px;
        border-bottom:1px solid var(--nsw-line);
        background:var(--nsw-bg)!important;
    }

    html body #toolWorkspace .nsw-preview-label strong{
        font-size:15px!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
    }

    html body #toolWorkspace .nsw-preview-label span{
        font-size:12px!important;
        font-weight:700!important;
        color:var(--nsw-accent)!important;
        -webkit-text-fill-color:var(--nsw-accent)!important;
    }

    html body #toolWorkspace
    .nsw-layout:not(.nsw-enabled)
    .nsw-preview-label{
        display:none!important;
    }
}

@media(max-width:1099px), (max-height:649px){
    #nswToolbar,
    #toolWorkspace .nsw-preview-label{
        display:none!important;
    }
}

/* No changes to media dimensions or overlays */

@media print{
    #nswToolbar,
    #toolWorkspace .nsw-preview-label{
        display:none!important;
    }
}

/* END NUJIZ SMART WORKSPACE V1 */


/* NUJIZ SMART WORKSPACE MOBILE V11 */

.nsw-mobile-toggle{
    display:none!important;
}

@media(max-width:1099px), (max-height:649px){

    html body #nswToolbar{
        display:flex!important;
        align-items:center;
        justify-content:space-between;
        flex-wrap:wrap;
        gap:10px;
        padding:12px;
        margin:10px 0;
        background:var(--nsw-bg)!important;
        border:1px solid var(--nsw-line);
        border-radius:12px;
    }

    html body #nswToolbar strong{
        font-size:15px!important;
        font-weight:800!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
    }

    html body #nswToolbar small{
        display:block;
        font-size:12px!important;
        color:var(--nsw-muted)!important;
        -webkit-text-fill-color:var(--nsw-muted)!important;
    }

    html body #nswToggle{
        min-height:42px;
        padding:10px 14px;
        border-radius:10px;
        background:#7045e8!important;
        color:#fff!important;
        -webkit-text-fill-color:#fff!important;
        font-size:13px!important;
        font-weight:800!important;
    }

    html body #toolWorkspace .nsw-layout.nsw-enabled{
        display:flex!important;
        flex-direction:column!important;
        align-items:stretch!important;
        gap:10px!important;
        min-height:0!important;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-preview{
        order:-1!important;
        position:sticky!important;
        top:var(--nsw-top)!important;
        z-index:25!important;
        width:100%!important;
        min-width:0!important;
        min-height:0!important;
        height:auto!important;
        max-height:none!important;
        overflow:auto!important;
        background:var(--nsw-bg)!important;
        border-radius:12px!important;
        overscroll-behavior-y:contain;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-controls{
        width:100%!important;
        min-width:0!important;
        min-height:0!important;
        height:auto!important;
        max-height:none!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        overscroll-behavior-y:contain;
        -webkit-overflow-scrolling:touch;
        scrollbar-width:thin;
        scrollbar-color:#9274e5 transparent;
        scroll-padding-bottom:110px;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-preview-label{
        display:flex!important;
        position:sticky;
        top:0;
        z-index:30;
        align-items:center;
        justify-content:space-between;
        gap:8px;
        padding:8px 12px;
        background:var(--nsw-bg)!important;
        border-bottom:1px solid var(--nsw-line);
    }

    html body #toolWorkspace
    .nsw-preview-label strong{
        font-size:14px!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
    }

    html body #toolWorkspace
    .nsw-preview-label > span{
        display:none!important;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-mobile-toggle{
        display:inline-flex!important;
        align-items:center;
        justify-content:center;
        min-height:36px;
        padding:7px 12px;
        border:1px solid var(--nsw-line);
        border-radius:8px;
        background:var(--nsw-soft)!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
        font-size:12px!important;
        font-weight:800!important;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-actions{
        position:sticky!important;
        bottom:0!important;
        z-index:20!important;
        background:var(--nsw-bg)!important;
        border-top:1px solid var(--nsw-line)!important;
        padding:10px 5px!important;
        padding-bottom:calc(
            10px + env(safe-area-inset-bottom, 0px)
        )!important;
        box-shadow:0 -6px 18px #0002;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-actions :is(button,a){
        min-height:44px;
        font-size:14px!important;
        font-weight:800!important;
    }

    /* Collapsed preview */

    html body #toolWorkspace
    .nsw-enabled.nsw-collapsed > .nsw-preview{
        max-height:none!important;
        overflow:hidden!important;
    }

    html body #toolWorkspace
    .nsw-enabled.nsw-collapsed
    > .nsw-preview > :not(.nsw-preview-label){
        display:none!important;
    }

    html body #toolWorkspace
    .nsw-enabled.nsw-collapsed > .nsw-controls{
        max-height:calc(
            100dvh - var(--nsw-top) - 85px
        )!important;
    }

    /* Release internal scrolling for keyboard */

    html body.nsw-keyboard-open #toolWorkspace
    .nsw-enabled > .nsw-controls{
        max-height:none!important;
        overflow:visible!important;
    }

    html body.nsw-keyboard-open #toolWorkspace
    .nsw-enabled > .nsw-preview{
        position:relative!important;
        top:auto!important;
    }

    html body.nsw-keyboard-open #toolWorkspace
    .nsw-enabled .nsw-actions{
        position:relative!important;
    }
}

@media(max-height:420px){
    html body #toolWorkspace
    .nsw-enabled > .nsw-controls{
        max-height:none!important;
        overflow:visible!important;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-preview{
        position:relative!important;
        top:auto!important;
    }
}

/* END NUJIZ SMART WORKSPACE MOBILE V11 */


/* NUJIZ MOBILE WORKSPACE V3 */

@media(max-width:767px){

    html body #toolWorkspace .nsw-layout,
    html body #toolWorkspace .nsw-layout.nsw-enabled {

        min-width:0!important;
        height:auto!important;
        max-height:none!important;
        overflow:visible!important;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-preview {

        position:relative!important;
        inset:auto!important;
        top:auto!important;
        bottom:auto!important;
        z-index:auto!important;

        width:100%!important;
        height:auto!important;
        min-height:0!important;
        max-height:none!important;

        overflow:visible!important;
        flex-shrink:0!important;
        align-self:stretch!important;
        overscroll-behavior:auto!important;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-controls,

    html body #toolWorkspace
    .nsw-enabled.nsw-collapsed > .nsw-controls {

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

        width:100%!important;
        height:auto!important;
        min-height:0!important;
        max-height:none!important;

        overflow:visible!important;
        overscroll-behavior:auto!important;
        scroll-padding-bottom:0!important;
        flex-shrink:0!important;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-preview-label,

    html body #toolWorkspace
    .nsw-enabled .nsw-actions {

        position:relative!important;
        inset:auto!important;
        top:auto!important;
        bottom:auto!important;
        z-index:auto!important;
        transform:none!important;
    }

    html body #toolWorkspace
    .nsw-enabled .nsw-preview-label span {

        display:none!important;
    }

    html body #toolWorkspace
    .nsw-enabled > .nsw-controls
    :is(
        #videoDynamicControls,
        #dynamicControls,
        .control-list
    ){

        height:auto!important;
        max-height:none!important;
        overflow:visible!important;
    }

    html body #toolWorkspace
    .nsw-enabled.nsw-collapsed > .nsw-preview {

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


/* NUJIZ V88 START */

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

    html body #toolWorkspace#toolWorkspace
    .nsw-layout.nsw-enabled.visible:not([hidden])
    :is(.nsw-preview,.nsw-controls) {
        min-width:0!important;
        max-width:100%!important;
    }

    html body #toolWorkspace#toolWorkspace
    .nsw-layout.nsw-enabled.visible:not([hidden]):has(>.nsw-preview):has(>.nsw-controls) {
        display:grid!important;
        grid-template-columns:
            minmax(0,1.5fr)
            minmax(0,1fr)!important;
        align-items:start!important;
        gap:18px!important;
        height:auto!important;
        max-height:none!important;
        overflow:visible!important;
    }

    html body #toolWorkspace#toolWorkspace
    .nsw-layout.nsw-enabled.visible > .nsw-preview {
        grid-column:1!important;
        grid-row:1!important;
        min-width:0!important;
        width:100%!important;
    }

    html body #toolWorkspace#toolWorkspace
    .nsw-layout.nsw-enabled.visible > .nsw-controls {
        grid-column:2!important;
        grid-row:1!important;
        min-width:0!important;
        width:100%!important;
    }
}

/* NUJIZ V88 END */
