/* «Душа» — оформление «Книга». Светлая «бумага», бордовые чернила, антиква.
   Все цвета — токены; тёмная тема переопределяет только токены. */

@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-cyrillic-400-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/pt-serif-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/pt-serif-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/pt-serif-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Serif"; font-style: italic; font-weight: 700; font-display: swap; src: url(../fonts/pt-serif-cyrillic-700-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-600-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-garamond-cyrillic-500-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Раскладка: «разворот книги» — оглавление слева, текст справа; на телефоне — одна колонка. */
:root {
  --paper: #F2F0EB;
  --paper-2: #F8F6F2;
  --paper-3: #FFFFFF;
  --ink: #2A2622;
  --ink-2: #4A433C;
  --muted: #675E56;
  --rule: #D6CFC4;
  --rule-soft: #E4DED4;
  --leader: #B2A99E;
  --accent: #7B2D3B;
  --accent-hover: #5A1F2A;
  --accent-ink: #FFFFFF;
  --accent-soft: #F3E6E7;
  --mark: #F2DEAE;
  --ok-bg: #E4F0E6; --ok-ink: #1F5A2E;
  --err-bg: #F7E2E0; --err-ink: #8A2420;
  --warn-bg: #F7EDD6; --warn-ink: #7A5200;

  --display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --text: "PT Serif", Georgia, "Times New Roman", serif;
  --poem-size: 1.1875rem;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1917; --paper-2: #23201D; --paper-3: #2A2723;
    --ink: #ECE5DA; --ink-2: #D3CABE; --muted: #A69B8C;
    --rule: #3B3631; --rule-soft: #302C28; --leader: #5D564D;
    --accent: #E3A3AE; --accent-hover: #F2C3CA; --accent-ink: #1B1917; --accent-soft: #3A2A2C;
    --mark: #5C4A1E;
    --ok-bg: #1F3324; --ok-ink: #A9D8B4; --err-bg: #3D2321; --err-ink: #F2B8B2; --warn-bg: #3A3020; --warn-ink: #EBCB8B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1B1917; --paper-2: #23201D; --paper-3: #2A2723;
  --ink: #ECE5DA; --ink-2: #D3CABE; --muted: #A69B8C;
  --rule: #3B3631; --rule-soft: #302C28; --leader: #5D564D;
  --accent: #E3A3AE; --accent-hover: #F2C3CA; --accent-ink: #1B1917; --accent-soft: #3A2A2C;
  --mark: #5C4A1E;
  --ok-bg: #1F3324; --ok-ink: #A9D8B4; --err-bg: #3D2321; --err-ink: #F2B8B2; --warn-bg: #3A3020; --warn-ink: #EBCB8B;
  color-scheme: dark;
}
:root[data-poem-size="1"] { --poem-size: 1rem; }
:root[data-poem-size="2"] { --poem-size: 1.0625rem; }
:root[data-poem-size="4"] { --poem-size: 1.375rem; }
:root[data-poem-size="5"] { --poem-size: 1.625rem; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0; }
mark { background: var(--mark); color: inherit; padding: 0 0.1em; border-radius: 2px; }
.muted { color: var(--muted); }
a.muted:hover { color: var(--accent); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden, .hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 16px; top: 16px; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }

/* ---------- Шапка */
.masthead {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px;
  padding-block: 36px 24px;
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wordmark { font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(2.6rem, 6vw, 3.5rem); line-height: 1; color: var(--ink); }
.wordmark:hover { color: var(--accent); text-decoration: none; }
.brand-h1 { margin: 0; font: inherit; line-height: 1; }
.byline { font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; font-size: 1rem; }
.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.menu-toggle { display: none; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
@media (max-width: 860px) {
  .masthead { align-items: center; padding-block: 20px 16px; }
  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
    border: 1px solid var(--rule); background: transparent; color: var(--ink); font: inherit; border-radius: 2px; cursor: pointer;
  }
  .js .nav { display: none; }
  .js .masthead.is-open .nav { display: flex; }
  .nav { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--rule-soft); padding-top: 8px; }
  .nav a { padding: 12px 2px; border-bottom: 1px solid var(--rule-soft); }
  .nav a.nav-search { justify-content: flex-start; border: 0; border-bottom: 1px solid var(--rule-soft); padding: 12px 2px; min-height: 0; border-radius: 0; }
  .theme-toggle { margin-top: 12px; }
}

/* ---------- Кнопки и формы */
.btn, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 2px; font: inherit; font-size: 1rem; cursor: pointer;
  text-decoration: none; line-height: 1.2;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); text-decoration: none; }
.nav .btn-outline { min-height: 38px; padding: 0 14px; }
.btn-danger { background: var(--err-ink); border-color: var(--err-ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form h2, .form h3 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row > .field { flex: 1 1 240px; }
.field label { font-weight: 700; font-size: 0.9375rem; }
.field label .muted { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper-3);
  border: 1px solid var(--rule); border-radius: 2px; padding: 10px 12px; min-height: 44px;
}
textarea { line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.check input { margin-top: 0.3em; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.card { background: var(--paper-2); border: 1px solid var(--rule); padding: 28px; align-self: start; }
@media (max-width: 560px) { .card { padding: 20px; } }

.flashes { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; }
.flash { padding: 12px 16px; border-radius: 2px; font-size: 0.9375rem; }
.flash-success { background: var(--ok-bg); color: var(--ok-ink); }
.flash-error { background: var(--err-bg); color: var(--err-ink); }
.flash-warning, .flash-info { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Общие блоки */
main { display: block; min-height: 50vh; }
.rule-top { border-top: 1px solid var(--rule); padding-top: 40px; margin-top: 8px; }
.h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 600; font-size: 1.875rem; line-height: 1.15; }
.h3 { margin: 0; font-size: 1.125rem; }
.page-title { margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: clamp(2.125rem, 5vw, 3rem); line-height: 1.08; }
.eyebrow { font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.lead { font-size: 1.125rem; color: var(--ink-2); max-width: 65ch; margin-bottom: 16px; }
.empty { padding: 24px 0; color: var(--muted); font-style: italic; }
.crumbs { font-size: 0.9375rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.badge { display: inline-block; font-size: 0.75rem; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); vertical-align: 0.15em; }
.badge-soft { background: var(--accent-soft); color: var(--accent); }
.more { margin-top: 16px; }
.rich { white-space: pre-wrap; overflow-wrap: anywhere; }
.narrow { max-width: 760px; padding-block: 40px 56px; }
.narrow-wide { padding-block: 40px 56px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Главная: разворот */
.spread { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding-block: 56px; }
.spread-left { padding-right: 56px; border-right: 1px solid var(--rule); }
.spread-right { padding-left: 64px; }
@media (max-width: 900px) {
  .spread { grid-template-columns: minmax(0, 1fr); padding-block: 32px; gap: 40px; }
  .spread-left { padding-right: 0; border-right: 0; order: 2; border-top: 1px solid var(--rule); padding-top: 32px; }
  .spread-right { padding-left: 0; }
}
.toc { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 1rem; }
.toc li { display: flex; align-items: baseline; gap: 8px; }
.toc a { color: var(--ink); }
.toc a:hover, .toc a[aria-current="page"] { color: var(--accent); }
.toc a[aria-current="page"] { font-weight: 700; }
.leader { flex: 1; border-bottom: 1px dotted var(--leader); transform: translateY(-4px); min-width: 12px; }
.toc .num { color: var(--muted); font-size: 0.9375rem; }

.poem-feature { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; min-width: 0; }
.poem-title { margin: 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(2.25rem, 5.5vw, 3.25rem); line-height: 1.05; }
.poem-title a { color: var(--ink); }
.poem-title a:hover { color: var(--accent); text-decoration: none; }
.ornament { color: var(--accent); display: block; }
.epigraph { font-style: italic; color: var(--muted); align-self: flex-end; text-align: right; max-width: 40ch; }
.poem-body {
  white-space: pre-wrap; overflow-wrap: break-word;
  font-size: var(--poem-size); line-height: 1.8; text-align: left; max-width: 100%;
}
.signature { font-style: italic; color: var(--muted); }
.feature-links { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center; font-size: 0.9375rem; }

.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; padding-bottom: 48px; }
.two-cols-wide { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 800px) { .two-cols, .two-cols-wide { grid-template-columns: minmax(0, 1fr); } }
.ranked, .dated { list-style: none; margin: 0; padding: 0; }
.ranked li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--rule-soft); }
.rank { font-family: var(--display); font-style: italic; font-size: 1.5rem; color: var(--accent); line-height: 1; }
.ranked a, .dated a { color: var(--ink); font-size: 1.0625rem; }
.ranked a:hover, .dated a:hover { color: var(--accent); }
.ranked .muted { font-size: 0.875rem; }
.dated li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--rule-soft); }
.dated .muted { font-size: 0.875rem; white-space: nowrap; }
.comment-teasers { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.comment-teasers blockquote { margin: 0 0 4px; font-style: italic; }
.pull-quote { margin: 0; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.75rem; line-height: 1.35; overflow-wrap: anywhere; }
.search-inline { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.search-inline label { font-weight: 700; font-size: 0.9375rem; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.card h3 { margin: 0 0 8px; font-size: 1.125rem; }
.card > p { margin-bottom: 14px; color: var(--ink-2); font-size: 0.9375rem; }
.card .btn-row { margin-bottom: 20px; }

/* ---------- Раздел и списки стихов */
.with-toc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 0; padding-block: 40px 56px; }
.toc-col { padding-right: 48px; border-right: 1px solid var(--rule); }
.content-col { padding-left: 56px; min-width: 0; }
@media (max-width: 900px) {
  .with-toc { grid-template-columns: minmax(0, 1fr); padding-block: 28px 40px; }
  .toc-col { order: 2; padding-right: 0; border-right: 0; border-top: 1px solid var(--rule); padding-top: 32px; margin-top: 40px; }
  .content-col { padding-left: 0; }
}
.poem-list { list-style: none; margin: 8px 0 0; padding: 0; }
.poem-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 14px 0; border-top: 1px solid var(--rule-soft); }
.poem-list-title { font-family: var(--display); font-weight: 600; font-size: 1.4375rem; line-height: 1.2; color: var(--ink); }
.poem-list-title:hover { color: var(--accent); }
.first-line { flex-basis: 100%; font-style: italic; color: var(--ink-2); font-size: 0.9375rem; }
.poem-list .meta { flex-basis: 100%; }
.sort-switch { margin-bottom: 8px; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 28px; }
.pager a, .pager span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--rule); border-radius: 2px; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pager .gap { border: 0; }

/* ---------- Стихотворение */
.reading { max-width: 720px; margin: 0 auto; padding-block: 40px 32px; display: flex; flex-direction: column; align-items: center; }
.reading > .crumbs { align-self: stretch; }
.reading-head { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; margin-bottom: 32px; width: 100%; }
.reading-head .epigraph { align-self: flex-end; }
.poem-body-full { align-self: center; }
.reading .signature { align-self: flex-end; margin-top: 20px; }
.reading-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--rule); width: 100%; }
.size-tools { display: inline-flex; gap: 4px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); font: inherit; font-size: 0.9375rem; border-radius: 2px; cursor: pointer;
}
.tool:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tool[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tool[aria-pressed="true"] svg { fill: currentColor; }
.prev-next { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; width: 100%; margin-top: 28px; }
.prev-next a { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.prev-next a:hover { color: var(--accent); text-decoration: none; }
.prev-next .next { text-align: right; align-items: flex-end; }
.prev-next .center { font-size: 0.9375rem; color: var(--accent); }
@media (max-width: 560px) { .prev-next { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .prev-next .center { grid-column: 1 / -1; grid-row: 2; justify-self: center; } }
.page-body { font-size: 1.0625rem; line-height: 1.8; align-self: stretch; }
.aside-poem { max-width: 720px; margin: 0 auto 56px; }
.poem-excerpt { font-style: italic; color: var(--ink-2); margin-bottom: 10px; }

/* ---------- Отзывы и гостевая */
.comments { max-width: 720px; margin: 0 auto; padding-block: 40px 56px; border-top: 1px solid var(--rule); }
.more-poems { max-width: 720px; margin: 0 auto; padding-block: 40px 56px; border-top: 1px solid var(--rule); }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--rule-soft); }
.comment-head { margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.author-reply { margin: 14px 0 0 24px; padding: 12px 16px; background: var(--accent-soft); border-radius: 2px; }
.author-reply .comment-body { color: var(--ink); }
.comments .form, .narrow .form.card { margin-top: 28px; }
.comment-notice { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; scroll-margin-top: 24px; }
.comment-notice:empty { display: none; }
.comment-notice:focus { outline: none; }
.comment-notice:not(:empty) + .form { margin-top: 12px !important; }
.comment.is-new { animation: comment-new 2.4s ease-out; }
@keyframes comment-new { from { background: var(--ok-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .comment.is-new { animation: none; } }
.gb-list { margin-top: 24px; }

.search-big { display: flex; gap: 10px; margin: 8px 0 20px; }
.search-big input { flex: 1; min-width: 0; font-size: 1.125rem; }
.search-results { padding-left: 1.4em; display: flex; flex-direction: column; gap: 18px; }
.snippet { color: var(--ink-2); font-size: 0.9375rem; margin-top: 4px; }

/* ---------- Фотогалерея */
.album-grid, .photo-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 20px; }
.album-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.album-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.album-card img, .album-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--rule-soft); border: 1px solid var(--rule); }
.album-name { font-family: var(--display); font-weight: 600; font-size: 1.375rem; }
.album-card:hover { text-decoration: none; }
.album-card:hover .album-name { color: var(--accent); }
.photo-grid figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); background: var(--rule-soft); }
.photo-grid figcaption { font-size: 0.9375rem; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(12, 10, 9, 0.9); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 92vw; }
.lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; }
.lightbox figcaption { color: #EEE7DC; font-size: 1rem; text-align: center; }
.lightbox-close, .lightbox-nav { position: fixed; background: rgba(0, 0, 0, 0.35); color: #FFFFFF; border: 0; cursor: pointer; font-size: 2rem; line-height: 1; width: 52px; height: 52px; border-radius: 50%; }
.lightbox-close { top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.lightbox-nav.prev { left: max(12px, env(safe-area-inset-left, 0px)); top: 50%; }
.lightbox-nav.next { right: max(12px, env(safe-area-inset-right, 0px)); top: 50%; }

/* ---------- Вход, кабинет */
.auth-box { max-width: 520px; padding-block: 48px 64px; display: flex; flex-direction: column; gap: 16px; }
.auth-box .rule-top { padding-top: 20px; }
.danger-zone { margin-top: 28px; }
.email-change { margin-top: 14px; }
.email-change summary, .danger-zone summary { cursor: pointer; }
.email-change summary { color: var(--accent); }
.email-change .form { margin-top: 14px; }
.notice-card { margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.notice-card .btn-row { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.danger-zone summary { cursor: pointer; color: var(--err-ink); }
.danger-zone .form { margin-top: 14px; max-width: 420px; }
.error-code { font-family: var(--display); font-style: italic; font-size: 5rem; line-height: 1; color: var(--accent); }

/* ---------- Подвал */
.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-block: 28px 48px; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted); }
.colophon > div { max-width: 60ch; }
.colophon-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; }
.colophon .tagline { font-style: italic; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  .masthead, .colophon, .reading-tools, .prev-next, .comments, .more-poems, .crumbs, .flashes { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
}
