:root {
            --bg: #ffffff;
            --bg-warm: #fafafa;
            --bg-scan: #F5F2ED;
            --text: #1a1a1a;
            --text-secondary: #080808;
            --text-muted: #8a8a8a;
            --text-faint: #b0b0b0;
            --accent: #948466;          /*gold*/
            --accent-hover: #948466;
            --border: #948466;
            --border-light: #eeeeee;
            --white: #ffffff;
            --black: #000000;
            --shadow-sm: rgba(0,0,0,0.04);
            --shadow-md: rgba(0,0,0,0.1);
            --shadow-lg: rgba(0,0,0,0.18);
            --serif: 'Brandon Grotesque', sans-serif;
            --sans: 'Brandon Grotesque', sans-serif;
            --mono: 'IBM Plex Mono', monospace;
            --ease: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
            --panel-w: 400px;
        }
   #introBody .bild   {float:left; margin:10px 30px 20px  0px;max-width:300px;}
        #introBody .bild img { width:100%;}
        #introBody .bild .bu { line-height:120%; font-size:0.8em;}
   
            * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            font-size: clamp(13px, 0.45rem + 0.9vw, 16px);
            font-size: clamp(15px, 0.6rem + 0.9vw, 18px);
            font-size: clamp(17px, 0.8rem + 1.2vw, 20px);
            scroll-behavior: smooth;
        }

        body {
            font-family: var(--sans);
            background: var(--bg);
            color: var(--text);
            /*min-height: 100vh;*/
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        ::selection {
            background: var(--text);
            color: var(--white);
        }

        /* ═══ HEADER ═══ */
        .site-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            background: rgba(255,255,255,0.96);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border-light);
            transition: transform var(--ease);
        }

            .site-header.hidden {
                transform: translateY(-100%);
            }

        .header-inner {
            max-width: 1800px;
            margin: 0 auto;
            padding: 0 2.5rem;
            height: 56px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header-title {
            font-family: var(--sans);
            font-size: 0.75rem;
            text-transform:uppercase;
            font-weight: 500;
            letter-spacing: 0.04em;
            color: var(--text);
            cursor: pointer;
            transition: color var(--ease);
        }

            .header-title:hover {
                color: var(--accent);
            }

            .header-title a {
                text-decoration: none;
                color: inherit;
            }

            .header-title span {
                font-weight: 300;
                color: var(--text-muted);
                margin-left: 0.3rem;
            }

        .header-nav {
            display: flex;
            align-items: center;
            gap: 0;
        }

            .header-nav a {
                font-family: var(--sans);
                font-size: 0.75rem;
                font-weight: 500;
                letter-spacing: 0.1em;
                text-transform: uppercase;
                color: var(--text-secondary);
                text-decoration: none;
                cursor: pointer;
                transition: color var(--ease);
                position: relative;
                padding: 0.3rem 0;
            }

                .header-nav a::after {
                    content: '';
                    position: absolute;
                    bottom: -2px;
                    left: 0;
                    width: 0;
                    height: 1px;
                    background: var(--text);
                    transition: width var(--ease);
                }

                .header-nav a:hover { color: var(--text); }
                .header-nav a:hover::after { width: 100%; }
                .header-nav a.active { color: var(--accent); }
                .header-nav a.active::after { width: 100%; }

        .breadcrumb-sep {
            font-family: var(--sans);
            font-size: 1.8rem;
            color: var(--border);
            margin: -0.6rem 0.55rem 0 0.55rem;
            user-select: none;
        }

        .breadcrumb-diary {
            display: none;
            align-items: center;
            padding-left: 1.1rem;
            margin-left: 1.1rem;
            border-left: 1px solid var(--border);
        }

            .breadcrumb-diary .breadcrumb-sep:first-child { display: none; }

        .page-indicator {
            font-family: var(--mono);
            font-size: 0.7rem;
            font-weight: 300;
            color: var(--text-faint);
            letter-spacing: 0.05em;
            margin-left: 0.5rem;
        }




        #navDiaryIntro,#navViewer {white-space:nowrap;}
        


          .nav-lang-toggle {
            display: flex;
            align-items: center;
            gap: 0;
            margin-left: 1.25rem;
            padding-left: 1.25rem;
            border-left: 1px solid var(--border);
            flex-shrink: 0;
        }
 
        .nav-lang-btn {
            font-family: var(--sans);
            font-size: 10px;
            font-weight: 500;
            letter-spacing: 0.1em;
            padding: 0.25rem 0.55rem;
            background: none;
            border: 1px solid var(--border);
            color: var(--text-muted);
            cursor: pointer;
            transition: all var(--ease);
            line-height: 1;
        }
 
            .nav-lang-btn:first-child {
                border-radius: 3px 0 0 3px;
                border-right: none;
            }
 
            .nav-lang-btn:last-child {
                border-radius: 0 3px 3px 0;
            }
 
            .nav-lang-btn.active {
                background: var(--accent);
                color: var(--white);
                border-color: var(--accent);
            }
 
            .nav-lang-btn:hover:not(.active) {
                color: var(--text);
                border-color: var(--text-muted);
            }



        /* ═══ INTRO ═══ */
        .intro-section {
            display: flex;
            flex-direction: column;
            padding: 8rem 2.5rem 4rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .intro-eyebrow {
            font-family: var(--sans);
            font-size: 0.9rem;
            font-weight: 500;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--text-secondary);
            margin-bottom: 1.0rem;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.15s forwards;
        }

        .intro-title {
            font-family: var(--serif);
            font-size: clamp(1.6rem, 3.5vw, 2.6rem);
            font-weight: 500;
            text-transform:uppercase;
            line-height: 1.15;
            color: var(--accent);
            margin-bottom: 0.4rem;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.25s forwards;
        }

        .intro-subtitle {
            font-family: var(--serif);
            font-size: clamp(1.05rem, 2vw, 1.5rem);
            font-weight: 400;
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.35s forwards;
        }

        .intro-rule {
            width: 40px;
            height: 2px;
            background: var(--accent);
            margin-bottom: 2.5rem;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.4s forwards;
        }

        .intro-meta-row {
            display: flex;
            gap: 2rem;
            margin-bottom: 3rem;
            flex-wrap: wrap;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.45s forwards;
        }

        .intro-meta-item {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .intro-meta-label {
            font-family: var(--sans);
            font-size: 0.6rem;
            font-weight: 500;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: var(--text-faint);
        }

        .intro-meta-value {
            font-family: var(--sans);
            font-size: 0.9rem;
            font-weight: 400;
            color: var(--text);
        }

        /* intro-body handles text now */

        .intro-archive {
            font-family: var(--sans);
            font-size: 0.72rem;
            color: var(--text-faint);
            letter-spacing: 0.03em;
            margin-bottom: 3.5rem;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.6s forwards;
        }

        .intro-lang-toggle {
            display: flex;
            gap: 0;
            margin-bottom: 2.5rem;
            opacity: 0;
            animation: fadeUp 0.6s ease 0.5s forwards;
        }

        .lang-btn {
            font-family: var(--sans);
            font-size: 0.65rem;
            font-weight: 400;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            padding: 0.4rem 1rem;
            cursor: pointer;
            background: none;
            border: 1px solid var(--border);
            color: var(--text-muted);
            transition: all var(--ease);
        }

            .lang-btn:first-child {
                border-radius: 3px 0 0 3px;
                border-right: none;
            }

            .lang-btn:last-child {
                border-radius: 0 3px 3px 0;
            }

            .lang-btn.active {
                background: var(--text);
                color: var(--white);
                border-color: var(--text);
            }

            .lang-btn:hover:not(.active) {
                color: var(--text);
                border-color: var(--text-muted);
            }

        .intro-body {
            max-width: 1000px;
            margin-bottom: 2.5rem;
            opacity: 0;
            transform: translateY(16px);
            transition: opacity 0.6s ease, transform 0.6s ease;
        }

        .intro-body.visible {
            opacity: 1;
            transform: translateY(0);
        }

            .intro-body h2 {
                font-family: var(--serif);
                font-size: 1.4rem;
                font-weight: 500;
                color: var(--text);
                margin-bottom: 1.25rem;
                line-height: 1.3;
            }

            .intro-body h3 {
                font-family: var(--serif);
                font-size: 1.15rem;
                font-weight: 500;
                color: var(--text);
                margin: 2.5rem 0 1rem;
                line-height: 1.3;
            }

            .intro-body p {
                font-family: var(--serif);
                font-size: 1.05rem;
                font-weight: 400;
                line-height: 1.8;
                color: var(--text-secondary);
                margin-bottom: 1rem;
            }

        .btn-enter {
            display: inline-flex;
            align-items: center;
            gap: 0.6rem;
            font-family: var(--sans);
            font-size: 0.72rem;
            font-weight: 500;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--accent);
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            text-decoration: none;
            transition: gap var(--ease), color var(--ease);
            opacity: 0;
            animation: fadeUp 0.6s ease 0.7s forwards;
        }

            .btn-enter:hover {
                gap: 1.1rem;
                color: var(--accent-hover);
            }

            .btn-enter svg {
                width: 20px;
                height: 20px;
                transition: transform var(--ease);
            }

            .btn-enter:hover svg {
                transform: translateX(3px);
            }

        /* ═══ VIEWER ═══ */
        .viewer-section {
            display: none;
            height: calc(100vh - 56px);
            margin-top: 56px;
            position: relative;
            overflow: hidden;
            flex-direction: column;
        }

            .viewer-section.active {
                display: flex;
            }

        .viewer-main {
            flex: 1 1 0;
            min-height: 0;
            height: 0;
            overflow: hidden;
        }

        .viewer-layout {
            display: flex;
            height: 100%;
            position: relative;
        }

        .image-area {
            flex: 1;
            position: relative;
            background: var(--bg-scan);
            overflow: hidden;
            min-width: 0;
        }

        .scan-container {
            position: absolute;
            inset: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: zoom-in;
        }

        .scan-image {
            max-height: 100%;
            max-width: 100%;
            object-fit: contain;
            display: block;
            /*box-shadow: 0 4px 24px var(--shadow-md), 0 1px 4px var(--shadow-sm);*/
            opacity: 0;
            transition: opacity 0.45s ease;
        }

            .scan-image.loaded {
                opacity: 1;
            }

        /* ═══ LOUPE / MAGNIFIER ═══ */
        .lens-rect {
            display: none;
            position: absolute;
            border: 2px solid var(--accent);
            background: rgba(200, 16, 46, 0.08);
            pointer-events: none;
            z-index: 5;
            transition: opacity 0.15s ease;
            box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
        }

        .loupe-active .scan-container {
            cursor: crosshair;
        }

        .loupe-active .lens-rect {
            display: block;
        }

        .panel-header-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 2rem;
            flex-shrink: 0;
        }

        .loupe-toggle {
            flex-shrink: 0;
            height: 32px;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0 0.75rem;
            background: none;
            border: 1px solid var(--border);
            border-radius: 16px;
            cursor: pointer;
            color: var(--text-muted);
            transition: all var(--ease);
        }

            .loupe-toggle:hover {
                color: var(--accent);
                border-color: var(--accent);
            }

            .loupe-toggle.active {
                color: var(--white);
                background: var(--accent);
                border-color: var(--accent);
            }

            .loupe-toggle svg {
                width: 14px;
                height: 14px;
                flex-shrink: 0;
            }

        .loupe-label {
            font-family: var(--sans);
            font-size: 0.62rem;
            font-weight: 400;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .panel-info {
            display: block;
            flex: 1;
            overflow-y: auto;
        }

        .panel-magnifier {
            display: none;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

            .panel-magnifier .panel-field-label {
                margin-bottom: 0.6rem;
                flex-shrink: 0;
            }

        .loupe-mode .panel-info {
            display: none;
        }

        .loupe-mode .panel-magnifier {
            display: flex;
        }

        .loupe-mode {
            overflow: hidden;
        }

        .magnifier-view {
            flex: 1;
            background-color: var(--bg-scan);
            background-repeat: no-repeat;
            min-height: 100px;
        }

        .magnifier-hint {
            font-family: var(--sans);
            font-size: 0.65rem;
            color: var(--text-faint);
            letter-spacing: 0.04em;
            text-align: center;
            margin-top: 0.6rem;
            flex-shrink: 0;
        }

        .nav-arrow {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255,255,255,0.9);
            border: 1px solid var(--border);
            border-radius: 50%;
            cursor: pointer;
            color: var(--text);
            transition: all var(--ease);
            z-index: 10;
        }

            .nav-arrow:hover {
                background: var(--white);
                box-shadow: 0 2px 12px var(--shadow-md);
                color: var(--accent);
            }

            .nav-arrow.disabled {
                opacity: 0.2;
                pointer-events: none;
            }

            .nav-arrow.prev {
                left: 1.25rem;
            }

            .nav-arrow.next {
                right: 1.25rem;
            }

            .nav-arrow svg {
                width: 18px;
                height: 18px;
            }

        /* ═══ SIDE PANEL ═══ */
        .side-panel {
            width: var(--panel-w);
            flex-shrink: 0;
            background: var(--white);
            border-left: 1px solid var(--border-light);
            overflow-y: auto;
            overflow-x: hidden;
            padding: 2.5rem 2rem;
            padding: 2.5rem 2rem 1rem 2rem;
            transition: width var(--ease), padding var(--ease), opacity var(--ease), border var(--ease);
            display: flex;
            flex-direction: column;
        }

            .side-panel.collapsed {
                width: 0;
                padding-left: 0;
                padding-right: 0;
                opacity: 0;
                overflow: hidden;
                border-left-color: transparent;
            }

        /* Toggle: positioned inside viewer-layout, at the seam between image-area and panel */
        .panel-toggle-btn {
            position: absolute;
            z-index: 20;
            top: 2rem;
            transform: translateY(-50%);
            width: 24px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--white);
            border: 1px solid var(--border);
            border-right: none;
            border-radius: 4px 0 0 4px;
            cursor: pointer;
            color: var(--text-muted);
            transition: color var(--ease), right var(--ease);
            right: var(--panel-w);
        }

            .panel-toggle-btn.shifted {
                right: 0;
            }

            .panel-toggle-btn:hover {
                color: var(--text);
            }

            .panel-toggle-btn svg {
                width: 12px;
                height: 12px;
                transition: transform var(--ease);
            }

            .panel-toggle-btn.shifted svg {
                transform: rotate(180deg);
            }

        /* Panel content */
        .panel-page-label {
            font-family: var(--serif);
            font-size: clamp(1.1rem, 1.8vw, 1.5rem);
            font-weight: 400;
            color: var(--accent);
            margin-bottom: 0.15rem;
            white-space: nowrap;
            text-transform:uppercase;
        }

        .panel-page-num {
            font-family: var(--mono);
            font-size: 0.7rem;
            font-weight: 300;
            color: var(--text-faint);
            letter-spacing: 0.04em;
        }

        .panel-field {
            margin-bottom: 1.5rem;
        }

        .panel-field-label {
            font-family: var(--sans);
            font-size: 0.58rem;
            font-weight: 500;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--text-faint);
            margin-bottom: 0.3rem;
        }

        .panel-field-value {
            font-family: var(--sans);
            font-size: 0.92rem;
            font-weight: 400;
            color: var(--text);
            line-height: 1.5;
        }

        .panel-divider {
            width: 100%;
            height: 1px;
            background: var(--border-light);
            margin: 1.25rem 0 1.5rem;
        }

        .transcription-area {
            font-family: var(--serif);
            font-size: 1rem;
            font-weight: 400;
            line-height: 1.85;
            color: var(--text-secondary);
            white-space: pre-line;
            /*overflow-y: auto;*/
            padding-right: 0.5rem;
        }

            .transcription-area::-webkit-scrollbar {
                width: 2px;
            }

            .transcription-area::-webkit-scrollbar-track {
                background: transparent;
            }

            .transcription-area::-webkit-scrollbar-thumb {
                background: var(--border);
                border-radius: 2px;
            }

        .transcription-pending {
            font-style: italic;
            color: var(--text-faint);
        }

        /* ═══ THUMBNAIL STRIP (flow-based, pushes content up) ═══ */
        .thumb-bar {
            flex-shrink: 0;
            background: var(--white);
            border-top: 1px solid var(--accent);
            max-height: 0;
            overflow: hidden;
            transition: max-height var(--ease), padding var(--ease);
            z-index:9999999;
        }

            .thumb-bar.visible {
                max-height: 80px;
            }

        .thumb-bar-inner {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 2.5rem;
            overflow-x: auto;
            scroll-behavior: smooth;
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

            .thumb-bar-inner::-webkit-scrollbar {
                display: none;
            }

        .thumb-cell {
            flex-shrink: 0;
            width: 60px;
            height: 48px;
            border-radius: 2px;
            cursor: pointer;
            opacity: 0.35;
            transition: all 0.25s ease;
            border: 2px solid transparent;
            background: var(--bg-scan);
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .thumb-cell:hover {
                opacity: 0.7;
            }

            .thumb-cell.active {
                opacity: 1;
                border-color: var(--accent);
            }

            .thumb-cell .t-num {
                font-family: var(--mono);
                font-size: 0.55rem;
                color: var(--text-muted);
            }

            .thumb-cell img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: 1px;
            }

        .thumb-toggle-btn {
            flex-shrink: 0;
            align-self: center;
            font-family: var(--sans);
            font-size: 0.75rem;
            font-weight: 500;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: var(--white);
            background: var(--accent);
            border: 1px solid var(--accent);
            border-radius: 16px 16px 0 0;
            border-bottom: none;
            padding: 0.3rem 1rem 0.3rem 1.2rem;
            cursor: pointer;
            transition: all var(--ease);
            display: none;
            margin: 0;
        }

            .thumb-toggle-btn:hover {
                color: var(--accent);
                border-color: var(--accent);
                background: var(--white);
            }

        /* ═══ LIGHTBOX ═══ */
        .lightbox {
            position: fixed;
            inset: 0;
            z-index: 200;
            background: #F5F2ED;
            display: none;
            align-items: center;
            justify-content: center;
            cursor: zoom-out;
            padding: 2rem;
            overflow: hidden;
        }

            .lightbox.active {
                display: flex;
            }

            /* Normalmodus: eingepasst */
            .lightbox img {
                max-width: 95vw;
                max-height: 95vh;
                object-fit: contain;
                cursor: zoom-in;
                user-select: none;
                transition: none;
            }

            /* Zoom-Modus: echte Pixel, verschiebbar */
            .lightbox.zoomed {
                cursor: default;
                align-items: flex-start;
                justify-content: flex-start;
                padding: 0;
            }

            .lightbox.zoomed img {
                max-width: none;
                max-height: none;
                width: auto;
                height: auto;
                cursor: grab;
                position: absolute;
            }

            .lightbox.zoomed img.dragging {
                cursor: grabbing;
            }

            /* Zoom-Hinweis */
            .lightbox-zoom-hint {
                position: absolute;
                bottom: 1.25rem;
                left: 50%;
                transform: translateX(-50%);
                font-family: var(--sans);
                font-size: 0.65rem;
                letter-spacing: 0.08em;
                color: rgba(0,0,0,0.4);
                pointer-events: none;
                white-space: nowrap;
            }

        .lightbox-close {
            position: absolute;
            top: 1.25rem;
            right: 1.25rem;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255,255,255,0.6);
            cursor: pointer;
            transition: color 0.25s ease;
        }

            .lightbox-close:hover {
                color: #fff;
            }

            .lightbox-close svg {
                width: 20px;
                height: 20px;
            }

        /* ═══ COLLECTION GRID ═══ */
        .collection-section {
            padding: 7rem 2.5rem 4rem;
            max-width: 1400px;
            margin: 0 auto;
        }

        .collection-header { margin-bottom: 3rem; }

        .collection-heading {
            font-family: var(--serif);
            font-size: clamp(1.3rem, 2.5vw, 1.8rem);
            font-weight: 400;
            color: var(--accent);
            margin-bottom: 0.3rem;
            text-transform:uppercase;
        }

        .collection-sub {
            font-family: var(--sans);
            font-size: 0.9rem;
            font-weight: 300;
            color: var(--text-secondary);
        }

        .collection-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 2rem;
        }

        .diary-card {
            cursor: pointer;
            transition: transform var(--ease);
            text-decoration: none;
            color: inherit;
            display: block;
        }

        .diary-card:hover { transform: translateY(-3px); }

        .diary-card-disabled {
            opacity: 0.4;
            cursor: default;
        }

        .diary-card-disabled:hover { transform: none; }

        .diary-card-cover {
            width: 100%;
            aspect-ratio: 5/4;
            background: var(--bg-scan);
            border-radius: 2px;
            margin-bottom: 0.6rem;
            overflow: hidden;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 6px var(--shadow-sm);
        }

        .diary-card-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .diary-card-nr {
            position: absolute;
            bottom: 0.4rem;
            right: 0.5rem;
            font-family: var(--mono);
            font-size: 0.6rem;
            color: var(--white);
            background: rgba(0,0,0,0.45);
            padding: 0.15rem 0.4rem;
            border-radius: 2px;
            letter-spacing: 0.04em;
        }

        .diary-card-title {
            font-family: var(--serif);
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--text);
            margin-bottom: 0.15rem;
        }

        .diary-card-meta {
            font-family: var(--sans);
            font-size: 0.68rem;
            color: var(--text-muted);
            margin-bottom: 0.15rem;
        }

        .diary-card-dest {
            font-family: var(--sans);
            font-size: 0.65rem;
            color: var(--text-faint);
            line-height: 1.4;
        }

        .diary-card-status {
            font-family: var(--sans);
            font-size: 0.6rem;
            font-weight: 400;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-faint);
            margin-top: 0.3rem;
        }

        /* ═══ DIARY INTRO ═══ */
        .diary-intro-section {
            padding: 7rem 2.5rem 4rem;
            max-width: 1400px;
            margin: 0 auto;
        }

        .diary-pages-section {
            margin-top: 3rem;
        }

        .diary-pages-heading {
            font-family: var(--serif);
            font-size: 1.2rem;
            font-weight: 400;
            color: var(--text);
            margin-bottom: 1.5rem;
        }

        /* ═══ PAGE GRID ═══ */
        .index-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 1.75rem;
        }

        .index-card {
            cursor: pointer;
            transition: transform var(--ease);
            text-decoration: none;
            color: inherit;
            display: block;
        }

            .index-card:hover {
                transform: translateY(-3px);
            }

        .index-card-thumb {
            width: 100%;
            aspect-ratio: 5/4;
            background: var(--bg-scan);
            border-radius: 1px;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 4px var(--shadow-sm);
            overflow: hidden;
        }

            .index-card-thumb img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            .index-card-thumb .ic-num {
                font-family: var(--mono);
                font-size: 0.7rem;
                color: var(--text-faint);
            }

        .index-card-title {
            font-family: var(--serif);
            font-size: 0.88rem;
            font-weight: 400;
            color: var(--text);
        }

        .index-card-meta {
            font-family: var(--sans);
            font-size: 0.65rem;
            color: var(--text-muted);
        }

        /* ═══ PANEL SEITEN-BLÖCKE (links / rechts untereinander) ═══ */
        .panel-side-block {
            margin-bottom: 1.5rem;
        }

        .panel-side-heading {
            font-family: var(--sans);
            font-size: 0.58rem;
            font-weight: 600;
            letter-spacing: 0.22em;
            text-transform: uppercase;
            color: var(--accent);
            border-bottom: 1px solid var(--border-light);
            padding-bottom: 0.4rem;
            margin-bottom: 1rem;
        }

        /* ═══ KEYBOARD HINTS ═══ */
        .kbd-hint {
            position: fixed;
            bottom: 14px;
            right: 1.5rem;
            z-index: 80;
            display: none;
            align-items: center;
            gap: 0.6rem;
            font-family: var(--sans);
            font-size: 0.8rem;
            color: var(--text-secondary);
            letter-spacing: 0.04em;
            opacity: 0.6;
        }

        .kbd {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 20px;
            height: 20px;
            padding: 0 4px;
            border: 1px solid var(--border);
            border-radius: 3px;
            font-family: var(--mono);
            font-size: 1.0rem;
            background: var(--bg-warm);
            color: var(--text-secondary);
        }
        .kbd2 {font-size:1.2rem;padding: 0 4px 0 4px;}

        /* ═══ LOADER ═══ */
        .loader-overlay {
            position: fixed;
            inset: 0;
            z-index: 300;
            background: var(--white);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.5s ease;
        }

            .loader-overlay.fade-out {
                opacity: 0;
                pointer-events: none;
            }

        .loader-label {
            font-family: var(--sans);
            font-size: 0.85rem;
            font-weight: 300;
            color: var(--text-muted);
            letter-spacing: 0.08em;
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% {
                opacity: 0.35;
            }

            50% {
                opacity: 1;
            }
        }

        @keyframes fadeUp {
            from {
                opacity: 0;
                transform: translateY(16px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ═══ RESPONSIVE ═══ */
        @media (max-width: 700px) {
            #introBody .bild {
                float: none;
                max-width: 100% !important;
                width: 100% !important;
                margin: 1rem 0 1.5rem;
            }

            .header-nav a[href="tagebuecher.html"] {
                font-size: 0 !important;
                width: 22px;
                height: 22px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }
            .header-nav a[href="tagebuecher.html"]::before {
                content: '';
                display: inline-block;
                width: 16px;
                height: 16px;
                background-repeat: no-repeat;
                background-size: contain;
                background-position: center;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Ccircle cx='3' cy='6' r='1'/%3E%3Ccircle cx='3' cy='12' r='1'/%3E%3Ccircle cx='3' cy='18' r='1'/%3E%3C/svg%3E");
            }
            .header-nav a[href="tagebuecher.html"]:hover::before,
            .header-nav a[href="tagebuecher.html"].active::before {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Ccircle cx='3' cy='6' r='1'/%3E%3Ccircle cx='3' cy='12' r='1'/%3E%3Ccircle cx='3' cy='18' r='1'/%3E%3C/svg%3E");
            }
            .header-nav a[href="tagebuecher.html"]::after { display: none; }

            .nav-word-intro { display: none; }

            #navViewer {
                font-size: 0 !important;
                width: 22px;
                height: 22px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }
            #navViewer::before {
                content: '';
                display: inline-block;
                width: 16px;
                height: 16px;
                background-repeat: no-repeat;
                background-size: contain;
                background-position: center;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
            }
            #navViewer:hover::before,
            #navViewer.active::before {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
            }
            #navViewer::after { display: none; }
        }

        @media (max-width: 1000px) {
            .kbd-hint { display: none !important; }

            /* Erster Nav-Link (Einführung) → Haus-Icon */
            .header-nav > a:first-child {
                font-size: 0 !important;
                width: 22px;
                height: 22px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }
            .header-nav > a:first-child::before {
                content: '';
                display: inline-block;
                width: 16px;
                height: 16px;
                background-repeat: no-repeat;
                background-size: contain;
                background-position: center;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12L12 3l9 9'/%3E%3Cpath d='M9 21V12h6v9'/%3E%3Cpath d='M3 12v9h18v-9'/%3E%3C/svg%3E");
            }
            .header-nav > a:first-child.active::before {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12L12 3l9 9'/%3E%3Cpath d='M9 21V12h6v9'/%3E%3Cpath d='M3 12v9h18v-9'/%3E%3C/svg%3E");
            }
            .header-nav > a:first-child:hover::before {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12L12 3l9 9'/%3E%3Cpath d='M9 21V12h6v9'/%3E%3Cpath d='M3 12v9h18v-9'/%3E%3C/svg%3E");
            }
            .header-nav > a:first-child::after { display: none; }
        }

        @media (max-width: 1200px) {
            .collection-grid {
                grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            }
        }

        @media (max-width: 960px) {
            :root { --panel-w: 300px; }
            .intro-meta-row { gap: 1rem; }
            .intro-subtitle { margin-bottom: 1.5rem; }
            .panel-field { margin-bottom: 1rem; }
            .transcription-area { font-size: 0.95rem; line-height: 1.75; }
        }

        /* ═══ FOOTER-LEISTE ═══ */

        .site-footer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 90;
            background: rgba(255,255,255,0.96);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-top: 1px solid var(--border-light);
        }
        .site-footer a {color:#948466;  }

        .site-footer-inner {
            max-width: 1800px;
            margin: 0 auto;
            padding: 0.5rem 2.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .footer-logo {
            height: 36px;
            width: auto;
            object-fit: contain;
        }

        /* Seiten-Body genug Abstand nach unten */
        .intro-section {
            padding-bottom: 80px;
        }

        @media (max-width: 600px) {
            .site-footer-inner { padding: 0.4rem 1rem; }
            .footer-logo { height: 26px; }
        }

        @media (max-width: 500px) {
            .header-nav a[href="tagebuecher.html"] {
                font-size: 0 !important;
                width: 22px;
                height: 22px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }
            .header-nav a[href="tagebuecher.html"]::before {
                content: '';
                display: inline-block;
                width: 16px;
                height: 16px;
                background-repeat: no-repeat;
                background-size: contain;
                background-position: center;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Ccircle cx='3' cy='6' r='1'/%3E%3Ccircle cx='3' cy='12' r='1'/%3E%3Ccircle cx='3' cy='18' r='1'/%3E%3C/svg%3E");
            }
            .header-nav a[href="tagebuecher.html"]:hover::before,
            .header-nav a[href="tagebuecher.html"].active::before {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Ccircle cx='3' cy='6' r='1'/%3E%3Ccircle cx='3' cy='12' r='1'/%3E%3Ccircle cx='3' cy='18' r='1'/%3E%3C/svg%3E");
            }
            .header-nav a[href="tagebuecher.html"]::after { display: none; }

            /* "Einführung" ausblenden → nur noch "Nr. X" */
            .nav-word-intro { display: none; }

            /* "Nr. X Lesen" → Buch-Icon */
            #navViewer {
                font-size: 0 !important;
                width: 22px;
                height: 22px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }
            #navViewer::before {
                content: '';
                display: inline-block;
                width: 16px;
                height: 16px;
                background-repeat: no-repeat;
                background-size: contain;
                background-position: center;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
            }
            #navViewer:hover::before,
            #navViewer.active::before {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948466' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
            }
            #navViewer::after { display: none; }
        }

        /* ═══ PANEL-LOGO-LEISTE ═══ */
        .panel-logo-bar {
            margin-top: auto;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            padding: 0.4rem 1.25rem;
            padding: 0.4rem 0 0 0rem;
            border-top: 1px solid var(--border-light);
            background: var(--bg);
        }

        .panel-logo {
            height: 22px;
            width: auto;
            object-fit: contain;
            opacity: 0.7;
        }

                @media (max-width: 768px) {
            .viewer-layout {
                flex-direction: column;
            }

            /* Viewer: volle Höhe, festes Layout */
            .viewer-section {
                height: calc(100vh - 56px);
                min-height: 0;
                overflow: hidden;
            }

            .viewer-main {
                flex: 1 1 0;
                min-height: 0;
                height: 0;
                overflow: hidden;
            }

            .viewer-layout {
                height: 100%;
            }

            /* Bild: 42% der Viewport-Höhe, steht oben */
            .image-area {
                height: 42vh;
                flex: none;
                overflow: hidden;
            }

            /* Panel: restliche Höhe, scrollbar */
            .side-panel {
                width: 100% !important;
                border-left: none;
                border-top: 1px solid var(--border-light);
                flex: 1 1 0;
                min-height: 0;
                max-height: none;
                overflow-y: auto;
            }

                .side-panel.collapsed {
                    flex: 0 0 0;
                    max-height: 0;
                    width: 100% !important;
                }

            /* "Seiten"-Toggle fixed am unteren Rand */
            .thumb-toggle-btn {
                position: fixed;
                bottom: 0;
                left: 50%;
                transform: translateX(-50%);
                border-radius: 16px 16px 0 0;
                z-index: 50;
            }

            .thumb-bar {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 49;
            }

            /* Alles im Panel gemeinsam scrollen */
            .panel-header-row {
                flex-shrink: 1;
                margin-bottom: 1rem;
            }

            .panel-info {
                overflow-y: visible;
                flex: none;
            }

            .panel-logo-bar {
                margin-top: 1.5rem;
            }

                .side-panel.collapsed {
                    max-height: 0;
                    width: 100% !important;
                }

            .panel-toggle-btn { display: none !important; }

            .header-inner { padding: 0 1rem; }
            .header-nav a { font-size: 0.65rem; }
            .breadcrumb-sep { font-size: 1.4rem; margin: -0.4rem 0.3rem 0; }

            .intro-section { padding: 5.5rem 1.25rem 2.5rem; }
            .diary-intro-section { padding: 5.5rem 1.25rem 2.5rem; }
            .collection-section { padding: 5.5rem 1.25rem 2.5rem; }

            .collection-grid {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 1.25rem;
            }

            .scan-container { inset: 0.5rem; }

            .nav-arrow { width: 36px; height: 36px; }

            /* Footer nicht mehr fixed auf Mobile */
            .site-footer {
                position: static;
                border-top: 1px solid var(--border-light);
            }
            .site-footer-inner {
                padding: 0.75rem 1.25rem;
            }
            .intro-section {
                padding-bottom: 1rem;
            }
            .nav-arrow.prev { left: 0.5rem; }
            .nav-arrow.next { right: 0.5rem; }

            .panel-page-label { white-space: normal; }
            .transcription-area { font-size: 0.9rem; }
        }

        @media (max-width: 480px) {
            .header-nav .breadcrumb-diary { display: none; }
            .collection-grid {
                grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
                gap: 1rem;
            }
            .diary-card-dest { display: none; }
            .intro-meta-row { flex-direction: column; gap: 0.75rem; }
            .panel-side-block + .panel-side-block { margin-top: 0.5rem; }
        }