
        /* ===== RWE PDF VIEWER - freistehend, kein Rahmen/Kasten ===== */
        .rwe-pdf-wrapper {
            position: relative;
            width: 100%;
            max-width: 100%;
            margin: 6px 0;
        }

        .rwe-pdf-wrapper.rwe-pdf-processing,
        .rwe-pdf-wrapper.rwe-pdf-error {
            padding: 24px;
            text-align: center;
            color: #b0a8a8;
            background: #f5f0f0;
            border-radius: 12px;
            font-size: 0.9rem;
        }

        .rwe-pdf-pageholder {
            position: relative;
            width: 100%;
            /* KEIN vh-basiertes max-height mehr: width:100% + aspect-ratio
               ergibt die Hoehe automatisch aus dem echten Seitenverhaeltnis.
               Ein vh-Cap wuerde bei normalen Hochformat-Seiten (A4 etc.) auf
               normalen Bildschirmen die Box kappen, WAEHREND die Breite bei
               100% bleibt -> object-fit:contain zeigt die Seite dann mit
               breiten leeren Raendern links/rechts (genau das "zu viel Box,
               zu wenig Inhalt"-Problem). Nur eine sehr grosszuegige
               Notbremse gegen wirklich extreme Seitenverhaeltnisse (z.B.
               kaputte/verzerrte Scans).  */
            max-height: 2400px;
            overflow: hidden;
            perspective: 2000px;
            border-radius: var(--border-radius, 8px);
        }

        .rwe-pdf-pageholder[onclick] {
            cursor: pointer;
        }

        .rwe-pdf-book {
            position: relative;
            width: 100%;
            height: 100%;
        }

        .rwe-pdf-under,
        .rwe-pdf-flip .rwe-pdf-page {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            user-select: none;
            -webkit-user-select: none;
            -webkit-touch-callout: none;
            background: #fff;
        }

        .rwe-pdf-flip {
            position: absolute;
            inset: 0;
            transform-style: preserve-3d;
            transform-origin: left center;
            transform: rotateY(0deg);
            will-change: transform;
            box-shadow: 2px 0 12px rgba(0,0,0,0.15);
        }

        .rwe-pdf-flip .rwe-pdf-page {
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
        }

        /* ===== Steuerung als dezentes Overlay auf dem Bild, kein Kasten ===== */
        .rwe-pdf-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0,0,0,0.4);
            border: none;
            color: #fff;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.2s ease, transform 0.2s ease;
            z-index: 2;
        }

        .rwe-pdf-prev { left: 10px; }
        .rwe-pdf-next { right: 10px; }

        .rwe-pdf-btn:hover:not(:disabled) {
            background: rgba(167, 9, 9, 0.85);
            transform: translateY(-50%) scale(1.08);
        }

        .rwe-pdf-btn:disabled {
            opacity: 0;
            pointer-events: none;
        }

        .rwe-pdf-indicator {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.5);
            color: #fff;
            font-weight: 500;
            font-size: 0.78rem;
            padding: 3px 10px;
            border-radius: 20px;
            z-index: 2;
        }

        @media (max-width: 480px) {
            .rwe-pdf-btn {
                width: 32px;
                height: 32px;
            }
        }

        /* ===== TOOLBAR (Merken / Teilen / Herunterladen / Vollansicht) =====
           Bugfix 2026-08-24 (gleiche Ursache wie beim Video-Player/Bild-
           Toolbar, siehe system/eigener_video_player.php bzw. thema/inhalt.php):
           waagerecht statt senkrecht gestapelt, damit die Leiste bei bis zu 4
           Buttons nicht in die Hoehe waechst - zusaetzlich ohne Kreis-/Rahmen-
           Hintergrund, nur noch reine Icons mit Schlagschatten. */
        .rwe-pdf-toolbar {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 20;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 4px;
            max-width: calc(100% - 16px);
        }

        .rwe-pdf-tool-btn {
            width: 30px;
            height: 30px;
            border: none;
            background: none;
            padding: 0;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
            cursor: pointer;
            filter: drop-shadow(0 1px 5px rgba(0,0,0,0.75));
            transition: transform 0.2s ease, filter 0.2s ease;
            touch-action: manipulation;
            flex-shrink: 0;
        }

        .rwe-pdf-tool-btn:hover {
            transform: scale(1.15);
            filter: drop-shadow(0 1px 5px rgba(0,0,0,0.75)) drop-shadow(0 0 10px rgba(255,255,255,0.9));
        }

        .rwe-pdf-tool-btn:active {
            transform: scale(0.92);
        }

        .rwe-pdf-tool-btn.is-bookmarked {
            filter: drop-shadow(0 1px 5px rgba(0,0,0,0.75)) drop-shadow(0 0 10px rgba(255,70,70,0.95));
        }

        @media (max-width: 480px) {
            .rwe-pdf-tool-btn {
                width: 26px;
                height: 26px;
                font-size: 0.85rem;
            }
            .rwe-pdf-toolbar { gap: 2px; }
        }

        /* ===== VOLLANSICHT-MODAL (Zoom/Pan, wie die Bild-Lightbox) ===== */
        .rwe-pdf-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.88);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            z-index: 9999;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            touch-action: none;
        }

        .rwe-pdf-modal-img {
            max-width: 92%;
            max-height: 80%;
            border-radius: 6px;
            object-fit: contain;
            user-select: none;
            -webkit-user-select: none;
            -webkit-touch-callout: none;
            touch-action: none;
            transform-origin: center center;
            will-change: transform;
            cursor: zoom-in;
            background: #fff;
        }

        .rwe-pdf-modal-img.is-zoomed { cursor: grab; }
        .rwe-pdf-modal-img.is-panning { cursor: grabbing; }
        .rwe-pdf-modal-img.is-transitioning { transition: transform 0.2s ease; }

        .rwe-pdf-modal-close {
            position: absolute;
            top: 20px; right: 30px;
            color: #fff;
            font-size: 40px;
            cursor: pointer;
            width: 50px; height: 50px;
            display: flex; align-items: center; justify-content: center;
            font-family: 'Courier New', monospace;
            font-weight: 300;
            background: rgba(0,0,0,0.3);
            border-radius: 50%;
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            z-index: 10001;
            transition: transform 0.3s;
        }
        .rwe-pdf-modal-close:hover { transform: scale(1.2) rotate(90deg); }

        .rwe-pdf-modal-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0,0,0,0.4);
            border: none;
            color: #fff;
            width: 44px; height: 44px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
            z-index: 10001;
            transition: background 0.2s ease;
        }
        .rwe-pdf-modal-nav:hover:not(:disabled) { background: rgba(167,9,9,0.85); }
        .rwe-pdf-modal-nav:disabled { opacity: 0.25; cursor: not-allowed; }
        .rwe-pdf-modal-prev { left: 16px; }
        .rwe-pdf-modal-next { right: 16px; }

        .rwe-pdf-modal-indicator {
            position: absolute;
            top: 24px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.5);
            color: #fff;
            font-weight: 500;
            font-size: 0.85rem;
            padding: 4px 14px;
            border-radius: 20px;
            z-index: 10001;
        }

        .rwe-pdf-modal-footer {
            position: absolute;
            bottom: 30px;
            left: 0; right: 0;
            text-align: center;
            z-index: 10001;
            display: flex;
            justify-content: center;
            gap: 12px;
            flex-wrap: wrap;
            padding: 0 12px;
        }

        .rwe-pdf-modal-footer .rwe-pdf-tool-btn {
            position: static;
            background: rgba(255,255,255,0.12);
        }

        @media (max-width: 480px) {
            .rwe-pdf-modal-img { max-height: 72%; }
            .rwe-pdf-modal-close { top: 10px; right: 15px; font-size: 32px; width: 44px; height: 44px; }
            .rwe-pdf-modal-nav { width: 38px; height: 38px; }
            .rwe-pdf-modal-footer { bottom: 20px; }
        }
    