/* Зелёная палитра — та же, что в админке Medical и Blogger Scout. */
:root {
  --accent: #169d65;
  --accent-dark: #107d4f;
  --accent-light: #e8f6ee;
  --accent-line: #c6e8d5;
  --text: #26342e;
  --muted: #6f7f76;
  --border: #e4eae6;
  --page-bg: #f5f7f6;
  --paper: #fff;
  --ui: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --read: 'Literata', Georgia, serif;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
}
* { box-sizing: border-box; }
/* Полоса прокрутки видна всегда: короткие и длинные страницы не сдвигают вёрстку по ширине. */
html { overflow-y: scroll; }
body { margin: 0; background: var(--page-bg); overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
/* Основной блок не короче экрана: подвал уходит за первый экран даже на коротких страницах. */
main.wrap { min-height: 100vh; }

/* Шапка */
.top { background: var(--paper); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.32s ease; }
/* Классы ставит /scrolltop.js: в начале прокрутки шапка уезжает, дальше возвращается закреплённой с тенью */
.top.top-away { transform: translateY(-100%); }
.top.top-stuck { box-shadow: 0 6px 18px #1b2b2314; }
.top-in { display: flex; align-items: center; gap: 28px; height: 62px; }
.brand { display: flex; align-items: center; --k: #16a768; }
.brand .logo-mark { display: block; overflow: visible; }
.nav { display: flex; gap: 4px; }
.nav { align-self: stretch; }
.nav a { position: relative; display: flex; align-items: center; padding: 0 12px; white-space: nowrap; color: var(--muted); font-weight: 500; transition: color 0.15s ease; }
.nav a:hover { color: var(--text); }
/* Активный пункт — не плашка, а ровная линия прямо под словом (.nav-pulse). Зубец кардиограммы на её конце и блик — только
   при наведении: в покое вторая кардиограмма рядом с w в логотипе спорит с ним */
.nav a[aria-current] { color: var(--accent-dark); }
.nav-pulse { position: absolute; left: 12px; right: 4px; bottom: calc(50% - 17px); height: 9px; display: flex; align-items: flex-end; color: var(--accent); pointer-events: none; }
.nav-pulse svg { display: block; overflow: visible; }
.nav-pulse path { fill: none; stroke: currentColor; stroke-dasharray: 100 200; stroke-dashoffset: 100; }
.np-line { flex: 1; min-width: 0; width: 0; height: 2px; margin-right: -1px; }
.np-line path { stroke-width: 2; stroke-dashoffset: 0; }
.np-spike { flex: none; width: 14px; height: 9px; }
.np-spike path { stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; transition: stroke-dashoffset 0.2s ease; }
/* Наведение: зубец дорисовывается из конца линии, потом по линии и зубцу пробегает блик — пока курсор на пункте */
.nav a:hover .np-spike path:not(.run) { stroke-dashoffset: 0; transition-duration: 0.38s; transition-timing-function: cubic-bezier(0.2, 0.5, 0.4, 1); }
.nav-pulse .run { stroke: #fff; opacity: 0.85; animation: none; }
.np-line .run { stroke-dasharray: 22 300; stroke-dashoffset: 22; }
.np-spike .run { stroke-dasharray: 34 300; stroke-dashoffset: 34; }
.nav a:hover .np-line .run { animation: np-run-line 3s linear 0.4s infinite; }
.nav a:hover .np-spike .run { animation: np-run-spike 3s linear 0.4s infinite; }
/* .np-hold (nav-pulse.js) — курсор ушёл, но блик добегает до конца, и только потом зубец втягивается */
.nav a.np-hold .np-spike path:not(.run) { stroke-dashoffset: 0; }
.nav a.np-hold .np-line .run { animation: np-run-line 3s linear 0.4s infinite; }
.nav a.np-hold .np-spike .run { animation: np-run-spike 3s linear 0.4s infinite; }
@keyframes np-run-line { 0% { stroke-dashoffset: 22; } 18%, 100% { stroke-dashoffset: -100; } }
@keyframes np-run-spike { 0%, 14% { stroke-dashoffset: 34; } 28%, 100% { stroke-dashoffset: -100; } }
/* Огонёк у «Моей ленты»: стоит вплотную за словом, язычок слегка колышется от основания */
.nav-fire { flex: none; margin: -2px 5px 0 0; overflow: visible; }
.nav-fire-body { transform-origin: 50% 95%; transform-box: fill-box; animation: nav-fire 2.4s ease-in-out infinite; }
@keyframes nav-fire { 0%, 100% { transform: scale(1, 1) rotate(0deg); } 35% { transform: scale(0.94, 1.06) rotate(-3deg); } 70% { transform: scale(1.03, 0.97) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .nav-fire-body { animation: none; } }
@media (prefers-reduced-motion: reduce) { .nav-pulse path { animation: none !important; transition: none; } .nav-pulse .run { display: none; } }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.account form { margin: 0; }
/* Профиль: круглый значок в шапке и меню под ним (popover в верхнем слое — привязан к значку через anchor).
   Значок стоит у правого края шапки, поэтому меню ровняется по его правому краю и раскрывается влево — не вылезает за экран */
.me-avatar { anchor-name: --me; flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font: 600 14px/1 var(--ui); letter-spacing: 0.3px; cursor: pointer; box-shadow: 0 0 0 0 var(--accent-line); transition: box-shadow 0.15s ease, background 0.15s ease; }
.me-avatar:hover { background: var(--accent-dark); }
.me-avatar:has(+ .me-menu:popover-open) { box-shadow: 0 0 0 4px var(--accent-line); }
.me-menu { position: fixed; position-anchor: --me; inset: auto; top: anchor(bottom); right: anchor(right); margin: 10px 0 0; width: min(250px, calc(100vw - 32px)); padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); color: var(--text); box-shadow: 0 18px 44px #1b2b2324, 0 2px 6px #1b2b2312; overflow: visible; }
/* Без anchor-позиционирования (старые браузеры) — правый край меню по правому краю колонки .wrap, под шапкой */
@supports not (anchor-name: --me) { .me-menu { top: 62px; right: max(24px, calc(50% - 516px)); } }
/* Меню выплывает снизу вверх, пункты поднимаются следом друг за другом */
.me-menu:popover-open { animation: menu-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
.me-menu:popover-open > * { animation: menu-item-in 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.me-menu:popover-open > :nth-child(2) { animation-delay: 0.04s; }
.me-menu:popover-open > :nth-child(3) { animation-delay: 0.08s; }
.me-menu:popover-open > :nth-child(4) { animation-delay: 0.12s; }
@keyframes menu-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes menu-item-in { from { opacity: 0; transform: translateY(10px); } }
.me-menu-who { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.me-menu-who > span:last-child { min-width: 0; }
.me-menu-who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-menu-who small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-menu a, .me-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 15px/1.3 var(--ui); text-align: left; cursor: pointer; }
.me-menu a svg, .me-menu button svg { color: var(--muted); }
.me-menu a:hover, .me-menu button:hover { background: var(--accent-light); color: var(--accent-dark); }
.me-menu a:hover svg, .me-menu button:hover svg { color: var(--accent); }
.me-menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .me-menu:popover-open, .me-menu:popover-open > * { animation: none; } .me-avatar { transition: none; } }
/* Разделы на телефоне: вместо строки «Статьи Книги Авторы» — три полоски слева перед логотипом и меню под ними (sectionsMenu) */
.sec-btn { display: none; anchor-name: --sec; flex: none; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--paper); color: var(--accent-dark); font: 600 15px/1 var(--ui); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.sec-btn .sec-burger { color: var(--muted); transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sec-btn:hover { border-color: var(--accent-line); }
.sec-btn:has(+ .sec-menu:popover-open) { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-line); }
.sec-btn:has(+ .sec-menu:popover-open) .sec-burger { color: var(--accent); transform: scaleX(-1); }
.sec-menu { position: fixed; position-anchor: --sec; inset: auto; top: anchor(bottom); left: anchor(left); margin: 10px 0 0; width: min(320px, calc(100vw - 32px)); padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); color: var(--text); box-shadow: 0 18px 44px #1b2b2324, 0 2px 6px #1b2b2312; overflow: visible; }
@supports not (anchor-name: --sec) { .sec-menu { top: 62px; left: 16px; } }
.sec-menu:popover-open { animation: menu-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sec-menu:popover-open > * { animation: menu-item-in 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.sec-menu:popover-open > :nth-child(2) { animation-delay: 0.04s; }
.sec-menu:popover-open > :nth-child(3) { animation-delay: 0.08s; }
.sec-menu:popover-open > :nth-child(4) { animation-delay: 0.12s; }
.sec-menu a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; }
.sec-menu a svg { flex: none; box-sizing: content-box; padding: 8px; border-radius: 9px; background: var(--page-bg); color: var(--muted); }
.sec-menu b { display: block; font: 600 16px/1.25 var(--ui); }
.sec-menu small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.3; }
.sec-menu a:hover { background: var(--accent-light); }
.sec-menu a:hover svg { background: var(--paper); color: var(--accent); }
.sec-menu a[aria-current] { background: var(--accent-light); }
.sec-menu a[aria-current] b { color: var(--accent-dark); }
.sec-menu a[aria-current] svg { background: var(--accent); color: #fff; }
@media (prefers-reduced-motion: reduce) { .sec-menu:popover-open, .sec-menu:popover-open > * { animation: none; } .sec-btn .sec-burger { transition: none; } }
/* С «Моей лентой» и «Избранным» пункты строкой не влезают рядом с «Подключить Awamed+» до ~940px — там тоже кнопка, «Избранное» остаётся в меню профиля */
@media (max-width: 940px) {
  .nav { display: none; }
  .sec-btn { display: grid; }
}
.link { background: none; border: 0; padding: 0; color: var(--muted); }
.link:hover { color: var(--accent-dark); }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.btn:hover { background: var(--accent-dark); }
.btn-small { height: 34px; padding: 0 16px; font-size: 14px; }

/* Моя лента над статьями: горизонтальная линия времени, у каждого вида обновлений свой цвет точки.
   Свежее слева; лишнее прокручивается вбок, на телефоне — по одной-полторы записи на экран */
/* Лента — одна колонка без настроек сбоку: они открываются кнопкой «Настроить ленту», а в первый раз стоят на месте ленты */
.news-page { display: grid; grid-template-columns: minmax(0, 1fr); padding: 8px 0 64px; }
.news { position: relative; margin-top: 28px; padding: 18px 22px 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.news-page .news { margin-top: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.news-head { display: flex; align-items: baseline; gap: 10px; min-height: 26px; }
.news-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }
.news-count { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.news-tune { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); font: 600 14px var(--ui); color: #fff; white-space: nowrap; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.news-tune:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.news-tune:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.news-tune svg { flex: none; }
.news-empty { margin: 10px 0 14px; max-width: 620px; color: var(--muted); }
.news-guest .btn { margin-top: 14px; }
/* Над лентой — вкладки «что показать сейчас»; заголовок остаётся для читалок экрана */
.news-title-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.news-head:has(.news-show) { align-items: center; }
.news-show { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.news-show .seg { white-space: nowrap; }
.seg-n { font-size: 12px; font-weight: 600; color: #9aa8a0; font-variant-numeric: tabular-nums; }
.seg[aria-current] .seg-n { color: var(--accent); }
/* Порядок ленты — тот же переключатель, но тише вкладок: прижат вправо, мельче */
.news-head .news-sort { flex: none; width: auto; margin-left: auto; padding: 2px; border-radius: 10px; }
.news-head:has(.news-sort) { flex-wrap: wrap; row-gap: 10px; }
.news-head:has(.news-sort) .news-show { flex-shrink: 0; }
.news-sort .seg { padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.news-likes { white-space: nowrap; }
/* Настройка ленты — три шага: авторы → темы → что собирать. В первый раз карточка стоит на месте ленты,
   дальше та же настройка открывается модалкой. Шаги сверху — полоски, пройденные остаются зелёными */
.news-setup-first { padding: 28px 30px 0; background: var(--paper); border: 1px solid var(--border); border-radius: 16px; }
.modal.news-setup { width: min(980px, calc(100vw - 32px)); padding-bottom: 0; }
.news-set.news-setup h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.4px; color: var(--text); }
.news-set-sub { margin: 6px 0 0; max-width: 520px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.news-set form { display: grid; margin-top: 20px; }
.news-pane-in { position: absolute; opacity: 0; pointer-events: none; }
.news-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.news-tabs label { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 10px 0 2px; border-top: 3px solid var(--border); font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: border-color 0.25s ease, color 0.15s ease; }
.news-tabs label:hover { color: var(--text); }
.news-step-n { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--page-bg); box-shadow: inset 0 0 0 1px var(--border); font: normal 700 11.5px var(--ui); color: var(--muted); transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; }
.news-tab-n { font-size: 12px; font-weight: 600; color: #9aa8a0; font-variant-numeric: tabular-nums; }
#news-pane-authors:checked ~ .news-tabs [for='news-pane-authors'],
#news-pane-topics:checked ~ .news-tabs [for='news-pane-topics'],
#news-pane-kinds:checked ~ .news-tabs [for='news-pane-kinds'] { border-top-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
#news-pane-authors:checked ~ .news-tabs [for='news-pane-authors'] .news-step-n,
#news-pane-topics:checked ~ .news-tabs [for='news-pane-topics'] .news-step-n,
#news-pane-kinds:checked ~ .news-tabs [for='news-pane-kinds'] .news-step-n { background: var(--accent); box-shadow: none; color: #fff; }
/* в первый раз пройденные шаги остаются отмеченными — видно, сколько осталось */
.news-setup-first #news-pane-topics:checked ~ .news-tabs [for='news-pane-authors'],
.news-setup-first #news-pane-kinds:checked ~ .news-tabs :is([for='news-pane-authors'], [for='news-pane-topics']) { border-top-color: var(--accent-line); }
.news-setup-first #news-pane-topics:checked ~ .news-tabs [for='news-pane-authors'] .news-step-n,
.news-setup-first #news-pane-kinds:checked ~ .news-tabs :is([for='news-pane-authors'], [for='news-pane-topics']) .news-step-n { background: var(--accent-light); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--accent-dark); }
#news-pane-authors:focus-visible ~ .news-tabs [for='news-pane-authors'],
#news-pane-topics:focus-visible ~ .news-tabs [for='news-pane-topics'],
#news-pane-kinds:focus-visible ~ .news-tabs [for='news-pane-kinds'] { outline: 2px solid var(--accent); outline-offset: 2px; }
/* низ шага — «Назад / Дальше» (в первый раз) или «Сохранить» (в модалке); прилипает к низу экрана, пока список длинный */
.news-step-nav, .news-set-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px -30px 0; padding: 14px 30px 18px; border-top: 1px solid var(--border); border-radius: 0 0 16px 16px; background: var(--paper); }
.news-set-foot { justify-content: flex-end; margin: 16px -26px 0; padding: 14px 26px 20px; }
.news-step-back { padding: 8px 2px; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.news-step-back:hover { color: var(--text); }
.news-step-nav label:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.news-step-nav .btn { min-width: 150px; cursor: pointer; }
.news-pane { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }
#news-pane-authors:checked ~ .news-pane-authors,
#news-pane-topics:checked ~ .news-pane-topics,
#news-pane-kinds:checked ~ .news-pane-kinds { display: block; }
.news-pane-note { float: left; width: 100%; padding: 12px 0 8px; font-size: 12.5px; color: var(--muted); }
.news-pane-note + * { clear: both; }
/* поиск по авторам и темам — над списками; на вкладке «Что собирать» искать нечего */
.news-find { position: relative; display: flex; align-items: center; height: 38px; margin-top: 14px; padding: 0 10px 0 36px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--page-bg); transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
.news-find[hidden], #news-pane-kinds:checked ~ .news-find { display: none; }
.news-find:focus-within { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px var(--accent-light); }
.news-find svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.news-find:focus-within svg { color: var(--accent); }
.news-find input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 400 14px var(--ui); color: var(--text); }
.news-find input::placeholder { color: #9aa8a0; }
.news-find input::-webkit-search-cancel-button { cursor: pointer; }
.news-find ~ .news-pane .news-pane-note { padding-top: 10px; }
.news-find-none { margin: 4px 0 6px; font-size: 13px; color: var(--muted); }
.news-who[hidden], .news-opt[hidden], .news-find-none[hidden] { display: none; }
@media (max-width: 720px) { .news-find input { font-size: 16px; } }
/* Авторы — аватар с инициалами, имя и специальность; отмеченный — аватар заливается и получает галочку. Длинный список прокручивается */
.news-who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 12px; margin: 0 -8px; }
.news-who { position: relative; display: flex; align-items: center; gap: 11px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.news-who:hover { background: var(--page-bg); }
.news-who input { position: absolute; opacity: 0; pointer-events: none; }
.news-who .avatar { position: relative; width: 34px; height: 34px; font-size: 12.5px; background: var(--page-bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); transition: background 0.15s ease, color 0.15s ease; }
.news-who .avatar::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 0 0 2px var(--paper); transform: scale(0); transition: transform 0.15s ease; }
.news-who input:checked ~ .avatar { background: var(--accent-light); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent-line); }
.news-who input:checked ~ .avatar::after { transform: scale(1); }
.news-who input:focus-visible ~ .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.news-who-name { min-width: 0; }
.news-who b { display: block; font-size: 14px; font-weight: 500; line-height: 1.3; }
.news-who input:checked ~ .news-who-name b { font-weight: 600; }
.news-who small { display: block; font-size: 12px; color: var(--muted); }
/* темы отмеченного автора: сужают его статьи в ленте до выбранных; с отступом до имени */
.news-who-topics { display: none; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 5px; padding: 0 8px 8px 53px; }
.news-who:has(input:checked):not([hidden]) + .news-who-topics { display: flex; }
.news-who-topics small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.news-who-topics .news-opt span { padding: 3px 10px; font-size: 12.5px; }
/* Темы — чипы */
.news-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.news-opt { position: relative; display: inline-flex; cursor: pointer; }
.news-opt input { position: absolute; opacity: 0; pointer-events: none; }
.news-opt span { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; color: var(--muted); transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; }
.news-opt:hover span { border-color: var(--accent-line); color: var(--text); }
.news-opt input:checked + span { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); }
.news-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Что собирать — переключатели; у каждого цвет своей точки на линии ленты */
.news-kind { --dot: var(--accent); display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.news-kind:first-of-type { border-top: 0; }
.news-kind input { position: absolute; opacity: 0; pointer-events: none; }
.news-kind > span:not(.news-badge) { flex: 1; min-width: 0; }
.news-kind b { display: block; font-size: 14px; font-weight: 500; }
.news-kind .news-badge { --size: 30px; }
.news-kind small { display: block; font-size: 12px; color: var(--muted); }
.news-switch { flex: none; position: relative; width: 34px; height: 20px; border-radius: 999px; background: #d5ddd8; transition: background 0.15s ease; }
.news-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0000002e; transition: transform 0.15s ease; }
.news-kind input:checked ~ .news-switch { background: var(--accent); }
.news-kind input:checked ~ .news-switch::after { transform: translateX(14px); }
.news-kind input:focus-visible ~ .news-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Лента — карточки одна под другой во всю ширину, как лента в Instagram, и сама карточка — как статья в разделе «Статьи»:
   сверху значок и что произошло, крупный заголовок, лид, внизу автор с фото. Появляются снизу вверх, как карточки статей (rise.js) */
.news-list { --dot: var(--accent); display: grid; grid-template-columns: 1fr; gap: 16px; margin: 18px 0 0; padding: 0; list-style: none; }
.news-item { padding: 22px 28px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); }
.news-row-meta { align-items: center; gap: 10px; }
.news-badge { --size: 30px; display: grid; place-items: center; flex: none; width: var(--size); height: var(--size); border-radius: 50%; color: var(--dot); background: color-mix(in srgb, var(--dot) 13%, var(--paper)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--dot) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { .news-tabs label, .news-step-n, .news-tune, .news-opt span, .news-who .avatar, .news-find, .news-who .avatar::after, .news-switch, .news-switch::after { transition: none; } }
.news-topics { --dot: #4d7a93; }
.news-reviews { --dot: #b8894a; }
.news-books { --dot: #6b6f9e; }
.news-mark { font-size: 13px; line-height: 1.3; font-weight: 600; color: color-mix(in srgb, var(--dot) 80%, #26342e); }
.news-when { margin-left: 4px; }
.news-item .row-title { margin-top: 12px; }
.news-doctors { display: inline-flex; align-items: center; }
.news-doctors > span:last-child { margin-left: 8px; }
.news-doctors .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--paper); }
.news-likes { color: var(--muted); }
@media (max-width: 560px) { .news-item { padding: 18px; } }
@media (max-width: 860px) {
  .news-head:has(.news-show) { flex-wrap: wrap; row-gap: 10px; }
  .news-show { order: 1; }
  .news-head .news-sort { margin-left: 0; }
}
@media (max-width: 560px) {
  .news { padding: 16px 16px 6px; }
  .news-page .news { padding: 0; }
  .news-tune-more { display: none; }
  .news-setup-first { padding: 22px 18px 0; }
  .news-setup-first .news-step-nav { margin: 18px -18px 0; padding: 12px 18px 16px; }
  .news-tabs label { gap: 5px; font-size: 13px; }
  .news-tabs .news-tab-n { display: none; }
}

/* Главная */
.intro { padding: 44px 0 22px; max-width: 700px; }
.intro h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.15; letter-spacing: -0.9px; font-weight: 650; }
.intro p { margin: 0; color: var(--muted); font-size: 16px; }
/* Шапка ленты: под заголовком — бумага кардиографа (клетка 8px, крупная — 40px) и тихая линия ЭКГ справа.
   Клетка растворяется к краям и к тексту, чтобы не спорить с заголовком; линия один раз прорисовывается при загрузке */
.intro.home-head { position: relative; isolation: isolate; max-width: none; }
.home-head > h1, .home-head > p { max-width: 700px; }
.home-head::before { content: ''; position: absolute; z-index: -2; inset: 0 -24px; pointer-events: none;
  background: linear-gradient(#169d651a 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, #169d651a 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(#169d650b 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, #169d650b 1px, transparent 1px) 0 0 / 8px 8px;
  -webkit-mask: radial-gradient(ellipse 70% 90% at 82% 55%, #000 20%, transparent 75%); mask: radial-gradient(ellipse 70% 90% at 82% 55%, #000 20%, transparent 75%); }
.home-trace { position: absolute; z-index: -1; right: 0; top: 50%; width: 50%; height: 90px; margin-top: -40px; color: var(--accent); opacity: 0.4; overflow: visible;
  -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 30%, #000 85%, transparent); }
.home-trace path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 100; stroke-dashoffset: 100; animation: home-trace 1.8s cubic-bezier(0.3, 0.1, 0.3, 1) 0.2s forwards; }
@keyframes home-trace { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .home-trace path { animation: none; stroke-dashoffset: 0; } }

.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.segs { display: inline-flex; padding: 3px; background: var(--paper); border: 1px solid var(--border); border-radius: 11px; }
.seg { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg:hover { color: var(--text); }
.seg[aria-current] { background: var(--accent-light); color: var(--accent-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper); font-size: 13.5px; color: var(--muted); }
.chip:hover { border-color: var(--accent-line); color: var(--text); }
.chip[aria-current] { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-light); }
/* Мультивыбор (лента статей): выбранная тема или вид доступа — с галочкой, чтобы было видно, что можно отметить ещё */
[data-multi] > [aria-current]:not([data-all])::after { content: ''; width: 4px; height: 8px; margin: -3px 1px 0 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); flex: none; }
[data-multi] > .chip[aria-current]:not([data-all])::after { display: inline-block; vertical-align: middle; margin-left: 7px; }
/* «Ещё N» в свёрнутом ряду чипов (/chip-fold.js): пунктир — не фильтр, а раскрытие ряда */
.chip-more { font: inherit; font-size: 13.5px; border-style: dashed; color: var(--accent-dark); cursor: pointer; }
.chip-more:hover { border-style: solid; }
.chip-more:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip[hidden] { display: none; }
.chip-in { animation: chip-in 0.18s ease-out; }
@keyframes chip-in { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .chip-in { animation: none; } }

/* Смена фильтра без перезагрузки: старый список коротко гаснет, новый поднимается строками (/filters.js) */
#feed { transition: opacity 0.16s ease, transform 0.16s ease; }
#feed.feed-leaving { opacity: 0.25; transform: translateY(6px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #feed { transition: none; } #feed.feed-leaving { transform: none; } }

/* Смена вкладки «Моей ленты» без перезагрузки: гаснут и поднимаются только записи (/news-show.js) */
#news .news-list, #news .news-empty { transition: opacity 0.16s ease, transform 0.16s ease; }
#news .news-leaving { opacity: 0.25; transform: translateY(6px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #news .news-list, #news .news-empty { transition: none; } #news .news-leaving { transform: none; } }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 48px; padding: 8px 0 64px; }

/* Лента — строки, а не карточки: статьи читают сверху вниз */
.rows { list-style: none; margin: 0; padding: 0; }
.row { padding: 26px 0; border-bottom: 1px solid var(--border); }
.row-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.topic { color: var(--accent-dark); font-weight: 500; }
.topic:hover { text-decoration: underline; }
.row-title { margin: 8px 0 6px; font-size: 22px; line-height: 1.25; letter-spacing: -0.4px; font-weight: 600; }
.row-title a:hover { color: var(--accent-dark); }
.row-lead { margin: 0 0 14px; max-width: 64ch; color: #45544c; font-family: var(--read); font-size: 16px; line-height: 1.6; }
.row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 13.5px; }
.byline { font-weight: 500; }
.row-foot .byline { display: inline-flex; align-items: center; gap: 8px; }
.byline:hover { color: var(--accent-dark); }

/* Метки доступа: открытая, по подписке, штучная */
.read-time, .book-year, .book-pages { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.read-time svg, .book-year svg, .book-pages svg { flex: none; }
.mark { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 500; }
.mark span { color: var(--accent-dark); }
/* По подписке — фиолетовый из радуги Awamed+ в шапке */
.mark-paid, .mark-paid span { color: #7a45b0; }
/* Штучная — медь монеты: не зелёный журнала и не фиолетовый подписки */
.mark-single, .mark-single span { color: #a4622a; }
.seg .mark { color: inherit; }

.side h2 { margin: 26px 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.authors-mini { list-style: none; margin: 0; padding: 0; }
.authors-mini a { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.authors-mini a:hover b { color: var(--accent-dark); }
.authors-mini b, .by-author b { display: block; font-weight: 600; }
.authors-mini small, .by-author small { display: block; color: var(--muted); font-size: 13px; }
.side-all { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--accent-dark); font-weight: 500; }
/* Топ авторов ленты: число статей по фильтрам справа, полоска под именем — доля от лидера */
.ta-scope { margin: -8px 0 10px; font-size: 13px; color: var(--muted); }
.ta-list a { gap: 12px; }
.ta-who { flex: 1; min-width: 0; }
.ta-bar { display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 0 / var(--share) 100% no-repeat, var(--accent-light); transition: background-size 0.4s ease-out; }
.ta-n { flex: none; min-width: 28px; font-size: 20px; font-weight: 650; letter-spacing: -0.4px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.ta-list li:first-child .ta-n { color: var(--accent-dark); }
.ta-list a:hover .ta-n { color: var(--accent-dark); }
.ta-none { margin: 0 0 6px; font-size: 14px; color: #45544c; }
.ta-more { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.ta-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.modal-authors { width: min(440px, calc(100vw - 32px)); }
.modal-authors h2 { font-size: 22px; letter-spacing: -0.4px; padding-right: 32px; }
.modal-authors .ta-list { margin-bottom: 10px; }
.avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-light); color: var(--accent-dark); font-weight: 600; font-size: 14px; }
.avatar-tone { background: hsl(var(--av-h) 55% 90%); color: hsl(var(--av-h) 60% 26%); }
a:hover > .avatar-tone, a.lp-face:hover .avatar-tone { background: hsl(var(--av-h) 55% 82%); }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
/* Фото автора ложится в тот же кружок, что и инициалы: тонкое кольцо держит край на светлом фоне */
img.avatar { object-fit: cover; box-shadow: 0 0 0 1px var(--accent-line); }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }

.empty { padding: 48px 0; }
.empty p { color: var(--muted); margin: 0 0 16px; }
.empty-page { max-width: 520px; padding: 80px 0; }
.empty-page h1 { margin: 0 0 10px; letter-spacing: -0.6px; }

/* Статья: текст прижат к левому краю сетки, справа — колонка с блоками */
.read-grid { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 56px; align-items: start; }
/* Шапка статьи и текст — белые карточки, как на странице автора и в правой колонке */
.article { min-width: 0; display: grid; align-content: start; gap: 16px; padding: 36px 0 72px; }
/* Левая колонка — карточки на всю ширину колонки, поэтому зазор до правой ровно как между карточками */
.read-grid:has(> .article) { gap: 16px; }
.article-head .back { margin-bottom: 18px; }
.article-head .by { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.article-body .prose > :last-child { margin-bottom: 0; }
.article .gate { margin-top: 0; }
/* Вся колонка закреплена под шапкой на любой высоте экрана; не влезает — листается сама */
.read-side { position: sticky; top: 50px; align-self: start; max-height: calc(100vh - 50px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; display: grid; align-content: start; gap: 16px; padding: 36px 0 72px; }
.side-stick { display: grid; gap: 16px; }
.side-block { padding: 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.side-block h2 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.side-author p { margin: 12px 0 10px; font-family: var(--read); font-size: 14.5px; line-height: 1.6; color: #45544c; }
.side-author .by-author:hover b { color: var(--accent-dark); }
.side-author .side-all { margin-top: 0; }
.rel { list-style: none; margin: 0; padding: 0; }
.rel li + li { border-top: 1px solid var(--border); }
.rel a { display: block; padding: 11px 0; }
.rel li:first-child a { padding-top: 0; }
.rel li:last-child a { padding-bottom: 0; }
.rel-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.rel b { display: block; margin-top: 3px; font-size: 15px; line-height: 1.35; font-weight: 600; }
.rel a:hover b { color: var(--accent-dark); }
.promo { background: var(--accent-light); border-color: var(--accent-line); }
.promo h2 { margin-bottom: 6px; font-size: 17px; line-height: 1.3; letter-spacing: -0.3px; color: var(--text); }
.promo p { margin: 0 0 14px; font-size: 14px; color: #45544c; }
.promo .btn { width: 100%; }
.back { display: inline-block; margin-bottom: 26px; font-size: 14px; color: var(--muted); }
.back:hover { color: var(--accent-dark); }
/* Хлебные крошки (#2844): тот же тихий тон, что у прежней ссылки «Все …», путь — строкой; текущая страница — цветом текста,
   длинное название обрезается многоточием (целиком — в подсказке и в заголовке ниже). «›» — оформление, диктор его не читает */
.crumbs { margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; min-width: 0; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: baseline; min-width: 0; }
.crumbs li + li::before { content: '›' / ''; padding: 0 8px; color: #a9b6af; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-dark); }
.crumbs [aria-current] { overflow: hidden; max-width: 52ch; color: var(--text); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.rd-crumbs { margin: 4px 0 0; font-size: 13px; }
/* В меню читалки название книги крупно стоит сразу ниже — текущий пункт крошек только для диктора */
.rd-crumbs li:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 760px) { .crumbs [aria-current] { max-width: 100%; } .crumbs li:last-child { flex: 1 1 100%; } .crumbs li:last-child::before { content: none; } }
.article h1 { margin: 12px 0 14px; font-size: 38px; line-height: 1.12; letter-spacing: -1px; font-weight: 650; }
.lead { margin: 0 0 26px; font-family: var(--read); font-size: 20px; line-height: 1.55; color: #45544c; }
.by { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.by-author { display: flex; align-items: center; gap: 12px; }
.by-author h1 { margin: 0; font-size: 30px; }
.by-books { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.by-books h2 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
/* книги — ровно пополам: две равные колонки на всю ширину, на узком экране одна */
.by-books ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 32px; width: 100%; margin: 0; padding: 0; list-style: none; }
.by-books li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.by-books li > span:not(.book-cover) { flex: 1; min-width: 0; }
@media (max-width: 560px) { .by-books ul { grid-template-columns: minmax(0, 1fr); } }
.by-books b { display: block; font-family: var(--read); font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.by-books small { color: var(--muted); font-size: 12.5px; }
.books-all { font-size: 14px; font-weight: 500; color: var(--accent-dark); white-space: nowrap; }
.books-all:hover { text-decoration: underline; }
.author-books .by-books { padding-top: 0; border-top: 0; scroll-margin-top: 70px; }
/* На странице автора книги — две ровные колонки: закладка прижата к правому краю своей колонки */
.author-books .by-books ul { gap: 16px 40px; }
/* Обложка-корешок: полоса корешка слева, поэтому левые углы прямые */
.book-cover { flex: none; width: 26px; height: 36px; border-radius: 0 3px 3px 0; background: var(--cover, var(--accent)); box-shadow: inset 4px 0 0 #0000002e, inset -1px 0 0 #ffffff55, 0 1px 2px #26342e26; }
.by-books li:nth-child(3n + 2) .book-cover { --cover: #4d7a93; }
.by-books li:nth-child(3n) .book-cover { --cover: #b8894a; }

.prose { font-family: var(--read); font-size: 18px; line-height: 1.75; max-width: 66ch; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin: 1.6em 0 0.5em; font-family: var(--ui); font-size: 22px; line-height: 1.3; letter-spacing: -0.3px; font-weight: 600; }
/* Открытое начало обрывается и уходит в панель входа — видно, что текст продолжается */
.prose-cut { position: relative; max-height: none; -webkit-mask-image: linear-gradient(#000 calc(100% - 7em), transparent); mask-image: linear-gradient(#000 calc(100% - 7em), transparent); }

.gate { display: grid; grid-template-columns: 1fr 300px; gap: 32px; margin-top: 8px; padding: 30px; border-radius: 16px; background: var(--accent-light); border: 1px solid var(--accent-line); }
.gate-text h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.25; letter-spacing: -0.4px; }
.gate-text p { margin: 0 0 16px; color: #45544c; }
.gate-reg { color: var(--accent-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.gate .form { background: var(--paper); padding: 20px; border-radius: 12px; }
/* Платное продолжение: без формы входа, в перламутре кнопки Awamed+ из шапки */
.gate-plus { grid-template-columns: 1fr; background: linear-gradient(110deg, #eef0ff, #fbecf6 50%, #fff1e4); border-color: #e6dcf3; }
.gate-plus h2 { display: flex; align-items: center; gap: 10px; }
.gate-plus h2 svg { flex: none; width: 24px; height: 24px; }
.gate-plus p { max-width: 60ch; }
/* Кнопка — в фиолетовых тонах Awamed+, а не зелёная: на перламутре зелень чужая */
.gate-plus .btn { background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3) 0 0 / 160% 100%; box-shadow: 0 6px 16px -6px #7a3fc899; transition: background-position 0.25s ease, box-shadow 0.15s ease; }
.gate-plus .btn:hover { background-position: 100% 0; box-shadow: 0 8px 20px -6px #7a3fc8b3; }
.gate-single { grid-template-columns: 1fr; background: #fbf4ec; border-color: #eedcc6; }
.gate-single h2 { display: flex; align-items: center; gap: 10px; }
.gate-single h2 .mark svg { width: 24px; height: 24px; }
.gate-single p { max-width: 60ch; }
.gate-single .btn { background: #a4622a; box-shadow: 0 6px 16px -6px #a4622a99; }
.gate-single .btn:hover { background: #8a4f1f; }
/* Штучная статья со скидкой подписчикам: два предложения рядом на медном фоне штучной —
   разовая покупка медной кнопкой, Awamed+ на белом с фиолетовой рамкой и своей кнопкой.
   Цена — главное в карточке, крупно; подпись под ней объясняет разницу словами */
.gate-piece { gap: 20px; }
.gate-piece .gate-text p { margin: 0; }
.piece-offers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.piece-offer { display: flex; flex-direction: column; padding: 20px; border-radius: 12px; background: #ffffffa6; border: 1px solid #eedcc6; }
.gate-piece .piece-offer p { margin: 0; max-width: none; }
.piece-name { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.piece-name svg { color: #7a4fd6; }
.gate-piece .piece-price { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; }
.piece-cut { padding: 2px 8px; border-radius: 999px; background: #f1eaff; color: #6a3fc0; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.gate-piece .piece-note { flex: 1; margin-bottom: 16px; color: #45544c; font-size: 14px; }
.piece-plus { background: var(--paper); border-color: #b9a4ee; box-shadow: 0 10px 24px -14px #7a3fc880; }
.gate-piece .btn { align-self: flex-start; }
.gate-piece .btn-plus { background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3) 0 0 / 160% 100%; box-shadow: 0 6px 16px -6px #7a3fc899; transition: background-position 0.25s ease; }
.gate-piece .btn-plus:hover { background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3) 100% 0 / 160% 100%; }
.piece-in { margin: 0; }
@media (max-width: 640px) { .piece-offers { grid-template-columns: 1fr; } }
.gate-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }

/* Формы */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.form input { height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; font-weight: 400; background: var(--paper); color: var(--text); }
.form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #169d6522; }
.form .btn { width: 100%; margin-top: 4px; }
.consents { display: grid; gap: 8px; }
.form .consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; font-weight: 400; line-height: 1.4; color: var(--muted); cursor: pointer; transition: color 0.25s ease; }
.form .consent:has(input:checked) { color: var(--text); }
/* Свой чекбокс: при отметке квадрат пружинисто «брыкает» и заливается, галочка прорисовывается штрихом.
   При снятии то же в обратную сторону: квадрат держит заливку, пока галочка стирается, и только потом белеет. */
.check { position: relative; flex: none; width: 18px; height: 18px; margin-top: 1px; }
.form .check input { appearance: none; display: block; width: 18px; height: 18px; margin: 0; padding: 0; border: 1.5px solid #c3cec8; border-radius: 5px; background: var(--paper); cursor: pointer; transition: background-color 0.2s ease 0.36s, border-color 0.2s ease, transform 0.35s cubic-bezier(0.34, 1.8, 0.5, 1); }
.form .check input:hover { border-color: var(--accent); }
.form .check input:active { transform: scale(0.84); transition-duration: 0.1s; }
.form .check input:focus { box-shadow: 0 0 0 3px #169d6522; }
.form .check input:checked { background: var(--accent); border-color: var(--accent); transition-delay: 0s; }
.check svg { position: absolute; inset: 0; width: 18px; height: 18px; color: #fff; pointer-events: none; }
.check path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.4s cubic-bezier(0.65, 0, 0.35, 1); }
.check input:checked + svg path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.06s; }
@media (prefers-reduced-motion: reduce) { .check path, .check input:checked + svg path, .form .check input { transition: none; } }
.error { margin: 0; padding: 10px 12px; border-radius: 9px; background: #fdecec; color: #a2332f; font-size: 14px; animation: error-in 0.22s ease-out; }
.error.error-again { animation: error-shake 0.36s ease; }
@keyframes error-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes error-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .error, .error.error-again { animation: none; } }
.form .btn:disabled { opacity: 0.7; cursor: progress; }

.auth { max-width: 400px; margin: 56px auto 80px; padding: 32px; background: var(--paper); border: 1px solid var(--border); border-radius: 16px; }
.auth h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.6px; }
.auth > p { margin: 0 0 22px; color: var(--muted); }
.auth .auth-alt { margin: 20px 0 0; font-size: 14px; }
.auth-alt a { color: var(--accent-dark); font-weight: 600; }

/* Авторы */
.author-list { list-style: none; margin: 0 0 72px; padding: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.author-card { padding: 24px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; }
.author-card > a:first-child { display: flex; align-items: center; gap: 14px; }
.author-card b { display: block; font-size: 17px; font-weight: 600; }
.author-card small { display: block; color: var(--muted); font-size: 13.5px; }
.author-card p { flex: 1; margin: 16px 0; font-family: var(--read); line-height: 1.6; color: #45544c; }
/* Листалка под сеткой авторов: сетка отдаёт ей свой нижний отступ */
.author-list:has(+ .list-pager) { margin-bottom: 28px; }
.list-pager { margin-bottom: 72px; }
.count { color: var(--accent-dark); font-weight: 500; font-size: 14px; }
.author-head small { font-size: 15px; }
.bio { font-family: var(--read); font-size: 17px; line-height: 1.65; color: #45544c; margin: 18px 0 0; max-width: 64ch; }
/* Левая колонка автора — стопка карточек в том же ритме, что и правая: профиль, книги, статьи */
.author-main { min-width: 0; display: grid; align-content: start; gap: 16px; padding: 36px 0 72px; }
.main-card { padding: 24px 28px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.author-head .back { margin-bottom: 18px; }
.rows-cards { display: grid; gap: 16px; }
/* Между колонками тот же шаг 16px, что между карточками внутри колонки */
.author-grid { gap: 16px; }
.rows-cards .row { padding: 22px 28px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.rows-cards .row-foot .fav-compact { margin-right: -10px; }
/* Главная: вступление и фильтры прямо на фоне, как у книг и авторов; лента и колонка авторов — белые карточки */
.home-head ~ .grid { gap: 16px; align-items: start; padding: 24px 0 72px; }
/* колонка авторов стоит на месте, пока листается лента — как правая колонка статьи */
.home-head ~ .grid > .side { position: sticky; top: 79px; }

/* Правая колонка автора: цифры, карта статей по месяцам, темы */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; margin: 0; }
.st { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; margin: 0; }
.st dd { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 650; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.st dt { font-size: 13px; color: var(--muted); }
.st-date { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--border); }
.st-date dd { font-size: 17px; letter-spacing: -0.3px; font-weight: 600; }
.months { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; }
.mc { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 104px; border-radius: 4px; outline-offset: 1px; }
.mc b { font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.mc-bar { display: block; width: 100%; max-width: 16px; height: calc(var(--h) * 70px); min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--accent); transform-origin: bottom; }
.mc-empty .mc-bar { height: 3px; background: var(--border); border-radius: 2px; }
.mc small { font-size: 11px; line-height: 1; color: var(--muted); }
.mc small.mc-year { color: var(--text); font-weight: 600; }
.mc:hover .mc-bar, .mc:focus-visible .mc-bar { background: var(--accent-dark); }
.mc-empty:hover .mc-bar { background: #c3cec8; }
.mc::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 2; padding: 5px 9px; border-radius: 7px; background: var(--text); color: #fff; font-size: 12.5px; white-space: nowrap; opacity: 0; transform: translateY(3px); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
.mc:nth-child(n + 7)::after { left: auto; right: 0; }
.mc:hover::after, .mc:focus-visible::after { opacity: 1; transform: none; }
.months-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.topic-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.topic-bars li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; font-size: 14px; }
.topic-bars .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.tb { flex: 1 0 100%; height: 6px; border-radius: 3px; background: var(--accent-light); overflow: hidden; }
.topics-total { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.topic-bars .tp { display: inline-flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.topic-bars .tp b { font-weight: 600; }
/* подтемы — второй уровень, свёрнут: вся строка раздела «Кардиология (2) ›» раскрывает их по клику */
.sub-more { flex: 1 0 100%; }
.sub-more summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; list-style: none; cursor: pointer; border-radius: 4px; }
.sub-more summary::-webkit-details-marker { display: none; }
.sub-more .tn { display: inline-flex; align-items: baseline; gap: 5px; }
.sub-n { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sub-n::after { content: ''; width: 5px; height: 5px; margin-bottom: 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.15s ease; }
.sub-more[open] .sub-n::after { transform: translateY(2px) rotate(-135deg); }
.sub-more summary:hover .sub-n { color: var(--accent-dark); }
.sub-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sub-bars { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; display: grid; gap: 10px; }
.topic-bars .sub-bars li { font-size: 13px; color: var(--muted); }
.topic-bars .sub-bars .muted { font-size: 12px; }
.sub-bars .tb { height: 4px; }
.sub-more summary .topic:hover { text-decoration: none; }
.sub-open { display: inline-block; margin: 10px 0 0 14px; font-size: 13px; font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.sub-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.sub-bars .tb span { opacity: 0.55; }
.tb span { display: block; width: var(--w); height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; }
/* Графики вырастают один раз, когда колонка доходит до экрана: столбики по очереди слева направо, затем полосы тем */
@keyframes bar-grow { from { transform: scaleY(0); } }
@keyframes bar-grow-x { from { transform: scaleX(0); } }
@keyframes num-in { from { opacity: 0; transform: translateY(4px); } }
.seen .mc-bar { animation: bar-grow 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) calc(250ms + var(--i) * 45ms) both; }
.seen .mc b { animation: num-in 0.35s ease-out calc(650ms + var(--i) * 45ms) both; }
.seen .tb span { animation: bar-grow-x 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) calc(300ms + var(--i) * 90ms) both; }
.seen .sub-bars .tb span { animation-duration: 0.5s; animation-delay: 0ms; }
@media (prefers-reduced-motion: reduce) { .seen .mc-bar, .seen .mc b, .seen .tb span { animation: none; } .mc::after, .sub-n::after { transition: none; } }

/* Подвал тёмно-графитовый: плашка экстренной помощи, под ней блок журнала — колонки разделов, тем и связи, внизу строка с правовым */
.foot { --foot-bg: #2a2d31; --foot-text: #dcdee0; --foot-muted: #9a9ea3; --foot-line: #ffffff21; margin-top: 56px; background: var(--foot-bg); color: var(--foot-text); font-size: 14px; }
.foot a { transition: color 0.15s ease; }
.foot a:hover { color: #fff; }
.foot-sos { background: #e9ebed; color: #2a2d31; }
.foot-sos-in { display: grid; grid-template-columns: minmax(0, 300px) 1fr; align-items: center; gap: 32px; padding-top: 26px; padding-bottom: 26px; }
.foot-sos p { margin: 0; font-size: 15px; line-height: 1.5; }
.foot-phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; }
.foot-phones a { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.foot-phones a:hover { color: var(--accent-dark); }
.foot-phones b { position: relative; align-self: flex-start; font: 650 34px/1 var(--ui); letter-spacing: -0.5px; color: var(--accent-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.foot-phones span { font-size: 13px; line-height: 1.3; color: #5f646a; }
/* Главная цифра — ровное золото, без блика и перелива по цифрам; из-за неё без конца всплывают золотые пузырьки */
.foot-gilt b { color: #9a6d22; }
.foot-bubbles { position: absolute; left: 0; right: 0; bottom: 60%; height: 46px; pointer-events: none; }
.foot-bubbles i { position: absolute; bottom: 0; width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(168, 121, 42, .75); background: radial-gradient(circle at 32% 30%, #fbf0c8 0 28%, rgba(246, 226, 160, .35) 45%, transparent 72%); opacity: 0; animation: bubble-up 3.2s ease-in infinite; }
.foot-bubbles i:nth-child(1) { left: 10%; animation-delay: 0s; }
.foot-bubbles i:nth-child(2) { left: 34%; width: 5px; height: 5px; animation-duration: 2.6s; animation-delay: -1.1s; }
.foot-bubbles i:nth-child(3) { left: 55%; width: 9px; height: 9px; animation-duration: 3.8s; animation-delay: -2.3s; }
.foot-bubbles i:nth-child(4) { left: 76%; width: 6px; height: 6px; animation-duration: 2.9s; animation-delay: -0.6s; }
.foot-bubbles i:nth-child(5) { left: 90%; width: 4px; height: 4px; animation-duration: 2.4s; animation-delay: -1.7s; }
@keyframes bubble-up {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  50% { transform: translate(3px, -23px) scale(.9); }
  85% { opacity: .9; }
  100% { transform: translate(-2px, -46px) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .foot-bubbles { display: none; } }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-top: 44px; padding-bottom: 36px; }
.foot-brand { display: inline-flex; --k: #5fd49a; }
.foot-brand .logo-mark { display: block; overflow: visible; }
.foot-about p { margin: 14px 0 0; max-width: 300px; color: var(--foot-muted); line-height: 1.55; }
.foot-col h2 { margin: 4px 0 14px; font: 600 15px/1.3 var(--ui); color: #fff; }
.foot-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.foot-col a { color: var(--foot-text); overflow-wrap: anywhere; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 18px; padding-bottom: 24px; border-top: 1px solid var(--foot-line); font-size: 13px; color: var(--foot-muted); }
.foot-legal .foot-age { margin-left: auto; padding: 1px 7px; border: 1px solid var(--foot-line); border-radius: 6px; }
@media (max-width: 860px) {
  .foot-sos-in { grid-template-columns: 1fr; gap: 22px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .foot-about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; padding-top: 28px; }
  .foot-legal .foot-age { margin-left: 0; }
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; gap: 0; }
  .side { border-top: 1px solid var(--border); }
  .gate { grid-template-columns: 1fr; padding: 22px; }
  .read-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article { padding-bottom: 40px; }
  .home-head ~ .grid > .side { position: static; }
  .read-side { position: static; max-height: none; overflow: visible; padding-top: 0; }
  .author-main { padding-bottom: 16px; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { gap: 12px; }
  @supports not (anchor-name: --me) { .me-menu { right: 16px; } }
  .nav a { padding: 0 8px; }
  .nav-pulse { left: 8px; right: 0; }
  .intro { padding-top: 28px; }
  .intro h1 { font-size: 26px; }
  .home-trace { width: 100%; opacity: 0.22; }
  .segs { width: 100%; overflow-x: auto; }
  .seg { white-space: nowrap; }
  .article h1 { font-size: 29px; }
  .lead { font-size: 18px; }
  .prose { font-size: 17px; }
  .auth { margin-top: 28px; padding: 22px; }
  .main-card, .rows-cards .row { padding: 18px; }
}

/* Вход — модалка поверх страницы: читатель остаётся на статье, фон приглушён, но виден */
.modal { width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 24px 26px 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--paper); color: var(--text); box-shadow: 0 24px 60px #1b2b2330, 0 2px 8px #1b2b2314; }
.modal::backdrop { background: #1f2f2873; backdrop-filter: blur(2px); }
.modal:popover-open { animation: modal-in 0.18s ease-out; }
.modal:popover-open::backdrop { animation: modal-fade 0.18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes modal-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal:popover-open, .modal:popover-open::backdrop { animation: none; } }
.modal h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.6px; font-weight: 650; }
.modal-sub { margin: 0 0 18px; color: var(--muted); }
.modal .form { gap: 12px; }
.modal .auth-alt { margin: 16px 0 0; font-size: 14px; }
.demo { margin: 14px 0 0; padding: 10px 12px; border: 1px dashed var(--accent-line); border-radius: 10px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.demo span { display: block; margin-top: 2px; font-size: 12.5px; }
.modal-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); transform-origin: center; transition: rotate 0.6s ease-out; }
.modal-close:hover { background: var(--page-bg); color: var(--text); rotate: 90deg; transition-duration: 0.8s; transition-timing-function: ease; animation: close-spin-hover 0.8s ease; }
/* Крестик как в aquagor: при открытии модалки сразу проявляется, а через секунду делает полный оборот;
   при наведении делает ровно оборот (3/4 анимацией + 1/4 поворотом), а когда курсор уходит — докручивается на четверть назад. Анимация открытия — на самой иконке, чтобы уход курсора с кнопки не запускал её заново. */
.modal:popover-open .modal-close svg { animation: close-appear 0.3s ease-out, close-spin-in 0.8s cubic-bezier(0.65, 0, 0.35, 1) 1s; }
@keyframes close-appear { from { opacity: 0; transform: scale(0.8); } }
@keyframes close-spin-in { from { transform: rotate(-360deg); } }
@keyframes close-spin-hover { from { transform: rotate(-270deg); } }
@media (prefers-reduced-motion: reduce) { .modal-close, .modal:popover-open .modal-close svg { animation: none; transition: none; } }
/* Мнения других врачей об абзаце: в конце абзаца — бейдж с цветными точками и числами: подтверждают / с оговорками / опровергают; по нажатию — модалка */
:root { --st-agree: #169d65; --st-agree-text: #107d4f; --st-partial: #e3a41c; --st-partial-text: #9a6a06; --st-dispute: #d4513d; --st-dispute-text: #b13a28; }
/* Шарик стоит в строке, в конце абзаца: словами — в подсказке над ним.
   Подсказка прижата к правому краю метки; у левого края карточки thesis-tip.js сдвигает её вправо (--dx), хвостик остаётся над шариком. */
.thesis { position: relative; display: inline-flex; align-items: center; height: 22px; margin: 0; padding: 0 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--paper); font-family: var(--ui); vertical-align: 0.05em; cursor: pointer; transition: box-shadow 0.15s ease; }
.thesis-dots { display: inline-flex; gap: 8px; }
.thesis-part { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.thesis-part i { width: 6px; height: 6px; border-radius: 50%; }
.thesis-part.st-agree { color: var(--st-agree-text); } .thesis-part.st-agree i { background: var(--st-agree); }
.thesis-part.st-partial { color: var(--st-partial-text); } .thesis-part.st-partial i { background: var(--st-partial); }
.thesis-part.st-dispute { color: var(--st-dispute-text); } .thesis-part.st-dispute i { background: var(--st-dispute); }
.thesis:hover { box-shadow: 0 0 0 3px var(--accent-light); }
.thesis:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thesis-tip { position: absolute; bottom: calc(100% + 8px); right: calc(-6px - var(--dx, 0px)); z-index: 5; width: max-content; max-width: min(280px, calc(100vw - 32px)); padding: 7px 11px 8px; border-radius: 8px; background: var(--text); color: #fff; font-size: 13px; font-weight: 500; line-height: 1.4; text-align: left; pointer-events: none; opacity: 0; translate: 0 4px; transition: opacity 0.15s ease, translate 0.15s ease; }
.thesis-tip::after { content: ''; position: absolute; top: 100%; right: calc(18px + var(--dx, 0px)); border: 5px solid transparent; border-top-color: var(--text); }
.thesis-tip small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; opacity: 0.7; }
.thesis:hover .thesis-tip, .thesis:focus-visible .thesis-tip { opacity: 1; translate: 0 0; }
@media (hover: none) and (pointer: coarse) { .thesis-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .thesis-tip { transition: none; } }
/* Модалка мнений — на всё окно: слева история переходов (шаги по нитке, как на карте пути),
   справа содержимое шага. Подгруженная страница автора, статьи или книги встаёт справа целиком. */
.modal.modal-thesis { width: calc(100vw - 32px); max-width: 1320px; height: calc(100dvh - 32px); max-height: none; padding: 0; overflow: hidden; }
.modal-thesis:popover-open { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.mt-trail { min-height: 0; overflow: auto; padding: 22px 14px 22px 12px; background: var(--page-bg); border-right: 1px solid var(--border); }
.mt-trail-h { margin: 0 0 12px 36px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mt-trail ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* нитка пути: от первого шага к последнему; точка отстоит от края карточки шага, а текст — от точки */
.mt-trail ol::before { content: ''; position: absolute; left: 16px; top: 20px; bottom: 20px; width: 2px; background: var(--accent-line); }
.mt-trail ol:has(> li:only-child)::before { display: none; }
.mt-step { position: relative; display: grid; gap: 1px; width: 100%; padding: 10px 12px 10px 36px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--text); }
.mt-step::before { content: ''; position: absolute; left: 12px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2px var(--accent-line); transition: box-shadow 0.15s ease, background 0.15s ease; }
.mt-step small { font-size: 12px; color: var(--muted); }
.mt-step span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.35; }
.mt-step:hover { background: #ebf0ed; }
.mt-step[aria-current] { background: var(--paper); box-shadow: 0 1px 3px #1b2b2314; }
.mt-step[aria-current] span { font-weight: 600; }
.mt-step[aria-current]::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-light); }
.mt-trail li:last-child .mt-step:not([aria-current])::before { box-shadow: 0 0 0 2px var(--accent); }
.mt-trail li:not(:first-child) { animation: mt-step-in 0.22s ease-out; }
@keyframes mt-step-in { from { opacity: 0; transform: translateY(-4px); } }
.mt-main { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.mt-bar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-height: 54px; padding: 10px 56px 10px 28px; border-bottom: 1px solid var(--border); }
.mt-out { font-size: 14px; }
.mt-view { overflow: auto; overscroll-behavior: contain; }
.mt-page { max-width: 1080px; margin: 0 auto; padding: 28px 32px 48px; animation: mt-page-in 0.2s ease-out; }
.mt-page[hidden] { display: none; }
@keyframes mt-page-in { from { opacity: 0; } }
/* первый шаг — сами мнения: текст узкой колонкой для чтения */
.mt-page:first-child { max-width: 700px; }
.modal-thesis h2 { font-size: 26px; letter-spacing: -0.5px; }
.mt-page > *, .mt-page .read-grid > * { margin-top: 0; padding-top: 0; }
.mt-page .read-side { position: static; max-height: none; overflow: visible; }
.mt-page .rd-pane { padding: 0; }
.mt-loading { display: grid; gap: 14px; }
.mt-skel { height: 18px; border-radius: 6px; background: linear-gradient(90deg, #eef2f0 30%, #f7f9f8 50%, #eef2f0 70%) 0 0 / 300% 100%; animation: mt-skel 1.2s linear infinite; }
.mt-skel:first-child { width: 60%; height: 30px; }
.mt-skel:last-child { width: 80%; }
@keyframes mt-skel { to { background-position: -150% 0; } }
.mt-fail { margin: 0; color: var(--muted); }
.mt-hit { animation: p-target 2.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .mt-trail li, .mt-page, .mt-skel, .mt-hit, .mt-step::before { animation: none; transition: none; } }
/* узкий экран: история — полосой шагов сверху, прокручивается вбок */
@media (max-width: 760px) {
  .modal.modal-thesis { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; border: 0; }
  .modal-thesis:popover-open { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .mt-trail { padding: 10px 56px 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .mt-trail-h, .mt-trail ol::before { display: none; }
  .mt-trail ol { display: flex; gap: 4px; overflow-x: auto; }
  .mt-trail li { flex: 0 0 auto; max-width: 200px; }
  .mt-step { padding: 6px 10px 6px 24px; }
  .mt-step::before { top: 12px; left: 8px; width: 8px; height: 8px; }
  .mt-step span { -webkit-line-clamp: 1; }
  .mt-bar { min-height: 0; padding: 8px 16px; }
  .mt-main { position: static; }
  .mt-bar:has(.mt-out[hidden]) { min-height: 0; padding: 0; border: 0; }
  .mt-page { padding: 18px 16px 36px; }
  .modal-thesis h2 { font-size: 22px; }
}
.thesis-quote { margin: 12px 0 20px; padding: 2px 0 2px 14px; border-left: 3px solid var(--st-agree); border-radius: 0; font-family: var(--read); font-size: 15.5px; line-height: 1.6; color: #45544c; }
.thesis-quote.thesis-yellow { border-left-color: var(--st-partial); }
.thesis-quote.thesis-red { border-left-color: var(--st-dispute); }
.st-group + .st-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.st-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.st-group h3::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.st-group h3 span { color: var(--muted); font-weight: 500; }
.st-group.st-agree { --dot: var(--st-agree); } .st-group.st-agree h3 { color: var(--st-agree-text); }
.st-group.st-partial { --dot: var(--st-partial); } .st-group.st-partial h3 { color: var(--st-partial-text); }
.st-group.st-dispute { --dot: var(--st-dispute); } .st-group.st-dispute h3 { color: var(--st-dispute-text); }
.st-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.st-group .by-author { display: flex; align-items: center; gap: 10px; color: var(--text); }
.st-group .by-author .avatar { width: 32px; height: 32px; font-size: 12.5px; }
.st-group .by-author:hover b { color: var(--accent-dark); }
.st-group li > p { margin: 6px 0 0 42px; font-family: var(--read); font-size: 15px; line-height: 1.6; color: #45544c; }
@media (max-width: 560px) { .st-group li > p { margin-left: 0; } }
/* Источник мнения раскрывается прямо в модалке; перейти на саму страницу — ссылкой внутри */
.st-source { margin: 6px 0 0 42px; }
.st-source summary { display: inline; list-style: none; font-size: 13px; color: var(--accent-dark); cursor: pointer; }
.st-source summary::-webkit-details-marker { display: none; }
.st-source summary::after { content: ''; display: inline-block; margin: 0 2px 0 8px; vertical-align: middle; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform 0.18s ease-out; }
.st-source[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.st-source summary:hover { text-decoration: underline; }
.st-source summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.st-peek { margin-top: 8px; padding: 10px 14px 12px; border-left: 3px solid var(--accent-line); border-radius: 0; background: var(--accent-light); }
.st-source[open] .st-peek { animation: peek-in 0.18s ease-out; }
@keyframes peek-in { from { opacity: 0; transform: translateY(-4px); } }
.st-peek blockquote { margin: 0 0 8px; font-family: var(--read); font-size: 14.5px; line-height: 1.6; color: #45544c; }
.st-peek-book, .st-peek-lock { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: #45544c; }
.st-peek-book b { display: block; font-weight: 600; color: var(--text); }
.st-peek .link-accent { font-size: 13px; }
@media (max-width: 560px) { .st-source { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .st-source[open] .st-peek { animation: none; } .st-source summary::after { transition: none; } }
/* Фильтр мнений в модалке: чипы-радиокнопки; выбранный красится в цвет своей оценки, остальные группы скрыты */
.st-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.st-f { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--paper); font-size: 13.5px; color: var(--muted); cursor: pointer; }
.st-f input { position: absolute; opacity: 0; pointer-events: none; }
.st-f span { font-size: 12.5px; opacity: 0.75; }
.st-f:hover { color: var(--text); border-color: #cfd8d3; }
.st-f:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-f:has(input:checked) { color: var(--text); border-color: var(--text); }
.st-f-agree:has(input:checked) { color: var(--st-agree-text); border-color: var(--st-agree); background: #eaf6f0; }
.st-f-partial:has(input:checked) { color: var(--st-partial-text); border-color: var(--st-partial); background: #fcf4e2; }
.st-f-dispute:has(input:checked) { color: var(--st-dispute-text); border-color: var(--st-dispute); background: #fbece9; }
.modal-thesis:has(.st-f-agree input:checked) .st-group:not(.st-agree),
.modal-thesis:has(.st-f-partial input:checked) .st-group:not(.st-partial),
.modal-thesis:has(.st-f-dispute input:checked) .st-group:not(.st-dispute) { display: none; }
/* при фильтре видна одна группа — разделитель над ней не нужен */
.modal-thesis:has(.st-filter input:not([value=all]):checked) .st-group { margin-top: 0; padding-top: 0; border-top: 0; }
/* Пришли по ссылке-источнику на абзац — он коротко подсвечивается */
/* Над якорем — закреплённая шапка (её высоту в --top-h кладёт /scrolltop.js; без скрипта — 62px + рамка) и воздух */
.prose p[id], .prose h2[id] { scroll-margin-top: calc(var(--top-h, 63px) + 24px); }
.prose h2[id]:focus:not(:focus-visible) { outline: none; }
.prose p:target { animation: p-target 2.4s ease-out; }
@keyframes p-target { from { background: var(--accent-light); box-shadow: 0 0 0 8px var(--accent-light); } }
@media (prefers-reduced-motion: reduce) { .prose p:target { animation: none; background: var(--accent-light); box-shadow: 0 0 0 8px var(--accent-light); } }
.link-accent { background: none; border: 0; padding: 0; color: var(--accent-dark); font-weight: 600; }
.link-accent:hover { text-decoration: underline; }
@media (max-width: 560px) { .modal { padding: 20px 18px 22px; } }

/* Появление снизу вверх — классы ставит /rise.js; без скрипта и при «меньше движения» ничего не прячется */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; }
.rise.risen { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rise-delay, 0ms) both; }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; }
  .rise.risen { animation: none; }
}

/* Варианты логотипа: знак крупно, затем он же в шапке и на зелёном */
.logos { list-style: none; margin: 8px 0 56px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.logo { background: var(--paper); border: 1px solid var(--border); border-radius: 16px; padding: 20px; --accent-mark: var(--accent); --k: #fff; }
.logo-big { height: 168px; display: grid; place-items: center; color: var(--accent); background: var(--page-bg); border-radius: 12px; }
.logo-uses { display: grid; gap: 8px; margin: 12px 0 14px; }
.logo-bar { height: 52px; display: flex; align-items: center; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--accent); }
.logo-bar-dark { background: var(--accent); border-color: var(--accent); color: #fff; --accent-mark: #fff; --k: var(--accent); }
.lk .logo-mark { color: var(--accent); }
.logo-bar-dark .lk, .logo-bar-dark .lk .logo-mark { color: #fff; }
.logo h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }
.logo p { margin: 0; color: var(--muted); font-size: 14px; }
.logo-mark { display: block; flex: none; font-family: var(--ui); }
.logo-mark .k { stroke: var(--k); }
.logo-mark .k-fill { fill: var(--k); }
/* Блик по w бежит только под курсором (или при фокусе с клавиатуры): в покое логотип не мигает. Вне наведения штрих
   стоит перед началом линии и не виден */
.logo-mark .k-run { stroke: #fff; stroke-dasharray: 16 200; stroke-dashoffset: 16; }
a:hover > .logo-mark .k-run, a:focus-visible > .logo-mark .k-run { animation: w-run 2.2s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes w-run { 0% { stroke-dashoffset: 16; } 30%, 100% { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) { .logo-mark .k-run { animation: none; } }
.lk { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; letter-spacing: -0.4px; color: var(--text); }
.lk-word { font-size: 23px; letter-spacing: -0.8px; gap: 0; }
.lk-xl { font-size: 46px; letter-spacing: -1.8px; }
.lw-pulse { width: 1.15em; height: .78em; margin: 0 -.06em 0 -.03em; }
.lk-pair .logo-mark { margin-right: .4em; }
.lk-xl.lk-pair { font-size: 34px; letter-spacing: -1.2px; }
/* Варианты w — как в шапке: зелёные буквы без плитки */
.logos-w .logo { --k: var(--accent); }
.logos-w .logo-bar-dark { --k: #fff; }
.logos-head { margin: 8px 0 14px; font-size: 20px; font-weight: 650; letter-spacing: -0.4px; }
.lw-plus { width: .5em; height: .5em; margin: 0 0 .75em .08em; }

/* Кнопка «Наверх» — появляется вместе с закреплённой шапкой (класс is-on ставит /scrolltop.js).
   Наведение — полный оборот по часовой, нажатие — оборот обратно, пока страница откручивается вверх. */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 9; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--accent-line); border-radius: 50%; background: var(--paper); color: var(--accent-dark); box-shadow: 0 8px 22px #1b2b231f, 0 1px 3px #1b2b2314;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(0.9); transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.32s, background 0.2s, color 0.2s; }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.to-top:hover svg { animation: to-top-spin 0.7s cubic-bezier(0.65, 0, 0.35, 1); }
.to-top svg.back { animation: to-top-back 0.7s cubic-bezier(0.65, 0, 0.35, 1); }
/* Предложение подключить Telegram (tg-notice.js) — карточка в левом нижнем углу поверх страницы: в поток не входит,
   поэтому ни появление, ни скрытие не сдвигают текст. Правый угол занят кнопкой «Наверх». */
main:focus { outline: none; }
.tg-notice { position: fixed; left: 24px; bottom: 24px; z-index: 9; display: flex; gap: 14px; width: min(372px, calc(100vw - 48px)); padding: 16px 18px 16px 16px;
  border: 1px solid var(--accent-line); border-radius: 14px; background: var(--paper); box-shadow: 0 12px 32px #1b2b2324, 0 1px 3px #1b2b2314;
  animation: tg-notice-in 0.36s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tg-notice[hidden] { display: none; }
.tg-notice-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); color: var(--accent-dark); }
.tg-notice-icon svg { margin-left: -2px; }
.tg-notice-body { min-width: 0; }
.tg-notice-title { margin: 1px 0 4px; font-weight: 600; font-size: 15px; line-height: 1.35; }
.tg-notice-text { margin: 0; font-size: 13.5px; line-height: 1.45; color: #45544c; }
.tg-notice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 12px; }
.tg-notice-later { height: 34px; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.tg-notice-later:hover { color: var(--text); }
@keyframes tg-notice-in { from { opacity: 0; transform: translateY(12px); } }
/* Телефон: карточка во всю ширину у нижнего края; кнопка «Наверх» вернётся, когда карточку скроют */
@media (max-width: 560px) {
  .tg-notice { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 14px; gap: 12px; }
  .tg-notice-icon { width: 34px; height: 34px; }
  .tg-notice:not([hidden]) ~ .to-top { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tg-notice { animation: none; } }
@keyframes to-top-spin { to { transform: rotate(360deg); } }
@keyframes to-top-back { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .top, .to-top { transition: none; }
  .to-top:hover svg, .to-top svg.back { animation: none; }
}
@media (max-width: 560px) { .to-top { right: 16px; bottom: 16px; } }

/* Избранное и подписки. Закладка — контур, в избранном заливается сверху вниз (как лента, опущенная в книгу) */
.bm { flex: none; overflow: visible; }
.bm-fill { clip-path: inset(0 0 100% 0); transition: clip-path 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
[aria-pressed="true"] .bm-fill { clip-path: inset(0); }
.toggle-form { display: contents; }
.fav, .sub { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease; }
.fav:hover, .sub:hover { border-color: var(--accent-line); color: var(--accent-dark); }
.fav[aria-pressed="true"], .sub[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-light); color: var(--accent-dark); }
.fav:active .bm, .sub:active svg { transform: scale(0.86); }
.fav:disabled, .sub:disabled { cursor: progress; }
/* Значок без подписи — в строках ленты, у книг и в списках кабинета */
.fav-compact { width: 32px; padding: 0; justify-content: center; border-color: transparent; background: none; }
.fav-compact[aria-pressed="true"] { border-color: transparent; background: none; color: var(--accent); }
.fav-compact:hover { background: var(--accent-light); border-color: transparent; }
.row-foot .fav-compact { margin-left: auto; margin-right: -8px; }
.by-books li .fav-compact { margin-left: -4px; }
.by-acts { display: flex; align-items: center; gap: 14px; }
.side-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.author-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* «Избранное» — пункт разделов в .nav, как «Моя лента»: те же цвета и линия под активным, закладка вместо огонька */
.nav .me-link { gap: 6px; }
.me-link[aria-current] .bm-fill { clip-path: inset(0); }
.me-count { margin-left: -2px; font-weight: 400; font-variant-numeric: tabular-nums; opacity: .75; }
.me-count:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .bm-fill, .fav, .sub { transition: none; } }

/* Кабинет: избранное по группам, справа подписки и Telegram */
.me-main { min-width: 0; padding-bottom: 72px; }
/* Колонка подписок закреплена, как в чтении. На короткой вкладке список ниже колонки — сетке не хватало высоты,
   прилипание не включалось и колонка ехала вместе со страницей. Список не ниже экрана — колонке всегда есть где держаться */
@media (min-width: 861px) { .me-main { min-height: 100vh; } }
.me-intro { padding-bottom: 8px; }
.me-group { margin-top: 16px; scroll-margin-top: 200px; }
/* Вкладки избранного: видна одна группа — та, что в адресе (#fav-…, в т.ч. #frag-… внутри неё), иначе первая непустая */
.me-main:has(.me-group:is(:target, :has(:target))) .me-group:not(:target):not(:has(:target)),
.me-main:not(:has(.me-group:is(:target, :has(:target)))) .me-group:not(.is-default) { display: none; }
/* Всё содержимое группы — белые карточки, как статьи в ленте карточек */
.me-authors, .me-pages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.me-authors li, .me-pages li, .me-books li, .me-hint { padding: 16px 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.me-authors li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-authors .by-author:hover b { color: var(--accent-dark); }
.me-books { border-top: 0; padding-top: 0; }
.me-books ul { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.me-books li { display: flex; align-items: center; gap: 14px; max-width: none; }
.me-books li > .me-book { flex: 1; min-width: 0; }
/* Автор книги — отдельная ссылка на его страницу, как подпись под статьёй */
.me-book small { display: block; margin-top: 3px; }
.me-book .byline { color: var(--text); }
.me-book .byline:hover { color: var(--accent-dark); }
.me-hint { margin: 0; padding: 22px 24px; font-size: 14.5px; color: #45544c; }
.me-hint .bm { vertical-align: -3px; color: var(--accent); }
.me-hint a { margin-left: 4px; font-weight: 500; color: var(--accent-dark); white-space: nowrap; }
.me-hint a:hover { text-decoration: underline; }
.by-books li a:hover b, .by-books li a:focus-visible b { color: var(--accent-dark); }
/* Сводка кабинета: сколько чего сохранено, клик ведёт к группе */
/* Разделители — зазор 1px на цвете рамки: линии остаются верными при любом числе плиток в ряду */
.me-tally { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-top: 18px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.me-tally a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 13px; background: var(--paper); color: var(--muted); font-size: 13.5px; font-weight: 500; transition: background-color 0.15s ease; }
.me-tally b { color: var(--text); font-size: 24px; font-weight: 650; line-height: 1.1; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.me-tally a:not(.is-empty) b { color: var(--accent-dark); }
.me-tally a:hover { background: var(--accent-light); color: var(--accent-dark); }
/* Выбранная вкладка — та, чья группа сейчас на экране */
.me-main:has(#fav-articles:is(:target, :has(:target))) .me-tally [data-tab="fav-articles"],
.me-main:has(#fav-authors:is(:target, :has(:target))) .me-tally [data-tab="fav-authors"],
.me-main:has(#fav-books:is(:target, :has(:target))) .me-tally [data-tab="fav-books"],
.me-main:has(#fav-pages:is(:target, :has(:target))) .me-tally [data-tab="fav-pages"],
.me-main:has(#fav-fragments:is(:target, :has(:target))) .me-tally [data-tab="fav-fragments"],
.me-main:not(:has(.me-group:is(:target, :has(:target)))) .me-tally .is-default { background: var(--accent-light); color: var(--accent-dark); box-shadow: inset 0 -3px 0 var(--accent); }
.me-tally .is-empty b { color: #b7c2bc; }
@media (max-width: 760px) { .me-tally { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* При открытии страницы вкладки проявляются друг за другом, как пункты меню профиля, цифры при этом поднимаются;
   сами ячейки непрозрачны, чтобы не просвечивал серый фон-разделитель сетки */
.me-tally a { animation: tally-cell-in 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.me-tally b { animation: tally-count-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.me-tally a:nth-child(2), .me-tally a:nth-child(2) b { animation-delay: 0.05s; }
.me-tally a:nth-child(3), .me-tally a:nth-child(3) b { animation-delay: 0.1s; }
.me-tally a:nth-child(4), .me-tally a:nth-child(4) b { animation-delay: 0.15s; }
.me-tally a:nth-child(5), .me-tally a:nth-child(5) b { animation-delay: 0.2s; }
.me-tally a:nth-child(6), .me-tally a:nth-child(6) b { animation-delay: 0.25s; }
@keyframes tally-cell-in { from { color: transparent; } }
@keyframes tally-count-in { from { opacity: 0; transform: translateY(8px) scale(0.85); } }
@media (prefers-reduced-motion: reduce) { .me-tally a, .me-tally b { animation: none; } }
.sub-all { width: 100%; justify-content: center; height: 36px; }
.me-subs { list-style: none; margin: 14px 0 0; padding: 0; }
.me-subs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14.5px; font-weight: 500; }
.me-subs a:hover { color: var(--accent-dark); }
.me-note, .tg-state, .tg-code { margin: 12px 0 0; font-size: 14px; color: #45544c; }
.tg-state { margin: 0 0 14px; }
.tg-on { color: var(--accent-dark); font-weight: 500; }
.tg-open { width: 100%; }
.tg-code { font-size: 13px; color: var(--muted); }
.tg-code code { padding: 1px 5px; border-radius: 5px; background: var(--page-bg); color: var(--text); font-size: 12.5px; }
.by-books span[id] { scroll-margin-top: 24px; border-radius: 4px; }
.by-books span:target { animation: p-target 2.4s ease-out; }

/* Раздел «Книги»: полка с обложками, фильтр по категориям — теми же чипами, что темы ленты */
.chip-n { margin-left: 6px; color: #9aa8a0; font-variant-numeric: tabular-nums; }
.chip[aria-current] .chip-n { color: var(--accent); }
/* Обложка: корешок слева — прямые левые углы, название набрано книжным шрифтом прямо на обложке */
.cover { position: relative; flex: none; display: flex; flex-direction: column; justify-content: space-between; width: 118px; aspect-ratio: 118 / 164; padding: 14px 10px 10px 18px; border-radius: 0 6px 6px 0; background: var(--cover, var(--accent)); color: #fff; box-shadow: inset 7px 0 0 #00000029, inset 8px 0 0 #ffffff26, inset -1px 0 0 #ffffff40, 0 1px 2px #26342e26, 0 8px 18px -8px #26342e59; overflow: hidden; }
.cover b { font-family: var(--read); font-size: 13.5px; font-weight: 600; line-height: 1.25; hyphens: auto; overflow-wrap: break-word; }
.cover small { font-size: 10.5px; line-height: 1.2; opacity: 0.82; }
/* Заглушка без своей картинки — тканевый переплёт с тиснёной рамкой: буквица, короткое название, фамилия.
   Текст сжат намеренно: полное название и автор стоят рядом с обложкой */
.cover:not(.cover-img) { padding: 8px 8px 8px 15px; background: radial-gradient(120% 70% at 30% 0%, #ffffff2e, transparent 60%), repeating-linear-gradient(45deg, #ffffff08 0 1px, transparent 1px 3px), var(--cover, var(--accent)); }
.cover-face { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 12px 6px 9px; border: 1px solid #ffffff5c; box-shadow: inset 0 0 0 3px #00000012, inset 0 0 0 4px #ffffff24; text-align: center; }
.cover-face em { font-family: var(--read); font-style: italic; font-size: 42px; font-weight: 500; line-height: 1; text-shadow: 0 1px 0 #0000002b; }
.cover-face em::after { content: ''; display: block; width: 18px; height: 1px; margin: 9px auto 8px; background: #ffffffa6; }
.cover-face b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 11.5px; line-height: 1.28; letter-spacing: 0.01em; text-wrap: balance; }
.cover-face small { margin-top: auto; font-size: 9.5px; letter-spacing: 0.06em; opacity: 0.8; }
.cover-lg .cover-face em { font-size: 48px; }
.cover-lg .cover-face b { font-size: 12.5px; }
/* Своя обложка — картинкой на весь переплёт, корешок рисуется поверх */
.cover-img { padding: 0; background: #e6ebe8; }
.cover-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-img::before { content: ''; position: absolute; inset: 0; box-shadow: inset 5px 0 0 #00000029, inset 6px 0 0 #ffffff26; pointer-events: none; }
/* Найденная обложка ложится поверх заглушки; корешок — тот же, что у своей */
.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #e6ebe8; }
.cover:has(> .cover-photo)::before { content: ''; position: absolute; inset: 0; z-index: 1; box-shadow: inset 5px 0 0 #00000029, inset 6px 0 0 #ffffff26; pointer-events: none; }
.cover-lg { width: 132px; }
.cover-lg b { font-size: 15px; }
.cover-sm { width: 40px; padding: 0; box-shadow: inset 4px 0 0 #0000002e, 0 1px 2px #26342e26; border-radius: 0 3px 3px 0; }
.cover.cover-sm b, .cover.cover-sm small, .cover-sm .cover-face { display: none; }
.cover.cover-sm:not(.cover-img) { padding: 0; }
.shelf { list-style: none; margin: 0 0 72px; padding: 24px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shelf-book { display: flex; gap: 22px; padding: 22px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.shelf-cover { align-self: flex-start; transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1); will-change: transform; backface-visibility: hidden; outline: 1px solid transparent; }
/* Сильно уменьшенная картинка при повороте пересчитывается заново, и из резких пикселей «вылезает» цвет. Слой растрится один раз, а повернётся уже готовым и сглаженным */
.shelf-cover img, .shelf-cover .cover-photo { image-rendering: auto; transform: translateZ(0); backface-visibility: hidden; }
.shelf-cover:hover { transform: translateY(-3px) rotate(-1deg); }
.shelf-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.shelf-info .topic { font-size: 13px; }
.shelf-info h2 { margin: 6px 0 8px; font-size: 19px; line-height: 1.25; letter-spacing: -0.3px; font-weight: 600; overflow-wrap: anywhere; }
.shelf-info h2 a:hover { color: var(--accent-dark); }
.shelf-info p { flex: 1; margin: 0 0 14px; font-family: var(--read); font-size: 15px; line-height: 1.55; color: #45544c; }
.shelf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13.5px; }
.shelf-foot .fav-compact { margin-left: auto; margin-right: -8px; }
@media (prefers-reduced-motion: reduce) { .shelf-cover { transition: none; } .shelf-cover:hover { transform: none; } }

/* Превью книги и читалка: шапка книги, лист с колонтитулом и номером страницы внизу, листалка */
.book-read { grid-template-columns: minmax(0, 1fr); }
.book-top { display: flex; gap: 24px; align-items: flex-start; }
.book-top h1 { margin: 10px 0 16px; font-size: 32px; }
.book-head .lead { margin: 22px 0 0; font-size: 18px; }
/* Кнопки «Читать» и «В избранное» — в правой колонке шапки, сразу под названием и автором */
.book-top > div:last-child { flex: 1; min-width: 0; }
.book-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.sheet { padding: 22px 48px 26px; scroll-margin-top: 70px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.sheet-run { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--read); font-size: 13.5px; font-style: italic; color: var(--muted); }
.sheet-text { max-width: none; }
.sheet-text > :first-child { margin-top: 0; }
.folio { margin-top: 18px; text-align: center; font-family: var(--read); font-size: 15px; color: var(--muted); font-variant-numeric: oldstyle-nums; }
/* Абзац книги и его закладка справа: видна при наведении, у сохранённого — всегда */
.bp { position: relative; padding-right: 40px; margin-right: -40px; scroll-margin-top: 80px; border-radius: 6px; }
.bp > p { margin: 0 0 1.1em; }
.bp:target { animation: p-target 2.4s ease-out; }
.bp-save { position: absolute; top: 2px; right: 0; opacity: 0; transition: opacity 0.15s ease; }
.bp:hover .bp-save, .bp-save:focus-visible, .bp-save[aria-pressed="true"] { opacity: 1; }
@media (hover: none) { .bp-save { opacity: 0.55; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pg-mid { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px; }
.pg-go label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pg-go input { width: 56px; height: 34px; padding: 0 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); font: inherit; font-weight: 500; color: var(--text); text-align: center; -moz-appearance: textfield; }
.pg-go input::-webkit-inner-spin-button, .pg-go input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pg-go input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
/* Enter в поле уже отправляет форму — кнопка только для экранных читалок */
.pg-go button { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }
.pg-nums { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pg-nums a { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.pg-nums a:hover { background: var(--paper); color: var(--text); }
.pg-nums a[aria-current] { background: var(--accent-light); color: var(--accent-dark); }
/* Пропуск в длинной листалке: «1 … 6 7 [8] 9 10 … 150» — не ссылка, только знак, что номера идут дальше */
.pg-gap { display: grid; place-items: end center; min-width: 22px; height: 34px; padding-bottom: 9px; color: #a3b1a9; letter-spacing: 1px; line-height: 1; user-select: none; }
.pg-nums { align-items: center; }
.pg-gap-narrow { display: none; }
@media (max-width: 560px) {
  .pg-nums .pg-far { display: none; }
  .pg-nums .pg-gap-narrow { display: grid; }
  .pager .pg-step { padding: 0 12px; }
  /* Длинная листалка в два ряда: номера во всю ширину, под ними «Назад», поле перехода и «Дальше» */
  .pager:has(.pg-gap) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 8px; }
  .pager:has(.pg-gap) .pg-mid { display: contents; }
  .pager:has(.pg-gap) .pg-nums { grid-column: 1 / -1; grid-row: 1; flex-wrap: nowrap; }
  .pager:has(.pg-gap) .prev { grid-column: 1; grid-row: 2; }
  .pager:has(.pg-gap) .pg-go { grid-column: 2; grid-row: 2; justify-self: center; }
  .pager:has(.pg-gap) .next { grid-column: 3; grid-row: 2; }
  .pager:has(.pg-gap) .pg-go label { white-space: nowrap; gap: 6px; }
}
@media (max-width: 360px) { .pager .pg-word { display: none; } }
.pg-step { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); font-weight: 500; }
a.pg-step:hover { border-color: var(--accent-line); color: var(--accent-dark); }
.pg-step[aria-disabled] { color: #b7c2bc; }
.shelf:has(+ .shelf-pager) { margin-bottom: 24px; }
.shelf-pager { margin-bottom: 72px; }
.lib-cards:has(+ .lib-pager-list) { margin-bottom: 24px; }
.lib-pager-list { margin-bottom: 72px; }
/* Та же листалка под лентой статей */
.feed-pager { margin-top: 28px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14.5px; line-height: 1.35; }
.toc li:first-child a { padding-top: 0; }
.toc li:last-child a { padding-bottom: 0; }
.toc small { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover span, .toc a[aria-current] span { color: var(--accent-dark); }
.rd-toc .toc a { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.rd-toc .toc a:hover { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent-line); border-radius: 0; }
.toc a[aria-current] span { font-weight: 600; }
.side-hint p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: #45544c; }
.side-hint .bm { vertical-align: -3px; color: var(--accent); }
/* Закрытая книга: формуляр Awamed+ над подсказкой про сохранение — тот же перелив, что у платной статьи (.gate-plus) */
.book-plus { background: linear-gradient(160deg, #eef0ff, #fbecf6 55%, #fff1e4); border-color: #e6dcf3; }
.book-plus h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 16px; font-weight: 650; color: var(--text); }
.book-plus h2 svg { flex: none; width: 22px; height: 22px; }
.bk-open { display: grid; gap: 7px; margin: 0 0 16px; font-size: 13.5px; color: #5d4f73; }
.bk-bar { height: 4px; border-radius: 4px; background: #ffffffb3; overflow: hidden; }
.bk-bar span { display: block; width: calc(var(--p) * 100%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6c7cff, #d946b5); }
/* Тарифы строками библиотечной карточки: название, отточие до цены, цена справа */
.bk-plans { list-style: none; margin: 0 0 12px; padding: 0; }
.bk-plans li { display: flex; align-items: baseline; gap: 8px; padding: 9px 0; }
.bk-plans li + li { border-top: 1px solid #e6dcf3; }
.bk-plans i { flex: 1; min-width: 12px; border-bottom: 1.5px dotted #b9a6d3; transform: translateY(-4px); }
.bk-name { display: grid; font-size: 14.5px; font-weight: 600; }
.bk-plans small { font-size: 12.5px; font-weight: 400; color: #6f6282; }
.bk-plans b { display: grid; justify-items: end; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Знак тарифной единицы Awamed — пульсовая w логотипа вместо ₽: зелёная, как в шапке, чуть ниже прописной, на базовой линии цифр */
.aw-price { white-space: nowrap; }
.bk-best b { color: #7a45b0; }
.bk-note { margin: 0 0 16px; font-size: 13.5px; line-height: 1.5; color: #5d4f73; }
.book-plus .btn { width: 100%; justify-content: center; background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3) 0 0 / 160% 100%; box-shadow: 0 6px 16px -6px #7a3fc899; transition: background-position 0.25s ease, box-shadow 0.15s ease; }
.book-plus .btn:hover { background-position: 100% 0; box-shadow: 0 8px 20px -6px #7a3fc8b3; }
.bk-in { display: block; margin-top: 12px; text-align: center; font-size: 14px; }
/* Штучная книга: вместо формуляра подписки — своя цена, в меди монеты, как штучная статья (.gate-single) */
.book-single { background: #fbf4ec; border-color: #eedcc6; }
.book-single h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; font-size: 16px; font-weight: 650; color: var(--text); }
.book-single h2 .mark svg { width: 22px; height: 22px; }
.bs-price { margin: 0 0 14px; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.book-single .bk-open, .book-single .bk-note { color: #6e5540; }
.book-single .bk-bar span { background: #a4622a; }
.book-single .btn { width: 100%; justify-content: center; background: #a4622a; box-shadow: 0 6px 16px -6px #a4622a99; }
.book-single .btn:hover { background: #8a4f1f; }
/* Штучная книга со скидкой подписчикам: те же два предложения, что у штучной статьи (.gate-piece),
   в узкой колонке — друг под другом, кнопки на всю ширину */
.bs-offers { display: grid; gap: 10px; margin-top: 14px; }
.book-piece .piece-offer, .sheet-single .piece-offer { padding: 16px; }
.book-piece .piece-offer p, .sheet-single .piece-offer p { margin: 0; max-width: none; }
.book-piece .piece-price, .sheet-single .piece-price { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 2px; font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.book-piece .piece-note, .sheet-single .piece-note { flex: 1; margin-bottom: 14px; color: #6e5540; font-size: 14px; }
.book-piece .piece-plus .piece-note, .sheet-single .piece-plus .piece-note { color: #45544c; }
.book-single .piece-plus .btn, .sheet-single .piece-plus .btn { background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3) 0 0 / 160% 100%; box-shadow: 0 6px 16px -6px #7a3fc899; transition: background-position 0.25s ease; }
.book-single .piece-plus .btn:hover, .sheet-single .piece-plus .btn:hover { background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3) 100% 0 / 160% 100%; }
.side-plus-note { padding-top: 10px; border-top: 1px dashed var(--border); }
.shelf-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
/* Закрытые главы в содержании — приглушены, у номера страницы замок Awamed+ */
.toc-shut span { color: var(--muted); }
.toc-shut small { display: inline-flex; align-items: center; gap: 6px; }
.toc-shut .mark svg { width: 14px; height: 14px; }
/* Закрытая страница в читалке — карточка-заглушка вместо текста */
.sheet-shut { background: linear-gradient(110deg, #eef0ff, #fbecf6 50%, #fff1e4); border-color: #e6dcf3; }
.sheet-shut .sheet-head { border-color: #e6dcf3; }
.sheet-shut .gate-text h2 { display: flex; align-items: center; gap: 10px; }
.sheet-shut .gate-text h2 svg { flex: none; width: 24px; height: 24px; }
.sheet-shut .gate-text p { max-width: 56ch; }
.sheet-shut .btn { background: linear-gradient(110deg, #5b63e8, #a23fb8 55%, #c23aa3); }
.sheet-single { background: #fbf4ec; border-color: #eedcc6; }
.sheet-single .sheet-head { border-color: #eedcc6; }
.sheet-single .btn { background: #a4622a; box-shadow: 0 6px 16px -6px #a4622a99; }
.sheet-single .btn:hover { background: #8a4f1f; }
.sheet-single .piece-offers { margin-bottom: 14px; }
.sheet-single .piece-offer .btn { align-self: flex-start; }
/* Превью: главная кнопка «Читать» и ссылка на полотно рядом, содержание — отдельной карточкой под шапкой */
.book-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn-read { height: 38px; padding: 0 16px 0 13px; font-size: 15px; }
.btn-read svg { margin-right: 8px; }
.book-all { display: inline-flex; align-items: center; gap: 7px; }
.book-all svg { flex: none; }
/* Печатная версия: цена и ссылка в Telegram, где обсуждают оплату и доставку — тише кнопки «Читать» */
.book-print { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; padding: 12px 12px 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--page-bg); }
.book-print-what { display: grid; gap: 1px; }
.book-print-what b { font-weight: 600; font-variant-numeric: tabular-nums; }
.book-print-what small { font-size: 13.5px; color: var(--muted); }
.book-print-buy { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--paper); color: var(--accent-dark); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent-line); transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.book-print-buy:hover { background: var(--accent-light); box-shadow: inset 0 0 0 1.5px var(--accent); }
.book-print-buy svg { flex: none; }
/* Прогресс чтения: полоска под кнопками превью и та же доля белой кромкой по нижнему обрезу обложки */
.book-progress { display: grid; gap: 8px; max-width: 360px; margin-top: 18px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cover-read { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #ffffff38; }
.cover-read::after { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: #fff; }
.shelf-read { font-weight: 500; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
a.shelf-read { text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a.shelf-read:hover { color: var(--accent); text-decoration-color: currentColor; }
/* Та же отметка в коротких списках — книги автора, избранное, поиск: отдельной строкой под годом */
.by-books .shelf-read, .found-book .shelf-read { display: flex; align-items: center; gap: 8px; width: fit-content; margin-top: 5px; font-size: 12.5px; }
.by-books a.shelf-read, .found-book a.shelf-read { text-decoration: none; }
/* полоска прочитанного: та же, что по низу карточки в каталоге, только короткая — в каталоге её заменяет нижняя кромка */
.shelf-read-bar { display: none; }
.by-books .shelf-read-bar, .found-book .shelf-read-bar { display: block; position: relative; flex: none; width: 56px; height: 4px; background: var(--border); overflow: hidden; }
.shelf-read-bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--accent); }
.by-books a.shelf-read:hover .shelf-read-bar::after { background: var(--accent-dark); }
/* у книг автора прогресс — полноценная полоса на всю ширину колонки, как полосы «Темы» справа */
.by-books .shelf-read { width: 100%; gap: 10px; margin-top: 7px; }
.by-books .shelf-read-bar { flex: 1; width: auto; height: 6px; border-radius: 3px; background: var(--accent-light); }
.by-books .shelf-read-bar::after { border-radius: 3px; }
.cover-sm .cover-read { height: 3px; }
/* прогресс чтения в каталоге — полоска по нижнему краю карточки, от края до края */
.shelf-book:has(.shelf-progress) { position: relative; overflow: hidden; }
.shelf-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--border); }
.shelf-progress::after { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--accent); }
/* «Читаете сейчас» над каталогом: начатые книги лентой, плитка — сразу в читалку на место остановки */
.reading-now { margin: -8px 0 26px; }
.reading-now h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.reading-now ul { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: thin; }
.reading-now li { flex: none; width: 272px; }
.now-book { display: flex; gap: 14px; align-items: center; height: 100%; padding: 12px 16px 12px 12px; background: var(--paper); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s; }
.now-book .cover-sm { width: 46px; }
.now-book > span { min-width: 0; }
.now-book b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; line-height: 1.3; }
.now-book small { display: block; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 13px; }
.now-at { display: block; position: relative; margin-top: 10px; height: 4px; background: var(--border); overflow: hidden; }
.now-at::after { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--accent); }
.now-book:hover { border-color: var(--accent-line); }
.now-book:hover b { color: var(--accent-dark); }
@media (max-width: 640px) { .reading-now li { width: 240px; } }
.book-contents { margin-top: 16px; }
.book-contents h2 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--muted); }

/* Читалка на весь экран: без шапки сайта, меню книги закреплено слева, текст — справа */
.reader-body { background: var(--page-bg); }
.reader { display: grid; grid-template-columns: 296px minmax(0, 1fr); min-height: 100vh; }
.rd-menu { position: sticky; top: 0; height: 100vh; overflow: clip; display: flex; flex-direction: column; gap: 22px; padding: 20px 22px 24px; background: var(--paper); border-right: 1px solid var(--border); }
.rd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rd-close { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; margin-left: -8px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); }
.rd-close:hover { background: var(--page-bg); color: var(--text); }
.rd-all-books { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.rd-all-books:hover { color: var(--accent-dark); }
.rd-book { display: flex; gap: 14px; align-items: flex-start; }
/* обложка в меню читалки — корешком 40px и на телефоне (общее правило .cover там увеличивает её до 92px) */
.rd-book .cover { width: 40px; padding: 0; }
.rd-book b { display: block; font-family: var(--read); font-size: 17px; font-weight: 600; line-height: 1.3; }
.rd-book small { display: block; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.rd-menu .segs { align-self: flex-start; }
.rd-progress { display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-bar { height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.rd-bar span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); transition: width 0.3s ease; }
/* Прокручивается сам <details>: внутри него браузеры прячут ol в безымянную обёртку, и flex/overflow у ol не срабатывают —
   список не сжимался под высоту меню, а .rd-menu его обрезала. Заголовок «Содержание» прилипает к верху прокрутки. */
.rd-toc { flex: 0 1 auto; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.rd-toc > ol.toc { padding-right: 6px; }
.rd-toc summary { position: sticky; top: 0; z-index: 1; padding-bottom: 12px; background: var(--paper); font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; list-style: none; }
.rd-toc summary::-webkit-details-marker { display: none; }
.rd-toc summary::after { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform 0.15s ease; }
.rd-toc:not([open]) summary::after { transform: rotate(-45deg); margin-bottom: 1px; }
.rd-foot { margin-top: auto; display: grid; gap: 10px; justify-items: start; }
/* Переведённая книга в той же читалке (#3306): язык версии и файлы — тихой строкой под режимами */
.rd-lang .segs { align-self: flex-start; }
.rd-files { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -8px 0 0; font-size: 13px; }
.rd-files a { color: var(--muted); }
.rd-files a:hover { color: var(--accent-dark); }
.rd-toc .toc-sub a, .rd-toc .toc-sub .toc-row { padding-left: 14px; font-size: 13.5px; }
.rd-toc .toc-d3 a, .rd-toc .toc-d3 .toc-row { padding-left: 26px; }
.rd-toc .toc-d4 a, .rd-toc .toc-d4 .toc-row { padding-left: 38px; }
.rd-toc .toc-num { font-variant-numeric: tabular-nums; }
.rd-toc .toc-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14.5px; line-height: 1.35; }
.rd-toc .toc-miss span { color: #9aa8a0; }
.rd-lib { display: grid; gap: 16px; align-content: start; min-width: 0; }
.rd-pane .lib-sheet .sheet-text { font-size: 19px; }
.rd-pane .lib-sheet .lib-text h2 { font-size: 22px; }
.rd-lib.lib-mode-both .lib-sheet .sheet-text { font-size: 17px; }
.rd-lib.lib-mode-both { max-width: none; }
.rd-pane:has(.rd-lib.lib-mode-both) { max-width: 1180px; }
.rd-keys { margin: 0; font-size: 12.5px; color: #9aa8a0; }
.rd-pane { width: 100%; max-width: 820px; margin: 0 auto; padding: 40px 32px 64px; display: grid; gap: 16px; align-content: start; }
.rd-pane .sheet { scroll-margin-top: 24px; }
.rd-pane .sheet-text { font-size: 19px; }
.rd-pane .bp { scroll-margin-top: 32px; }
@media (prefers-reduced-motion: reduce) { .rd-bar span { transition: none; } }
@media (max-width: 860px) {
  .reader { grid-template-columns: minmax(0, 1fr); }
  .rd-menu { position: static; height: auto; overflow: visible; gap: 16px; padding: 14px 16px 18px; border-right: 0; border-bottom: 1px solid var(--border); }
  .rd-toc:not([open]) summary { padding-bottom: 0; }
  .rd-toc { overflow: visible; }
  .rd-toc > ol.toc { max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; }
  .rd-keys { display: none; }
  .rd-foot { margin-top: 0; }
  .rd-pane { padding: 16px 16px 48px; }
  .rd-pane .sheet-text { font-size: 17px; }
}
@media (max-width: 560px) {
  .shelf { grid-template-columns: minmax(0, 1fr); }
  .shelf-book { gap: 16px; padding: 16px; }
  .cover { width: 92px; padding: 10px 5px 8px 12px; }
  .cover b { font-size: 11px; }
  .cover:not(.cover-img) { padding: 6px 6px 6px 12px; }
  .cover-face { padding: 9px 4px 7px; }
  .cover-face em { font-size: 32px; }
  .cover-face em::after { margin: 6px auto 6px; }
  .cover-face b { font-size: 10px; }
  .cover-face small { font-size: 8.5px; }
  .book-top { gap: 16px; }
  .book-top h1 { font-size: 24px; }
  .sheet { padding: 18px 18px 22px; }
  .bp { margin-right: -8px; padding-right: 36px; }
  .pg-step { padding: 0 10px; }
  .pg-nums a { min-width: 30px; }
  /* на телефоне у «В оригинале» остаётся значок, подпись — для экранных читалок */
  .orig-open { width: 32px; padding: 0; justify-content: center; }
  .orig-open span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 860px) { .shelf { grid-template-columns: minmax(0, 1fr); } }

/* Кнопка «В оригинале» — рядом с закладкой страницы в шапке листа */
.sheet-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.orig-open svg { flex: none; }

/* Просмотр оригинала страницы: тёмный «световой стол», на нём лист — PDF или Markdown-исходник.
   Кнопки те же, что в читалке, — светлыми плашками поверх стола */
.orig-body { --desk: #1d2823; --desk-line: #33443b; --desk-ink: #c7d5cd; background: var(--desk); color: var(--desk-ink); }
.orig { display: grid; grid-template-rows: auto auto 1fr; min-height: 100vh; }
.orig-bar { display: flex; align-items: center; gap: 18px; padding: 14px 24px; border-bottom: 1px solid var(--desk-line); }
.orig-bar .rd-close { margin-left: -8px; color: var(--desk-ink); }
.orig-bar .rd-close:hover { background: var(--desk-line); color: #fff; }
.orig-book { flex: 1; min-width: 0; }
.orig-book b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--read); font-size: 15.5px; font-weight: 600; color: #fff; }
.orig-book small { display: block; font-size: 13px; color: #93a69b; }
.orig-fmt .seg { min-width: 52px; justify-content: center; font-weight: 600; letter-spacing: 0.2px; }
.orig-pager { width: 100%; max-width: 820px; margin: 0 auto; padding: 16px 24px 0; }
.orig-pager .pg-go label { color: #93a69b; }
.orig-pager .pg-step { color: var(--text); }
.orig-desk + .orig-pager { padding: 0 24px 40px; }
.sheet ~ .pager { margin: 20px 0 40px; }
.orig-pager .pg-nums a:not([aria-current]) { color: #93a69b; }
.orig-pager .pg-nums a:not([aria-current]):hover { background: var(--desk-line); color: #fff; }
.orig-pager .pg-step[aria-disabled] { background: transparent; border-color: var(--desk-line); color: #56685e; }
.orig-desk { display: flex; justify-content: center; align-items: flex-start; padding: 20px 24px 48px; }
/* Лист A5: целиком влезает в экран по высоте, на узком — во всю ширину */
.orig-pdf, .orig-md { width: min(100%, 640px, calc((100vh - 190px) * 420 / 595)); min-width: min(100%, 360px); }
.orig-pdf { display: grid; gap: 18px; }
.orig-pdf:not(.orig-drawn) { aspect-ratio: 420 / 595; }
.orig-pdf iframe, .orig-pdf canvas, .orig-md { display: block; width: 100%; border: 0; border-radius: 2px; background: var(--paper); box-shadow: 0 24px 60px -18px #000000a6; }
.orig-pdf iframe { height: 100%; }
.orig-pdf canvas { height: auto; }
.orig-md { aspect-ratio: 420 / 595; }
.orig-md { margin: 0; padding: 40px 36px; overflow: auto; font: 13.5px/1.7 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.md-h { font-weight: 700; }
.md-mark { color: var(--accent); }
.orig-desk .sheet-shut { width: min(100%, 720px); color: var(--text); }
@media (max-width: 720px) {
  .orig-bar { flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; }
  .orig-book { order: 3; flex-basis: 100%; }
  .orig-bar .orig-fmt { width: auto; margin-left: auto; }
  .orig-pager { padding: 12px 16px 0; }
  .orig-desk { padding: 14px 16px 32px; }
  .orig-pdf, .orig-md { width: 100%; }
  .orig-md { padding: 24px 20px; font-size: 13px; }
}

/* Кнопка над выделенным текстом: тёмная, чтобы не спутать с выделением; стрелка смотрит на текст */
.sel-pill { position: absolute; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 999px; background: var(--text); color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 28px #1b2b233d; animation: sel-in 0.16s ease-out; }
.sel-pill[hidden] { display: none; }
.sel-pill::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--text); }
.sel-pill.sel-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--text); }
.sel-save { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px 0 11px; border: 0; border-radius: 999px; background: none; color: #fff; }
.sel-save:hover { background: #ffffff1f; }
.sel-save:disabled { cursor: progress; opacity: 0.7; }
.sel-msg { padding: 5px 12px; }
.sel-done { display: inline-flex; align-items: center; gap: 6px; padding-left: 11px; color: #9ee0bf; }
.sel-pill a { padding: 5px 14px 5px 0; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@keyframes sel-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .sel-pill { animation: none; } }

/* Кабинет: сохранённые страницы и фрагменты с заметками */
.me-pages li { display: flex; align-items: center; gap: 14px; }
.me-pages li > a { min-width: 0; flex: 1; }
.me-pages a b { display: block; font-weight: 600; }
.me-pages small { display: block; margin-top: 2px; font-family: var(--read); font-size: 14px; line-height: 1.45; color: #45544c; }
.me-pages li > a:hover b { color: var(--accent-dark); }
.frags { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* Фрагмент в кабинете — белая карточка, как страницы книг: название-ссылка, откуда и когда, комментарий */
.frag { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; scroll-margin-top: 84px; }
.frag:target { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-light); }
.frag-body { min-width: 0; flex: 1; }
.frag-name { display: block; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.frag-name:hover { color: var(--accent-dark); }
/* Без названия вместо него — начало цитаты, книжным шрифтом: видно, что это текст статьи */
.frag-name.frag-quote { font-family: var(--read); font-weight: 400; font-size: 15.5px; }
.frag-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.frag-src { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; overflow-wrap: anywhere; }
.frag-src:hover { color: var(--accent-dark); text-decoration-color: currentColor; }
.frag-comment { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: #45544c; white-space: pre-line; }
.frag-tools { display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding-top: 2px; font-size: 13.5px; }
.frag-del { margin: 0; }
.frag-tools .link { font-size: 13.5px; }
.frag-del .link:hover { color: #a2332f; }
@media (max-width: 560px) { .frag { flex-direction: column; gap: 8px; } }
/* Модалка фрагмента: цитата фоном (не полосой слева) и не выше пяти строк, дальше — прокрутка внутри */
.modal-frag { width: min(460px, calc(100vw - 32px)); }
.modal-frag h2 { font-size: 22px; letter-spacing: -0.4px; padding-right: 32px; }
.frag-cite { margin: 12px 0 18px; padding: 10px 14px; max-height: calc(1.6em * 5 + 20px); overflow: auto; border-radius: 10px; background: var(--accent-light); font-family: var(--read); font-size: 15px; line-height: 1.6; white-space: pre-line; }
.frag-cite:has(+ .frag-source:not([hidden])) { margin-bottom: 10px; }
.frag-source { display: flex; align-items: baseline; gap: 8px; margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.frag-source a { min-width: 0; font-weight: 600; color: var(--accent-dark); overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.frag-source a:hover { text-decoration-color: currentColor; }
.modal-frag textarea { min-height: 76px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; font-weight: 400; color: var(--text); background: var(--paper); resize: vertical; }
.modal-frag textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #169d6522; }
.frag-toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; }
.frag-toast::after { display: none; }
/* Сохранённый фрагмент в тексте: медовый маркер — не зелёный интерфейсный, чтобы читался как пометка читателя */
.frag-mark { padding: 0.05em 0; border-radius: 2px; background: linear-gradient(transparent 14%, #fbe5a0 14%, #fbe5a0 90%, transparent 90%); color: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.frag-mark.frag-lit { background: linear-gradient(transparent 14%, #f6d36c 14%, #f6d36c 90%, transparent 90%); }
.frag-pin { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 2px 0 4px; border-radius: 50%; background: #f6d36c; color: #7a5200; vertical-align: 0.15em; line-height: 0; text-decoration: none; transition: background-color 0.15s ease, transform 0.15s ease; }
.frag-pin:hover { background: #e9b93a; transform: scale(1.1); }
.frag-pin svg { display: block; }
@media (prefers-reduced-motion: reduce) { .frag-pin { transition: none; } .frag-pin:hover { transform: none; } }

/* Три пункта меню и вход должны влезать в шапку на узком телефоне */
@media (max-width: 440px) {
  .top-in { gap: 8px; }
  .brand .logo-mark { width: 75px; height: 24px; }
  .nav { gap: 0; }
  .nav a { padding: 0 6px; font-size: 14.5px; }
  .nav-pulse { left: 6px; right: -2px; }
  .account { gap: 8px; }
  .account .btn-small { padding: 0 12px; }
}

/* Awamed+ в шапке: кнопка с плюсом на переливающемся пастельном фоне; на узком экране — короче, на телефоне — только значок */
/* Тень делает ссылку выпуклой кнопкой: заметное сиренево-розовое кольцо в тон плюса (зелёное спорило с пастельным фоном) + зелёная тень снизу; фон — нежный градиент из тех же сиреневого, розового и персикового, что у плюса и надписи, медленно перетекает; при наведении не меняется: кнопка только приподнимается, при нажатии вдавливается */
.sub-link { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; background: linear-gradient(110deg, #eef0ff, #fbecf6, #fff1e4, #fbecf6, #eef0ff) 0 0 / 300% 100%; animation: sub-link-bg 9s ease-in-out infinite alternate; color: var(--accent-dark); font-weight: 600; white-space: nowrap; box-shadow: 0 2px 4px #1b2b231a, 0 6px 16px -4px #107d4f59; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.sub-link svg { flex: none; }
/* Блик пробегает косой полосой по всей кнопке, а не по одному плюсу, и делает паузу между проходами */
.sub-link::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #fff0, #ffffffd9 50%, #fff0); transform: translateX(-120%) skewX(-20deg); animation: sub-link-glint 3.6s ease-in-out infinite; }
@keyframes sub-link-bg { to { background-position: 100% 0; } }
@keyframes sub-link-glint { 0% { transform: translateX(-120%) skewX(-20deg); } 45%, 100% { transform: translateX(260%) skewX(-20deg); } }
/* Плюс и надпись Awamed+ живут всё время, как Premium в Telegram: плюс покачивается, искры мерцают, по надписи переливается градиент */
.sub-plus { overflow: visible; filter: drop-shadow(0 1px 3px rgba(217, 70, 181, 0.4)); animation: sub-plus-sway 3.2s ease-in-out infinite; }
.sub-spark { transform-box: fill-box; transform-origin: center; animation: sub-spark 1.6s ease-in-out infinite; }
.sub-spark-2 { animation-delay: -0.8s; }
.sub-shine { background: linear-gradient(90deg, #5b63e8, #c23aa3, #e8730f, #c23aa3, #5b63e8) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sub-shine 4s linear infinite; }
@keyframes sub-plus-sway { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.08); } }
@keyframes sub-spark { 0%, 100% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1); } }
@keyframes sub-shine { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sub-plus, .sub-spark, .sub-shine { animation: none; } .sub-spark { opacity: 1; } .sub-link::after { display: none; } .sub-link { animation: none; } }
.sub-link:hover { transform: translateY(-1px); box-shadow: 0 3px 6px #1b2b231f, 0 10px 24px -6px #107d4f73; }
.sub-link:active { transform: translateY(0); box-shadow: inset 0 1px 3px #1b2b231f; }
@media (prefers-reduced-motion: reduce) { .sub-link:hover { transform: none; } }
.sub-link-short { display: none; }
@media (max-width: 860px) { .sub-link-full { display: none; } .sub-link-short { display: inline; } }
@media (max-width: 560px) { .sub-link-short { display: none; } .sub-link { padding: 7px 8px; } }

/* Страница подписки. Главный образ — бланк рецепта с печатью журнала, остальное спокойно. */
.sub-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 56px 0 48px; }
.sub-brand { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--accent-dark); font-weight: 650; font-size: 16px; }
.sub-brand svg { width: 20px; height: 20px; color: var(--accent); }
.sub-hero h1 { margin: 0 0 18px; font: 600 46px/1.08 var(--read); letter-spacing: -1.2px; max-width: 13em; text-wrap: balance; }
.sub-lead { margin: 0 0 28px; max-width: 34em; font-size: 17px; line-height: 1.55; color: #45544c; }
.sub-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.btn-big { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.sub-plans-link { color: var(--accent-dark); font-weight: 500; border-bottom: 1px solid var(--accent-line); }
.sub-plans-link:hover { border-color: var(--accent); }
/* Один таймлайн на всю первую полосу и тарифы, шаг --step: строки героя поднимаются по очереди,
   рецепт в это время «выписывается» — Rp., затем D.S., пульс, печать, — и сразу за печатью
   линия уходит в тарифы (--plans-t0 = 6 шагов). Всё линейно и стык в стык, без пауз.
   Вся загрузка — меньше секунды: «чпок — и страничка появилась». */
.sub-hero, .sub-plans { --step: 0.08s; }
.sub-brand, .sub-hero h1, .sub-lead, .sub-cta { animation: sub-in calc(2 * var(--step)) ease-out calc(var(--n) * var(--step)) backwards; }
.sub-brand { --n: 0; } .sub-hero h1 { --n: 1; } .sub-lead { --n: 2; } .sub-cta { --n: 3; }
@keyframes sub-in { from { opacity: 0; translate: 0 14px; } }

.rx { position: relative; margin: 0; padding: 26px 28px 22px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 1px 0 #fff, 0 22px 50px -24px #1b4b3340; rotate: 1.6deg;
  background-image: repeating-linear-gradient(transparent 0 33px, #e9efeb 33px 34px); background-position: 0 86px; }
.rx::before { content: ''; position: absolute; inset: 7px; border: 1px dashed var(--accent-line); border-radius: 3px; pointer-events: none; }
.rx-head { display: flex; justify-content: space-between; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px solid var(--accent); color: var(--accent-dark); font-weight: 650; font-size: 13.5px; letter-spacing: 0.4px; }
.rx-rp, .rx-line { margin: 0; font: 400 19px/34px var(--read); color: #2c4a3b; }
.rx-line { font-size: 16px; }
.rx i { color: var(--accent-dark); font-weight: 600; margin-right: 6px; }
.rx-pulse { display: block; width: 100%; height: 40px; margin: 6px 0 4px; color: var(--accent); }
.rx-rp { animation: rx-write var(--step) linear var(--step) backwards; }
.rx-line { animation: rx-write calc(2 * var(--step)) linear calc(2 * var(--step)) backwards; }
@keyframes rx-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.rx-pulse path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: rx-draw var(--step) linear calc(4 * var(--step)) forwards; }
@keyframes rx-draw { to { stroke-dashoffset: 0; } }
.rx-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.rx-stamp { flex: none; color: var(--accent); --k: #fff; opacity: 0.88; rotate: -14deg; margin: -18px -6px -6px 0; mix-blend-mode: multiply; animation: rx-stamp var(--step) ease-in calc(5 * var(--step)) backwards; }
@keyframes rx-stamp { from { opacity: 0; scale: 1.6; } }
/* Рецепт медленно поворачивается вокруг своего центра в 3D — будто листок чуть вертят в руках:
   то к нам левым краем, то верхом, то правым. Без сдвига с места; собственный rotate (наклон) не трогаем */
.rx { transform-origin: 50% 50%; animation: rx-in calc(2 * var(--step)) ease-out backwards, rx-sway 14s ease-in-out calc(6 * var(--step)) infinite; }
@keyframes rx-in { from { opacity: 0; translate: 0 14px; } }
@keyframes rx-sway {
  0%, 100% { transform: perspective(900px) rotateX(0deg) rotateY(0deg); }
  25% { transform: perspective(900px) rotateX(3deg) rotateY(-7deg); }
  50% { transform: perspective(900px) rotateX(-4deg) rotateY(2deg); }
  75% { transform: perspective(900px) rotateX(2deg) rotateY(7deg); }
}
/* Под мышью покачивание стоит, листок поворачивается за курсором (rx-tilt.js): край под мышью уходит вглубь, блик едет следом */
.rx.rx-follow { animation: none; transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform 0.18s ease-out; }
.rx.rx-back { transition-duration: 0.6s; }
.rx::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), #ffffff80, #ffffff00 55%); }
.rx.rx-follow:not(.rx-back)::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .rx-pulse path { animation: none; stroke-dashoffset: 0; } .rx { animation: none; } .rx-rp, .rx-line, .rx-stamp, .sub-brand, .sub-hero h1, .sub-lead, .sub-cta { animation: none; } }

.sub-block { padding: 36px 0 8px; border-top: 1px solid var(--border); margin-top: 20px; }
.sub-block h2 { margin: 0 0 20px; font-size: 24px; font-weight: 650; letter-spacing: -0.5px; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.perks h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 650; color: var(--accent-dark); }
.perks p { margin: 0; font-size: 14.5px; color: #45544c; }
.sub-locked { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sub-locked a { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 16px 18px; background: var(--paper); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s ease; }
.sub-locked a:hover { border-color: var(--accent-line); }
.sub-locked a:hover b { color: var(--accent-dark); }
.sub-locked .mark { margin-top: 2px; }
.sub-locked b { display: block; font: 600 16.5px/1.35 var(--read); }
.sub-locked small { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; color: var(--muted); }
/* Тарифы — сразу под рецептом. Кардиограмма — фон почти во всю ширину страницы: висит позади полупрозрачных карточек
   и не сдвигает их (карточки сразу под заголовком). Зубец на каждый тариф, чем больше доступа — тем выше. Карточка проявляется, когда линия до неё добегает.
   Один таймлайн на всё: линия рисуется равномерно (linear), каждая карточка начинает проявляться,
   когда линия доходит до её левого края, и длится ровно треть прохода — без рывков и пауз. */
.sub-plans { --plans-t0: calc(6 * var(--step)); --plans-dur: 0.45s; border-top: 0; margin-top: 0; padding-top: 12px; }
/* Кардиограмма — очень бледный фон всей первой полосы: от заголовка «Дочитайте до конца…» до низа карточек тарифов,
   по ширине — почти во всю страницу. Лента лежит в .sub-top под всем содержимым (z-index: -1 внутри isolation) и места не занимает. */
.sub-top { position: relative; isolation: isolate; }
.plans-wrap { --trace-w: min(calc(100vw - 48px), 1680px); }
.plans-trace { position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - var(--trace-w) / 2); width: 0; overflow: hidden; pointer-events: none; animation: plans-draw var(--plans-dur) linear var(--plans-t0) forwards; }
@keyframes plans-draw { to { width: var(--trace-w); } }
/* Миллиметровка под лентой: мелкая клетка 8px, крупная — каждые 40px, края растворяются в фоне */
.plans-trace { background: linear-gradient(#169d650d 1px, transparent 1px) 0 3px / 40px 40px, linear-gradient(90deg, #169d650d 1px, transparent 1px) 0 0 / 40px 40px,
  linear-gradient(#169d6506 1px, transparent 1px) 0 3px / 8px 8px, linear-gradient(90deg, #169d6506 1px, transparent 1px) 0 0 / 8px 8px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.plans-pulse { display: flex; width: var(--trace-w); height: 100%; color: var(--accent); opacity: 0.14; }
/* Сигнал: та же линия, размытая и едва заметная, видна только под бегущим окном (30% ленты) с хвостом — как развёртка монитора */
.plans-run { position: absolute; z-index: 1; top: 0; opacity: 0.3; filter: blur(0.8px) drop-shadow(0 0 10px #169d6566);
  -webkit-mask: linear-gradient(90deg, transparent, #000 92%, transparent) -50% 0 / 30% 100% no-repeat; mask: linear-gradient(90deg, transparent, #000 92%, transparent) -50% 0 / 30% 100% no-repeat;
  animation: plans-run 3.6s linear calc(var(--plans-t0) + var(--plans-dur)) infinite; }
@keyframes plans-run { from { -webkit-mask-position: -50% 0; mask-position: -50% 0; } to { -webkit-mask-position: 150% 0; mask-position: 150% 0; } }
.plans-lead { flex: 1; display: flex; }
.plans-lead i { flex: 1; background: linear-gradient(currentColor, currentColor) 0 75% / 100% 2px no-repeat; }
.plans-beat { flex: none; display: block; height: 100%; overflow: visible; }
.plans { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 24px; background: color-mix(in srgb, var(--paper) 74%, transparent); backdrop-filter: blur(1.5px); border: 1px solid var(--border); border-radius: 14px;
  animation: plan-in calc(var(--plans-dur) / 3) ease-out calc(var(--plans-t0) + var(--i) * var(--plans-dur) / 3) backwards;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s ease, border-color 0.2s ease; }
@keyframes plan-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.plan:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: 0 22px 40px -26px #1b4b3366; }
.plan-best { border: 2px solid var(--accent); padding: 23px; background: linear-gradient(color-mix(in srgb, var(--accent-light) 80%, transparent), color-mix(in srgb, var(--paper) 74%, transparent) 62%); box-shadow: 0 24px 48px -30px #169d6580; }
/* Без подписки — не тариф, а покупка поштучно: рамка пунктиром, как у отрывного талона, фон без заливки */
.plan-piece { border-style: dashed; border-color: var(--accent-line); background: color-mix(in srgb, var(--paper) 55%, transparent); }
.plan-piece .plan-price b { color: var(--muted); }
.plan-best:hover { border-color: var(--accent); box-shadow: 0 30px 54px -28px #169d6599; }
/* Название тарифа и срок под ним. Значок тарифа — рисунок за текстом в правом нижнем углу карточки, над кнопкой:
   тонкой линией и едва заметен, при наведении и фокусе проявляется и оживает. Рядом две звёздочки крутятся и мерцают всегда. */
.plan { overflow: hidden; isolation: isolate; }
.plan h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 19px; font-weight: 650; }
.plan-name small { display: block; margin-top: 1px; font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-bonus { color: var(--accent-dark); font-weight: 650; }
.plan-icon { position: absolute; z-index: -1; right: -18px; bottom: 58px; width: 150px; height: 150px; overflow: visible; pointer-events: none;
  color: var(--accent); stroke-width: 1.3; opacity: 0.14; transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.plan-best .plan-icon { opacity: 0.2; }
.plan:is(:hover, :focus-within) .plan-icon { opacity: 0.26; transform: translateX(-8px) rotate(-4deg); }
.plan-icon * { transform-box: fill-box; }
.plan-stars { position: absolute; z-index: -1; right: 12px; bottom: 184px; width: 48px; height: 48px; overflow: visible; pointer-events: none; color: var(--accent); opacity: 0.32; transition: opacity 0.35s ease; }
.plan:is(:hover, :focus-within) .plan-stars { opacity: 0.55; }
.ps-star { transform-box: fill-box; transform-origin: 50% 50%; animation: ps-spin 9s linear infinite; }
.ps-star-b { animation-duration: 6s; animation-direction: reverse; animation-delay: -2s; }
@keyframes ps-spin { from { transform: rotate(0) scale(1); } 25% { transform: rotate(90deg) scale(0.6); opacity: 0.4; } 50% { transform: rotate(180deg) scale(1); opacity: 1; } 75% { transform: rotate(270deg) scale(0.75); } to { transform: rotate(360deg) scale(1); } }
.pi-half { transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.pi-grains { opacity: 0; transition: opacity 0.2s ease; }
.pi-heart { transform-origin: 50% 55%; }
.pi-ecg { stroke-dasharray: 1; stroke-dashoffset: 0; }
.plan:is(:hover, :focus-within) .pi-half-l { transform: translateX(-3.5px); }
.plan:is(:hover, :focus-within) .pi-half-r { transform: translateX(3.5px); }
.plan:is(:hover, :focus-within) .pi-grains { opacity: 1; animation: pi-fall 0.9s ease-in 0.15s; }
.plan:is(:hover, :focus-within) .pi-heart { animation: pi-lubdub 1.1s ease-in-out infinite; }
.pi-handle, .pi-cross { transform-origin: 50% 50%; transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.plan:is(:hover, :focus-within) .pi-handle { transform: translateY(-3px); }
.plan:is(:hover, :focus-within) .pi-cross { animation: pi-lubdub 1.1s ease-in-out infinite; }
.plan:is(:hover, :focus-within) .pi-ecg { animation: pi-draw 1.1s linear infinite; }
@keyframes pi-draw { from { stroke-dashoffset: 1; } }
@keyframes pi-fall { from { transform: translateY(-9px); opacity: 0; } 50% { opacity: 1; } }
@keyframes pi-lubdub { 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.07); } 50% { transform: scale(1); } }
.plan-save { padding: 2px 8px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; animation: plan-beat 0.5s ease calc(var(--plans-t0) + var(--plans-dur)) 2 both; }
@keyframes plan-beat { 30% { transform: scale(1.14); } 60% { transform: scale(0.97); } }
.plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 4px; }
.plan-price b { font-size: 30px; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.plan-price > span { color: var(--muted); font-size: 14px; }
.plan-note { margin: 0 0 16px; font-size: 14px; color: #45544c; }
.plan-gets { list-style: none; margin: 0 0 22px; padding: 14px 0 0; border-top: 1px dashed var(--accent-line); display: grid; gap: 8px; font-size: 14px; color: #2c4a3b; }
.plan-gets li { display: flex; gap: 9px; align-items: baseline; }
.plan-gets li::before { content: ''; flex: none; width: 9px; height: 5px; border: solid var(--accent); border-width: 0 0 2px 2px; transform: translateY(-3px) rotate(-45deg); }
.plan .btn { margin-top: auto; }
.btn-ghost { background: var(--paper); color: var(--accent-dark); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.btn-ghost:hover { background: var(--accent-light); }
.plans-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.sub-faq { padding-bottom: 56px; }
.sub-faq details { border-bottom: 1px solid var(--border); }
.sub-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; }
.sub-faq summary::-webkit-details-marker { display: none; }
.sub-faq summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform 0.18s ease-out; }
.sub-faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.sub-faq summary:hover { color: var(--accent-dark); }
.sub-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .sub-faq summary::after { transition: none; } }
.sub-faq details p { max-width: 72ch; margin: 0 0 16px; color: #45544c; }

@media (max-width: 860px) {
  .sub-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 36px; }
  .rx { max-width: 440px; }
  .perks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; max-width: 440px; }
  .plans-trace { display: none; }
  .plan { animation-delay: calc(0.2s + var(--i) * 0.12s); }
}
@media (prefers-reduced-motion: reduce) { .plans-trace { animation: none; width: 100%; } .plans-run { display: none; } .plan, .plan-save { animation: none; } .plan { transition: none; } .plan:hover { transform: none; }
  .plan-icon, .plan:is(:hover, :focus-within) .plan-icon { transform: none; transition: none; }
  .plan-icon *, .plan:is(:hover, :focus-within) .plan-icon * { animation: none; transition: none; }
  .ps-star { animation: none; } }
@media (max-width: 560px) {
  .sub-hero h1 { font-size: 32px; letter-spacing: -0.6px; }
  .sub-lead { font-size: 16px; }
  .rx { padding: 22px 20px 18px; rotate: 0.8deg; }
  .perks, .sub-locked, .plans { grid-template-columns: 1fr; }
}
/* На узком телефоне значку места нет (у гостя — рядом с «Войти» уже с 440px) — подписка остаётся в подвале */
@media (max-width: 440px) { .account:has(.btn-small) .sub-link { display: none; } }
@media (max-width: 380px) { .sub-link { display: none; } }

/* Главная — поиск по журналу. Заголовок набран шрифтом чтения: сайт про тексты врачей;
   последнее слово сменяется по кругу (статью, книгу, тему), под ним прорисовывается зубец кардиограммы */
.find { padding: 72px 0 36px; max-width: 760px; }
.find-title { margin: 0 0 28px; font-family: var(--read); font-size: 54px; line-height: 1.12; letter-spacing: -1.4px; font-weight: 600; }
.find-title-sm { margin-bottom: 20px; font-family: var(--ui); font-size: 30px; letter-spacing: -0.8px; font-weight: 650; }
.find-done { padding: 40px 0 8px; }
.find-lede { max-width: 62ch; margin: -4px 0 26px; color: var(--muted); font-size: 17px; line-height: 1.5; text-wrap: pretty; }
.find-word { position: relative; display: inline-grid; vertical-align: bottom; color: var(--accent-dark); }
.find-word > span { grid-area: 1 / 1; opacity: 0; animation: find-word 9s cubic-bezier(0.2, 0.7, 0.2, 1) infinite; }
.find-word > span:nth-child(2) { animation-delay: 3s; }
.find-word > span:nth-child(3) { animation-delay: 6s; }
@keyframes find-word { 0% { opacity: 0; transform: translateY(0.35em); } 5%, 30% { opacity: 1; transform: none; } 35%, 100% { opacity: 0; transform: translateY(-0.25em); } }
.find-pulse { position: absolute; left: 0; right: 0; bottom: -0.14em; width: 100%; height: 0.2em; overflow: visible; color: var(--accent); }
.find-pulse path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 100 200; animation: find-pulse 3s cubic-bezier(0.3, 0.6, 0.3, 1) infinite; }
@keyframes find-pulse { 0% { stroke-dashoffset: 100; } 30%, 88% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
/* Фон главного поиска во всю ширину окна: миллиметровка, за заголовком медленно «дышит» пятно зелени,
   а справа от заголовка в пустом поле расходятся волны сердцебиения. Линии-кардиограммы на фоне нет —
   кардиограмма одна, зубец под словом, и волны бьют в такт ему (тот же период 3 с): удар — «тук-тук». */
.find { position: relative; isolation: isolate; }
.find-bg { position: absolute; z-index: -1; top: 0; bottom: -40px; left: calc((min(100vw, 1080px) - 100vw) / 2 - 24px); width: 100vw; overflow: hidden; pointer-events: none;
  background: linear-gradient(#169d6512 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, #169d6512 1px, transparent 1px) 0 0 / 24px 24px;
  -webkit-mask: radial-gradient(ellipse 70% 90% at 60% 45%, #000 30%, transparent 78%); mask: radial-gradient(ellipse 70% 90% at 60% 45%, #000 30%, transparent 78%); }
.find-glow { position: absolute; left: calc(50% - 280px); top: 8%; width: 620px; height: 360px; border-radius: 50%; background: radial-gradient(closest-side, #169d651f, transparent); animation: find-glow 9s ease-in-out infinite alternate; }
@keyframes find-glow { from { transform: translate(-40px, 10px) scale(0.9); } to { transform: translate(60px, -20px) scale(1.15); } }
.find-beat { position: absolute; left: min(50% + 430px, 100% - 90px); top: 150px; width: 0; height: 0; }
.find-beat::before { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); opacity: 0.5; animation: find-dot 3s ease-out infinite; }
.find-beat i { position: absolute; left: -220px; top: -220px; width: 440px; height: 440px; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; transform: scale(0.04); animation: find-beat 3s cubic-bezier(0.2, 0.6, 0.35, 1) infinite; }
.find-beat i + i { animation-delay: 0.28s; }
@keyframes find-beat { 0% { opacity: 0.75; transform: scale(0.04); } 70%, 100% { opacity: 0; transform: scale(1); } }
@keyframes find-dot { 0%, 100% { transform: scale(1); } 6% { transform: scale(1.6); } 15% { transform: scale(1); } 20% { transform: scale(1.35); } 30% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .find-glow, .find-beat::before { animation: none; }
  .find-beat i { display: none; }
  .find-word > span, .find-pulse path { animation: none; }
  .find-word > span:first-child { opacity: 1; }
}

.find-form { position: relative; display: flex; align-items: center; height: 64px; padding: 0 8px 0 56px; border: 2px solid var(--border); border-radius: 16px; background: var(--paper); box-shadow: 0 10px 30px -18px #1b2b2340; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.find-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-light), 0 10px 30px -18px #1b2b2340; }
.find-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.find-form:focus-within .find-icon { color: var(--accent); }
.find-form input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 400 18px var(--ui); color: var(--text); }
.find-form input::placeholder { color: #9aa8a0; }
.find-form input::-webkit-search-cancel-button { cursor: pointer; }
.find-go { height: 46px; padding: 0 24px; font-size: 16px; }
.find-try { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 18px 0 0; color: var(--muted); font-size: 14.5px; }
.find-try a { color: var(--text); border-bottom: 1px solid var(--accent-line); }
.find-try a:hover { color: var(--accent-dark); border-color: var(--accent); }

/* Разделы под поиском: три входа, не карточки — строки под общей линией */
.doors ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; margin: 0; padding: 32px 0 0; border-top: 1px solid var(--border); }
.doors a { display: grid; gap: 4px; padding: 4px 0 8px; }
.doors b { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.doors a:hover b { color: var(--accent-dark); }
.door-n { color: var(--accent-dark); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.door-text { color: var(--muted); font-size: 14.5px; }
.fresh { padding: 44px 0 80px; max-width: 760px; }
.fresh h2 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.fresh ul { list-style: none; margin: 0 0 12px; padding: 0; }
.fresh li a { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 2px 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.fresh time { grid-row: span 2; color: var(--muted); font-size: 13.5px; padding-top: 3px; }
.fresh b { font-family: var(--read); font-size: 18px; font-weight: 600; line-height: 1.35; }
.fresh small { color: var(--muted); font-size: 13.5px; }
.fresh li a:hover b { color: var(--accent-dark); }

/* Результаты поиска: статьи — основной столбец, книги и врачи — справа */
.found { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; padding: 20px 0 80px; }
.found ul { list-style: none; margin: 0; padding: 0; }
.found-group + .found-group { margin-top: 32px; }
.found-group h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.found-group h2 span { font-variant-numeric: tabular-nums; color: #9aa8a0; }
.found mark { background: none; color: var(--accent-dark); text-decoration: underline 2px var(--accent-line); text-underline-offset: 0.2em; }
.found-article a { display: grid; gap: 6px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.found-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.found-article b { font-size: 20px; line-height: 1.3; letter-spacing: -0.3px; font-weight: 600; }
.found-article a:hover b { color: var(--accent-dark); }
.found-lead { max-width: 64ch; color: #45544c; font-family: var(--read); font-size: 15.5px; line-height: 1.6; }
.found-book a, .found-author a { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.found-book b, .found-author b { display: block; font-weight: 600; line-height: 1.3; }
.found-book small, .found-author small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.found-book a:hover b, .found-author a:hover b { color: var(--accent-dark); }
.found-aside:empty { display: none; }
.found-none { max-width: 620px; padding: 12px 0 96px; }
.found-none p { margin: 0 0 10px; color: var(--muted); font-size: 16px; }

@media (max-width: 860px) {
  .found { grid-template-columns: 1fr; gap: 32px; }
  .doors ul { grid-template-columns: 1fr; gap: 0; }
  .doors li + li { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 10px; }
}
@media (max-width: 560px) {
  .find { padding: 40px 0 28px; }
  .find-beat { left: calc(100% - 30px); top: 250px; }
  .find-beat i { left: -140px; top: -140px; width: 280px; height: 280px; }
  .find-title { font-size: 36px; letter-spacing: -0.9px; }
  .find-lede { margin: -4px 0 22px; font-size: 15.5px; }
  .find-title-sm { font-size: 24px; }
  .find-form { height: 56px; padding-left: 46px; border-radius: 14px; }
  .find-icon { left: 14px; }
  .find-form input { font-size: 16px; }
  .find-go { height: 40px; padding: 0 16px; }
  .fresh li a { grid-template-columns: 1fr; }
  .fresh time { grid-row: auto; }
}

/* Поиск внутри раздела (книги, статьи): в строке фильтров справа — та же рамка, что у поиска на главной,
   только в рост фильтров; на телефоне — во всю ширину над категориями */
.list-find { position: relative; display: flex; align-items: center; flex: 0 1 300px; margin-left: auto; height: 40px; padding: 0 12px 0 40px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--paper); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.list-find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }
.list-find-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.list-find-icon svg { width: 18px; height: 18px; }
.list-find:focus-within .list-find-icon { color: var(--accent); }
.list-find input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 400 15px var(--ui); color: var(--text); }
.list-find input::placeholder { color: #9aa8a0; }
.list-find input::-webkit-search-cancel-button { cursor: pointer; }
.found-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 20px 0 0; color: var(--muted); font-size: 14.5px; }
.found-line a { color: var(--text); border-bottom: 1px solid var(--accent-line); }
.found-line a:hover { color: var(--accent-dark); border-color: var(--accent); }
#feed mark { background: none; color: var(--accent-dark); text-decoration: underline 2px var(--accent-line); text-underline-offset: 0.2em; }
@media (max-width: 640px) {
  .list-find { order: -1; flex: 1 1 100%; margin-left: 0; height: 44px; }
  .list-find input { font-size: 16px; }
}

/* Переводы источников (#2718): список и двуязычная читалка. Статус перевода — словом на мягкой подложке, без цветных
   полос слева; выбранный абзац — заливкой, общей для русского и оригинала в виде «Рядом». */
:root { --lib-draft: #5d6b64; --lib-draft-bg: #eef1ef; --lib-review: #8a5a12; --lib-review-bg: #fbf1de; --lib-none-bg: #f6f3ec; --lib-on: #eaf6ef; --lib-faint: #aab5af; }
.lib-head { padding: 36px 0 20px; max-width: 70ch; }
.lib-head h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.15; letter-spacing: -0.8px; font-weight: 650; }
.lib-head p { margin: 0 0 18px; color: #45544c; }
.lib-empty { color: var(--muted); }
/* Карточки перевода: статус, название, авторы и сведения — четыре строки, общие для всего ряда (subgrid), поэтому
   одинаковые блоки соседей стоят на одном уровне. Название — до трёх строк, авторы — до двух (в разметке уже первые
   имена и «ещё N»), длинное слово без пробелов переносится внутри карточки; полный текст — на странице материала. */
.lib-cards { list-style: none; margin: 0 0 72px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.lib-card { display: grid; min-width: 0; }
.lib-card a { display: flex; flex-direction: column; gap: 8px; height: 100%; min-width: 0; padding: 18px 20px 16px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
@supports (grid-template-rows: subgrid) {
  .lib-cards { grid-auto-rows: auto auto 1fr; }
  .lib-card { grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
  .lib-card a { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; row-gap: 8px; align-content: start; }
}
.lib-card a:hover { border-color: var(--accent-line); }
.lib-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.lib-kind { color: var(--muted); font-size: 13px; }
.lib-card-title, .lib-card-names { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card-title { font-size: 17px; line-height: 1.3; letter-spacing: -0.2px; font-weight: 600; -webkit-line-clamp: 3; line-clamp: 3; }
.lib-card-orig { font-family: var(--read); font-size: 14px; color: var(--muted); }
/* Две строки авторов: все имена, либо первые имена в строку и «и ещё N» второй строкой — счёт не прячется под многоточие */
.lib-card-by { display: grid; align-content: start; min-width: 0; font-size: 14px; line-height: 1.4; }
.lib-card-names { -webkit-line-clamp: 2; line-clamp: 2; }
.lib-card-names-cut { -webkit-line-clamp: 1; line-clamp: 1; }
.lib-card-more { color: var(--muted); }

.lib-read { display: grid; gap: 16px; padding: 36px 0 72px; max-width: 880px; }
.lib-read-head h1 { margin: 12px 0 6px; font-size: 34px; line-height: 1.15; letter-spacing: -0.8px; font-weight: 650; }
.lib-orig-title { margin: 0 0 12px; }
/* Оригинальное название — по запросу: основное на сайте — русское */
.lib-orig-title summary { display: inline-block; cursor: pointer; list-style: none; font-size: 13px; color: var(--muted); }
.lib-orig-title summary::-webkit-details-marker { display: none; }
.lib-orig-title summary:hover, .lib-orig-title[open] summary { color: var(--accent-dark); }
.lib-orig-title summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.lib-orig-title p { margin: 6px 0 0; font-family: var(--read); font-size: 17px; color: #3c4a43; }
/* Шапка читалки перевода (#3297): название, под ним одной строкой лица людей материала и «В избранное» справа.
   Лица — кружки по ролям; полное имя из источника — подсказкой. Много людей в роли — кружки ложатся черепицей.
   Кнопка «Содержание» в шапку не входит: на широком экране оно колонкой справа, на узком — кнопкой у нижнего края */
.lib-read-head h1 { margin-bottom: 14px; }
.lib-byrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 14px; }
.lib-byrow .lib-acts { margin: 0; }
@media (min-width: 640px) { .lib-byrow .lib-acts { margin-left: auto; } }
.lib-people { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; min-width: 0; }
.lp-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lp-role { font-size: 13px; color: var(--muted); }
.lp-faces { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lp-faces > li { position: relative; }
.lp-stack { flex-wrap: nowrap; gap: 0; }
.lp-stack > li + li { margin-left: -11px; }
.lp-stack .lp-pic { box-shadow: 0 0 0 2px var(--paper); }
.lp-stack > li:hover, .lp-stack > li:focus-within { z-index: 2; }
.lp-face { position: relative; display: block; border-radius: 50%; color: inherit; text-decoration: none; cursor: default; }
a.lp-face { cursor: pointer; }
.lp-pic { width: 36px; height: 36px; font-size: 13px; letter-spacing: 0.2px; object-fit: cover; transition: transform 0.15s ease, background 0.15s ease; }
a.lp-face:hover .lp-pic { background: var(--accent-line); }
.lp-face:hover .lp-pic, .lp-face:focus-visible .lp-pic { transform: translateY(-2px); }
.lp-face:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-tip { position: absolute; z-index: 5; left: -4px; bottom: calc(100% + 8px); width: max-content; max-width: min(280px, 80vw); padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--paper); font-size: 13px; font-weight: 500; line-height: 1.35; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.12s ease, visibility 0.12s; }
.lp-face:hover .lp-tip, .lp-face:focus-visible .lp-tip { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .lp-pic, .lp-tip { transition: none; } .lp-face:hover .lp-pic, .lp-face:focus-visible .lp-pic { transform: none; } }
.lib-toc-dock { position: absolute; width: 0; height: 0; }
.lib-sub { margin: 32px 0 12px; font-size: 20px; font-weight: 600; }
.lib-head .chips { margin-top: 14px; }
.lib-by { margin: 10px 0; }
.lib-by a, .lib-facts a, .lib-files a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lib-facts { margin-bottom: 14px; }
.lib-files { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; font-size: 14px; }
.lib-text { font-family: var(--read); font-size: 18px; line-height: 1.75; }
/* Шапка и текст — одна страница: карточки смыкаются, между ними только тонкая линия (#3191) */
.lib-read-head:has(+ .lib-text) { border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding-bottom: 20px; }
.lib-read-head + .lib-text { margin-top: -16px; border-top-color: var(--border); border-top-left-radius: 0; border-top-right-radius: 0; }
.lib-text p, .lib-text h2 { margin: 0; }
.lib-text h2 { font-family: var(--ui); font-size: 21px; line-height: 1.3; letter-spacing: -0.3px; font-weight: 600; }
.lib-text b { font-weight: 600; }

/* Абзац: заливка — выбранный. По-русски текст идёт сплошь, как в книге (#3295): без подписи «Оригинал» под абзацем,
   абзацы — с воздухом в полстроки, заголовок отбит сверху сильнее, чем снизу, и держится своего раздела */
.lb { position: relative; margin: 0 -14px; padding: 4px 14px; border-radius: 10px; scroll-margin: 90px; scroll-margin-top: calc(var(--top-h, 63px) + 20px); transition: background 0.2s ease; }
.lb + .lb { margin-top: 0.5em; }
.lb-heading { margin-top: 1.4em; }
.lb-heading + .lb { margin-top: 0.25em; }
.lib-mode-ru .lib-text p, .lib-mode-ru .lib-text li { hyphens: auto; }
.lib-text > .lb:first-child, .lib-text > .lib-page:first-child > .lb:first-of-type { margin-top: 0; }
.lb-on, .lb:target { background: var(--lib-on); }
/* Перевода нет: виден оригинал на тёплой подложке и прямо сказано, что это не русский текст */
.lb-none { background: var(--lib-none-bg); }
.lb-none.lb-on { background: var(--lib-on); }
.lb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.lb-pair:hover { background: #f3f7f5; }
.lb-pair.lb-on, .lb-pair:target { background: var(--lib-on); }
.lb-src { font-size: 16px; line-height: 1.65; color: #3c4a43; }
.lib-mode-both .lib-text { font-size: 17px; }
.lib-mode-both .lb-pair.lb-none { background: transparent; }
.lib-mode-both .lb-pair.lb-none .lb-ru { padding: 0 10px; border-radius: 8px; background: var(--lib-none-bg); }

/* Страница источника: номер на полях, как колонтитул; рисунки страницы — рядом с её подписями */
.lib-page { position: relative; padding-top: 6px; }
.lib-page + .lib-page { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--border); }
.lib-folio { display: inline-block; margin-bottom: 8px; font-family: var(--ui); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-folio:hover { color: var(--accent-dark); }
.lib-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 0; }
.lib-fig { margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.lib-fig img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; background: #fff; }
.lib-fig figcaption { margin-top: 8px; font-family: var(--ui); font-size: 12.5px; color: var(--muted); text-align: center; }
.lib-fig figcaption a { color: var(--accent-dark); }
/* Подпись рисунка: сразу под ним, мельче и серее основного текста, по центру */
.lib-figs + .lb-caption { margin-top: 0; padding-top: 8px; padding-bottom: 6px; }
.lib-figs + .lb-caption p, .lb-caption p { margin: 0; font-family: var(--ui); font-size: 13.5px; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: balance; }
.lib-figs + .lb-caption p { margin-bottom: 14px; }
.lib-pager .pg-mid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.lib-text h3, .lib-text h4, .lib-text h5, .lib-text h6 { margin: 0; font-family: var(--ui); line-height: 1.35; font-weight: 600; }
.lib-text h3 { font-size: 19px; }
.lib-text h4, .lib-text h5, .lib-text h6 { font-size: 17px; }
/* Таблица источника (#2851): сетка как в оригинале, числа — табличными цифрами, широкая — прокручивается сама */
.lb-tablebox { margin: 14px 0; overflow-x: auto; }
.lb-table { border-collapse: collapse; min-width: 50%; font-family: var(--ui); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.lb-table th, .lb-table td { padding: 7px 12px; border: 1px solid var(--border); vertical-align: top; text-align: left; }
.lb-table th { background: #f4f7f5; font-weight: 600; }
.lb-table .lb-cell { margin: 0; border-radius: 0; scroll-margin: 90px; }
.lb-table .lb-cell.lb-on, .lb-table .lb-cell:target { background: var(--lib-on); }
.lb-table .lb-none { background: var(--lib-none-bg); }
.lb-cell-cut { color: var(--muted); text-align: center; }
.lb-table-note { margin: 6px 0 0; font-family: var(--ui); font-size: 13px; color: var(--muted); }
.lb-tablepair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.lb-tablepair .lb-table { min-width: 100%; }
/* Таблица шире колонки прокручивается по горизонтали, а слова в ячейках не рвутся по буквам в столбик */
.lb-tablebox .lb-ru, .lb-tablebox .lb-src { min-width: 0; overflow-x: auto; }
.lb-table, .lb-table th, .lb-table td { overflow-wrap: normal; word-break: normal; hyphens: manual; }
/* Список источника: пункт — тот же блок читалки (выделение, якорь), маркер — у списка */
.lb-listbox { margin: 6px 0; padding-left: 28px; }
.lb-listbox .lb-listbox { margin: 2px 0; }
.lb-listbox > .lb { margin: 0; padding: 4px 8px 4px 4px; border-radius: 0 10px 10px 0; }
.lb-listbox > .lb + .lb { margin-top: 2px; }
.lb-pair-in { margin: 0; padding: 0; background: none; }
.lb-pair-in:hover { background: none; }
.lb-listbox:has(> .lb-task) { list-style: none; padding-left: 4px; }
.lb-task { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; }
.lb-task > :not(input) { grid-column: 2; }
.lb-task > input { margin: 0; accent-color: var(--accent-dark); }
/* Цитата источника: полоса слева — прямая, без скругления */
.lb-quote { border-radius: 0 10px 10px 0; box-shadow: inset 3px 0 0 var(--accent-line); }
.lb-quote p { color: #3c4a43; }
.lb-literal pre { margin: 0; padding: 10px 12px; overflow-x: auto; background: #f4f7f5; border-radius: 8px; font-size: 14px; line-height: 1.55; white-space: pre; }
.lb-math { text-align: center; font-style: italic; }
/* Литература из сносок источника и ссылки на неё в тексте; простые формулы показом (readerMarkup.js) */
.lb-fn { margin: 0; padding-left: 2.4em; font-size: 15px; line-height: 1.55; }
.lb-fn li { margin: 0 0 6px; scroll-margin-top: 80px; }
.lb-fn li:target { background: #fff7d6; border-radius: 4px; }
.fn-ref { font-size: .72em; line-height: 0; }
.fn-ref a { text-decoration: none; color: var(--accent-dark); }
.tex { font-family: 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif; white-space: nowrap; }
p.lb-math.tex { white-space: normal; font-size: 1.08em; }
/* Участники материала (#3300): имя — строкой интерфейсным шрифтом, под ним плотно должность и место работы,
   «Конфликт интересов» — подписью к абзацу, а не заголовком раздела */
.lib-text .lb-person { margin-top: 1.1em; }
.lb-person p { font-family: var(--ui); font-size: 17px; line-height: 1.35; font-weight: 600; }
.lb-affiliation p { font-family: var(--ui); font-size: 15px; line-height: 1.45; color: #45544c; }
.lib-text .lb-person + .lb-affiliation, .lib-text .lb-affiliation + .lb-affiliation { margin-top: 0; padding-top: 0; }
.lib-text .lb-label { margin-top: 0.6em; }
.lb-label p { font-family: var(--ui); font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--muted); }
.lib-text .lb-label + .lb { margin-top: 0; padding-top: 0; }
@media (max-width: 760px) {
  .lib-head h1, .lib-read-head h1 { font-size: 26px; }
  .lb-pair { grid-template-columns: 1fr; gap: 8px; }
  .lb-pair .lb-src { padding-top: 8px; border-top: 1px dashed var(--accent-line); }
  .lb-tablepair { grid-template-columns: 1fr; gap: 8px; }
  .lib-text { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .lb { transition: none; } }

/* Переводы источников в общих каталогах (#2718): та же строка ленты, полка и карточка автора, отличие — словом
   «Перевод …» и статусом проверки, без отдельной раскраски; у авторов источника нет фото и специализации — только инициалы */
.row-import .row-meta { align-items: center; }
.row-import .row-foot { flex-wrap: wrap; row-gap: 8px; }
.shelf-import .shelf-foot { flex-wrap: wrap; row-gap: 8px; }
.author-source .avatar { background: var(--lib-draft-bg); color: var(--lib-draft); }
.me-menu-note { margin: 0 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--accent-light); color: var(--accent-dark); font-size: 13px; line-height: 1.35; }

/* Страницы для чтения (#2718): экран собран по объёму текста, листы источника внутри — тихими метками на полях,
   без жирного разделителя: граница листа PDF — не разрыв чтения. Крупный рисунок вписан в экран целиком */
.lib-controls { display: flex; flex-wrap: wrap; gap: 10px 12px; }
/* Переключатель языка (#3494) закреплён под шапкой сайта: на середине статьи оригинал — в один клик, без возврата наверх */
.lib-controls-sticky { position: sticky; top: calc(var(--top-h, 0px) + 8px); z-index: 5; width: fit-content; max-width: 100%; margin: 0 0 14px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); box-shadow: 0 2px 10px rgba(20, 40, 30, 0.08); }
/* Режим чтения — иконками окон (#3299): рамка и разделитель штрихом, буквы «Я» / «A» заливкой текущего цвета кнопки */
.lib-modes .seg { padding: 6px 9px; }
.lib-mode-ico { display: block; fill: none; stroke: currentColor; stroke-width: 1.4; }
.lib-mode-ico text { fill: currentColor; stroke: none; font-family: inherit; font-size: 11.5px; font-weight: 600; }
.lib-modes .seg[aria-current] .lib-mode-ico rect { fill: var(--paper); }
/* Длинные адреса в тексте источника не распирают колонку на телефоне */
.lib-read { grid-template-columns: minmax(0, 1fr); }
.lib-text { overflow-wrap: anywhere; }
.lib-flow .lib-page, .lib-flow .lib-page + .lib-page { margin-top: 0; padding-top: 0; border-top: 0; }
.lib-read-pager .pg-of { font-weight: 600; font-variant-numeric: tabular-nums; }
.lib-fig-open { display: block; cursor: zoom-in; border-radius: 6px; transition: box-shadow 0.15s ease; }
.lib-fig-open:hover, .lib-fig-open:focus-visible { box-shadow: 0 0 0 3px var(--accent-line); }
.lib-fig:has(.lib-fig-open:hover) { border-color: var(--accent-line); }
.lib-fig img { max-height: min(72vh, 760px); width: auto; object-fit: contain; }
@media (max-width: 760px) {
  .lib-controls .segs { max-width: 100%; overflow-x: auto; }
  .lib-fig img { max-height: 64vh; }
}

/* Содержание перевода (#2850): как страница «Contents» печатной книги — номер раздела, название шрифтом чтения,
   отточие и номер страницы книги. Кнопка — в ряду переключателей читалки; на телефоне содержание — шторка снизу */
.lib-toc { flex-basis: 100%; order: -1; }
.lib-toc-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--paper); font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; user-select: none; }
.lib-toc-btn::-webkit-details-marker { display: none; }
.lib-toc-btn::before { content: ''; width: 16px; height: 12px; background: linear-gradient(currentColor 0 0) 0 0 / 100% 1.6px no-repeat, linear-gradient(currentColor 0 0) 4px 5px / 12px 1.6px no-repeat, linear-gradient(currentColor 0 0) 4px 10px / 9px 1.6px no-repeat; color: var(--accent); }
.lib-toc-btn:hover { border-color: var(--accent-line); }
.lib-toc[open] > .lib-toc-btn { background: var(--accent-light); border-color: var(--accent-line); color: var(--accent-dark); }
.lib-toc-panel { margin-top: 12px; max-height: min(68vh, 640px); overflow: auto; overscroll-behavior: contain; padding: 0 18px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); }
.lib-toc-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px 0 10px; background: var(--paper); }
.lib-toc-head b { font-family: var(--read); font-size: 19px; font-weight: 600; }
.toc-find { flex: 1; min-width: 0; max-width: 300px; margin-left: auto; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--page-bg); }
.toc-find:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: var(--paper); }
.lib-toc-close { display: none; }
.tn-list, .tn-list ol { list-style: none; margin: 0; padding: 0; }
.tn-row { display: grid; grid-template-columns: auto minmax(0, max-content) minmax(14px, 1fr) auto; align-items: baseline; column-gap: 8px; padding: 6px 8px 6px 10px; margin: 0 -8px 0 -10px; color: var(--text); text-decoration: none; }
.tn-row::after { content: ''; grid-column: 3; grid-row: 1; align-self: end; margin-bottom: 0.4em; border-bottom: 1.5px dotted #c8d3cc; }
/* Без номера страницы (разделы статьи журнала) — без отточия в пустоту */
.tn-row:not(:has(.tn-pg))::after { content: none; }
.tn-num { grid-column: 1; min-width: 2.2em; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tn-title { grid-column: 2; font-family: var(--read); font-size: 15px; line-height: 1.4; }
.tn-orig { display: block; font-family: var(--ui); font-size: 12.5px; font-weight: 400; color: var(--muted); }
.tn-pg { grid-column: 4; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tn-pg .mark svg { width: 13px; height: 13px; }
a.tn-row { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
a.tn-row:hover .tn-title { color: var(--accent-dark); }
/* Наведение: мягкая подсветка строки и тонкая полоса слева без скругления; номер и точки отточия тоже теплеют */
a.tn-row:hover, a.tn-row:focus-visible { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent-line); border-radius: 0; outline: none; }
a.tn-row:hover .tn-num, a.tn-row:hover .tn-pg { color: var(--accent-dark); }
a.tn-row:hover::after { border-bottom-color: var(--accent-line); }
.tn-l1 > .tn-row .tn-title, .tn-l2:has(> .tn-sub) > .tn-row .tn-title { font-weight: 600; }
.tn-l3 > .tn-row { padding-left: 26px; }
.tn-l4 > .tn-row { padding-left: 42px; }
.tn-in > .tn-row .tn-title { color: var(--accent-dark); }
/* Текущий раздел: полоса слева от края до края, без скругления */
.tn-row[aria-current] { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent); border-radius: 0; }
.tn-shut .tn-title, .tn-miss .tn-title { color: var(--muted); }
.tn-miss .tn-pg { font-size: 12px; font-style: italic; }
.tn-sub > summary { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px 2.2em; padding: 2px 0; font-size: 12.5px; color: var(--muted); cursor: pointer; list-style: none; }
.tn-l3 > .tn-sub > summary { margin-left: calc(2.2em + 26px); }
.tn-sub > summary::-webkit-details-marker { display: none; }
.tn-sub > summary::before { content: ''; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform 0.15s ease; }
.tn-sub[open] > summary::before { transform: rotate(45deg); }
.tn-sub > summary:hover { color: var(--accent-dark); }
.tn-sub > ol { padding-bottom: 6px; }
.tn[hidden], .tn-sub > summary[hidden] { display: none; }
.lib-toc-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.toc-none { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
/* Оглавление источника в потоке чтения — короткая сноска вместо сотен строк, сами строки свёрнуты */
.lib-notice { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--accent-light); color: var(--accent-dark); font-size: 14.5px; }
.pg-go-book input { width: 64px; }
/* Цель якоря (#2850) с tabindex="-1": после перехода мышью её и так видно подсветкой :target — без рамки;
   пришли с клавиатуры (:focus-visible) — общая рамка фокуса остаётся. Цитата с полосой слева — без скругления слева */
:is(.lb, .lib-page, .prose > [id], .sheet-text > [id], .sheet)[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.lb-quote:focus-visible { border-radius: 0 10px 10px 0; }
.lib-acts { margin: 0 0 12px; }
.me-gone .row-lead { color: var(--muted); }
@media (max-width: 760px) {
  .lib-toc[open] > .lib-toc-panel { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 84vh; margin: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; border: 0; box-shadow: 0 -12px 40px rgba(20, 40, 30, 0.22); }
  .lib-toc[open]::before { content: ''; position: fixed; inset: 0; z-index: 59; background: rgba(20, 40, 30, 0.32); }
  .lib-toc-close { display: inline-flex; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--page-bg); font: inherit; font-size: 14px; color: var(--text); }
  .toc-find { max-width: none; }
  .tn-row { padding-top: 9px; padding-bottom: 9px; }
  .tn-l3 > .tn-row { padding-left: 18px; }
  .tn-l4 > .tn-row { padding-left: 30px; }
}
@media (prefers-reduced-motion: reduce) { .tn-sub > summary::before { transition: none; } }

/* Содержание в колонке справа от статьи журнала: пока колонка рядом с текстом, оно в ней, кнопка «Содержание» скрыта.
   Текущий раздел идёт за прокруткой (library.js) — отрезок направляющей цветом и жирным, как в читалке переводов */
.read-side > .toc-rail { display: block; position: static; margin: 0; max-height: none; overflow: visible; padding: 0 0 4px 2px; }
.read-side > .toc-rail .toc-rail-head { position: static; padding-bottom: 10px; background: none; }
@media (min-width: 861px) { .read-grid:has(> .read-side > .toc-rail) .art-controls { display: none; } }
@media (max-width: 860px) { .read-side > .toc-rail { display: none; } }

/* Содержание справа (#3294): на широком экране колонка рядом с текстом закреплена под шапкой и идёт за читателем.
   Тихая — без карточки: вертикальная направляющая слева, текущий раздел — отрезок направляющей цветом и жирным.
   Глубже второго уровня раскрыта только ветка, которую сейчас читают; на узком экране — прежняя кнопка «Содержание» */
.lib-shell { display: grid; grid-template-columns: minmax(0, 1fr); }
.toc-rail { display: none; }
@media (min-width: 1180px) {
  .lib-shell { grid-template-columns: minmax(0, 1fr) 252px; column-gap: 36px; }
  .lib-shell > .lib-read { max-width: none; }
  .lib-shell .lib-toc { display: none; }
  .toc-rail { display: block; position: sticky; top: calc(var(--top-h, 63px) + 20px); align-self: start; margin: 36px 0 72px; max-height: calc(100vh - var(--top-h, 63px) - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; padding: 0 6px 12px 2px; }
}
.toc-rail-head { position: sticky; top: 0; z-index: 1; display: grid; gap: 10px; padding: 2px 0 12px; background: var(--page-bg); }
.toc-rail-head b { font-family: var(--read); font-size: 17px; font-weight: 600; }
.toc-rail .toc-find { max-width: none; margin-left: 0; background: var(--paper); }
.toc-rail .toc-none { margin: 10px 0 0 16px; font-size: 13px; color: var(--muted); }
.tr-list, .tr-list ol { list-style: none; margin: 0; padding: 0; }
.tr-list { border-left: 2px solid var(--border); }
.tr-row { display: flex; align-items: baseline; gap: 6px; margin-left: -2px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; border-radius: 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease; }
.toc-rail .tn-title { font-family: var(--ui); font-size: inherit; }
.toc-rail .tn-orig { font-size: 12px; }
.tr-num { flex: none; font-variant-numeric: tabular-nums; }
.tr-d1 > .tr-row { color: var(--text); font-weight: 500; }
.tr-d1 + .tr-d1 > .tr-row { margin-top: 4px; }
.tr-d2 > .tr-row { padding-left: 26px; }
.tr-d3 > .tr-row { padding-left: 38px; font-size: 13px; }
.tr-d4 > .tr-row { padding-left: 50px; font-size: 13px; }
a.tr-row:hover, a.tr-row:focus-visible { color: var(--accent-dark); border-left-color: var(--accent-line); background: linear-gradient(90deg, var(--accent-light), transparent); outline: none; }
a.tr-row[aria-current]:hover { border-left-color: var(--accent); }
.tr-in > .tr-row { color: var(--accent-dark); }
.tr-row[aria-current] { color: var(--accent-dark); font-weight: 600; border-left-color: var(--accent); }
.tr-shut, .tr-miss { cursor: default; }
.tr-shut .mark svg { width: 12px; height: 12px; }
.tr-miss .tn-title { opacity: 0.7; }
.tr-d2:not(.tr-in) > ol, .tr-many .tr-d1:not(.tr-in) > ol { display: none; }
.toc-rail.is-finding .tr > ol { display: block; }
.tr[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tr-row, a.tn-row { transition: none; } }
@media (max-width: 1179px) {
  .lib-toc.is-floating { min-height: 40px; }
  .lib-toc.is-floating > .lib-toc-btn, .lib-toc-dock .lib-toc > .lib-toc-btn { position: fixed; z-index: 58; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 6px 22px rgba(20, 40, 30, 0.18); }
  .lib-toc.is-floating[open] > .lib-toc-panel, .lib-toc-dock .lib-toc[open] > .lib-toc-panel { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; width: min(640px, 100%); max-height: 84vh; margin: 0 auto; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(20, 40, 30, 0.22); }
  .lib-toc.is-floating[open]::before, .lib-toc-dock .lib-toc[open]::before { content: ''; position: fixed; inset: 0; z-index: 59; background: rgba(20, 40, 30, 0.32); }
  .lib-toc.is-floating .lib-toc-close, .lib-toc-dock .lib-toc-close { display: inline-flex; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--page-bg); font: inherit; font-size: 14px; color: var(--text); }
}

/* ——— Заказы (#2998): чек слева, оплата справа. Чек — бумажная квитанция с перфорацией снизу, как рецепт на странице подписки ——— */
.ord-h1 { margin: 0 0 18px; font-size: 30px; line-height: 1.2; letter-spacing: -0.01em; }
.ord-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
.ord-head .ord-h1 { margin-bottom: 18px; font-family: var(--read); font-weight: 600; }
.ord-sandbox { display: inline-block; margin: 0 0 18px; padding: 6px 12px; border-radius: 8px; background: #fff4d6; color: #7a5600; font-size: 14px; font-weight: 500; }
.ord-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; margin-bottom: 48px; }
.ord-receipt { position: relative; padding: 26px 26px 34px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px 14px 0 0;
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, #0000 98%, #000) 0 0 / 22px 100%; mask: radial-gradient(circle 7px at 50% 100%, #0000 98%, #000) 0 0 / 22px 100%; }
.ord-what { margin: 0 0 6px; font-family: var(--read); font-size: 21px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.ord-term { margin: 0 0 20px; color: var(--muted); }
.ord-lines { margin: 0 0 18px; padding: 14px 0 0; border-top: 1px dashed var(--accent-line); }
.ord-lines div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.ord-lines:first-child { padding-top: 0; border-top: 0; }
.ord-lines dt { color: var(--muted); }
.ord-lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.ord-back { color: var(--accent-dark); font-weight: 500; }
.ord-form, .ord-owned, .ord-box { padding: 24px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.ord-form fieldset { margin: 0 0 16px; padding: 0; border: 0; }
.ord-form legend { margin-bottom: 10px; font-weight: 600; font-size: 17px; }
.ord-method { display: flex; gap: 12px; padding: 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; }
.ord-method + .ord-method { margin-top: 10px; }
.ord-method:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.ord-method input { margin-top: 3px; accent-color: var(--accent); }
.ord-method b { display: block; }
.ord-method small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }
.ord-method-off { cursor: not-allowed; opacity: 0.72; }
.ord-submit { width: 100%; }
.ord-fine { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.ord-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #a1281c; }
.ord-pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 99px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.ord-wait { background: #fff4d6; color: #7a5600; }
.ord-ok { background: var(--accent-light); color: var(--accent-dark); }
.ord-bad { background: #fdecea; color: #a1281c; }
.ord-off { background: #eef1ef; color: var(--muted); }
/* Шаги: точка и линия между ними — путь заказа сверху вниз */
.ord-steps { margin: 6px 0 0; padding: 0; list-style: none; }
.ord-steps li { position: relative; padding: 0 0 16px 28px; color: var(--muted); }
.ord-steps li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px #c3cec8; }
.ord-steps li:not(:last-child)::after { content: ''; position: absolute; left: 8px; top: 20px; bottom: 2px; width: 2px; background: #e1e7e3; }
.ord-steps b { display: block; font-weight: 500; }
.ord-steps small { display: block; font-size: 13.5px; }
.ord-steps .is-done, .ord-steps .is-now { color: var(--text); }
.ord-steps .is-done::before { background: var(--accent); box-shadow: none; }
.ord-steps .is-done:not(:last-child)::after { background: var(--accent-line); }
.ord-steps .is-now::before { background: #f0b429; box-shadow: 0 0 0 4px #fff4d6; }
.ord-steps .is-bad::before { background: #d64545; box-shadow: none; }
.ord-steps .is-bad { color: #a1281c; }
@media (prefers-reduced-motion: no-preference) { .ord-steps .is-now::before { animation: ord-wait 1.6s ease-in-out infinite; } }
@keyframes ord-wait { 50% { box-shadow: 0 0 0 7px #fff4d600; } }
.ord-side { display: grid; gap: 16px; min-width: 0; }
.ord-box p { margin: 0 0 14px; }
.ord-box-ok { background: var(--accent-light); border-color: var(--accent-line); }
.ord-box-bad { background: #fdf6f5; border-color: #f3d2cd; }
.ord-box-wait { background: #fffaeb; border-color: #f1dfa6; }
.ord-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ord-acts form { margin: 0; }
.ord-cancel { padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.ord-cancel:hover { color: #a1281c; }
.ord-qr { display: block; margin: 0 auto 14px; border-radius: 8px; image-rendering: pixelated; }
.ord-sandbox-acts { margin-top: 16px; padding: 14px; border-radius: 12px; background: #fffaeb; border: 1px dashed #e9c46a; }
.ord-sandbox-acts p { margin: 0 0 10px; font-size: 14px; color: #7a5600; }
.ord-sandbox-acts form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ord-history summary { cursor: pointer; color: var(--muted); }
.ord-history ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.ord-history time { color: var(--text); }
.ord-list { margin: 0 0 48px; padding: 0; list-style: none; display: grid; gap: 10px; }
.ord-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 18px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--border); border-radius: 12px; }
.ord-row:hover { border-color: var(--accent-line); }
.ord-row-what b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ord-row-what small { color: var(--muted); }
.ord-row-sum { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ord-empty { max-width: 560px; padding: 28px 0 60px; }
.ord-empty p { color: var(--muted); }
@media (max-width: 760px) {
  .ord-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ord-h1 { font-size: 24px; }
  .ord-receipt, .ord-form, .ord-owned, .ord-box { padding: 18px; }
  .ord-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ord-row .ord-pill { grid-column: 1 / -1; justify-self: start; }
}
/* Страницы, где в исходном PDF нет текста (#2996): тихая пометка на месте листа, ссылка на сам PDF */
.lib-blank { margin: 6px 0 14px; padding: 14px 16px; border: 1px dashed var(--accent-line); border-radius: 12px; background: var(--page-bg); font-family: var(--ui); }
.lib-blank p { margin: 0 0 8px; font-size: 14.5px; color: var(--muted); }
.lib-blank p b { color: var(--text); font-weight: 600; }
.lib-blank-pdf { font-size: 14px; font-weight: 600; }
/* Титульные страницы тома серии (#3300): выходные данные свёрнуты строкой интерфейса, раскрываются тем же текстом */
.lib-publication { margin: 4px 0 10px; border-bottom: 1px solid var(--border); font-family: var(--ui); }
.lib-publication summary { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.lib-publication summary::-webkit-details-marker { display: none; }
.lib-publication summary::before { content: ''; flex: none; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform 0.18s ease-out; }
.lib-publication[open] summary::before { transform: rotate(45deg); }
.lib-publication summary:hover, .lib-publication[open] summary { color: var(--accent-dark); }
.lib-publication summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.lib-publication[open] { padding-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .lib-publication summary::before { transition: none; } }

/* Лента чтения (#3293): текст без страниц, большой материал догружается порциями (stream.js).
   Край ленты — тихая строка между двумя линейками в шрифте текста: без скрипта это ссылка «Читать дальше»,
   со скриптом её почти не видно — порция встаёт на место раньше, чем читатель долистает. Пока порция в пути,
   линейки бегут, а подпись говорит, что текст загружается. */
.rd-sheets { display: grid; gap: 16px; }
.rd-edge:empty { display: none; }
.rd-edge:has(> .rd-more) { display: flex; justify-content: center; }
.rd-more { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 640px; padding: 14px 0; color: var(--muted); font-family: var(--read); font-size: 15px; font-style: italic; }
.rd-more::before, .rd-more::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.rd-more:hover { color: var(--accent-dark); }
.rd-more:hover::before, .rd-more:hover::after { background: var(--accent-line); }
.rd-edge.is-loading .rd-more { pointer-events: none; }
.rd-edge.is-loading .rd-more::before, .rd-edge.is-loading .rd-more::after { background: linear-gradient(90deg, var(--border) 0 30%, var(--accent) 50%, var(--border) 70% 100%) 0 0 / 300% 100%; animation: rd-run 1.1s linear infinite; }
.rd-edge.is-loading .rd-more::after { animation-direction: reverse; }
@keyframes rd-run { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .rd-edge.is-loading .rd-more::before, .rd-edge.is-loading .rd-more::after { animation: none; background: var(--accent-line); } }
.lib-goto { display: flex; justify-content: center; }

/* Рисунок крупно: на телефоне — на весь экран, на широком — по центру с отступом; закрывается крестиком, фоном и Esc */
.zoom-on { overflow: hidden; }
.zoom { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 56px 20px 20px; background: rgba(20, 28, 24, 0.82); cursor: zoom-out; animation: zoom-in 0.16s ease-out; }
.zoom[hidden] { display: none; }
.zoom-fig { margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: default; }
.zoom-fig img { display: block; max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.zoom-fig figcaption { max-width: 70ch; max-height: 6.5em; overflow-y: auto; font-family: var(--ui); font-size: 13.5px; line-height: 1.5; color: #d5dfd9; text-align: center; }
.zoom-x { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; }
.zoom-x:hover { background: rgba(255, 255, 255, 0.26); }
.zoom-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes zoom-in { from { opacity: 0; } }
@media (max-width: 760px) {
  .zoom { padding: 60px 0 0; background: #101713; align-items: stretch; }
  .zoom-fig { max-width: 100%; justify-content: center; height: 100%; padding-bottom: 16px; }
  .zoom-fig img { max-height: none; flex: 0 1 auto; min-height: 0; width: 100%; object-fit: contain; border-radius: 0; box-shadow: none; }
  .zoom-fig figcaption { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { .zoom { animation: none; } }
/* Имя автора как в источнике; русское написание — во всплывающей подсказке (#3496) */
.pn { text-decoration: underline dotted color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; cursor: help; }
.lp-tip small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; opacity: 0.8; }
/* Непереведённый кусок (#3497): оригинал среди русского текста помечен, а не выглядит случайным сбоем */
.lb-untr { box-shadow: inset 3px 0 0 var(--lib-none-bg, #e6d9b8); }
.tn-untr { font-style: italic; }
.tn-untr::after { content: " · не переведено"; font-size: 12px; color: var(--muted); font-style: normal; }
