.pdf-flipbook-instance {
    background: #fff;
    color: white;
    height: 96dvh;
    margin-left: 50%;
    overflow: hidden;
    transform: translateX(-50%);
    width: 99.2dvw; /* magic number for now, alas (accounts for old-school non-overlay scrollbars in some browsers) */

    & .grid-container {
        display: grid;
        grid-template-rows: 5rem 1fr 5rem;
        height: 100%;
        position: relative; /* anchor for absolute-positioned side buttons */
        width: 100%;
    }

    & header,
    & footer {
        align-items: center;
        background: #fff;
        border: 1px solid #333;
        display: flex;
        justify-content: center;
        z-index: 100;
    }

    & header {
        border-width: 0 0 1px;
        flex-direction: column;
    }

    & footer {
        border-width: 1px 0 0;
        color: #003262;
        font-size: 14px;
        letter-spacing: 2px;
        text-transform: uppercase;
    }

    & .top-controls {
        display: flex;
        gap: 10px;
        & .util-btn {
            border-radius: 5px;
            background-color: #003262;
            color: #f2a900;
            text-transform: uppercase;
            font-weight: 600;
            padding:12px 25px 10px;
            line-height: 1rem;
            &:hover{
                color: #003262;
                background-color: #f2a900;
            }
        }
    }

    & .viewer {
        background: #fff;
        overflow: auto;
        position: relative;
        scroll-behavior: auto !important;
        scrollbar-width: none;
        z-index: 10;

        &::-webkit-scrollbar {
            display: none;
        }

        &.zoom-active .scroll-surface {
            cursor: grab !important;
            min-height: 200%;
            min-width: 200%;
        }

        &.zoom-active .flipbook-wrapper {
            cursor: grab !important;
        }

        &.zoom-active:active .scroll-surface,
        &.zoom-active:active .flipbook-wrapper {
            cursor: grabbing !important;
        }
    }

    & .loading-overlay {
        color: #888;
        font-style: italic;
        left: 50%;
        pointer-events: none;
        position: fixed;
        text-align: center;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 500;
    }

    & .scroll-surface {
        align-items: center;
        display: flex;
        justify-content: center;
        min-height: 100%;
        min-width: 100%;
        position: relative;
    }

    & .flipbook-wrapper {
        box-shadow: 0 20px 50px rgba(0,0,0,.9);
        cursor: pointer;
        display: none;
        flex-shrink: 0;
        opacity: 0;
        position: relative;
        transform-origin: center center;
        transition: transform .4s cubic-bezier(.4, 0, .2, 1), opacity .8s ease;
        z-index: 20;

        &.zoomed {
            transform: scale(2.0);
        }
    }

    & .page {
        background-color: #fff;
        display: flex;
        justify-content: center;

        & canvas {
            display: block;
            height: 100%;
            width: auto;
        }
    }

    & .side-btn {
        backdrop-filter: blur(5px);
        background: #fff;
        border: 1px solid rgba(255,255,255,.3);
        border-radius: 90px;
        color: #003262;
        cursor: pointer;
        display: none;
        font-size: 30px;
        height: 60px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        transition: all .2s;
        width: 60px;
        z-index: 1000;

        &:hover {
            background: #003262;
            color: white;
        }

        &:disabled {
            background: rgba(0,0,0,.2);
            cursor: default;
            opacity: .2;
        }

        &.prev-btn { left: 30px; }
        &.next-btn { right: 30px; }
    }

    & .util-btn {
        background: #34495e;
        border: none;
        border-radius: 4px;
        color: white;
        cursor: pointer;
        display: inline-block;
        font-family: inherit;
        font-size: 13.3px;
        line-height: normal;
        padding: 8px 16px;
        text-decoration: none;
        transition: background .3s;

        &:hover {
            background: #46637f;
        }
    }
}
