/* Зелёная палитра — та же, что в админке 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) 320px; gap: 40px; align-items: start; 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: 22px 26px 8px; }
.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: none; margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent-dark); }
.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; }
/* Настройки — колонка справа с тремя вкладками: авторы, темы, что собирать. Отметил, сохранил, дальше только читаешь */
/* Колонка едет рядом с длинной лентой, только если целиком помещается по высоте — иначе кнопка «Сохранить» не видна */
@media (min-height: 820px) { .news-page > .news-set { position: sticky; top: 84px; } }
.news-set.side-block { padding: 18px 18px 18px; }
.news-set.side-block h2 { margin: 0; font-size: 15px; font-weight: 650; color: var(--text); }
.news-set form { display: grid; margin-top: 12px; }
.news-pane-in { position: absolute; opacity: 0; pointer-events: none; }
.news-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); }
.news-tabs label { display: inline-flex; align-items: baseline; gap: 5px; margin-bottom: -1px; padding: 0 0 9px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.news-tabs label:hover { color: var(--text); }
.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-bottom-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
#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; border-radius: 4px; }
.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-set .btn { justify-self: stretch; margin-top: 14px; }
/* поиск по авторам и темам — над списками; на вкладке «Что собирать» искать нечего */
.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 { max-height: 312px; margin: 0 -8px; overflow-y: auto; scrollbar-width: thin; }
.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; 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 { flex: 1; min-width: 0; }
.news-kind b { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.news-kind b::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.news-kind small { display: block; padding-left: 16px; 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; }
/* Лента — сверху вниз по линии времени: у каждого вида обновления своя точка */
.news-list { --dot: var(--accent); margin: 18px 0 0; padding: 0; list-style: none; }
.news-item { position: relative; padding: 0 0 22px 28px; }
.news-item::after { content: ''; position: absolute; top: 12px; bottom: -4px; left: 4px; width: 2px; background: var(--border); }
.news-item:last-child::after { display: none; }
.news-item::before { content: ''; position: absolute; z-index: 1; top: 4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px var(--paper); }
.news-item:first-child::before { animation: news-beat 2.4s ease-out 0.6s 2; }
@keyframes news-beat { 0%, 60%, 100% { box-shadow: 0 0 0 3px var(--paper), 0 0 0 3px transparent; } 20% { box-shadow: 0 0 0 3px var(--paper), 0 0 0 8px color-mix(in srgb, var(--dot) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .news-item:first-child::before { animation: none; } .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: 12.5px; font-weight: 600; color: color-mix(in srgb, var(--dot) 80%, #26342e); }
.news-title { margin: 2px 0 3px; font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: -0.2px; }
.news-title a:hover { color: var(--accent-dark); }
.news-meta { margin: 0; font-size: 13px; color: var(--muted); }
.news-meta .byline:hover { color: var(--accent-dark); }
@media (max-width: 860px) {
  .news-page { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .news-page-empty .news-set { order: -1; }
  .news-tune { display: inline; }
  .news-head:has(.news-show) { flex-wrap: wrap; row-gap: 10px; }
  .news-show { order: 1; }
  .news-head .news-sort { margin-left: 0; }
  .news-page > .news-set { position: static; scroll-margin-top: 72px; }
}
@media (max-width: 560px) {
  .news, .news-page .news { padding: 16px 16px 6px; }
}

/* Главная */
.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); }
/* «Ещё 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-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); }
.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; }
.gate-single .btn .aw-unit { color: inherit; }
/* Штучная статья со скидкой подписчикам: два предложения рядом на медном фоне штучной —
   разовая покупка медной кнопкой, 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-thesis { width: min(520px, calc(100vw - 32px)); }
.modal-thesis h2 { font-size: 22px; letter-spacing: -0.4px; padding-right: 32px; }
.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; }
/* Пришли по ссылке-источнику на абзац — он коротко подсвечивается */
.prose p[id] { scroll-margin-top: 24px; }
.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); }
@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-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 { display: none; }
.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); }
.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; }
.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); }
.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; }
/* Та же листалка под лентой статей */
.feed-pager { margin-top: 28px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li + li { border-top: 1px solid var(--border); }
.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); }
.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; }
.aw-unit { display: inline-block; width: .56em; height: .66em; margin-left: .04em; vertical-align: -.04em; overflow: visible; color: #16a768; }
.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-y: auto; 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-home { font-size: 13.5px; color: var(--muted); }
.rd-home:hover { color: var(--accent-dark); }
.rd-book { display: flex; gap: 14px; align-items: flex-start; }
.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; }
.rd-toc summary { margin-bottom: 12px; 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; }
.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; gap: 16px; padding: 14px 16px 18px; border-right: 0; border-bottom: 1px solid var(--border); }
  .rd-toc:not([open]) summary { margin-bottom: 0; }
  .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: 1fr; }
  .shelf-book { gap: 16px; padding: 16px; }
  .cover { width: 92px; padding: 10px 5px 8px 12px; }
  .cover b { font-size: 11px; }
  .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: 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-dl { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--desk-ink); white-space: nowrap; }
.orig-dl:hover { background: var(--desk-line); color: #fff; }
.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-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-dl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .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; }

/* Три пункта меню и вход должны влезать в шапку на узком телефоне */
@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(4, 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-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-tube { stroke-dasharray: 1; stroke-dashoffset: 0; }
.pi-bell { transform-origin: 50% 0; }
.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-tube { animation: pi-draw 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.plan:is(:hover, :focus-within) .pi-bell { animation: pi-swing 0.9s ease-in-out 0.35s; }
.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-swing { 25% { transform: rotate(14deg); } 55% { transform: rotate(-9deg); } 80% { transform: rotate(4deg); } }
@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: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@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; }
}
