.ab-reader {
    --ab-paper: #fffefb;
    --ab-ink: #18212a;
    --ab-toolbar: rgba(18, 27, 35, .92);
    --ab-accent: #bf8c45;
    --ab-zoom: 1;
    --ab-book-shift: 0%;
    --ab-heading-font: Georgia, "Times New Roman", serif;
    --ab-body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ab-cover-color: #26384a;
    --ab-cover-inside: #e8dfd1;
    --ab-cover-text: #fff;
    --ab-cover-logo-width: 34%;
    width: 100%;
    max-width: 1280px;
    margin: 28px auto;
    padding: 16px;
    color: var(--ab-ink);
    font-family: var(--ab-body-font);
    box-sizing: border-box;
    isolation: isolate;
}

.ab-reader *,
.ab-reader *::before,
.ab-reader *::after {
    box-sizing: border-box;
}

.ab-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 14px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: var(--ab-toolbar);
    box-shadow: 0 14px 35px rgba(7, 14, 20, .18);
    backdrop-filter: blur(12px);
}

.ab-tool,
.ab-edge-control,
.ab-corner-turn {
    appearance: none;
    display: inline-grid;
    place-items: center;
    border: 0;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, opacity .18s ease;
}

.ab-tool {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    background: transparent;
    font-size: 22px;
    line-height: 1;
}

.ab-tool:hover:not(:disabled),
.ab-tool:focus-visible,
.ab-edge-control:hover:not(:disabled),
.ab-edge-control:focus-visible {
    transform: translateY(-1px);
    outline: 2px solid rgba(255, 255, 255, .65);
    outline-offset: 2px;
}

.ab-tool:hover:not(:disabled),
.ab-tool:focus-visible {
    background: rgba(255, 255, 255, .14);
}

.ab-tool:disabled,
.ab-edge-control:disabled,
.ab-corner-turn:disabled {
    opacity: .22;
    cursor: default;
}

.ab-toolbar-separator {
    width: 1px;
    height: 23px;
    margin: 0 2px;
    background: rgba(255, 255, 255, .2);
}

.ab-stage {
    position: relative;
    width: 100%;
    min-height: 250px;
    padding: 26px 2.5% 34px;
    overflow: auto;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 15%, rgba(255,255,255,.16), transparent 34%),
        linear-gradient(145deg, #2d3439, #11171c 72%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 28px 70px rgba(13, 22, 29, .22);
    perspective: 2600px;
    perspective-origin: 50% 44%;
    scrollbar-width: thin;
}

.ab-stage::before {
    content: "";
    position: absolute;
    inset: auto 9% 18px;
    height: 11%;
    background: radial-gradient(ellipse, rgba(0,0,0,.62), rgba(0,0,0,0) 70%);
    filter: blur(12px);
    pointer-events: none;
    transition: opacity .35s ease, transform .5s ease;
}

.ab-reader.is-turning .ab-stage::before,
.ab-reader.is-dragging-page .ab-stage::before {
    opacity: .82;
    transform: scaleX(1.035) translateY(2px);
}

.ab-book {
    position: relative;
    width: min(1120px, 94%);
    aspect-ratio: var(--ab-book-ratio, 1.414);
    margin: 0 auto;
    transform: translateX(var(--ab-book-shift)) scale(var(--ab-zoom));
    transform-origin: center center;
    transform-style: preserve-3d;
    transition: transform .62s cubic-bezier(.2,.75,.2,1), filter .35s ease;
    touch-action: pan-y;
    outline: none;
}

.ab-reader.is-closed {
    --ab-book-shift: -25%;
}

.ab-reader.is-turning .ab-book,
.ab-reader.is-dragging-page .ab-book {
    filter: drop-shadow(0 18px 18px rgba(0,0,0,.16));
}

.ab-book:focus-visible {
    outline: 3px solid rgba(255,255,255,.82);
    outline-offset: 8px;
    border-radius: 4px;
}

.ab-sheet {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    z-index: var(--ab-z);
    transform: rotateY(0deg) translateZ(0);
    transform-origin: left center;
    transform-style: preserve-3d;
    transition-property: transform, filter;
    transition-duration: var(--ab-duration, 950ms);
    transition-timing-function: cubic-bezier(.16, .76, .18, 1);
    will-change: transform;
}

.ab-sheet.is-flipped {
    transform: rotateY(-180deg) translateZ(0);
}

.ab-sheet.is-dragging {
    transition: none !important;
    cursor: grabbing;
}

.ab-sheet.is-turning-forward,
.ab-sheet.is-turning-backward,
.ab-sheet.is-dragging {
    filter: drop-shadow(13px 15px 16px rgba(0,0,0,.24));
}

.ab-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--ab-paper);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
}

.ab-front {
    border-radius: 2px 10px 10px 2px;
    box-shadow: 9px 7px 24px rgba(0,0,0,.22), inset 10px 0 16px rgba(52,41,22,.045);
}

.ab-back {
    transform: rotateY(180deg);
    border-radius: 10px 2px 2px 10px;
    box-shadow: -9px 7px 24px rgba(0,0,0,.22), inset -10px 0 16px rgba(52,41,22,.045);
}

.ab-face::before,
.ab-face::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    transition: opacity .32s ease;
}

.ab-front::after {
    opacity: .62;
    background: linear-gradient(90deg, rgba(44,34,22,.11), transparent 7%, transparent 86%, rgba(255,255,255,.28));
}

.ab-back::after {
    opacity: .62;
    background: linear-gradient(270deg, rgba(44,34,22,.11), transparent 7%, transparent 86%, rgba(255,255,255,.26));
}

.ab-sheet.is-turning-forward .ab-front::before,
.ab-sheet.is-dragging .ab-front::before {
    opacity: .68;
    background: linear-gradient(100deg, transparent 18%, rgba(255,255,255,.18) 43%, rgba(0,0,0,.38) 100%);
}

.ab-sheet.is-turning-forward .ab-back::before,
.ab-sheet.is-dragging .ab-back::before {
    opacity: .58;
    background: linear-gradient(80deg, rgba(0,0,0,.35), rgba(255,255,255,.16) 58%, transparent 88%);
}

.ab-sheet.is-turning-backward .ab-front::before {
    opacity: .56;
    background: linear-gradient(100deg, transparent 10%, rgba(255,255,255,.16) 55%, rgba(0,0,0,.32));
}

.ab-sheet.is-turning-backward .ab-back::before {
    opacity: .68;
    background: linear-gradient(80deg, rgba(0,0,0,.36), rgba(255,255,255,.18) 58%, transparent 88%);
}

.ab-sheet.is-flipped .ab-back {
    box-shadow: -8px 8px 22px rgba(0,0,0,.22), inset -12px 0 16px rgba(52,41,22,.055);
}

.ab-spine {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    z-index: 9999;
    transform: translateX(-1.5px) translateZ(4px);
    background: linear-gradient(to bottom, rgba(255,255,255,.22), rgba(0,0,0,.38), rgba(255,255,255,.16));
    box-shadow: 0 0 18px rgba(0,0,0,.4);
    pointer-events: none;
}

.ab-page-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--ab-paper);
    background-image: var(--ab-page-image, none);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    color: var(--ab-ink);
    font-family: var(--ab-body-font);
}

.ab-page-scroll {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: clamp(24px, 5.4%, 64px);
    padding-bottom: clamp(48px, 8%, 82px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    touch-action: pan-y;
}

.ab-page-inner.has-page-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02));
    pointer-events: none;
}

.ab-page-inner h1,
.ab-page-inner h2,
.ab-page-inner h3,
.ab-page-inner h4,
.ab-page-inner h5,
.ab-page-inner h6 {
    font-family: var(--ab-heading-font);
}

.ab-page-default {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ab-page-default h2 {
    margin: 0 0 .7em;
    font-size: clamp(1.5rem, 3vw, 3.8rem);
    line-height: 1.05;
    letter-spacing: -.035em;
    color: inherit;
}

.ab-page-kicker {
    margin-bottom: 1.2em;
    font-size: clamp(.68rem, 1vw, .9rem);
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ab-accent);
}

.ab-page-copy {
    font-size: clamp(.76rem, 1.25vw, 1.08rem);
    line-height: 1.68;
}

.ab-page-copy p:first-child {
    margin-top: 0;
}

.ab-page-inner img {
    max-width: 100%;
    height: auto;
}

.ab-page-number {
    position: absolute;
    bottom: clamp(15px, 2.8%, 29px);
    z-index: 8;
    min-width: 1.3em;
    color: currentColor;
    font-family: var(--ab-body-font);
    font-size: clamp(.72rem, 1.05vw, .96rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    opacity: .72;
    pointer-events: none;
}

.ab-page-number--left {
    left: clamp(17px, 4.2%, 42px);
}

.ab-page-number--right {
    right: clamp(17px, 4.2%, 42px);
}

.ab-page-blank {
    background:
        linear-gradient(90deg, rgba(95,70,35,.035), transparent 12%),
        var(--ab-paper);
}

/* Stabiler, eigenständiger Umschlag. */
.ab-cover-sheet {
    filter: drop-shadow(12px 13px 18px rgba(0,0,0,.3));
}

.ab-cover-sheet .ab-face {
    border-radius: 3px 13px 13px 3px;
    background: var(--ab-cover-color);
    box-shadow:
        12px 10px 26px rgba(0,0,0,.3),
        inset 0 0 0 2px rgba(255,255,255,.09),
        inset 11px 0 22px rgba(0,0,0,.18),
        inset -3px 0 8px rgba(255,255,255,.08);
}

.ab-cover-sheet .ab-back {
    border-radius: 13px 3px 3px 13px;
}

.ab-cover-page {
    display: grid;
    place-items: stretch;
    overflow: hidden;
}

.ab-cover-page--front {
    color: var(--ab-cover-text);
    background:
        radial-gradient(circle at 70% 14%, rgba(255,255,255,.15), transparent 28%),
        repeating-linear-gradient(95deg, rgba(255,255,255,.025) 0 1px, rgba(0,0,0,.018) 1px 3px),
        var(--ab-cover-color);
}

.ab-cover-frame {
    position: absolute;
    inset: clamp(17px, 4.2%, 43px);
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.32);
    box-shadow: inset 0 0 0 4px rgba(0,0,0,.06);
}

.ab-cover-frame::before,
.ab-cover-frame::after {
    content: "";
    position: absolute;
    width: 18%;
    height: 18%;
    border-color: currentColor;
    opacity: .45;
}

.ab-cover-frame::before {
    top: 10px;
    left: 10px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.ab-cover-frame::after {
    right: 10px;
    bottom: 10px;
    border-right: 2px solid;
    border-bottom: 2px solid;
}

.ab-cover-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 10%;
    text-align: center;
}

.ab-cover-logo {
    display: block;
    width: var(--ab-cover-logo-width);
    max-height: 29%;
    margin: 0 auto clamp(20px, 6%, 52px);
    object-fit: contain;
    filter: drop-shadow(0 5px 12px rgba(0,0,0,.18));
}

.ab-cover-title {
    margin: 0;
    color: inherit;
    font-family: var(--ab-heading-font);
    font-size: clamp(1.45rem, 3.1vw, 3.65rem);
    line-height: 1.08;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.ab-cover-subtitle {
    max-width: 82%;
    margin: 1.2em auto 0;
    color: inherit;
    font-family: var(--ab-body-font);
    font-size: clamp(.72rem, 1.2vw, 1.08rem);
    line-height: 1.5;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .82;
}

.ab-cover-page--inside {
    background:
        linear-gradient(90deg, rgba(0,0,0,.13), transparent 8%, transparent 92%, rgba(255,255,255,.16)),
        repeating-linear-gradient(95deg, rgba(255,255,255,.035) 0 1px, rgba(0,0,0,.015) 1px 3px),
        var(--ab-cover-inside);
}

.ab-cover-inside-decoration {
    position: absolute;
    inset: 7%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(50,45,38,.14);
}

.ab-cover-watermark {
    width: var(--ab-cover-logo-width);
    max-height: 24%;
    object-fit: contain;
    opacity: .09;
    filter: grayscale(1);
}

/* Zuverlässige, große Umblätterzonen an den unteren Außenecken. */
.ab-corner-turn {
    position: absolute;
    bottom: 0;
    z-index: 12000;
    width: 15%;
    min-width: 54px;
    height: 23%;
    min-height: 62px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: transparent;
    opacity: .9;
}

.ab-corner-turn--prev {
    left: 0;
    border-radius: 0 0 0 10px;
}

.ab-corner-turn--next {
    right: 0;
    border-radius: 0 0 10px 0;
}

.ab-corner-turn::before {
    content: "";
    position: absolute;
    bottom: 0;
    width: 54%;
    aspect-ratio: 1;
    opacity: 0;
    transition: opacity .18s ease, transform .24s ease;
}

.ab-corner-turn--prev::before {
    left: 0;
    background: linear-gradient(45deg, rgba(0,0,0,.12), rgba(255,255,255,.5) 48%, transparent 51%);
    transform: translate(-18%, 18%) scale(.72);
}

.ab-corner-turn--next::before {
    right: 0;
    background: linear-gradient(-45deg, rgba(0,0,0,.12), rgba(255,255,255,.5) 48%, transparent 51%);
    transform: translate(18%, 18%) scale(.72);
}

.ab-corner-turn:hover:not(:disabled)::before,
.ab-corner-turn:focus-visible::before {
    opacity: .72;
    transform: translate(0, 0) scale(1);
}

.ab-corner-turn:focus-visible {
    outline: 2px solid rgba(255,255,255,.85);
    outline-offset: -4px;
}

.ab-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 740px;
    margin: 13px auto 0;
}

.ab-bottom-spacer {
    flex: 1 1 auto;
}

.ab-edge-control {
    width: 48px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #1f2933;
    background: #fff;
    box-shadow: 0 7px 22px rgba(15, 23, 42, .12);
    font-size: 30px;
}

.ab-edge-control:hover:not(:disabled),
.ab-edge-control:focus-visible {
    background: #fff;
    outline-color: #213b50;
}

.ab-live-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ab-no-shadow .ab-face,
.ab-no-shadow .ab-stage,
.ab-no-shadow .ab-edge-control,
.ab-no-shadow .ab-cover-sheet {
    box-shadow: none !important;
    filter: none !important;
}

.ab-reader:fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 12px;
    background: #0e1419;
    overflow: auto;
}

.ab-reader:fullscreen .ab-stage {
    min-height: calc(100vh - 110px);
    display: grid;
    align-items: center;
}

.ab-reader:fullscreen .ab-book {
    width: min(1450px, 92vw);
    max-height: calc(100vh - 160px);
}

.ab-notice {
    padding: 12px 15px;
    border-left: 4px solid #d97706;
    background: #fff7ed;
}

@media (max-width: 760px) {
    .ab-reader {
        margin: 16px auto;
        padding: 8px;
    }

    .ab-toolbar {
        margin-bottom: 9px;
    }

    .ab-stage {
        padding: 15px 8px 22px;
        border-radius: 16px;
    }

    .ab-book {
        width: 96%;
        min-width: 620px;
        transform-origin: top left;
    }

    .ab-reader.is-closed {
        --ab-book-shift: -25%;
    }

    .ab-stage {
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .ab-page-scroll {
        padding: 24px;
        padding-bottom: 50px;
    }

    .ab-bottom-row {
        padding: 0 5px;
    }

    .ab-edge-control {
        width: 44px;
        height: 40px;
    }

    .ab-corner-turn {
        width: 18%;
        height: 27%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ab-sheet,
    .ab-book,
    .ab-tool,
    .ab-edge-control,
    .ab-corner-turn::before {
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .ab-toolbar,
    .ab-bottom-row,
    .ab-spine,
    .ab-corner-turn,
    .ab-cover-sheet {
        display: none !important;
    }

    .ab-stage {
        padding: 0;
        background: #fff;
        box-shadow: none;
        overflow: visible;
    }

    .ab-book {
        width: 100%;
        aspect-ratio: auto;
        transform: none !important;
    }

    .ab-sheet {
        position: static;
        width: 100%;
        height: auto;
        transform: none !important;
    }

    .ab-face {
        position: relative;
        min-height: 95vh;
        transform: none !important;
        page-break-after: always;
        box-shadow: none;
    }

    .ab-page-scroll {
        overflow: visible;
    }
}
