.loulou-flipbook {
    --loulou-navy: #173f67;
    --loulou-teal: #2d7374;
    --loulou-gold: #b79a52;
    --loulou-paper: #f7f3eb;
    max-width: 1200px;
    margin: 24px auto;
    padding: 12px;
    border: 1px solid rgba(183, 154, 82, .55);
    border-radius: 14px;
    background: var(--loulou-paper);
    box-shadow: 0 16px 46px rgba(23, 63, 103, .16);
    box-sizing: border-box;
}

.loulou-flipbook *,
.loulou-flipbook *::before,
.loulou-flipbook *::after {
    box-sizing: border-box;
}

.loulou-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    padding: 4px 0 12px;
}

.loulou-language-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 10px;
}

.loulou-language {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid var(--loulou-gold);
    border-radius: 999px;
    background: #fff;
    color: var(--loulou-navy);
    font: 700 14px/1.2 Arial, sans-serif;
    text-decoration: none !important;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.loulou-language:hover,
.loulou-language:focus-visible,
.loulou-language.is-active {
    background: var(--loulou-navy);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.loulou-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--loulou-gold);
    border-radius: 8px;
    background: #fff;
    color: var(--loulou-navy);
    font: 600 14px/1.2 Arial, sans-serif;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.loulou-button:hover,
.loulou-button:focus-visible {
    background: var(--loulou-navy);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.loulou-counter {
    min-width: 76px;
    color: var(--loulou-navy);
    font: 700 14px/1.2 Arial, sans-serif;
    text-align: center;
}

.loulou-chapter-select {
    min-height: 38px;
    max-width: 235px;
    padding: 7px 30px 7px 10px;
    border: 1px solid var(--loulou-gold);
    border-radius: 8px;
    background: #fff;
    color: var(--loulou-navy);
    font: 600 14px/1.2 Arial, sans-serif;
    cursor: pointer;
}

.loulou-chapter-select:focus-visible {
    outline: 2px solid var(--loulou-teal);
    outline-offset: 2px;
}

.loulou-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: min(88vh, 1120px);
    min-height: 520px;
    overflow: hidden;
    border-radius: 9px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.94), rgba(236,230,216,.92) 68%),
        #ece6da;
}

.loulou-book {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 950px;
    margin: 0 auto;
}

.loulou-static-cover {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: auto;
    object-fit: contain;
    background: #ece6da;
}

.loulou-flipbook.has-fallback .loulou-static-cover {
    position: relative;
}

.loulou-page {
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.loulou-page-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    -webkit-user-drag: none;
}

.loulou-link-overlay {
    position: absolute;
    z-index: 12;
    display: block;
    border-radius: 3px;
    background: rgba(45, 115, 116, 0);
    cursor: pointer;
}

.loulou-link-overlay:hover,
.loulou-link-overlay:focus-visible {
    outline: 2px solid var(--loulou-teal);
    outline-offset: 1px;
    background: rgba(45, 115, 116, .10);
}

.loulou-loading {
    position: absolute;
    z-index: 20;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 18px;
    border-radius: 9px;
    background: rgba(255,255,255,.94);
    color: var(--loulou-navy);
    font: 600 15px/1.3 Arial, sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.loulou-loading[hidden] {
    display: none;
}

.loulou-flipbook:fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 8px;
    border: 0;
    border-radius: 0;
    background: #171b20;
}

.loulou-flipbook:fullscreen .loulou-stage {
    height: calc(100vh - 64px);
    min-height: 0;
}

.loulou-flipbook:fullscreen .loulou-counter {
    color: #fff;
}

@media (max-width: 700px) {
    .loulou-flipbook {
        margin: 12px 0;
        padding: 7px;
        border-radius: 8px;
    }

    .loulou-stage {
        height: min(78vh, 820px);
        min-height: 360px;
    }

    .loulou-toolbar {
        gap: 5px;
        padding-bottom: 7px;
    }

    .loulou-language-switcher {
        gap: 5px;
        padding-bottom: 7px;
    }

    .loulou-language {
        min-width: 96px;
        min-height: 34px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .loulou-button {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 13px;
    }

    .loulou-chapter-select {
        order: 5;
        width: 100%;
        max-width: none;
    }

    .loulou-fullscreen span,
    .loulou-download span {
        display: none;
    }
}

@media (max-width: 430px) {
    .loulou-prev span,
    .loulou-next span {
        display: none;
    }

    .loulou-counter {
        min-width: 60px;
        font-size: 13px;
    }
}
