
/* NUJIZ SMART WORKSPACE V1 */

.nsw-pdf-root{
    --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"] .nsw-pdf-root{
    --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 .nsw-pdf-root .nsw-layout.nsw-enabled{
        align-items:start!important;
    }

    html body .nsw-pdf-root
    .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 .nsw-pdf-root
    .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 .nsw-pdf-root
    .nsw-enabled .nsw-controls::-webkit-scrollbar{
        width:7px;
    }

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

    /* Keep existing action buttons accessible */

    html body .nsw-pdf-root
    .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 .nsw-pdf-root
    .nsw-enabled .nsw-actions
    :is(button,a){
        font-size:15px!important;
        font-weight:800!important;
    }

    /* Preview label */

    html body .nsw-pdf-root .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 .nsw-pdf-root .nsw-preview-label strong{
        font-size:15px!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
    }

    html body .nsw-pdf-root .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 .nsw-pdf-root
    .nsw-layout:not(.nsw-enabled)
    .nsw-preview-label{
        display:none!important;
    }
}

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

/* No changes to media dimensions or overlays */

@media print{
    #nswToolbar,
    .nsw-pdf-root .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 .nsw-pdf-root .nsw-layout.nsw-enabled{
        display:flex!important;
        flex-direction:column!important;
        align-items:stretch!important;
        gap:10px!important;
        min-height:0!important;
    }

    html body .nsw-pdf-root
    .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:36dvh!important;
        overflow:auto!important;
        background:var(--nsw-bg)!important;
        border-radius:12px!important;
        overscroll-behavior-y:contain;
    }

    html body .nsw-pdf-root
    .nsw-enabled > .nsw-controls{
        width:100%!important;
        min-width:0!important;
        min-height:0!important;
        height:auto!important;
        max-height:calc(
            100dvh - var(--nsw-top) - 36dvh - 30px
        )!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 .nsw-pdf-root
    .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 .nsw-pdf-root
    .nsw-preview-label strong{
        font-size:14px!important;
        color:var(--nsw-text)!important;
        -webkit-text-fill-color:var(--nsw-text)!important;
    }

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

    html body .nsw-pdf-root
    .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 .nsw-pdf-root
    .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 .nsw-pdf-root
    .nsw-enabled .nsw-actions :is(button,a){
        min-height:44px;
        font-size:14px!important;
        font-weight:800!important;
    }

    /* Collapsed preview */

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

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

    html body .nsw-pdf-root
    .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 .nsw-pdf-root
    .nsw-enabled > .nsw-controls{
        max-height:none!important;
        overflow:visible!important;
    }

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

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

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

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

/* END NUJIZ SMART WORKSPACE MOBILE V11 */


/* NUJIZ SMART WORKSPACE PDF V12 */

html body .nsw-pdf-root{
    --nsw-top:90px;
}

html body .nsw-pdf-root .nsw-layout{
    min-width:0;
}

html body .nsw-pdf-root .nsw-preview,
html body .nsw-pdf-root .nsw-controls{
    min-width:0!important;
    box-sizing:border-box!important;
}

html body .nsw-pdf-root
.nsw-preview-label{
    border-radius:10px 10px 0 0;
}

html body .nsw-pdf-root
.nsw-preview-label button{
    cursor:pointer;
}

html body .nsw-pdf-root
.nsw-pdf-single.nsw-enabled{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
}

html body .nsw-pdf-root
.nsw-pdf-single.nsw-enabled > .nsw-preview{
    order:-1!important;
    width:100%!important;
    z-index:15;
}

html body .nsw-pdf-root
.nsw-pdf-single.nsw-enabled > .nsw-controls{
    width:100%!important;
    max-height:none!important;
    overflow:visible!important;
}

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

    html body .nsw-pdf-root
    .nsw-pdf-single.nsw-enabled > .nsw-preview{
        max-height:55vh!important;
    }

}

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

    html body .nsw-pdf-root
    .nsw-enabled > .nsw-preview{
        max-height:42dvh!important;
    }

    html body .nsw-pdf-root
    .nsw-enabled:not(.nsw-pdf-single) > .nsw-controls{
        max-height:max(
            160px,
            calc(100dvh - var(--nsw-top) - 42dvh - 30px)
        )!important;
    }

    html body .nsw-pdf-root
    .nsw-enabled.nsw-collapsed > .nsw-preview{
        max-height:none!important;
    }

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

    html body .nsw-pdf-root
    .nsw-mobile-toggle{
        min-height:40px!important;
        flex-shrink:0;
    }

}

@media print{

    html body .nsw-pdf-root #nswToolbar,
    html body .nsw-pdf-root .nsw-preview-label{
        display:none!important;
    }

    html body .nsw-pdf-root .nsw-preview,
    html body .nsw-pdf-root .nsw-controls{
        position:static!important;
        max-height:none!important;
        overflow:visible!important;
    }

}

/* NUJIZ PDF WORKSPACE V13 */

html body .nsw-pdf-root{
    --npw-bg:#fff;
    --npw-text:#182238;
    --npw-muted:#475569;
    --npw-line:#dce1ec;
    --npw-soft:#f5f3ff;
    --npw-top:85px;
}

html[data-theme="dark"] body .nsw-pdf-root{
    --npw-bg:#171c27;
    --npw-text:#f8fafc;
    --npw-muted:#cbd5e1;
    --npw-line:#394255;
    --npw-soft:#252039;
}

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

html body .npw-toolbar strong{
    display:block!important;
    font-size:15px!important;
    font-weight:800!important;
    color:var(--npw-text)!important;
    -webkit-text-fill-color:var(--npw-text)!important;
}

html body .npw-toolbar small{
    display:block!important;
    margin-top:4px!important;
    font-size:12px!important;
    color:var(--npw-muted)!important;
    -webkit-text-fill-color:var(--npw-muted)!important;
}

html body .npw-toggle{
    min-height:40px!important;
    padding:8px 12px!important;
    border:1px solid var(--npw-line)!important;
    border-radius:9px!important;
    background:var(--npw-soft)!important;
    color:var(--npw-text)!important;
    -webkit-text-fill-color:var(--npw-text)!important;
    font-size:13px!important;
    font-weight:800!important;
    cursor:pointer!important;
}

html body .npw-toggle[aria-pressed="true"]{
    background:#7045e8!important;
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
}

html body .npw-preview-head{
    display:none!important;
}

html body .npw-enabled > .npw-preview-head{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    padding:9px 12px!important;
    background:var(--npw-bg)!important;
    border:1px solid var(--npw-line)!important;
    border-radius:10px!important;
    min-width:0!important;
}

html body .npw-preview-head strong{
    font-size:14px!important;
    font-weight:800!important;
    color:var(--npw-text)!important;
    -webkit-text-fill-color:var(--npw-text)!important;
}

html body .npw-collapse{
    display:none!important;
}

html body .npw-enabled > .npw-preview{
    min-width:0!important;
    box-sizing:border-box!important;
    scrollbar-width:thin;
    scrollbar-color:#9274e5 transparent;
}

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

    html body .npw-enabled{
        display:grid!important;
        grid-template-columns:minmax(0,1.65fr)
                              minmax(0,1fr)!important;
        align-items:start!important;
        align-content:start!important;
        gap:12px!important;
    }

    html body .npw-enabled > *{
        min-width:0;
        grid-column:2;
    }

    html body .npw-enabled > .npw-heading{
        grid-column:1 / -1!important;
    }

    html body .npw-enabled > .npw-preview-head{
        grid-column:1!important;
        grid-row:var(--npw-row)!important;
        position:sticky!important;
        top:var(--npw-top)!important;
        z-index:16!important;
    }

    html body .npw-enabled > .npw-preview{
        grid-column:1!important;
        grid-row:var(--npw-content-row) / span 20!important;
        position:sticky!important;
        top:calc(var(--npw-top) + 54px)!important;
        align-self:start!important;
        max-height:calc(
            100vh - var(--npw-top) - 80px
        )!important;
        overflow:auto!important;
        overscroll-behavior:contain;
    }

    html body .npw-enabled > .npw-controls{
        max-height:calc(
            100vh - var(--npw-top) - 120px
        )!important;
        overflow-y:auto!important;
        overscroll-behavior-y:contain;
    }

    html body .npw-enabled > .npw-actions{
        position:sticky!important;
        bottom:12px!important;
        z-index:12!important;
        background:var(--npw-bg)!important;
    }
}

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

    html body .npw-enabled{
        display:flex!important;
        flex-direction:column!important;
        align-items:stretch!important;
        gap:10px!important;
    }

    html body .npw-enabled > .npw-preview-head{
        order:-20!important;
        position:sticky!important;
        top:var(--npw-top)!important;
        z-index:26!important;
    }

    html body .npw-enabled > .npw-preview{
        order:-19!important;
        position:sticky!important;
        top:calc(var(--npw-top) + 56px)!important;
        z-index:25!important;
        width:100%!important;
        max-height:38dvh!important;
        overflow:auto!important;
        background:var(--npw-bg)!important;
        border-radius:10px!important;
        overscroll-behavior-y:contain;
    }

    html body .npw-enabled > .npw-controls{
        max-height:max(
            150px,
            calc(62dvh - var(--npw-top) - 90px)
        )!important;
        overflow-y:auto!important;
        overscroll-behavior-y:contain;
        scrollbar-width:thin;
    }

    html body .npw-enabled > .npw-actions{
        position:sticky!important;
        bottom:0!important;
        z-index:20!important;
        padding:10px 4px!important;
        background:var(--npw-bg)!important;
    }

    html body .npw-enabled .npw-collapse{
        display:inline-flex!important;
        align-items:center!important;
        justify-content:center!important;
        min-height:40px!important;
        flex-shrink:0!important;
        padding:7px 11px!important;
        border:1px solid var(--npw-line)!important;
        border-radius:8px!important;
        background:var(--npw-soft)!important;
        color:var(--npw-text)!important;
        -webkit-text-fill-color:var(--npw-text)!important;
        font-size:12px!important;
        font-weight:800!important;
        cursor:pointer!important;
        touch-action:manipulation!important;
    }

    html body .npw-enabled.npw-collapsed > .npw-preview{
        display:none!important;
    }

    html body .npw-enabled.npw-collapsed > .npw-controls{
        max-height:none!important;
        overflow:visible!important;
    }

    html body.npw-keyboard .npw-enabled > .npw-preview,
    html body.npw-keyboard .npw-enabled > .npw-preview-head{
        position:relative!important;
        top:auto!important;
    }

    html body.npw-keyboard .npw-enabled > .npw-controls{
        max-height:none!important;
        overflow:visible!important;
    }
}

@media(max-height:420px){

    html body .npw-enabled > .npw-preview,
    html body .npw-enabled > .npw-preview-head{
        position:relative!important;
        top:auto!important;
    }

    html body .npw-enabled > .npw-controls{
        max-height:none!important;
        overflow:visible!important;
    }
}

@media print{

    html body .npw-toolbar,
    html body .npw-preview-head{
        display:none!important;
    }

    html body .npw-enabled{
        display:block!important;
    }

    html body .npw-enabled > .npw-preview,
    html body .npw-enabled > .npw-controls{
        display:block!important;
        position:static!important;
        max-height:none!important;
        overflow:visible!important;
    }
}



/* NUJIZ PDF WORKSPACE V14 STICKY */

@media screen {

html body .pdf-page-main,
html body .pdf-workspace,
html body .pdf-workspace:has(.npw-enabled),
html body .pdf-workspace .npw-enabled {
    overflow: visible !important;
    contain: none !important;
    content-visibility: visible !important;
}

html body .pdf-workspace .npw-enabled {
    align-items: start !important;
    align-content: start !important;
    min-width: 0 !important;
}

html body .pdf-workspace .npw-enabled > .npw-preview-head {
    position: sticky !important;
    top: var(--npw-top, 90px) !important;
    align-self: start !important;
    z-index: 28 !important;
}

html body .pdf-workspace .npw-enabled > .npw-preview {
    position: sticky !important;
    top: calc(var(--npw-top, 90px) + 54px) !important;
    align-self: start !important;
    min-width: 0 !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    z-index: 25 !important;
}

}

/* Desktop */

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

html body .pdf-workspace .npw-enabled {
    grid-template-columns:
        minmax(0,1.65fr)
        minmax(0,1fr) !important;
    align-items: start !important;
}

html body .pdf-workspace .npw-enabled > .npw-preview {
    max-height:
        calc(100vh - var(--npw-top,90px) - 80px)
        !important;
}

html body .pdf-workspace .npw-enabled > .npw-controls {
    max-height:
        calc(100vh - var(--npw-top,90px) - 120px)
        !important;
    overflow-y: auto !important;
    min-width: 0 !important;
    overscroll-behavior: contain;
}

}

/* Mobile */

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

html body .pdf-workspace .npw-enabled {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

html body .pdf-workspace .npw-enabled > .npw-preview-head {
    order: -20 !important;
    width: 100% !important;
}

html body .pdf-workspace .npw-enabled > .npw-preview {
    order: -19 !important;
    width: 100% !important;
    max-height: 36dvh !important;
    flex-shrink: 0 !important;
}

html body .pdf-workspace .npw-enabled > .npw-controls {
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
}

html body .pdf-workspace .npw-enabled.npw-collapsed
> .npw-preview {
    display: none !important;
}

html body .pdf-workspace .npw-enabled > .npw-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
}

}

/* Very short screens */

@media screen and (max-height:420px) {

html body .pdf-workspace .npw-enabled > .npw-preview,
html body .pdf-workspace .npw-enabled > .npw-preview-head {
    position: relative !important;
    top: auto !important;
}

}



/* NUJIZ V88 START */

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

    html body .nsw-pdf-root.nsw-pdf-root
    .nsw-layout.nsw-enabled: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;
    }

    html body .nsw-pdf-root.nsw-pdf-root
    .nsw-layout.nsw-enabled > .nsw-preview {
        grid-column:1!important;
        grid-row:1!important;
        min-width:0!important;
    }

    html body .nsw-pdf-root.nsw-pdf-root
    .nsw-layout.nsw-enabled > .nsw-controls {
        grid-column:2!important;
        grid-row:1!important;
        min-width:0!important;
    }

    html body .pdf-workspace.pdf-workspace
    .npw-enabled.npw-enabled:not([hidden]):not(.npw-collapsed):has(>.npw-preview):has(>.npw-controls) {
        display:grid!important;
        grid-template-columns:
            minmax(0,1.5fr)
            minmax(0,1fr)!important;
        align-items:start!important;
        gap:18px!important;
    }

    html body .pdf-workspace.pdf-workspace
    .npw-enabled.npw-enabled > .npw-preview {
        grid-column:1!important;
        min-width:0!important;
    }

    html body .pdf-workspace.pdf-workspace
    .npw-enabled.npw-enabled > .npw-controls {
        grid-column:2!important;
        min-width:0!important;
    }
}

/* NUJIZ V88 END */
