        body {
            max-width: 1600px;
            margin: auto auto;
            font-size: 16px;
            line-height: 1.5;
            font-family: "Noto Sans",Verdana,Arial,"Arial Unicode MS",sans-serif !important;
        }
        .navbar-nav {
            flex-wrap: wrap;
        }
        .navbar {
            background: linear-gradient(135deg, #343d4a 0%, #1f2937 100%) !important;
            display: flex;
        }
        .navbar a {
            color: white;
            text-decoration: none;
        }
        .navbar>.container-fluid {
            display: flex;
            flex-wrap: inherit;
            align-items: center;
            justify-content: space-between;
            width: 100%;
        }
        .navbar-brand {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .navbar-tools {
            margin-left: auto;
        }
        #nav-title {
            display: flex;
            flex-direction: column;
            line-height: 1.2;
        }
.document.htmlDoc {
    font-family: "Times New Roman", Times, serif; /* Шрифт */
    font-size: var(--doc-font-size, 16pt); /* Управляется панелью читателя */
    text-align: justify; /* Выравнивание текста по ширине */
    line-height: var(--doc-line-height, 1.8); /* Управляется панелью читателя */
}

.document.htmlDoc p {
    margin: 0; /* Убираем отступы между абзацами */
    text-indent: 1.5em; /* Абзацный отступ */
}

.document.htmlDoc h1,
.document.htmlDoc h2,
.document.htmlDoc h3,
.document.htmlDoc h4,
.document.htmlDoc h5,
.document.htmlDoc h6 {
    margin-top: 1em; /* Отступ сверху для заголовков */
    margin-bottom: 0.5em; /* Опционально: отступ снизу для заголовков */
    font-family: inherit; /* Наследуем шрифт от родителя */
    font-size: inherit; /* Наследуем размер шрифта (опционально) */
    text-align: center; /* Центрируем заголовки */
}

        @import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');

        #panel {
            width: 100%;
            max-width: 500px;
            border: 1px solid #ccc;
            background-color: #ffffff;
            font-size: 14px;
            font-family: Arial, sans-serif;
            padding: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            margin: 20px auto;
            text-align: center;
        }

        .control-panel {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            align-items: center;
        }

        .control-panel select,
        .control-panel input[type="range"] {
            margin: 0;
            padding: 5px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 14px;
            flex: 1 1 auto;
            min-width: 150px;
        }

        .control-panel input[type="range"] {
            cursor: pointer;
        }

        .control-panel label {
            font-weight: bold;
            text-align: center;
        }

        .font-size-wrapper {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .font-size-display {
            font-size: 16px;
            color: #555;
            min-width: 50px;
            text-align: left;
        }

        @font-face {
            font-family: 'Lobster';
            src: url('https://fonts.gstatic.com/s/lobster/v23/neILzCirqoswsqX9zoKmM4MwWQI.woff2') format('woff2');
        }

#smallFooter {
    position: fixed; /* "Прилипает" к нижнему краю контейнера */
    bottom: 10px; /* Расстояние от нижнего края страницы */
    margin-left: 10px; /* Отступ слева */
    font-size: 0.8rem; /* Небольшой размер текста */
    background-color: white; /* Белый фон */
    padding: 5px 10px; /* Внутренние отступы для удобства */
    border: 1px solid #ccc; /* Светлая граница */
    border-radius: 5px; /* Закруглённые углы */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Лёгкая тень */
    text-align: center;
    opacity: 0.7; /* Полупрозрачность */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Плавность для hover-эффекта */
    display: inline-block; /* Убедиться, что блок не растягивается на всю ширину */
}

#smallFooter:hover {
    opacity: 1; /* Увеличение непрозрачности при наведении */
    transform: scale(1.05); /* Лёгкое увеличение */
}

#smallFooter a {
    color: #000; /* Нейтральный цвет текста */
    text-decoration: none; /* Убираем подчёркивание */
}

#smallFooter a:hover {
    text-decoration: underline; /* Подчёркивание при наведении */
}

/* Unified panel styling */
#panel {
    width: 100%;
    max-width: 600px;
    border: 1px solid #ddd;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    font-size: 14px;
    font-family: Arial, sans-serif;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    margin: 15px auto 20px;
}

#panel .control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* Download buttons inside panel */
#panel .download-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

#panel .download-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
}

#panel .download-label svg {
    color: #777;
}

#panel .download-buttons {
    display: flex;
    gap: 6px;
}

#panel .download-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    background: #fff !important;
    color: #444 !important;
    border: 1px solid #ccc;
    transition: all 0.15s ease;
}

#panel .download-buttons .btn:hover {
    background: #f0f0f0 !important;
    border-color: #999;
}

#panel .download-buttons .btn img {
    height: 16px !important;
    width: auto !important;
}

/* Hide leftover disclaimer chrome once buttons live in #panel */
#docDisclaimer:not(:has(.download-panel)),
body:has(#panel .download-panel) #docDisclaimer {
    display: none !important;
}

/* Fallback: keep PDF/EPUB visible in-place if the panel move has not run yet */
body:not(:has(#panel .download-panel)) #docDisclaimer:has(.download-panel) {
    display: flex !important;
    width: 100%;
    max-width: 600px;
    margin: 15px auto 20px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 14px;
    font-family: Arial, sans-serif;
    justify-content: center;
}

body:not(:has(#panel .download-panel)) #docDisclaimer .download-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

body:not(:has(#panel .download-panel)) #docDisclaimer .download-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
}

body:not(:has(#panel .download-panel)) #docDisclaimer .download-buttons {
    display: flex;
    gap: 6px;
}

body:not(:has(#panel .download-panel)) #docDisclaimer .download-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    background: #fff !important;
    color: #444 !important;
    border: 1px solid #ccc;
}

body:not(:has(#panel .download-panel)) #docDisclaimer .download-buttons .btn img {
    height: 16px !important;
    width: auto !important;
}

body.dark-mode:not(:has(#panel .download-panel)) #docDisclaimer:has(.download-panel) {
    background: #252525 !important;
    border-color: #3d3d3d !important;
}

body.dark-mode:not(:has(#panel .download-panel)) #docDisclaimer .download-label {
    color: #d4d0cb;
}

body.dark-mode:not(:has(#panel .download-panel)) #docDisclaimer .download-buttons .btn {
    background: #2a2a2a !important;
    color: #d4d0cb !important;
    border-color: #3d3d3d !important;
}

/* Mobile panel */
@media (max-width: 600px) {
    #panel {
        margin: 80px 10px 10px 10px;
        padding: 10px 12px;
        max-width: none;
    }

    body:not(:has(#panel .download-panel)) #docDisclaimer:has(.download-panel) {
        margin: 80px 10px 10px 10px;
        padding: 10px 12px;
        max-width: none;
    }
    
    #panel .control-panel {
        gap: 8px;
    }
    
    #panel .download-panel {
        width: 100%;
        justify-content: center;
    }
}

/* Year filter badges */
.year-filter-bar {
    padding: 10px 0 8px;
}
.year-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr));
    gap: 6px;
}
.year-filter-decades {
    grid-template-columns: repeat(auto-fill, minmax(4.3rem, 1fr));
}
.year-filter-years {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(128, 128, 128, 0.25);
}
.year-filter-row[hidden] {
    display: none;
}
.year-badge {
    padding: 3px 11px;
    border-radius: 20px;
    border: 1px solid #c0b8b0;
    background: transparent;
    color: #555;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    line-height: 1.7;
}
.year-badge:hover {
    background: #ede8f5;
    border-color: #9c7cbf;
    color: #5a3a8a;
}
.year-badge.active {
    background: #6b3fa0;
    border-color: #6b3fa0;
    color: #fff;
}
body.dark-mode .year-badge {
    border-color: #484848;
    color: #aaa;
}
body.dark-mode .year-badge:hover {
    background: #3a2e55;
    border-color: #7b5fa0;
    color: #c8a8f0;
}
body.dark-mode .year-badge.active {
    background: #7b4fc0;
    border-color: #7b4fc0;
    color: #fff;
}

/* AI Chat icon for directory listing */
.icon-ai-chat {
    background-image: url("../images/icons/ai-chat.svg");
}

.icon-doctrines {
    background-image: url("../images/icons/timeline.svg");
}

/* The Archivist is off while html.archivist-off is set from js/archivist-flag.js. */
html.archivist-off #btnAiChat,
html.archivist-off .archivist-entry,
html.archivist-off #contents li.item:has(> a[href="chat.html"]) {
    display: none !important;
}

/* Archive Assistant button in search bar */
#btnAiChat {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    margin-left: 6px;
    border-radius: 8px;
    color: #4f6f9a;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, transform 0.15s;
}
#btnAiChat:hover {
    color: #1d4ed8;
    background: rgba(79, 111, 154, 0.12);
    transform: scale(1.1);
}
body.dark-mode #btnAiChat {
    color: #6b8cbe;
}
body.dark-mode #btnAiChat:hover {
    color: #93c5fd;
    background: rgba(107, 140, 190, 0.15);
}

.search-mode {
    margin: 0.35rem 0.4rem 0.9rem 0;
}
.search-mode-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.search-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.2rem 0;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    cursor: pointer;
}
.search-mode-option input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.search-mode-option strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
}
.search-mode-option small {
    display: block;
    color: #6c757d;
    font-size: 0.78rem;
    line-height: 1.35;
}
.search-mode-option:has(input:checked) {
    background: rgba(52, 61, 74, 0.08);
}
body.dark-mode .search-mode-option small { color: #adb5bd; }
body.dark-mode .search-mode-option:has(input:checked) {
    background: rgba(142, 176, 224, 0.14);
}

#startVectorSearch {
    vertical-align: baseline;
    margin-left: 0.4em;
}
#resultsHeader.vector-mode #startVectorSearch.active {
    background: #343d4a;
    color: #fff;
    border-color: #343d4a;
}
#resultsHeader.vector-mode #rankSelector,
#resultsHeader.vector-mode #resultsSort,
#resultsHeader.vector-mode #exactSearchLimitNote {
    display: none !important;
}
@media only screen and (max-width: 480px) {
    #startVectorSearch {
        display: block;
        margin-top: 0.5em;
        margin-left: 0;
        width: 100%;
    }
}

#vectorResults {
    margin-top: 0.5rem;
}
.vector-status {
    margin: 0 0 0.75rem;
    color: #495057;
    font-size: 0.95rem;
}
.vector-card {
    margin: 0 0 1.15rem;
    padding: 1.15rem 1.35rem 1.2rem;
    border: 1px solid #e5e1da;
    border-radius: 10px;
    background: #fff;
}
.vector-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
    margin-bottom: 0.35rem;
}
.vector-score {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
    white-space: nowrap;
}
.vector-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}
.vector-title:hover { text-decoration: underline; }
.vector-meta {
    flex-basis: 100%;
    font-size: 0.82rem;
    color: #6c757d;
}
.vector-excerpt {
    margin: 0.7rem 0 0.95rem;
    font-size: 1.125rem;
    line-height: 1.65;
    white-space: pre-wrap;
}
.vector-excerpt mark {
    background: #fff3bf;
    color: inherit;
    padding: 0 0.12em;
    border-radius: 2px;
}
.vector-translate-all {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    cursor: pointer;
}
.vector-error {
    color: #9b1c1c;
    padding: 0.4rem 0;
}
.vector-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.vector-card-foot .btn { font-size: 0.82rem; }
.vector-more { margin-top: 0.25rem; }
body.dark-mode .vector-card {
    background: #1f2430;
    border-color: #3a4150;
}
body.dark-mode .vector-title { color: #e8eaed; }
body.dark-mode .vector-status,
body.dark-mode .vector-meta { color: #adb5bd; }
body.dark-mode .vector-score { color: #93c5fd; }
body.dark-mode .vector-excerpt mark {
    background: #5c4a1f;
    color: #fff8e1;
}
body.dark-mode #resultsHeader.vector-mode #startVectorSearch.active {
    background: #8eb0e0;
    color: #1a1a1a;
    border-color: #8eb0e0;
}
body.dark-mode .vector-error { color: #f0a8a8; }

/* OCR publication hero cover at top of article */
.publication-hero-cover {
    margin: 0 0 1.5rem;
    text-align: center;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}
.publication-hero-cover img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
body.dark-mode .publication-hero-cover img {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.search-status {
    color: #6c757d;
    padding: 0.5rem 0;
}
.search-empty {
    padding: 1.5rem 0;
    max-width: 640px;
}
.search-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.search-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.search-empty-hint {
    color: #6c757d;
    font-size: 0.9rem;
}
body.dark-mode .search-status,
body.dark-mode .search-empty-hint { color: #adb5bd; }

/* Search mode: radios in the sidebar on a wide screen, a segmented switch above results on a phone. */
#startExactSearch,
#startVectorSearch {
    display: none !important;
}
.mode-switch {
    display: none;
}
@media (max-width: 800px) {
    .mode-switch {
        display: flex;
        margin: 0 0 0.6rem;
        padding: 3px;
        gap: 3px;
        border-radius: 10px;
        background: rgba(52, 61, 74, 0.08);
    }
    .mode-switch button {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.4rem 0.5rem;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: inherit;
        font-size: 0.9rem;
        font-weight: 500;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mode-switch[data-mode="keyword"] button[data-mode="keyword"],
    .mode-switch[data-mode="exact"] button[data-mode="exact"],
    .mode-switch[data-mode="ai"] button[data-mode="ai"] {
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
        font-weight: 600;
    }
    body.dark-mode .mode-switch {
        background: rgba(255, 255, 255, 0.07);
    }
    body.dark-mode .mode-switch[data-mode="keyword"] button[data-mode="keyword"],
    body.dark-mode .mode-switch[data-mode="exact"] button[data-mode="exact"],
    body.dark-mode .mode-switch[data-mode="ai"] button[data-mode="ai"] {
        background: #3a4150;
        color: #fff;
        box-shadow: none;
    }
}

/* Comfortable line length for result excerpts on a wide screen. */
#resultsHeader,
#contents > .results {
    max-width: 52rem;
}

@media (max-width: 600px) {
    #contents ul.result {
        padding-left: 0;
    }
    #contents ul.resultItems {
        padding-left: 0.75rem;
    }
}

/* ---- Browser translation (Google/Chrome/Yandex wrap text in <font>, strings get longer) ---- */

/* style.min.css sets width:100% here while translated; with the sidebar margin that pushes content off-screen. */
html.translated-ltr #regionBodyInner,
html.translated-rtl #regionBodyInner {
    width: auto;
}

#rankSelector {
    display: inline-block;
    max-width: 100%;
    min-width: 0;
    vertical-align: middle;
}
#regionBodyInner:has(.search-empty) #rankSelector {
    display: none;
}
#rankSelector select {
    max-width: 100%;
    text-overflow: ellipsis;
}

#searchRefineForm li:has(> input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
}
#searchRefineForm li > input[type="checkbox"] {
    flex: none;
    margin-top: 0.3em;
}
#searchRefineForm li > input[type="checkbox"] + label,
#searchRefineForm li > label:has(+ input[type="checkbox"]) {
    flex: 1 1 auto;
    min-width: 0;
}

#searchRefineForm .d-flex:has(#minYear) {
    align-items: flex-end;
}
#searchRefineForm .d-flex:has(#minYear) .form-group {
    flex: 1 1 0;
    min-width: 0;
}
#searchRefineForm .d-flex:has(#minYear) .form-control {
    width: 100% !important;
    max-width: 7.5rem;
}

.search-mode-option > span,
.search-mode-option small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.navbar-brand,
#nav-title {
    min-width: 0;
}
#nav-title .main-title,
#nav-title .title-years {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-tools {
    flex: none;
}

#btnSearch {
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
#btnSearch .btn-label {
    display: none;
}
#btnSearch[data-mode="keyword"] .btn-label[data-mode="keyword"],
#btnSearch[data-mode="exact"] .btn-label[data-mode="exact"],
#btnSearch[data-mode="ai"] .btn-label[data-mode="ai"] {
    display: inline;
}

.bottom-nav .nav-item {
    min-width: 0;
    padding-left: 2px;
    padding-right: 2px;
}
.bottom-nav .nav-item > span {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

#resultsHeader {
    min-width: 0;
}
#resultsHeader,
.searchResult,
.search-empty,
#exactSearchLimitNote {
    overflow-wrap: anywhere;
}

/* Justified text leaves wide gaps with long translated words; translators set <html lang>, so hyphenation follows the target language. */
html.translated-ltr .document.htmlDoc,
html.translated-rtl .document.htmlDoc {
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}
@media (max-width: 600px) {
    .document.htmlDoc {
        -webkit-hyphens: auto;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    /* Not every browser ships hyphenation dictionaries; without them justify leaves rivers on a phone. */
    html.translated-ltr .document.htmlDoc,
    html.translated-rtl .document.htmlDoc {
        text-align: start;
    }
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* Text variants of an issue (official jw.org text / OCR of the scan): a segmented
   switch at the start of the #panel card, before the download buttons */
.variant-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

#panel .variant-toggle {
    padding-right: 14px;
    border-right: 1px solid #ddd;
}

.variant-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
}

.variant-label svg {
    color: #777;
}

.variant-switch {
    display: inline-flex;
    padding: 2px;
    background: #e9e9ec;
    border-radius: 7px;
}

.variant-switch button {
    padding: 4px 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.variant-switch button:hover:not(.active) {
    color: #222;
}

.variant-switch button.active {
    background: #fff;
    color: #222;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    cursor: default;
}

/* Narrow cards: switch and downloads stack, each centered */
@media screen and (max-width: 600px) {
    #panel .variant-toggle {
        width: 100%;
        justify-content: center;
        padding: 0 0 10px;
        border-right: 0;
        border-bottom: 1px solid #ddd;
    }
}

body.dark-mode #panel .variant-toggle {
    border-color: #3d3d3d;
}

body.dark-mode .variant-label {
    color: #d4d0cb;
}

body.dark-mode .variant-label svg {
    color: #a8a49f;
}

body.dark-mode .variant-switch {
    background: #1b1b1b;
}

body.dark-mode .variant-switch button {
    color: #a8a49f;
}

body.dark-mode .variant-switch button:hover:not(.active) {
    color: #d4d0cb;
}

body.dark-mode .variant-switch button.active {
    background: #3a3a3a;
    color: #f0ece6;
    box-shadow: none;
}

/* Related Works (category rel): notes explaining the section, its series and each work */
.related-note {
    border-left: 4px solid #b8860b;
    background: #fbf7ec;
    color: #3d3420;
    padding: 12px 16px;
    margin: 8px 0 16px;
    border-radius: 4px;
    max-width: 860px;
    line-height: 1.5;
}
.related-note p { margin: 0 0 8px; }
.related-note p:last-child { margin-bottom: 0; }
.related-note .related-lead { font-weight: 600; }
.related-note .related-badge {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a6200;
}
.related-note .related-author { font-style: italic; }
.related-note .related-small { font-size: 0.9rem; }
.related-note summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.related-note a { color: #7a5200; text-decoration: underline; }
body.dark-mode .related-note { background: #2b261a; color: #e6dcc3; border-left-color: #c9a227; }
body.dark-mode .related-note .related-badge { color: #e0b84a; }
body.dark-mode .related-note a { color: #e0b84a; }

/* Big documents: blocks off screen skip layout until they are shown (prepareDocumentBlocks) */
.doc-cv > * {
    content-visibility: auto;
    contain-intrinsic-size: auto var(--doc-block-h, 300px);
}

/* Parts of a paginated book (docPagerHtml), above and below the text */
.doc-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 720px;
    margin: 12px auto;
}
.doc-pager-bottom { margin-top: 28px; }
.doc-pager-btn,
.doc-pager-select {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 7px;
    background: #fff;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}
.doc-pager-btn { white-space: nowrap; cursor: pointer; }
.doc-pager-btn:hover:not(:disabled) { background: #f1f1f3; }
.doc-pager-btn:disabled { opacity: 0.4; cursor: default; }
.doc-pager-select { flex: 0 1 440px; min-width: 0; padding: 6px 8px; text-overflow: ellipsis; }
@media screen and (max-width: 600px) {
    .doc-pager-btn span { display: none; }
}
body.dark-mode .doc-pager-btn,
body.dark-mode .doc-pager-select { background: #1b1b1b; border-color: #3d3d3d; color: #d4d0cb; }
body.dark-mode .doc-pager-btn:hover:not(:disabled) { background: #262626; }

/* "Continue reading" offer when a document with a saved place opens (offerReadPosition) */
.read-resume {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 720px;
    margin: 12px auto;
    padding: 10px 14px;
    border: 1px solid #c9d8f5;
    border-radius: 8px;
    background: #eef4ff;
    color: #223;
    font-size: 14px;
}
.read-resume-text { flex: 1 1 auto; min-width: 0; }
.read-resume-go {
    padding: 5px 14px;
    border: 0;
    border-radius: 6px;
    background: #2f6fde;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.read-resume-close { border: 0; background: transparent; color: #667; font-size: 20px; line-height: 1; cursor: pointer; }
/* On phones the first block clears the fixed header (#panel does the same) */
@media (max-width: 600px) {
    .read-resume { margin: 80px 10px 0; }
    .read-resume + #panel { margin-top: 10px; }
}
body.dark-mode .read-resume { background: #1f2a3a; border-color: #33445f; color: #dde3ee; }
body.dark-mode .read-resume-close { color: #a8b0bf; }

/* Phones: the breadcrumb box (#currentFileBox) is fixed over the page top; its height comes from syncCurrentFileBoxOffset */
@media screen and (max-width: 800px) {
    #regionBodyInner { padding-top: calc(0.75em + var(--current-file-box-h, 0px)); }
}

/* Phones: wide tables scroll inside themselves instead of widening the whole page */
@media screen and (max-width: 800px) {
    .document table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Header motto (in place of the year span, 2026-11-03) */
#nav-title .title-years.title-quote {
    font-style: italic;
    letter-spacing: 0.01em;
}
