html:has(#lesefenster) { scrollbar-gutter: stable; }
#lesefenster {
    position: fixed; inset: 20px 14px auto auto; z-index: 1100;
    width: min(49vw, 780px); height: min(var(--blatthoehe, 960px), 88dvh, 960px);
    max-width: 100%; max-height: 100%; margin: 0; padding: 0;
    border: 1px solid #aebcc6; border-radius: 8px;
    background: white; color: #253343; box-shadow: 0 8px 32px rgb(23 45 60 / 20%);
}
#lesefenster[open] { display: flex; flex-direction: column; }
.leseleiste {
    display: flex; align-items: center; gap: 16px; flex-shrink: 0;
    padding: 12px 18px; background: #f4f6f7; border-bottom: 1px solid #cbd4da;
}
.leseleiste h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; margin: 0; font-size: 1.05rem; line-height: 1.3; letter-spacing: 0; }
.leseleiste button, #lesefenster .button {
    border: 1px solid #253343; border-radius: 5px;
    background: #253343; color: white; cursor: pointer;
    font: 650 .95rem/1.4 system-ui, sans-serif; padding: 9px 14px; text-decoration: none;
}
#lesefenster :is(a, button):focus-visible { outline: 3px solid #a47721; outline-offset: 3px; }
.leseleiste .lese-zurueck { color: #23384b; background: #fff; border-color: #9eacb8; }
#lesefenster [hidden] { display: none; }
.lese-inhalt { flex: 1; min-height: 0; }
.lese-blatt { display: flex; flex-direction: column; height: 100%; }
.lese-blatt iframe { flex: 1; display: block; min-height: 0; width: 100%; border: 0; background: white; }
.lese-quelle { padding: 5px 18px; border-bottom: 1px solid #d5dadf; font-size: .85rem; }
.lese-karte { overflow-y: auto; overscroll-behavior: contain; padding: clamp(20px, 5vw, 56px); }
.lese-karte p { max-width: 68ch; }
.lese-karte figure { margin: 22px 0 0; }
.lese-karte img { display: block; width: 100%; height: auto; border: 1px solid #d5dadf; }
.lese-karte figcaption { margin-top: 5px; font-size: .85rem; }
.lese-karte .button { align-self: flex-start; }
.lese-produkte li { margin-bottom: 10px; }
@media (max-width: 650px) {
    .leseleiste { gap: 8px; padding: 10px; }
    .leseleiste h2 { font-size: .93rem; }
    .leseleiste button { min-height: 44px; padding-inline: 9px; }
}

/* The document and article have independent scroll areas. */
.lese-griff { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; cursor: grab; touch-action: none; user-select: none; }
.lese-griff:active { cursor: grabbing; }
.lese-griff > span { font-size: 1.4rem; color: #566a7a; }
.lese-griff:focus-visible { outline: 2px solid #9a731e; outline-offset: 3px; }
@media (min-width: 801px) {
    body:has(#lesefenster[open]) { padding-right: min(calc(49vw + 26px), 806px); }
    body:has(#lesefenster[open][data-side="left"]) { padding-right: 0; padding-left: min(calc(49vw + 26px), 806px); }
    body:has(#lesefenster[open]) .reader-intro, body:has(#lesefenster[open]) .wk-items { grid-template-columns: 1fr; }
    body:has(#lesefenster[open]) .lese-inhalt iframe { overscroll-behavior: contain; }
}
@media (max-width: 800px) {
    #lesefenster[open] { inset: auto 5px 5px; width: calc(100% - 10px); height: 49dvh; }
    body:has(#lesefenster[open]) { padding-bottom: 51dvh; }
    .leseleiste { padding: 5px 8px; }
}
