.ppbv-viewer,
.ppbv-viewer * {
    box-sizing: border-box;
}

.ppbv-viewer {
    --ppbv-bg: #f4f0ea;
    --ppbv-paper: #ffffff;
    --ppbv-text: #171713;
    --ppbv-muted: #74716c;
    --ppbv-accent: #d5a34a;
    --ppbv-accent-dark: #b98631;
    --ppbv-stage-shadow: 0 26px 50px rgba(38, 31, 22, 0.17);
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 31%) minmax(0, 69%);
    width: 100%;
    min-height: 540px;
    overflow: hidden;
    border: 1px solid rgba(45, 38, 28, 0.07);
    background:
        radial-gradient(circle at 73% 18%, rgba(255, 255, 255, 0.95), transparent 36%),
        linear-gradient(110deg, #f8f5f0 0%, var(--ppbv-bg) 48%, #eee9e1 100%);
    color: var(--ppbv-text);
    isolation: isolate;
}

.ppbv-viewer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(94, 80, 61, 0.04) 0.65px, transparent 0.65px);
    background-size: 5px 5px;
    opacity: 0.4;
    pointer-events: none;
}

.ppbv-copy-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(46px, 6vw, 92px) clamp(30px, 5vw, 76px);
}

.ppbv-eyebrow {
    margin: 0 0 20px;
    color: #9a6b2d;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ppbv-title {
    max-width: 520px;
    margin: 0;
    color: var(--ppbv-text);
    font-family: Outfit, serif;
    font-size: clamp(40px, 4vw, 66px);
    font-weight: 500;
    line-height: 1.03;
    letter-spacing: -0.035em;
}

.ppbv-description {
    max-width: 510px;
    margin: 24px 0 0;
    color: #6f6b65;
    font-size: clamp(16px, 1.35vw, 20px);
    line-height: 1.62;
      font-family: Outfit, serif;
}

.ppbv-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 58px;
    margin-top: 48px;
    padding: 16px 27px;
    border: 1px solid rgba(123, 82, 24, 0.24);
    border-radius: 9px;
    background: linear-gradient(180deg, #e4b75f 0%, var(--ppbv-accent) 100%);
    box-shadow: 0 9px 20px rgba(164, 112, 34, 0.18), inset 0 1px rgba(255, 255, 255, 0.55);
    color: #2d2519;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ppbv-download:hover,
.ppbv-download:focus-visible {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #e9c16e 0%, #d9a951 100%);
    box-shadow: 0 13px 26px rgba(164, 112, 34, 0.24), inset 0 1px rgba(255, 255, 255, 0.6);
    color: #201a12;
}

.ppbv-download svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex: 0 0 auto;
}

.ppbv-file-size {
    margin: 17px 0 0;
    color: var(--ppbv-muted);
    font-size: 15px;
}

.ppbv-view-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 34px clamp(24px, 4vw, 70px) 24px 10px;
}

.ppbv-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 470px;
    perspective: 2400px;
}

.ppbv-book {
    position: relative;
    display: flex;
    align-items: stretch;
    width: min(100%, 980px);
    aspect-ratio: 1.42 / 1;
    transform-origin: center center;
    filter: drop-shadow(0 24px 18px rgba(49, 40, 29, 0.18));
    transform-style: preserve-3d;
    transform: rotateX(1deg);
}

.ppbv-book::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: -4.5%;
    height: 8%;
    border-radius: 50%;
    background: rgba(42, 34, 25, 0.17);
    filter: blur(18px);
    z-index: -2;
}

.ppbv-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    min-width: 0;
    overflow: hidden;
    background: var(--ppbv-paper);
    box-shadow:
        inset 0 0 0 1px rgba(56, 45, 30, 0.05),
        inset 0 -9px 17px rgba(43, 34, 22, 0.05),
        var(--ppbv-stage-shadow);
    backface-visibility: hidden;
}

.ppbv-page-left {
    border-radius: 6px 2px 4px 10px;
    transform-origin: right center;
    transform: perspective(1000px) rotateY(1.2deg);
}

.ppbv-page-right {
    border-radius: 2px 7px 10px 4px;
    transform-origin: left center;
    transform: perspective(1000px) rotateY(-1.2deg);
}

.ppbv-page canvas,
.ppbv-flip-face canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    image-rendering: auto;
}

.ppbv-page-shine,
.ppbv-flip-gloss {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.ppbv-page-left .ppbv-page-shine,
.ppbv-flip-sheet.is-prev .ppbv-flip-front .ppbv-flip-gloss,
.ppbv-flip-sheet.is-next .ppbv-flip-back .ppbv-flip-gloss {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 75%, rgba(0, 0, 0, 0.08));
}

.ppbv-page-right .ppbv-page-shine,
.ppbv-flip-sheet.is-next .ppbv-flip-front .ppbv-flip-gloss,
.ppbv-flip-sheet.is-prev .ppbv-flip-back .ppbv-flip-gloss {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 24%, rgba(255, 255, 255, 0.07));
}

.ppbv-spine {
    position: absolute;
    z-index: 5;
    top: 1%;
    bottom: 1%;
    left: 50%;
    width: 34px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent 0%, rgba(28, 22, 15, 0.1) 39%, rgba(255, 255, 255, 0.38) 50%, rgba(28, 22, 15, 0.12) 61%, transparent 100%);
    filter: blur(0.4px);
    pointer-events: none;
}

.ppbv-spine::after {
    content: "";
    position: absolute;
    inset: auto -18px -7px;
    height: 14px;
    border-radius: 50%;
    background: rgba(38, 30, 20, 0.15);
    filter: blur(5px);
}

.ppbv-flip-layer {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.ppbv-flip-layer.is-visible {
    opacity: 1;
    visibility: visible;
}

.ppbv-flip-sheet {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    transform-style: preserve-3d;
    transition: transform 980ms cubic-bezier(0.22, 0.72, 0.16, 1), filter 980ms ease;
    filter: drop-shadow(0 9px 12px rgba(35, 28, 18, 0.14));
    will-change: transform;
}

.ppbv-flip-sheet::before {
    content: "";
    position: absolute;
    z-index: 6;
    top: 0;
    bottom: 0;
    width: 24%;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.16), rgba(255, 255, 255, 0.28), transparent);
    filter: blur(2px);
    transition: opacity 360ms ease;
    pointer-events: none;
}

.ppbv-flip-sheet.is-next {
    left: 50%;
    transform-origin: left center;
    transform: translateZ(2px) rotateY(0deg);
}

.ppbv-flip-sheet.is-next::before {
    left: -3%;
}

.ppbv-flip-sheet.is-next.is-active {
    transform: translateZ(2px) rotateY(-180deg);
    filter: drop-shadow(-25px 12px 24px rgba(22, 18, 12, 0.24));
}

.ppbv-flip-sheet.is-prev {
    left: 0;
    transform-origin: right center;
    transform: translateZ(2px) rotateY(0deg);
}

.ppbv-flip-sheet.is-prev::before {
    right: -3%;
    transform: scaleX(-1);
}

.ppbv-flip-sheet.is-prev.is-active {
    transform: translateZ(2px) rotateY(180deg);
    filter: drop-shadow(25px 12px 24px rgba(22, 18, 12, 0.24));
}

.ppbv-flip-sheet.is-active::before {
    opacity: 0.72;
}

.ppbv-flip-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow:
        inset 0 0 0 1px rgba(56, 45, 30, 0.06),
        inset 0 -9px 17px rgba(43, 34, 22, 0.05),
        0 10px 22px rgba(35, 28, 18, 0.12);
}

.ppbv-flip-front {
    transform: rotateY(0deg) translateZ(0.5px);
}

.ppbv-flip-back {
    transform: rotateY(180deg) translateZ(0.5px);
}

.ppbv-flip-sheet.is-next .ppbv-flip-front {
    border-radius: 2px 7px 10px 4px;
}

.ppbv-flip-sheet.is-next .ppbv-flip-back {
    border-radius: 6px 2px 4px 10px;
}

.ppbv-flip-sheet.is-prev .ppbv-flip-front {
    border-radius: 6px 2px 4px 10px;
}

.ppbv-flip-sheet.is-prev .ppbv-flip-back {
    border-radius: 2px 7px 10px 4px;
}

.ppbv-flip-edge {
    position: absolute;
    z-index: 7;
    top: 0.25%;
    bottom: 0.25%;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(90, 75, 54, 0.24), rgba(255, 255, 255, 0.72));
    box-shadow: 0 0 9px rgba(33, 25, 15, 0.17);
    pointer-events: none;
}

.ppbv-flip-sheet.is-next .ppbv-flip-edge {
    left: -1px;
}

.ppbv-flip-sheet.is-prev .ppbv-flip-edge {
    right: -1px;
}

.ppbv-loader {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.93);
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.ppbv-loader span {
    width: 29px;
    height: 29px;
    border: 3px solid rgba(213, 163, 74, 0.25);
    border-top-color: var(--ppbv-accent-dark);
    border-radius: 50%;
    animation: ppbv-spin 780ms linear infinite;
}

.ppbv-page.is-loading .ppbv-loader {
    opacity: 1;
    visibility: visible;
}

.ppbv-page.is-empty canvas,
.ppbv-page.is-empty .ppbv-page-shine {
    opacity: 0;
}

.ppbv-page.is-empty {
    background: linear-gradient(90deg, #fbfaf8, #f4f0e9);
}

.ppbv-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: min(100%, 980px);
    margin: 16px auto 0;
    gap: 16px;
}

.ppbv-nav-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

.ppbv-control {
    appearance: none;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(116, 93, 59, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.43);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.75), 0 3px 12px rgba(67, 50, 26, 0.05);
    color: #5c554b;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.ppbv-control:hover:not(:disabled),
.ppbv-control:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.84);
    color: #2a251f;
}

.ppbv-control:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

.ppbv-control svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.ppbv-counter {
    color: #342f29;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ppbv-counter-separator {
    display: inline-block;
    padding: 0 6px;
    color: #8b867f;
    font-weight: 400;
}

.ppbv-fullscreen {
    justify-self: end;
}

.ppbv-icon-compress {
    display: none;
}

.ppbv-viewer.is-fullscreen .ppbv-icon-expand {
    display: none;
}

.ppbv-viewer.is-fullscreen .ppbv-icon-compress {
    display: block;
}

.ppbv-error {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 10;
    width: min(90%, 540px);
    transform: translate(-50%, -50%);
    padding: 18px 20px;
    border: 1px solid #d9a4a4;
    border-radius: 10px;
    background: #fff4f4;
    box-shadow: 0 15px 35px rgba(80, 0, 0, 0.12);
    color: #7f1d1d;
    text-align: center;
}

.ppbv-notice {
    padding: 14px 18px;
    border-left: 4px solid #dba617;
    background: #fff8e5;
}

.ppbv-book.is-turning .ppbv-page-left {
    animation: ppbv-left-turn 320ms ease both;
}

.ppbv-book.is-turning .ppbv-page-right {
    animation: ppbv-right-turn 320ms ease both;
}

.ppbv-viewer.is-flipping .ppbv-page-left,
.ppbv-viewer.is-flipping .ppbv-page-right {
    transition: filter 300ms ease, opacity 300ms ease;
    filter: saturate(0.98) brightness(0.99);
}

.ppbv-viewer.is-single-page .ppbv-book {
    width: min(70%, 500px);
    aspect-ratio: 0.707 / 1;
}

.ppbv-viewer.is-single-page .ppbv-page-left {
    width: 100%;
    border-radius: 7px 9px 11px 8px;
    transform: none;
}

.ppbv-viewer.is-single-page .ppbv-page-right,
.ppbv-viewer.is-single-page .ppbv-spine,
.ppbv-viewer.is-single-page .ppbv-flip-layer {
    display: none;
}

.ppbv-viewer:fullscreen {
    grid-template-columns: minmax(280px, 28%) minmax(0, 72%);
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
}

.ppbv-viewer:fullscreen .ppbv-stage {
    min-height: 72vh;
}

.ppbv-viewer:fullscreen .ppbv-book,
.ppbv-viewer:fullscreen .ppbv-controls {
    width: min(100%, 1180px);
}

@keyframes ppbv-spin {
    to { transform: rotate(360deg); }
}

@keyframes ppbv-left-turn {
    0% { opacity: 0.55; transform: perspective(1000px) rotateY(6deg) translateX(5px); }
    100% { opacity: 1; transform: perspective(1000px) rotateY(1.2deg) translateX(0); }
}

@keyframes ppbv-right-turn {
    0% { opacity: 0.55; transform: perspective(1000px) rotateY(-6deg) translateX(-5px); }
    100% { opacity: 1; transform: perspective(1000px) rotateY(-1.2deg) translateX(0); }
}

@media (max-width: 1100px) {
    .ppbv-viewer {
        grid-template-columns: minmax(280px, 34%) minmax(0, 66%);
        min-height: 500px;
    }

    .ppbv-copy-panel {
        padding-inline: 34px;
    }

    .ppbv-title {
        font-size: clamp(38px, 4vw, 52px);
    }

    .ppbv-view-panel {
        padding-right: 30px;
    }
}

@media (max-width: 767px) {
    .ppbv-viewer {
        display: block;
        min-height: 0;
    }

    .ppbv-copy-panel {
        padding: 44px 24px 28px;
    }

    .ppbv-eyebrow {
        margin-bottom: 14px;
        font-size: 12px;
    }

    .ppbv-title {
    font-size: 40px!important;
        font-weight: 300!important;
        font-family: Outfit!important;
    }

    .ppbv-description {
        margin-top: 18px;
        font-size: 16px;
    }

    .ppbv-download {
        width: 100%;
        margin-top: 30px;
    }

    .ppbv-view-panel {
        padding: 8px 18px 28px;
    }

    .ppbv-stage {
        min-height: 390px;
    }

    .ppbv-viewer.is-single-page .ppbv-book {
        width: min(92%, 430px);
    }

    .ppbv-controls {
        margin-top: 14px;
    }
}

@media (max-width: 420px) {
    .ppbv-stage {
        min-height: 330px;
    }

    .ppbv-control {
        width: 40px;
        height: 40px;
    }

    .ppbv-controls {
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ppbv-viewer *,
    .ppbv-viewer *::before,
    .ppbv-viewer *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.ppbv-viewer.is-native-fallback .ppbv-book {
    overflow: hidden;
    background: #fff;
    box-shadow: var(--ppbv-stage-shadow);
    filter: none;
}

.ppbv-native-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

/* v1.4: crisp static rendering and mirror-free two-stage page fold */
.ppbv-book {
    filter: none !important;
    transform: none !important;
}

.ppbv-page-left,
.ppbv-page-right {
    transform: none !important;
}

.ppbv-viewer.is-flipping .ppbv-page-left,
.ppbv-viewer.is-flipping .ppbv-page-right {
    filter: none !important;
    opacity: 1 !important;
}

.ppbv-flip-sheet {
    transition: none !important;
    filter: none !important;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.ppbv-flip-front {
    transform: none !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.ppbv-flip-back {
    display: none !important;
}

.ppbv-flip-sheet.is-next-out {
    left: 50%;
    transform-origin: left center;
}

.ppbv-flip-sheet.is-next-in {
    left: 0;
    transform-origin: right center;
}

.ppbv-flip-sheet.is-prev-out {
    left: 0;
    transform-origin: right center;
}

.ppbv-flip-sheet.is-prev-in {
    left: 50%;
    transform-origin: left center;
}

.ppbv-flip-sheet.is-next-out .ppbv-flip-edge,
.ppbv-flip-sheet.is-prev-in .ppbv-flip-edge {
    left: -1px;
    right: auto;
}

.ppbv-flip-sheet.is-prev-out .ppbv-flip-edge,
.ppbv-flip-sheet.is-next-in .ppbv-flip-edge {
    right: -1px;
    left: auto;
}

.ppbv-flip-sheet.is-next-out .ppbv-flip-gloss,
.ppbv-flip-sheet.is-prev-in .ppbv-flip-gloss {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 24%, rgba(255, 255, 255, 0.08));
}

.ppbv-flip-sheet.is-prev-out .ppbv-flip-gloss,
.ppbv-flip-sheet.is-next-in .ppbv-flip-gloss {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 75%, rgba(0, 0, 0, 0.12));
}

.ppbv-flip-shadow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 4;
    opacity: 0.28;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.15), transparent 30%, transparent 72%, rgba(255, 255, 255, 0.13));
    pointer-events: none;
}

.ppbv-page canvas,
.ppbv-flip-face canvas {
    transform: none !important;
    filter: none !important;
}

.ppbv-flip-sheet.is-next-out .ppbv-flip-front,
.ppbv-flip-sheet.is-prev-in .ppbv-flip-front {
    border-radius: 2px 7px 10px 4px;
}

.ppbv-flip-sheet.is-prev-out .ppbv-flip-front,
.ppbv-flip-sheet.is-next-in .ppbv-flip-front {
    border-radius: 6px 2px 4px 10px;
}

/* v1.5: PDF-only fullscreen mode */
.ppbv-viewer:fullscreen,
.ppbv-viewer.is-fullscreen {
    display: block !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    border: 0 !important;
    background: #151515 !important;
}

.ppbv-viewer:fullscreen::before,
.ppbv-viewer.is-fullscreen::before {
    display: none !important;
}

.ppbv-viewer:fullscreen .ppbv-copy-panel,
.ppbv-viewer.is-fullscreen .ppbv-copy-panel {
    display: none !important;
}

.ppbv-viewer:fullscreen .ppbv-view-panel,
.ppbv-viewer.is-fullscreen .ppbv-view-panel {
    display: flex !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 18px 28px 14px !important;
    align-items: center !important;
    justify-content: center !important;
    background: #151515 !important;
}

.ppbv-viewer:fullscreen .ppbv-stage,
.ppbv-viewer.is-fullscreen .ppbv-stage {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    height: calc(100vh - 82px) !important;
    perspective: 2400px !important;
}

.ppbv-viewer:fullscreen .ppbv-book,
.ppbv-viewer.is-fullscreen .ppbv-book {
    width: min(calc(100vw - 72px), calc((100vh - 108px) * 1.42)) !important;
    max-width: none !important;
    max-height: calc(100vh - 108px) !important;
    margin: 0 auto !important;
}

.ppbv-viewer:fullscreen .ppbv-controls,
.ppbv-viewer.is-fullscreen .ppbv-controls {
    position: absolute !important;
    left: 50% !important;
    bottom: 12px !important;
    z-index: 30 !important;
    width: min(calc(100vw - 72px), calc((100vh - 108px) * 1.42)) !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
}

.ppbv-viewer:fullscreen .ppbv-control,
.ppbv-viewer.is-fullscreen .ppbv-control {
    border-color: rgba(255, 255, 255, 0.22) !important;
    background: rgba(28, 28, 28, 0.78) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    backdrop-filter: blur(8px);
}

.ppbv-viewer:fullscreen .ppbv-control:hover:not(:disabled),
.ppbv-viewer.is-fullscreen .ppbv-control:hover:not(:disabled) {
    background: rgba(64, 64, 64, 0.92) !important;
}

.ppbv-viewer:fullscreen .ppbv-counter,
.ppbv-viewer.is-fullscreen .ppbv-counter,
.ppbv-viewer:fullscreen .ppbv-counter-separator,
.ppbv-viewer.is-fullscreen .ppbv-counter-separator {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.ppbv-viewer.is-single-page:fullscreen .ppbv-book,
.ppbv-viewer.is-single-page.is-fullscreen .ppbv-book {
    width: min(calc(100vw - 48px), calc((100vh - 104px) * 0.707)) !important;
    max-height: calc(100vh - 104px) !important;
}

.ppbv-viewer.is-single-page:fullscreen .ppbv-controls,
.ppbv-viewer.is-single-page.is-fullscreen .ppbv-controls {
    width: min(calc(100vw - 48px), calc((100vh - 104px) * 0.707)) !important;
}

.ppbv-viewer.is-native-fallback:fullscreen .ppbv-book,
.ppbv-viewer.is-native-fallback.is-fullscreen .ppbv-book {
    width: min(calc(100vw - 48px), 1280px) !important;
    height: calc(100vh - 96px) !important;
    max-height: none !important;
    aspect-ratio: auto !important;
}

@media (max-width: 767px) {
    .ppbv-viewer:fullscreen .ppbv-view-panel,
    .ppbv-viewer.is-fullscreen .ppbv-view-panel {
        padding: 10px 12px 10px !important;
    }

    .ppbv-viewer:fullscreen .ppbv-stage,
    .ppbv-viewer.is-fullscreen .ppbv-stage {
        height: calc(100vh - 72px) !important;
    }

    .ppbv-viewer.is-single-page:fullscreen .ppbv-book,
    .ppbv-viewer.is-single-page.is-fullscreen .ppbv-book {
        width: min(calc(100vw - 24px), calc((100vh - 90px) * 0.707)) !important;
        max-height: calc(100vh - 90px) !important;
    }

    .ppbv-viewer:fullscreen .ppbv-controls,
    .ppbv-viewer.is-fullscreen .ppbv-controls,
    .ppbv-viewer.is-single-page:fullscreen .ppbv-controls,
    .ppbv-viewer.is-single-page.is-fullscreen .ppbv-controls {
        width: calc(100vw - 24px) !important;
        bottom: 8px !important;
    }
}

/* v1.6: ensure stale render errors disappear after fullscreen changes */
.ppbv-error[hidden] {
    display: none !important;
}
