@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-cyrillic-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Golos Text"; src: url("/assets/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("/assets/fonts/golos-text-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }

/* Том I: тканевый переплёт, тёплая бумага, коричневые чернила. */
:root {
  --cloth: #4b2f1d;
  --cloth-deep: #3a2315;
  --paper: #f8f1e4;
  --paper-raised: #fcf8f0;
  --paper-sunk: #f0e5d2;
  --doc: #fdfaf3;
  --edge: #e2d3b9;
  --ink: #2a1c12;
  --ink-soft: #67523f;
  --rule: #ddccb1;
  --rule-strong: #5b3b23;
  --brown: #6f4426;
  --link: #7a3a14;
  --link-hover: #a54f1b;
  --gold: #b98a2e;
  --ribbon: #8a2e1d;
  --band-a: #8a2e1d;
  --band-b: #e0bd73;
  --stamp: #4c3c86;
  --thread: #9b4c2d;
  --hole: #b9a68a;
  --green: #2f6146;
  --green-wash: #e6ecdc;
  --amber: #85560c;
  --amber-wash: #f5e7c6;
  --rust: #92371d;
  --rust-wash: #f5e0cf;
  --mark: #f1d48c;
  --shadow: rgba(40, 22, 10, 0.38);
  --serif: "Literata", "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", "PT Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --measure: 35rem;
  --gutter: clamp(18px, 4.2vw, 48px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cloth: #140d09;
    --cloth-deep: #0d0806;
    --paper: #211913;
    --paper-raised: #2a2019;
    --paper-sunk: #19130e;
    --doc: #2b221b;
    --edge: #31261d;
    --ink: #ece1cf;
    --ink-soft: #bca992;
    --rule: #44362a;
    --rule-strong: #c7a47b;
    --brown: #d5a776;
    --link: #e5b37e;
    --link-hover: #f5d2a7;
    --gold: #dcb05a;
    --ribbon: #a8412b;
    --band-a: #93402a;
    --band-b: #a9884d;
    --stamp: #ab9fe4;
    --thread: #c98c60;
    --hole: #0f0b08;
    --green: #95c8a6;
    --green-wash: #22302a;
    --amber: #e5be6f;
    --amber-wash: #342a16;
    --rust: #eca080;
    --rust-wash: #3a2319;
    --mark: #6b5016;
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--cloth);
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.09) 0 1px, transparent 1px 4px),
    radial-gradient(120% 80% at 50% 0%, transparent 40%, var(--cloth-deep));
  background-attachment: fixed;
  font: 400 1.125rem/1.7 var(--serif);
  font-optical-sizing: auto;
  font-feature-settings: "kern", "liga", "onum";
  overflow-wrap: break-word;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.18; font-weight: 700; letter-spacing: -0.012em; text-wrap: balance; font-feature-settings: "kern", "liga", "lnum"; }
p { margin: 0 0 1em; text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; font: 500 0.9rem var(--sans); }
.skip:focus { top: 8px; color: var(--paper); }

/* Лист в переплёте */
.sheet {
  position: relative;
  width: min(76rem, 100% - 2 * clamp(0px, 3vw, 40px));
  margin: clamp(0px, 3vw, 36px) auto clamp(0px, 4vw, 56px);
  background:
    repeating-linear-gradient(90deg, var(--band-a) 0 3px, var(--band-b) 3px 6px) top / 100% 3px no-repeat,
    linear-gradient(to right, rgba(70, 40, 18, 0.11), rgba(70, 40, 18, 0) 34px) left / 34px 100% no-repeat,
    var(--paper);
  box-shadow:
    2px 1px 0 var(--edge), 4px 2px 0 var(--paper), 5px 3px 0 var(--edge), 7px 4px 0 var(--paper), 8px 5px 0 var(--edge),
    0 22px 48px -12px var(--shadow);
}
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  right: clamp(14px, 1.6vw, 22px);
  width: 13px;
  height: 78px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 35%, rgba(255, 255, 255, 0.12) 60%, rgba(0, 0, 0, 0.14)), var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  pointer-events: none;
}

/* Скол-реношка: две зеркальные выщерблины на стыке рамки */
.chip, .infobox, .document { position: relative; }
.infobox::after, .document::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 2.6rem;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  transform: scaleY(1.85) rotate(45deg);
  pointer-events: none;
}

/* Шапка */
.site-header { padding-top: 3px; }
.header-inner { max-width: 72rem; margin: 0 auto; padding: 16px var(--gutter) 10px; display: flex; gap: 12px 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--brown); }
.brand-logo { flex: none; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%), var(--paper-sunk); box-shadow: 0 0 0 1px var(--gold), 0 0 0 3px var(--paper), 0 0 0 4px var(--rule); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand-vol { font: 500 0.68rem/1.5 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.search-form { display: flex; flex: 0 1 21rem; min-width: min(100%, 15rem); }
.search-form input, .search-page input, .registry-tools input { width: 100%; font: 400 0.95rem var(--sans); color: var(--ink); background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 2px; padding: 8px 11px; min-height: 42px; }
.search-form input { border-right: 0; border-radius: 2px 0 0 2px; }
.search-form input:focus, .search-page input:focus, .registry-tools input:focus { border-color: var(--brown); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brown) 20%, transparent); }
.search-form input::placeholder, .search-page input::placeholder, .registry-tools input::placeholder { color: var(--ink-soft); opacity: 0.85; }
.search-form button { font: 600 0.82rem var(--sans); letter-spacing: 0.04em; color: var(--paper); background: var(--brown); border: 1px solid var(--brown); border-radius: 0 2px 2px 0; padding: 0 15px; min-height: 42px; cursor: pointer; }
.search-form button:hover { background: var(--link-hover); border-color: var(--link-hover); }
.site-nav { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); display: flex; gap: 4px 26px; flex-wrap: wrap; font: 600 0.74rem var(--sans); letter-spacing: 0.09em; text-transform: uppercase; }
.site-nav a { color: var(--ink-soft); text-decoration: none; padding: 8px 0 7px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.site-header::after { content: ""; display: block; max-width: calc(72rem - 2 * var(--gutter)); margin: 0 auto; height: 5px; border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); width: calc(100% - 2 * var(--gutter)); }

/* Титульный лист */
.is-home .header-inner { flex-direction: column; align-items: center; padding-top: clamp(28px, 6vw, 56px); gap: 22px; }
.is-home .site-nav { justify-content: center; }
.is-home .search-form { flex-basis: auto; width: min(100%, 30rem); }
.masthead { text-align: center; }
.frontispiece { width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 30%, transparent) 0, transparent 68%), var(--paper-sunk); box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--paper), 0 0 0 6px var(--rule-strong); }
.masthead-logo { display: block; width: 128px; height: 128px; }
.edition, .motto { font: 600 0.74rem var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.motto { font: italic 400 1.02rem var(--serif); letter-spacing: 0.01em; text-transform: none; }
.wordmark { font-size: clamp(2.3rem, 7.2vw, 4.6rem); line-height: 1.02; margin: 14px auto 6px; max-width: 13ch; letter-spacing: -0.024em; font-weight: 800; }
.wordmark em { font-style: italic; font-weight: 500; color: var(--brown); letter-spacing: -0.01em; }
.fleuron { display: flex; align-items: center; justify-content: center; gap: 12px; width: min(100%, 15rem); margin: 14px auto; }
.fleuron::before, .fleuron::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--rule-strong)); }
.fleuron::after { background: linear-gradient(90deg, var(--rule-strong), transparent); }
.fleuron span { flex: none; width: 8px; height: 15px; background: var(--gold); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }

main { min-height: 50vh; }
.home, .page, .article { max-width: 72rem; margin: 0 auto; padding: 30px var(--gutter) 56px; }
.page { max-width: 52rem; }
.page-hronologiya, .page-slovar { max-width: 48rem; }

/* Заголовок статьи */
.crumbs { font: 400 0.8rem var(--sans); color: var(--ink-soft); margin-bottom: 22px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }
.crumbs i { font-style: normal; margin: 0 7px; opacity: 0.5; }
.kicker { font: 600 0.72rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brown); margin: 0 0 10px; }
.article-head { max-width: 46rem; margin-bottom: 28px; }
.article-head h1 { font-size: clamp(2.1rem, 5.4vw, 3.2rem); line-height: 1.06; margin: 0 0 12px; letter-spacing: -0.022em; }
.article-head h1.source-title { font-size: clamp(1.45rem, 3.6vw, 2.05rem); line-height: 1.2; }
.aliases { font: italic 400 0.98rem var(--serif); color: var(--ink-soft); margin: 0 0 14px; }
.lede { font-size: 1.24rem; line-height: 1.55; margin: 0 0 16px; color: var(--ink); }
.grade { display: inline-block; font: 400 0.82rem/1.5 var(--sans); padding: 5px 12px 5px 10px; border: 1px solid var(--rule); border-left: 3px solid var(--ink-soft); background: var(--paper-raised); color: var(--ink-soft); margin: 0; }
.grade span { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.7rem; color: var(--ink); margin-right: 2px; }
.grade-stable { border-left-color: var(--green); }
.grade-versions { border-left-color: var(--amber); }
.grade-thin { border-left-color: var(--rust); }

.article-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(15rem, 18.5rem); gap: 0 clamp(40px, 6vw, 80px); align-items: start; justify-content: space-between; }
.article-grid > .article-head { grid-column: 1; grid-row: 1; }
.article-main { min-width: 0; grid-column: 1; grid-row: 2; }

/* Справка-вклейка */
.infobox { grid-column: 2; grid-row: 1 / span 2; background: var(--paper-raised); border: 1px solid var(--rule-strong); box-shadow: inset 0 0 0 3px var(--paper-raised), inset 0 0 0 4px var(--rule); padding: 16px 18px 16px; font: 400 0.88rem/1.5 var(--sans); }
.infobox-title { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0 0 6px; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brown); }
.infobox-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.infobox dl { margin: 0; }
.infobox dl div { padding: 8px 0; border-top: 1px solid var(--rule); }
.infobox dl div:first-child { border-top: 0; }
.infobox dt { color: var(--ink-soft); font-size: 0.76rem; letter-spacing: 0.02em; }
.infobox dd { margin: 0; font: 500 0.95rem/1.4 var(--serif); font-feature-settings: "lnum"; }
.infobox figure { margin: 0 0 14px; }
.infobox img { display: block; width: 100%; height: auto; background: var(--paper-sunk); border: 1px solid var(--rule); }
.infobox figcaption { font-size: 0.76rem; line-height: 1.45; color: var(--ink-soft); margin-top: 7px; }

/* Содержание */
.toc { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); padding: 12px 0 14px; margin: 0 0 30px; font: 400 0.92rem/1.55 var(--sans); max-width: var(--measure); }
.toc p { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brown); margin: 0 0 6px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; columns: 2 14rem; column-gap: 28px; }
.toc li { counter-increment: toc; break-inside: avoid; padding: 2px 0 2px 1.7em; text-indent: -1.7em; }
.toc li::before { content: counter(toc) "."; display: inline-block; width: 1.7em; text-indent: 0; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Текст */
.prose { max-width: var(--measure); hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 7 3 3; }
.prose h2 { font-size: 1.6rem; margin: 2em 0 0.6em; padding-top: 0.65em; border-top: 1px solid var(--rule); hyphens: manual; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 0.35em; hyphens: manual; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.45em; padding-left: 0.15em; }
.prose li::marker { color: var(--brown); }
.prose strong { font-weight: 650; }
.prose > p.initial:first-child::first-letter,
.intro p::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: 0.84;
  font-weight: 700;
  margin: 0.08em 0.09em 0 0;
  color: var(--brown);
  font-feature-settings: "lnum";
}
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .prose > p.initial:first-child::first-letter,
  .intro p::first-letter { float: none; font-size: inherit; line-height: inherit; margin: 0 0.1em 0 0; -webkit-initial-letter: 3; initial-letter: 3; }
}
sup.fn { font: 600 0.66rem/0 var(--sans); font-feature-settings: "lnum"; }
sup.fn a { text-decoration: none; padding: 0 1px 0 2px; color: var(--brown); }
sup.fn a:hover { color: var(--link-hover); }
sup.fn a:target { background: var(--mark); }

/* Врезки */
.callout { margin: 1.5em 0; padding: 12px 18px 4px; border-left: 2px solid var(--brown); background: var(--paper-raised); font-size: 1rem; line-height: 1.62; }
.callout-title { font: 700 0.7rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; margin: 2px 0 6px; color: var(--brown); }
.callout p { margin-bottom: 0.75em; }
.callout-calc { border-left-color: var(--green); background: var(--green-wash); }
.callout-calc .callout-title { color: var(--green); }
.callout-hypothesis, .callout-unclear { border-left-color: var(--amber); background: var(--amber-wash); }
.callout-hypothesis .callout-title, .callout-unclear .callout-title { color: var(--amber); }
.callout-hypothesis { border-left-style: dashed; }
.callout-caution { border-left-color: var(--rust); background: var(--rust-wash); }
.callout-caution .callout-title { color: var(--rust); }
.callout-note { font-style: italic; }
.callout-note .callout-title, .callout-note strong { font-style: normal; }
.article-main > .callout { max-width: var(--measure); margin-top: 0; }

/* Таблицы в книжной манере */
.table { overflow-x: auto; margin: 1.4em 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font: 400 0.9rem/1.45 var(--sans); font-variant-numeric: lining-nums tabular-nums; border-top: 2px solid var(--rule-strong); border-bottom: 2px solid var(--rule-strong); hyphens: manual; }
th { text-align: left; font-weight: 700; font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--rule-strong); padding: 8px 12px 6px 0; vertical-align: bottom; }
td { border-bottom: 1px solid var(--rule); padding: 8px 12px 8px 0; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Подшитый документ: ведомость */
.document {
  --stitch: 18px;
  margin: 1.8em 0 2.4em;
  padding: 18px 22px 20px 54px;
  border: 1px solid var(--rule);
  background:
    radial-gradient(circle at 3px 3px, var(--hole) 1.7px, transparent 2.3px) var(--stitch) 9px / 6px 24px repeat-y,
    radial-gradient(circle at 3px 3px, var(--hole) 1.7px, transparent 2.3px) var(--stitch) 23px / 6px 24px repeat-y,
    linear-gradient(to bottom, var(--thread) 0 14px, transparent 14px) calc(var(--stitch) + 2px) 12px / 2px 24px repeat-y,
    linear-gradient(var(--rule), var(--rule)) 40px 0 / 1px 100% no-repeat,
    var(--doc);
  box-shadow: 0 1px 0 var(--edge), 0 10px 22px -14px var(--shadow);
  font-family: var(--sans);
}
.document::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 40px; background: linear-gradient(to right, rgba(70, 40, 18, 0.06), transparent); pointer-events: none; }
.document-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-strong); }
.document-head span { font: 700 0.7rem var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--brown); }
.document-head strong { font: 600 1.06rem/1.3 var(--serif); color: var(--ink); }
.document .table { margin: 0 0 12px; }
.document table { border-top: 0; border-bottom: 1px solid var(--rule-strong); }
.document th + th, .document td + td { text-align: right; padding-left: 12px; }
.document th:last-child, .document td:last-child { padding-right: 0; }
.document tr:last-child td { font-weight: 700; border-top: 1px solid var(--rule-strong); }
.document p, .document-foot { font: 400 0.82rem/1.5 var(--sans); color: var(--ink-soft); margin: 0; padding-right: 108px; min-height: 52px; }
.stamp-seal { position: absolute; right: 16px; bottom: -26px; width: 100px; height: 100px; color: var(--stamp); opacity: 0.8; transform: rotate(-12deg); font-family: var(--sans); pointer-events: none; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .stamp-seal { mix-blend-mode: screen; opacity: 0.7; } }

/* Блоки статей */
.prose .route, .prose .timeline { padding-left: 0; }
.route { list-style: none; counter-reset: step; margin: 1.4em 0; padding: 0; }
.route li { counter-increment: step; position: relative; padding: 0 0 16px 46px; margin: 0; }
.route li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 30px; height: 30px; border-radius: 50%; background: var(--paper); border: 1px solid var(--brown); color: var(--brown); font: 700 0.8rem/28px var(--sans); text-align: center; }
.route li::after { content: ""; position: absolute; left: 14.5px; top: 33px; bottom: 2px; width: 1px; background: var(--rule-strong); opacity: 0.5; }
.route li:last-child::after { display: none; }
.route strong, .route span { display: block; }
.route span { color: var(--ink-soft); font-size: 0.98rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1px; background: var(--rule); border-top: 2px solid var(--rule-strong); border-bottom: 2px solid var(--rule-strong); margin: 1.4em 0; }
.stats div { background: var(--paper); padding: 12px 14px 10px; }
.stats dt { font-weight: 700; font-size: 1.4rem; line-height: 1.2; font-variant-numeric: lining-nums; color: var(--ink); }
.stats dd { margin: 3px 0 0; font: 400 0.8rem/1.4 var(--sans); color: var(--ink-soft); hyphens: manual; }

.house { margin: 1.4em 0; }
.house-grid { display: inline-grid; grid-template-columns: repeat(4, 44px); gap: 6px; padding: 10px; background: var(--paper-sunk); border: 1px solid var(--rule); }
.stack { display: grid; gap: 2px; }
.stack i { display: block; height: 10px; background: var(--brown); opacity: 0.85; }
.house figcaption { font: 400 0.82rem var(--sans); color: var(--ink-soft); margin-top: 6px; }

.timeline { list-style: none; margin: 0 0 1.6em; padding: 0; }
.timeline li { display: grid; grid-template-columns: 6.6rem 1fr; gap: 0 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.timeline time { font: 600 0.84rem/1.6 var(--sans); font-variant-numeric: tabular-nums lining-nums; }
.tl-kind { grid-column: 1; grid-row: 2; font: 500 0.7rem var(--sans); letter-spacing: 0.04em; color: var(--ink-soft); }
.timeline p { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.tl-world time { color: var(--green); }
.tl-plan time { color: var(--amber); }
.page-hronologiya .prose h2 { font-size: 2.1rem; font-weight: 800; color: var(--brown); border-top-width: 2px; border-top-color: var(--rule-strong); }

/* Сноски — концевые примечания */
.notes { margin-top: 2.8em; border-top: 2px solid var(--rule-strong); padding-top: 6px; font: 400 0.86rem/1.55 var(--sans); max-width: var(--measure); }
.fold summary { cursor: pointer; font: 700 0.76rem/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brown); padding: 10px 0; }
.fold summary:hover { color: var(--link-hover); }
.fold-count { font: 500 0.78rem var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-soft); margin-left: 4px; }
.fold[open] > summary { margin-bottom: 4px; }
.notes-hint { font-size: 0.8rem; color: var(--ink-soft); font-style: normal; }
.notes ol { padding-left: 2em; margin: 0; }
.notes li { margin-bottom: 8px; scroll-margin-top: 8px; }
.notes li::marker { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.notes li:target { background: var(--mark); }
.back a { text-decoration: none; }
.stamp { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.article-foot { margin-top: 36px; padding-top: 8px; border-top: 1px solid var(--rule); max-width: 46rem; font-family: var(--sans); }
.article-foot h2, .page section h2 { font: 700 0.74rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brown); margin: 18px 0 10px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 0; margin: 0; font: 400 0.88rem var(--sans); }
.tags a { display: inline-block; padding: 5px 11px; border: 1px solid var(--rule); border-radius: 2px; background: var(--paper-raised); text-decoration: none; }
.tags a:hover { border-color: var(--link); }

/* Списки статей */
.cards { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.cards a { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.cards strong { display: block; font-size: 1.2rem; color: var(--link); }
.cards a:hover strong { color: var(--link-hover); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.cards span { display: block; color: var(--ink-soft); font-size: 1rem; line-height: 1.55; margin-top: 2px; }

.button { display: inline-block; font: 600 0.86rem var(--sans); letter-spacing: 0.02em; background: var(--brown); color: var(--paper); padding: 10px 18px; border-radius: 2px; text-decoration: none; border: 1px solid var(--brown); }
.button:hover { color: var(--paper); background: var(--link-hover); border-color: var(--link-hover); }
.button-quiet { background: transparent; color: var(--link); }
.button-quiet:hover { background: transparent; color: var(--link-hover); }

/* Главная */
.intro { max-width: 44rem; margin: 6px auto 34px; font-size: 1.16rem; line-height: 1.68; hyphens: auto; -webkit-hyphens: auto; }
.intro p { margin: 0; }
.front { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem); gap: 28px clamp(36px, 6vw, 72px); padding: 30px 0 40px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); align-items: start; }
.front h2 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.06; margin: 0 0 14px; letter-spacing: -0.022em; }
.front h2 a { color: var(--ink); text-decoration: none; }
.front h2 a:hover { color: var(--brown); }
.front-lead { max-width: 36rem; }
.front-links { margin: 18px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.ledger { margin: 0; }
.ledger dl { margin: 0 0 6px; }
.ledger dl div { display: flex; align-items: baseline; gap: 0; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.ledger dd { order: 1; margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.ledger dl div::after { content: ""; order: 2; flex: 1; min-width: 12px; margin: 0 8px; border-bottom: 1px dotted var(--ink-soft); opacity: 0.6; transform: translateY(-4px); }
.ledger dt { order: 3; font: 700 1.12rem var(--serif); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.ledger .document-foot { margin-top: 10px; }
.sections > h2 { font-size: 0.78rem; font-family: var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--brown); text-align: center; margin: 38px 0 18px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 12px clamp(32px, 4vw, 56px); }
.section-grid h3 { font-size: 1.22rem; margin: 8px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--rule-strong); display: flex; justify-content: space-between; align-items: baseline; }
.section-grid h3 a { color: var(--ink); text-decoration: none; }
.section-grid h3 a:hover { color: var(--brown); }
.section-grid h3 span { font: 500 0.78rem var(--sans); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.section-grid ul { list-style: none; padding: 0; margin: 0 0 14px; font-size: 1.02rem; line-height: 1.4; }
.section-grid li { padding: 5px 0; border-bottom: 1px dotted var(--rule); }
.section-grid li a { text-decoration: none; }
.section-grid li a:hover { text-decoration: underline; }
.reading { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 8px clamp(32px, 4vw, 56px); margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--rule-strong); font-size: 1rem; line-height: 1.6; }
.reading h2 { font: 700 0.74rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brown); margin: 12px 0 8px; }
.reading p { margin-bottom: 0.5em; }

/* Реестр и источники */
.registry-tools { display: flex; gap: 8px 12px; flex-wrap: wrap; margin: 22px 0 6px; align-items: stretch; }
.registry-tools input { flex: 1 1 15rem; }
.segmented { display: flex; }
.segmented button { font: 600 0.8rem var(--sans); color: var(--ink); background: var(--paper-raised); border: 1px solid var(--rule); padding: 0 13px; min-height: 42px; cursor: pointer; }
.segmented button + button { border-left: 0; }
.segmented button[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: var(--paper); }
.stamp-cell { font-weight: 600; white-space: nowrap; }
.flag { font-size: 0.72rem; color: var(--rust); white-space: nowrap; }
.source-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1px; background: var(--rule); border-top: 2px solid var(--rule-strong); border-bottom: 2px solid var(--rule-strong); margin: 0 0 22px; font: 400 0.9rem/1.45 var(--sans); }
.source-card div { background: var(--paper); padding: 10px 12px; }
.source-card dt { font-size: 0.74rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.source-card dd { margin: 0; }
.fragments { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 2px 12px; font: 400 0.86rem/1.7 var(--sans); }

.search-page input { font-size: 1.08rem; min-height: 50px; }
.search-status { font: 400 0.86rem var(--sans); color: var(--ink-soft); margin: 12px 0; }
.results { list-style: none; margin: 0; padding: 0; }
.results a { display: block; padding: 13px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.results strong { display: block; color: var(--link); font-size: 1.14rem; }
.result-kind { font: 700 0.66rem var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.result-text { display: block; font-size: 0.96rem; color: var(--ink-soft); }
mark { background: var(--mark); color: inherit; padding: 0 1px; }

/* Колофон */
.site-footer { margin-top: 8px; font: 400 0.82rem/1.6 var(--sans); color: var(--ink-soft); text-align: center; }
.footer-inner { max-width: 44rem; margin: 0 auto; padding: 8px var(--gutter) 44px; display: flex; flex-direction: column; align-items: center; }
.footer-inner .fleuron { margin: 0 auto 22px; }
.footer-inner p { margin: 0 0 0.7em; }
.colophon-title { font: 400 0.72rem/1.6 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.colophon-title strong { font: 700 1rem var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); }
.seal { width: 64px; height: 64px; margin-bottom: 12px; border-radius: 50%; background: var(--paper-sunk); box-shadow: 0 0 0 1px var(--gold), 0 0 0 3px var(--paper), 0 0 0 4px var(--rule); }

@media (max-width: 62rem) {
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .article-main { grid-row: 3; grid-column: 1; }
  .infobox { grid-column: 1; grid-row: 2; margin-bottom: 28px; max-width: var(--measure); }
  .front { grid-template-columns: minmax(0, 1fr); }
  .ledger { max-width: 30rem; }
}
@media (max-width: 48rem) {
  body { background: var(--paper); }
  .sheet { width: auto; margin: 0; box-shadow: none; background: repeating-linear-gradient(90deg, var(--band-a) 0 3px, var(--band-b) 3px 6px) top / 100% 3px no-repeat, var(--paper); }
  .sheet::before { display: none; }
}
@media (max-width: 34rem) {
  body { font-size: 1.0625rem; line-height: 1.66; }
  .lede { font-size: 1.12rem; }
  .intro { font-size: 1.08rem; }
  .header-inner { padding-top: 12px; }
  .brand-name { font-size: 1rem; }
  .brand-vol { display: none; }
  .brand-logo { width: 38px; height: 38px; }
  .site-nav { gap: 2px 18px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; white-space: nowrap; }
  .site-nav::-webkit-scrollbar { display: none; }
  .is-home .site-nav { justify-content: flex-start; }
  .frontispiece { width: 124px; height: 124px; }
  .masthead-logo { width: 108px; height: 108px; }
  .edition { font-size: 0.64rem; letter-spacing: 0.1em; }
  .timeline li { grid-template-columns: minmax(0, 1fr); }
  .tl-kind { grid-column: 1; grid-row: 2; }
  .timeline p { grid-column: 1; grid-row: 3; margin-top: 2px; }
  .document { padding: 14px 14px 18px 42px; --stitch: 13px; background-position: var(--stitch) 9px, var(--stitch) 23px, calc(var(--stitch) + 2px) 12px, 31px 0; }
  .document::before { width: 31px; }
  .document p, .document-foot { padding-right: 84px; }
  .stamp-seal { width: 82px; height: 82px; right: 8px; bottom: -20px; }
  .document table { font-size: 0.8rem; }
  .document th { font-size: 0.66rem; letter-spacing: 0.03em; }
  .document th, .document td { padding-right: 0; }
  .document th + th, .document td + td { padding-left: 8px; }
  .document td:first-child { white-space: nowrap; }
  .toc ol { columns: 1; }
}
@media print {
  body { background: #fff; color: #000; }
  .sheet { box-shadow: none; margin: 0; background: #fff; }
  .sheet::before, .site-header, .site-footer, .toc, .search-form { display: none; }
}
