.csfb-wrapper {
    --csfb-height: 620px;
    --csfb-accent: #0b5d94;
    --csfb-bg: #f3f7fb;
    width: 100%;
    margin: 28px 0;
    padding: 22px;
    background: var(--csfb-bg);
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(15, 44, 72, 0.12);
    box-sizing: border-box;
}
.csfb-heading h2 {
    margin: 0 0 16px;
    color: #063b64;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
}
.csfb-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.csfb-btn,
.csfb-small-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--csfb-accent);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(3, 56, 94, 0.18);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.csfb-btn:hover,
.csfb-small-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(3, 56, 94, 0.22);
}
.csfb-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}
.csfb-zoom-out,
.csfb-zoom-in,
.csfb-fullscreen {
    min-width: 38px;
    padding: 8px 11px;
}
.csfb-page-info {
    margin: 0 8px;
    font-weight: 700;
    color: #14344e;
}
.csfb-stage {
    position: relative;
    min-height: var(--csfb-height);
    height: var(--csfb-height);
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 12%, rgba(255,255,255,.86), rgba(255,255,255,.28) 34%, rgba(0,0,0,.08) 100%),
        linear-gradient(135deg, #e8eef5, #ced9e6);
    overflow: hidden;
    perspective: 1800px;
}
.csfb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-weight: 700;
    color: #14344e;
    background: rgba(255,255,255,.74);
}

.csfb-loader[hidden],
.csfb-fallback[hidden] {
    display: none !important;
}

.csfb-loader-error {
    color: #9f1d1d;
}
.csfb-book {
    position: absolute;
    inset: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    transform-style: preserve-3d;
}
.csfb-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(50% - 10px);
    max-height: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(0,0,0,.22);
    overflow: hidden;
    transform-style: preserve-3d;
}
.csfb-page canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
}
.csfb-left::after,
.csfb-right::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 16px;
    pointer-events: none;
    opacity: .22;
}
.csfb-left::after {
    right: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.45));
}
.csfb-right::before {
    left: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0));
}
.csfb-empty-page {
    background: linear-gradient(135deg, #fff, #eef2f6);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04), 0 14px 30px rgba(0,0,0,.12);
}
.csfb-flip-next .csfb-right {
    animation: csfbFlipNext .5s ease;
    transform-origin: left center;
}
.csfb-flip-prev .csfb-left {
    animation: csfbFlipPrev .5s ease;
    transform-origin: right center;
}
@keyframes csfbFlipNext {
    0% { transform: rotateY(0deg); }
    48% { transform: rotateY(-72deg); }
    100% { transform: rotateY(0deg); }
}
@keyframes csfbFlipPrev {
    0% { transform: rotateY(0deg); }
    48% { transform: rotateY(72deg); }
    100% { transform: rotateY(0deg); }
}
.csfb-single-mode .csfb-book {
    gap: 0;
}
.csfb-single-mode .csfb-page {
    max-width: 100%;
}
.csfb-single-mode .csfb-left::after,
.csfb-single-mode .csfb-right::before {
    display: none;
}
.csfb-fallback,
.csfb-fallback iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.csfb-noscript,
.csfb-message {
    padding: 14px 18px;
    border-left: 4px solid var(--csfb-accent, #0b5d94);
    background: #f4f8fb;
    color: #14344e;
}
.csfb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin: 28px 0;
}
.csfb-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(15, 44, 72, 0.12);
    overflow: hidden;
}
.csfb-card-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    background: #eff4f9;
    color: #0b5d94;
    font-size: 56px;
    text-decoration: none !important;
}
.csfb-card-cover img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}
.csfb-card h3 {
    margin: 16px 18px 8px;
    font-size: 20px;
    line-height: 1.25;
}
.csfb-card h3 a {
    color: #063b64;
    text-decoration: none;
}
.csfb-card p {
    margin: 0 18px 14px;
    color: #35475a;
}
.csfb-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 18px 18px;
}
.csfb-small-btn-light {
    background: #e8eef5;
    color: #063b64 !important;
}
:fullscreen.csfb-wrapper {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow: auto;
}
:fullscreen.csfb-wrapper .csfb-stage {
    height: calc(100vh - 130px);
}
@media (max-width: 760px) {
    .csfb-wrapper {
        padding: 14px;
        border-radius: 14px;
    }
    .csfb-stage {
        height: min(var(--csfb-height), 72vh);
        min-height: 430px;
    }
    .csfb-toolbar {
        gap: 6px;
    }
    .csfb-btn {
        min-height: 36px;
        padding: 8px 11px;
        font-size: 13px;
    }
    .csfb-page-info {
        width: 100%;
        margin: 4px 0;
    }
}
