body {
    overscroll-behavior: none;
    touch-action: auto;
}

#pdf-viewport {
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    /* Use block to allow natural scroll overflow */
    overflow: auto;
    /* Enable scrolling */
    background: #18181b;
    cursor: grab;
    width: 100%;
    height: 100%;
}

:root {
    --pdf-zoom: 1;
}

#pdf-content {
    display: block;
    margin: 0 auto;
    /* Auto margin centers the block horizontally */
    will-change: width;
    /* Zoom transitions removed for precision */

    /* Scaled padding */
    padding-top: calc(8rem * var(--pdf-zoom));
    padding-bottom: calc(15rem * var(--pdf-zoom));
    padding-left: calc(1rem * var(--pdf-zoom));
    padding-right: calc(1rem * var(--pdf-zoom));

    /* Default fallback */
    width: 100%;
    max-width: none;
    /* Ensure visibility */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Always have shadow */
}

.page-wrapper {
    margin-bottom: calc(2.5rem * var(--pdf-zoom));
}

/* UI Overlay stays fixed */
#ui-overlay {
    transform-origin: 0 0;
    will-change: transform, opacity;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100vw;
    height: 100vh;
}

#bottom-bar {
    transform-origin: center bottom;
    bottom: calc(2.5rem + env(safe-area-inset-bottom));
    /* Respect gesture bar */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* No desktop specific widths in CSS - We delegate full control to JS */