.pbv-wrapper {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    background: #2b2b2b;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.pbv-wrapper * {
    box-sizing: border-box;
}

/* Loading */
.pbv-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    gap: 12px;
}

.pbv-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pbv-spin 0.9s linear infinite;
}

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

/* Book stage */
.pbv-book-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    overflow: auto;
    min-height: 0;
}

.pbv-book {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
    flex: none;
    transition: opacity 0.15s ease;
}

.pbv-book.pbv-flipping {
    opacity: 0.55;
}

.pbv-canvas {
    display: block;
    flex: none;
}

.pbv-canvas-left {
    border-right: 1px solid #ddd;
}

.pbv-wrapper.pbv-landscape .pbv-canvas-left {
    border-right: none;
}

.pbv-canvas-right.pbv-empty {
    display: none;
}

/* Nav arrows */
.pbv-nav {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.pbv-nav:hover {
    background: rgba(255, 255, 255, 0.28);
}

.pbv-nav:active {
    transform: scale(0.92);
}

.pbv-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

/* Toolbar */
.pbv-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #1f1f1f;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pbv-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.pbv-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pbv-sep {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 6px;
}

.pbv-page-indicator {
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 8px;
    white-space: nowrap;
}

.pbv-page-input {
    width: 48px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 4px 2px;
    font-size: 13px;
}

/* Error */
.pbv-error {
    color: #ff8a8a;
    text-align: center;
    padding: 30px;
}

/* Fullscreen */
.pbv-wrapper:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #1a1a1a;
}

.pbv-wrapper:fullscreen .pbv-book-stage {
    padding: 30px;
}

/* Responsive: stack pages on small screens */
@media (max-width: 700px) {
    .pbv-canvas-right {
        display: none !important;
    }

    .pbv-nav {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .pbv-toolbar {
        flex-wrap: wrap;
    }
}
