/* Тема «память о ВОВ»: шинель/бумага, георгиевская лента в акцентах, типографика PT Serif + Oswald */

:root {
    --ink: #1a1714;
    --ink-soft: #3d342c;
    --paper: #e8dfd0;
    --paper-card: #f3ebe0;
    --paper-dark: #d4c7b4;
    --khaki: #4e5644;
    --khaki-deep: #2f3428;
    --red-star: #a61018;
    --red-deep: #7a0c12;
    --gold: #c9a24d;
    --gold-dim: #9a7b38;
    --border: #b6a892;
    --shadow: 0 8px 28px rgba(26, 23, 20, 0.18);
    --ribbon-orange: #ff9b00;
    --ribbon-black: #1a1a1a;
    --font-serif: "PT Serif", Georgia, "Times New Roman", serif;
    --font-head: "Oswald", "Arial Narrow", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.5rem;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: var(--khaki-deep);
    color: #fff;
    font-family: var(--font-head);
    font-size: 0.85rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 2px;
    box-shadow: var(--shadow);
}

.skip-link:focus {
    left: 0.5rem;
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

body.theme-vov {
    position: relative;
    margin: 0;
    font-family: var(--font-serif);
    background-color: var(--paper);
    background-image:
        linear-gradient(180deg, rgba(47, 52, 40, 0.04) 0%, transparent 32%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(74, 85, 68, 0.04) 2px,
            rgba(74, 85, 68, 0.04) 3px
        );
    color: var(--ink);
    line-height: 1.58;
}

#main-content:focus {
    outline: none;
}

#main-content:focus-visible {
    outline: 2px solid var(--khaki);
    outline-offset: 4px;
}

/* Ссылки в контенте; пункты меню в шапке не в .main-area — им не задаётся этот цвет */
.main-area a:not(.btn) {
    color: var(--khaki-deep);
}

.main-area a:not(.btn):hover {
    color: var(--red-star);
}

a.btn,
a.btn:hover,
a.btn:focus-visible {
    color: #fff;
}

a.btn-outline {
    color: var(--khaki-deep);
}

a.btn-outline:hover,
a.btn-outline:focus-visible {
    color: var(--red-star);
}

code {
    font-size: 0.88em;
    background: rgba(47, 52, 40, 0.08);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
}

.wrap {
    max-width: 58rem;
    margin: 0 auto;
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

/* Шапка */
.site-header {
    background: linear-gradient(180deg, var(--khaki-deep) 0%, #252a1f 48%, var(--khaki-deep) 100%);
    color: var(--paper-card);
    border-bottom: 4px solid var(--gold);
    box-shadow: var(--shadow);
    position: relative;
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--ribbon-black) 0 33.33%,
        var(--ribbon-orange) 33.33% 66.66%,
        #c4c4c4 66.66% 100%
    );
    opacity: 0.85;
    pointer-events: none;
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0 1rem;
}

.brand-mark {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.brand-star {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    flex-shrink: 0;
}

.brand-text h1 {
    margin: 0 0 0.35rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.theme {
    margin: 0;
    color: rgba(243, 235, 224, 0.82);
    font-size: 0.86rem;
    max-width: 44rem;
    line-height: 1.45;
}

.nav-toggle {
    display: none;
    background: var(--red-star);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
}

.site-nav a {
    color: var(--paper-card);
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 162, 77, 0.35);
    color: #fff;
}

.site-nav a.is-active {
    background: rgba(166, 16, 24, 0.35);
    border-color: rgba(201, 162, 77, 0.55);
    color: #fff;
}

.main-area {
    padding-bottom: max(2.75rem, calc(env(safe-area-inset-bottom, 0px) + 1.5rem));
}

/* Карточки — «документ на столе» */
.card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.35rem 1.5rem;
    margin: 1rem 0;
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
    opacity: 0.9;
    border-radius: 2px 0 0 2px;
}

/* Не трогаем лайтбокс: иначе position:fixed превращается в relative и оверлей не на весь экран */
.card > *:not(.gallery-lightbox) {
    position: relative;
}

.card h2,
.card h3 {
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.card h2 {
    margin-top: 0;
    font-size: 1.22rem;
    text-transform: uppercase;
    color: var(--khaki-deep);
}

.lead-card h2 {
    margin-top: 0;
}

.muted {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* Герой главной: один слой сетки — фон и текст в одной ячейке, иначе белый текст уезжает на «бумагу» body */
.hero.hero--vov {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, auto);
    border: 1px solid var(--border);
    border-radius: 2px;
    margin-top: 1.35rem;
    margin-bottom: 1.5rem;
    padding: 0;
    box-shadow: var(--shadow);
}

.hero--fullbleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-left: none;
    border-right: none;
    border-radius: 0;
}

.hero-bg {
    grid-column: 1;
    grid-row: 1;
    min-height: 220px;
    align-self: stretch;
    background-color: var(--khaki-deep);
    background-image:
        linear-gradient(120deg, rgba(18, 16, 14, 0.82) 0%, rgba(35, 38, 30, 0.68) 42%, rgba(55, 62, 48, 0.55) 100%),
        url("assets/img/vov-banner.svg");
    background-size: cover;
    background-position: center 35%;
}

.hero-inner {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
    align-self: center;
    padding: 2rem 1.5rem 2.25rem;
    max-width: 58rem;
    width: 100%;
    margin: 0 auto;
}

.hero-inner h2 {
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.85),
        0 2px 24px rgba(0, 0, 0, 0.65);
    margin: 0 0 0.75rem;
    font-size: 1.65rem;
    line-height: 1.15;
}

.hero-lead {
    color: #f5f2eb;
    font-size: 1.05rem;
    max-width: 40rem;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.9),
        0 1px 14px rgba(0, 0, 0, 0.55);
    margin: 0 0 1.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

/* Кнопки */
.btn {
    display: inline-block;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.82rem;
    background: var(--red-star);
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 0.55rem 1.15rem;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 0 var(--red-deep);
}

button.btn {
    appearance: none;
    -webkit-appearance: none;
}

.btn:hover {
    background: #c4141e;
    color: #fff;
}

.btn-secondary {
    background: var(--khaki);
    box-shadow: 0 2px 0 var(--khaki-deep);
}

.btn-secondary:hover {
    background: #5d684f;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--paper-card);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--khaki-deep);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(74, 85, 68, 0.1);
    color: var(--red-star);
    border-color: var(--gold-dim);
}

/* Галерея «архив» */
.gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.archive-frame {
    margin: 0;
    background: var(--paper-dark);
    border: 1px solid var(--border);
    padding: 0.65rem 0.65rem 0.5rem;
    box-shadow: var(--shadow);
}

.gallery-open {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    font: inherit;
    text-align: inherit;
    border-radius: 0;
}

.gallery-open:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.archive-frame img,
.archive-frame .gallery-img {
    width: 100%;
    height: auto;
    max-height: 14rem;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    filter: sepia(0.12) contrast(1.02);
    border: 1px solid rgba(61, 52, 44, 0.25);
}

.gallery-open .gallery-img {
    vertical-align: middle;
}

.archive-frame figcaption {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.archive-frame.placeholder {
    min-height: 11rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    border-style: dashed;
    background: repeating-linear-gradient(
        -45deg,
        rgba(74, 85, 68, 0.06),
        rgba(74, 85, 68, 0.06) 8px,
        transparent 8px,
        transparent 16px
    );
}

.archive-frame.placeholder .ph-icon {
    font-family: var(--font-head);
    font-size: 2rem;
    color: var(--gold-dim);
    opacity: 0.65;
    line-height: 1;
}

/* Лайтбокс галереи (главная) */
body.lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding:
        max(4.25rem, calc(env(safe-area-inset-top, 0px) + 3.25rem))
        max(1rem, env(safe-area-inset-right, 0px))
        max(1rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
    background: rgba(14, 12, 10, 0.94);
    cursor: zoom-out;
}

.gallery-lightbox[hidden] {
    display: none !important;
}

.gallery-lightbox-close {
    position: fixed;
    top: max(0.55rem, calc(env(safe-area-inset-top, 0px) + 0.35rem));
    right: max(0.55rem, calc(env(safe-area-inset-right, 0px) + 0.35rem));
    z-index: 20001;
    width: 3rem;
    height: 3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 4px;
    background: var(--red-star);
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    font-family: var(--font-head);
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.55);
}

.gallery-lightbox-close:hover {
    background: #c4141e;
    color: #fff;
}

.gallery-lightbox-close:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.gallery-lightbox-panel {
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: min(96vw, 52rem);
    max-height: calc(100vh - 5.75rem);
    max-height: calc(100dvh - 5.75rem);
    min-height: 0;
}

.gallery-lightbox-img {
    max-width: 100%;
    max-height: min(46vh, 480px);
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
    filter: none;
}

.gallery-lightbox-text-wrap {
    flex: 1 1 auto;
    align-self: stretch;
    min-height: 0;
    max-height: min(40vh, 24rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0.35rem 0.5rem;
    text-align: center;
}

.gallery-lightbox-caption {
    margin: 0 0 0.75rem;
    font-size: 0.93rem;
    line-height: 1.52;
    color: rgba(252, 248, 240, 0.98);
    text-align: center;
}

.gallery-lightbox-source {
    margin: 0;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    line-height: 1.48;
    color: rgba(220, 210, 195, 0.92);
    text-align: center;
}

.theme-vov .gallery-lightbox a:not(.btn) {
    color: #f2e4bc;
    font-weight: 600;
}

.theme-vov .gallery-lightbox a:not(.btn):hover {
    color: #fff;
}

@media (max-width: 40rem) {
    .gallery-lightbox-img {
        max-height: min(40vh, 360px);
    }

    .gallery-lightbox-text-wrap {
        max-height: min(48vh, 26rem);
    }
}

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0 1rem;
}

.route-list {
    margin: 0;
    padding-left: 1.2rem;
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
}

.lesson-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.lesson-card {
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1rem 1.1rem;
    background: linear-gradient(165deg, #faf6ef 0%, #ebe2d4 100%);
    box-shadow: 0 4px 14px rgba(26, 23, 20, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26, 23, 20, 0.12);
}

.lesson-card.mini {
    background: var(--paper-card);
}

.lesson-card h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-head);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lesson-card h3 a {
    color: var(--khaki-deep);
    text-decoration: none;
}

.lesson-card h3 a:hover {
    color: var(--red-star);
}

.lesson-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}

.lesson-article .pre-title {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--font-head);
    font-size: 0.72rem;
    color: var(--gold-dim);
    margin: 0 0 0.35rem;
}

.lesson-article .lead {
    font-size: 1.05rem;
    color: var(--ink-soft);
}

.lesson-epigraphs {
    margin: 1rem 0 0;
}

.lesson-pullquote {
    margin: 0 0 1rem;
    padding: 1rem 1.15rem;
    border-left: 4px solid var(--gold);
    background: rgba(74, 85, 68, 0.06);
    font-style: italic;
    color: var(--ink-soft);
}

.lesson-pullquote p {
    margin: 0 0 0.5rem;
}

.lesson-pullquote footer {
    font-style: normal;
    font-size: 0.88rem;
    color: var(--khaki-deep);
}

.lesson-highlight-cards {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.lesson-highlight-card {
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: linear-gradient(160deg, rgba(255, 252, 248, 0.9) 0%, var(--paper-card) 100%);
    box-shadow: 0 2px 10px rgba(26, 23, 20, 0.06);
}

.lesson-highlight-title {
    display: block;
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--khaki-deep);
    margin-bottom: 0.35rem;
}

.lesson-highlight-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.lesson-section {
    margin-top: 1.25rem;
}

.lesson-section h3 {
    font-family: var(--font-head);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--khaki-deep);
}

.terms-box ul,
.reflect-box ol {
    margin: 0.35rem 0 0;
}

.lesson-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.lesson-banner-strip {
    height: 7.5rem;
    border-radius: 2px;
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    background-color: var(--khaki-deep);
    background-image:
        linear-gradient(120deg, rgba(26, 23, 20, 0.55) 0%, rgba(47, 52, 40, 0.35) 100%),
        url("assets/img/vov-banner.svg");
    background-size: cover;
    background-position: center 40%;
    box-shadow: var(--shadow);
}

.breadcrumbs {
    font-size: 0.9rem;
    margin: 1rem 0 0;
}

.breadcrumbs a {
    color: var(--khaki-deep);
    font-weight: 600;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 2rem;
}

.pager-link {
    font-weight: 600;
    text-decoration: none;
    max-width: 48%;
    color: var(--khaki-deep);
}

.pager-link:hover {
    color: var(--red-star);
}

.pager-muted {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

/* Хронология — компактный вариант (если где-то остался старый класс) */
.timeline:not(.timeline-beautiful) {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline:not(.timeline-beautiful) .timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    align-items: start;
}

/* Хронология — оформленная лента */
.timeline-intro {
    position: relative;
    overflow: hidden;
}

.timeline-intro::after {
    content: "";
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8rem;
    height: 8rem;
    background: radial-gradient(circle, rgba(166, 16, 24, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.timeline-memo {
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--gold);
}

.timeline-memo-lead {
    margin-top: 0;
}

.timeline-memo-list {
    margin: 0;
    padding-left: 1.25rem;
}

.timeline-memo-list li {
    margin-bottom: 0.45rem;
}

.timeline-filter-card {
    margin-bottom: 1.25rem;
}

.timeline-filter-heading {
    font-size: 1.1rem;
    margin-top: 0;
}

.timeline-year-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.timeline-year-btn {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--khaki-deep);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.35);
}

.timeline-year-btn:hover {
    border-color: var(--khaki);
    color: var(--red-star);
}

.timeline-year-btn.is-active {
    background: var(--khaki-deep);
    color: #fff;
    border-color: var(--khaki-deep);
}

/* Выше задаётся color: #fff, но .main-area a:not(.btn) сильнее по специфичности — без этого текст «пропадает» */
.main-area a.timeline-year-btn.is-active,
.main-area a.timeline-year-btn.is-active:hover {
    color: #fff;
}

.timeline-stage {
    text-align: center;
    margin: 0.5rem 0 1.75rem;
}

.timeline-stage-label {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.75rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold-dim);
    padding: 0.35rem 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* «Дерево хронологии» */
.timeline-tree-wrap {
    margin: 0 auto 2rem;
    max-width: 52rem;
    padding: 0 0 1rem;
    background: linear-gradient(
        180deg,
        rgba(107, 125, 88, 0.06) 0%,
        transparent 18%,
        transparent 78%,
        rgba(74, 61, 50, 0.06) 100%
    );
    border-radius: 16px;
}

.timeline-canopy {
    text-align: center;
    margin: 0 0 0.25rem;
    padding: 0 0.5rem;
}

.timeline-canopy-svg {
    display: block;
    width: min(100%, 22rem);
    height: auto;
    margin: 0 auto -0.5rem;
    filter: drop-shadow(0 4px 8px rgba(47, 52, 40, 0.12));
}

.timeline-stage--in-tree {
    margin: 0 0 1.25rem;
}

.timeline-tree-tagline {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    font-style: italic;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.timeline-beautiful {
    list-style: none;
    margin: 0 auto 0;
    padding: 0 0 0 0.25rem;
    max-width: 48rem;
    position: relative;
}

.timeline-roots {
    max-width: 48rem;
    margin: 0.5rem auto 0;
    padding: 0 1rem;
}

.timeline-roots-svg {
    display: block;
    width: 100%;
    max-width: 28rem;
    height: auto;
    margin: 0 auto;
    opacity: 0.9;
}

@media (min-width: 40rem) {
    .timeline-beautiful::before {
        content: "";
        position: absolute;
        left: 1.25rem;
        top: 0.35rem;
        bottom: 0.35rem;
        width: 6px;
        border-radius: 6px;
        background: repeating-linear-gradient(
            -8deg,
            #4a3d32 0px,
            #4a3d32 3px,
            #5c4a3a 3px,
            #5c4a3a 6px,
            #3d2f24 6px,
            #3d2f24 9px
        );
        box-shadow:
            inset 1px 0 0 rgba(255, 255, 255, 0.12),
            inset -1px 0 0 rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(201, 162, 77, 0.25);
    }

    .timeline-as-tree.timeline-beautiful::before {
        background: repeating-linear-gradient(
            -8deg,
            #3f3328 0px,
            #3f3328 4px,
            #554436 4px,
            #554436 8px,
            #2e241c 8px,
            #2e241c 11px
        );
    }
}

.timeline-beautiful .timeline-item {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: start;
    margin: 0;
    padding: 0 0 1.65rem;
    position: relative;
}

.timeline-beautiful .timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-node {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.5rem;
}

.timeline-node-ring {
    position: absolute;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: 2px solid rgba(201, 162, 77, 0.45);
    top: 0.15rem;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.9;
}

.timeline-node-mark {
    position: relative;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    background: linear-gradient(155deg, #c4141e 0%, var(--red-deep) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 600;
    border: 3px solid var(--gold);
    box-shadow:
        0 4px 14px rgba(122, 12, 18, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.08);
}

.timeline-panel {
    position: relative;
    margin: 0;
    background: linear-gradient(168deg, #fdfaf5 0%, var(--paper-card) 42%, #e8dfd4 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: 2px 12px 12px 2px;
    padding: 1.1rem 1.35rem 1.2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: visible;
}

/* «Ветка» от ствола к карточке */
@media (min-width: 40rem) {
    .timeline-as-tree .timeline-panel::before {
        content: "";
        position: absolute;
        left: -14px;
        top: 50%;
        width: 14px;
        height: 22px;
        border: 2px solid transparent;
        border-left-color: rgba(90, 74, 58, 0.55);
        border-bottom-color: rgba(90, 74, 58, 0.55);
        border-radius: 0 0 0 14px;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .timeline-as-tree .timeline-item:nth-child(even) .timeline-panel::before {
        border-left-color: rgba(107, 125, 88, 0.45);
        border-bottom-color: rgba(107, 125, 88, 0.45);
    }
}

.timeline-leaf {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 10px;
    height: 14px;
    background: linear-gradient(135deg, #6b7d58 0%, #4a5a3d 100%);
    border-radius: 0 80% 0 80%;
    opacity: 0.35;
    transform: rotate(-25deg);
    pointer-events: none;
}

.timeline-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(26, 23, 20, 0.14);
}

.timeline-as-tree .timeline-panel:hover .timeline-leaf {
    opacity: 0.55;
}

.timeline-panel-top {
    margin-bottom: 0.45rem;
}

.timeline-date-badge {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--khaki-deep);
    background: linear-gradient(180deg, rgba(201, 162, 77, 0.28) 0%, rgba(201, 162, 77, 0.12) 100%);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(201, 162, 77, 0.4);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.timeline-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--khaki-deep);
    margin: 0 0 0.5rem;
    line-height: 1.28;
}

.timeline-note {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.96rem;
    line-height: 1.58;
}

@media (max-width: 39.99rem) {
    .timeline-beautiful::before {
        display: none;
    }

    .timeline-tree-wrap {
        border-radius: 10px;
    }

    .timeline-canopy-svg {
        max-width: 16rem;
    }

    .timeline-tree-tagline {
        font-size: 0.78rem;
        padding: 0 0.5rem;
    }

    .timeline-roots-svg {
        max-width: 18rem;
    }

    .timeline-beautiful .timeline-item {
        grid-template-columns: 1fr;
        padding-bottom: 1.35rem;
    }

    .timeline-node {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.85rem;
        padding-top: 0;
        margin-bottom: 0.5rem;
    }

    .timeline-node-ring {
        display: none;
    }

    .timeline-node-mark {
        flex-shrink: 0;
    }

    .timeline-panel:hover {
        transform: none;
    }

    .timeline-leaf {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-panel {
        transition: none;
    }

    .timeline-panel:hover {
        transform: none;
    }
}

@media print {
    .timeline-beautiful::before {
        display: none;
    }

    .timeline-panel {
        break-inside: avoid;
        box-shadow: none;
    }

    .timeline-panel::before,
    .timeline-leaf {
        display: none !important;
    }

    .timeline-canopy-svg,
    .timeline-roots-svg {
        display: none;
    }

    .timeline-tree-wrap {
        background: none;
    }
}

/* Глоссарий */
.glossary-search label {
    display: block;
    font-weight: 700;
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    color: var(--khaki-deep);
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-row input[type="search"] {
    flex: 1 1 12rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-family: var(--font-serif);
    font-size: 1rem;
    background: #fffef9;
}

.glossary-letter-filter {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(74, 85, 68, 0.15);
}

.glossary-letter-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--khaki-deep);
    margin-bottom: 0.4rem;
}

.glossary-letter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.glossary-letter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.28rem 0.45rem;
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 2px;
    text-decoration: none;
    color: var(--khaki-deep);
    background: rgba(255, 255, 255, 0.4);
}

.glossary-letter-btn:hover {
    border-color: var(--khaki);
    color: var(--red-star);
}

.glossary-letter-btn.is-active {
    background: var(--khaki-deep);
    color: #fff;
    border-color: var(--khaki-deep);
}

.main-area a.glossary-letter-btn.is-active,
.main-area a.glossary-letter-btn.is-active:hover {
    color: #fff;
}

.glossary-list {
    margin: 0;
}

.glossary-row dt {
    font-weight: 700;
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    margin: 0 0 0.35rem;
    color: var(--khaki-deep);
}

.glossary-row dd {
    margin: 0;
    color: var(--ink-soft);
}

.glossary-page-info--in-pager {
    margin: 0 0 0.35rem;
    text-align: center;
}

.glossary-pager {
    padding: 0.85rem 1.1rem;
    margin: 0.75rem 0;
}

.glossary-pager--bottom {
    margin-top: 1rem;
}

.glossary-pager-inner {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.glossary-pager-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
}

.glossary-pager-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
}

.glossary-pager-link {
    font-family: var(--font-head);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--khaki-deep);
    text-decoration: none;
    white-space: nowrap;
}

.glossary-pager-link:hover {
    color: var(--red-star);
}

.glossary-pager-muted {
    font-family: var(--font-head);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.65;
    white-space: nowrap;
}

.glossary-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.15rem;
    height: 2.15rem;
    padding: 0 0.35rem;
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--khaki-deep);
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255, 254, 249, 0.7);
}

.glossary-pager-num:hover {
    border-color: var(--gold-dim);
    color: var(--red-star);
    background: #fffef9;
}

.glossary-pager-num.is-current {
    background: var(--khaki-deep);
    color: #fff;
    border-color: var(--khaki-deep);
    cursor: default;
}

.glossary-pager-ellipsis {
    color: var(--muted);
    padding: 0 0.15rem;
    user-select: none;
}

/* Карточки запоминания */
.flash-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.flash-term {
    font-family: var(--font-head);
    font-size: 1.45rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1rem 0;
    color: var(--khaki-deep);
}

.flash-def {
    font-size: 1.05rem;
    max-width: 36rem;
    margin: 1rem auto;
    text-align: left;
}

.flash-hint {
    color: var(--ink-soft);
    font-style: italic;
}

.flash-pager {
    justify-content: center;
}

.quiz-toolbar {
    margin: 0 0 0.75rem;
}

.quiz-toolbar .btn {
    text-decoration: none;
}

/* Неактивные «кнопки» пейджера выглядят как остальные, но не кликаются */
.btn-pager-fake {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* Тесты */
.question {
    border: 0;
    margin: 1.25rem 0;
    padding: 0;
}

.question legend {
    font-weight: 700;
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--khaki-deep);
}

.option {
    display: block;
    margin: 0.4rem 0;
    cursor: pointer;
}

.hint {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.quiz-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.85rem;
}

.quiz-hub-card h3 {
    margin-top: 0;
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.quiz-hub-final {
    background: linear-gradient(145deg, #f0e8dc 0%, #e3d4c2 100%);
    border-color: var(--gold);
}

.result .score-line {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Задания */
.task-block .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.65rem;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: rgba(74, 85, 68, 0.12);
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table select {
    width: 100%;
    max-width: 10rem;
    padding: 0.4rem;
    border-radius: 2px;
    border: 1px solid var(--border);
    font-family: var(--font-serif);
    background: #fffef9;
}

.statement-field {
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1rem 1.15rem 1.1rem;
    margin: 0.85rem 0;
    background: rgba(255, 254, 249, 0.6);
}

/* Текст утверждения — обычный блок внутри рамки (без <legend>, чтобы линия не резала буквы) */
.statement-text {
    margin: 0 0 0.85rem;
    font-weight: 600;
    line-height: 1.5;
    font-size: 0.98rem;
}

.statement-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.35rem;
}

.inline-opt {
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Результаты заданий (tasks.php): карточка со шкалой и цветовой индикацией */
.task-result {
    padding: 0;
    overflow: hidden;
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.task-result-inner {
    display: flex;
    align-items: stretch;
    min-height: 6.25rem;
}

.task-result-accent {
    width: 5px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
}

.task-result--good .task-result-accent {
    background: linear-gradient(180deg, #6d8f5c 0%, var(--khaki) 100%);
}

.task-result--mid .task-result-accent {
    background: linear-gradient(180deg, #d4a03a 0%, #a67c2e 100%);
}

.task-result--low .task-result-accent {
    background: linear-gradient(180deg, var(--red-star) 0%, var(--red-deep) 100%);
}

.task-result--neutral .task-result-accent {
    background: var(--paper-dark);
}

.task-result-content {
    flex: 1;
    padding: 1rem 1.35rem 1.15rem;
    background: linear-gradient(145deg, rgba(255, 252, 248, 0.55) 0%, var(--paper-card) 48%, rgba(232, 223, 208, 0.65) 100%);
}

.task-result-kicker {
    font-family: var(--font-head);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--khaki-deep);
    opacity: 0.88;
    margin: 0 0 0.4rem;
}

.task-result-scoreline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.35rem;
    margin: 0 0 0.2rem;
}

.task-result-number {
    font-family: var(--font-head);
    font-size: 2.65rem;
    font-weight: 600;
    line-height: 1;
    color: var(--khaki-deep);
    letter-spacing: 0.02em;
}

.task-result--good .task-result-number {
    color: #2d4a26;
}

.task-result--mid .task-result-number {
    color: #5c4018;
}

.task-result--low .task-result-number {
    color: var(--red-deep);
}

.task-result-sep {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--border);
    opacity: 0.9;
}

.task-result-total {
    font-family: var(--font-head);
    font-size: 1.65rem;
    font-weight: 500;
    color: var(--ink-soft);
}

.task-result-caption {
    margin: 0 0 0.75rem;
    font-size: 0.98rem;
    color: var(--ink-soft);
}

.task-result-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(47, 52, 40, 0.12);
    overflow: hidden;
}

.task-result-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--khaki-deep), var(--khaki));
    transition: width 0.35s ease;
}

.task-result--good .task-result-bar-fill {
    background: linear-gradient(90deg, #3d5c34, #5a7a4a);
}

.task-result--mid .task-result-bar-fill {
    background: linear-gradient(90deg, #8a5f1a, #c4882e);
}

.task-result--low .task-result-bar-fill {
    background: linear-gradient(90deg, var(--red-deep), var(--red-star));
}

.task-result--neutral .task-result-bar-fill {
    width: 0 !important;
    background: var(--paper-dark);
}

.score-big {
    font-family: var(--font-head);
    font-size: 2.4rem;
    font-weight: 600;
    margin: 0.25rem 0;
    color: var(--red-star);
    letter-spacing: 0.04em;
}

.attempt-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
}

.attempt-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border);
}

.attempt-list time {
    grid-column: 1 / -1;
    color: var(--ink-soft);
    font-size: 0.82rem;
}

.attempt-mode {
    font-family: ui-monospace, monospace;
}

.attempt-score {
    font-weight: 700;
    color: var(--khaki-deep);
}

.muted-note {
    background: rgba(74, 85, 68, 0.08);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Подвал */
.site-footer {
    margin-top: 0;
    padding: 2rem 0 max(2.5rem, calc(env(safe-area-inset-bottom, 0px) + 1.25rem));
    background: var(--khaki-deep);
    color: rgba(243, 235, 224, 0.88);
    border-top: 4px solid var(--gold);
    font-size: 0.86rem;
}

.footer-inner {
    position: relative;
}

.footer-ribbon {
    height: 4px;
    margin-bottom: 1rem;
    background: repeating-linear-gradient(
        90deg,
        var(--ribbon-black) 0 33.33%,
        var(--ribbon-orange) 33.33% 66.66%,
        #c4c4c4 66.66% 100%
    );
    opacity: 0.9;
    border-radius: 2px;
}

.site-footer a {
    color: var(--gold);
}

.footer-note {
    margin-top: 0.65rem;
    opacity: 0.82;
    font-size: 0.8rem;
    line-height: 1.45;
}

.footer-admin {
    margin-top: 0.75rem;
    font-size: 0.82rem;
}

.footer-admin a {
    color: var(--gold);
}

@media (max-width: 52rem) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .brand-mark {
        align-items: center;
    }

    .nav-toggle {
        display: inline-flex;
        align-self: flex-end;
        align-items: center;
        justify-content: center;
        min-height: 2.75rem;
        min-width: 2.75rem;
        touch-action: manipulation;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.15rem;
        padding-top: 0.35rem;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        display: flex;
        align-items: center;
        min-height: 2.75rem;
        padding: 0.5rem 0.65rem;
        box-sizing: border-box;
    }

    .hero.hero--vov {
        grid-template-rows: minmax(200px, auto);
    }

    .hero-bg {
        min-height: 200px;
    }

    .hero-inner {
        padding: 1.5rem max(1rem, env(safe-area-inset-left, 0px)) 1.75rem max(1rem, env(safe-area-inset-right, 0px));
    }

    .hero-inner h2 {
        font-size: clamp(1.2rem, 4.2vw, 1.45rem);
    }

    .hero-lead {
        font-size: clamp(0.95rem, 2.8vw, 1.05rem);
    }

    .btn,
    button.btn {
        touch-action: manipulation;
        min-height: 2.75rem;
        padding: 0.55rem 1.1rem;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Узкие телефоны */
@media (max-width: 36rem) {
    .wrap {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .card {
        padding: 1rem 0.9rem;
    }

    .card h2 {
        font-size: 1.06rem;
        line-height: 1.28;
    }

    .brand-text h1 {
        font-size: clamp(0.9rem, 4.8vw, 1.12rem);
        line-height: 1.2;
    }

    .theme {
        font-size: 0.78rem;
        line-height: 1.42;
    }

    .hero-inner {
        padding-top: 1.15rem;
        padding-bottom: 1.35rem;
    }

    .hero-inner h2 {
        font-size: clamp(1.02rem, 5.5vw, 1.32rem);
    }

    .two-col,
    .lesson-grid,
    .lesson-grid.compact {
        grid-template-columns: 1fr;
    }

    .quiz-hub-grid {
        grid-template-columns: 1fr;
    }

    .lesson-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .lesson-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .pager {
        flex-direction: column;
        align-items: stretch;
    }

    .pager-link {
        max-width: none;
        text-align: center;
        padding: 0.35rem 0;
    }

    .pager-muted {
        text-align: center;
    }

    .task-block {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -0.35rem;
        margin-right: -0.35rem;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .task-block .data-table {
        min-width: 18rem;
    }

    .data-table select {
        max-width: none;
        width: 100%;
        min-height: 2.75rem;
        font-size: 1rem;
    }

    .statement-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .inline-opt {
        min-height: 2.5rem;
        align-items: center;
    }

    .glossary-letter-filter {
        margin-left: -0.4rem;
        margin-right: -0.4rem;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .glossary-letter-row {
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }

    .glossary-letter-btn {
        flex-shrink: 0;
        min-width: 2.4rem;
        min-height: 2.4rem;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row .btn {
        width: 100%;
    }

    .glossary-pager-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .glossary-pager-pages {
        justify-content: center;
    }

    .timeline-filter-card .timeline-year-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding-bottom: 0.35rem;
        gap: 0.4rem;
    }

    .timeline-year-btn {
        flex-shrink: 0;
    }

    .task-result-number {
        font-size: clamp(1.85rem, 12vw, 2.65rem);
    }

    .task-result-total {
        font-size: clamp(1.2rem, 6vw, 1.65rem);
    }

    .score-big {
        font-size: clamp(1.65rem, 10vw, 2.4rem);
    }

    .flash-term {
        font-size: clamp(1.1rem, 5vw, 1.45rem);
        word-break: break-word;
    }

    .gallery-open {
        touch-action: manipulation;
    }

    .timeline-memo-list {
        padding-left: 1.1rem;
    }
}

@media print {
    .skip-link,
    .gallery-lightbox,
    .site-header,
    .site-footer,
    .nav-toggle,
    .hero-actions,
    .lesson-footer,
    .pager,
    .footer-ribbon {
        display: none !important;
    }

    body.theme-vov {
        background: #fff;
    }

    .card {
        box-shadow: none;
        break-inside: avoid;
    }
}
