.ouvrage-page {
    background: #100d09;
    min-height: 80vh;
    padding-top: 24px;
}

.ouvrage-stage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.ouvrage-topbar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #f4ead9;
}

.ouvrage-back,
.ouvrage-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f4ead9;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid rgba(244, 234, 217, 0.35);
    border-radius: 999px;
    padding: 8px 16px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ouvrage-back:hover,
.ouvrage-download:hover {
    border-color: #c8a24a;
    background: rgba(200, 162, 74, 0.12);
    color: #f4ead9;
}

.ouvrage-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    text-align: center;
    color: #e9dcc0;
    margin: 0;
    flex: 1 1 260px;
}

.ouvrage-flipbook-wrap {
    position: relative;
    width: 100%;
    max-width: 1080px;
    aspect-ratio: var(--ouvrage-ratio, 1.5);
}

#ouvrage-flipbook {
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.pdf-page {
    background: #efe7d8;
    overflow: hidden;
}

.pdf-page-inner {
    width: 100%;
    height: 100%;
    display: flex;
}

.pdf-page canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.ouvrage-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #e9dcc0;
    background: rgba(16, 13, 9, 0.55);
    border-radius: 6px;
}

.ouvrage-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(233, 220, 192, 0.25);
    border-top-color: #c8a24a;
    animation: ouvrage-spin 0.9s linear infinite;
}

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

.ouvrage-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #f4ead9;
}

.ouvrage-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(244, 234, 217, 0.35);
    background: transparent;
    color: #f4ead9;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ouvrage-nav-btn:hover {
    border-color: #c8a24a;
    background: rgba(200, 162, 74, 0.12);
}

.ouvrage-page-indicator {
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: center;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .ouvrage-title {
        order: 3;
        flex-basis: 100%;
    }
}
