/* Веб-читалка Readmix: те же цвета и пропорции, что в приложении для iOS (Brand.swift). */
:root {
  --red: #ff4438;
  --blue: #2f6bff;
  --green: #15b36b;
  --yellow: #fec01d;
  --ink: #1e1e1e;
  --text: #000000;
  --muted: #6a6a6f;
  --bg: #f2f2f7;
  --card: #ffffff;
  --page: #ffffff;
  --fill: #eceef3;
  --line: #d8d8de;
  /* Цвета текста темнее цветов логотипа: на светлом фоне и подсветках контраст не ниже 4,5:1. */
  --en: #2257d6;
  /* Синий под белым текстом, как Brand.buttonFill в приложении: 6,2:1. У --blue белый текст — 4,50:1, чуть ниже нормы. */
  --button: #2257d6;
  --word-bg: #ffe7a3;
  --phrase-bg: #e6edff;
  --speaking-bg: #fff2c4;
  --news: #d3261e;
  --story: #00793f;
  --fact: #946300;
  --bar: rgba(249, 249, 251, 0.86);
  --shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  --reading: 19px;
  --tabs-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ffffff;
    --muted: #98989f;
    --bg: #000000;
    --card: #1c1c1e;
    --page: #000000;
    --fill: #2c2c2e;
    --line: #38383a;
    --en: #8aaeff;
    --word-bg: #4d3d0f;
    --phrase-bg: #1f2b4a;
    --speaking-bg: #3d3414;
    --news: #ff7a70;
    --story: #45d893;
    --fact: #fec01d;
    --bar: rgba(22, 22, 24, 0.86);
    --shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--en); }
svg.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.solid { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
}
.app.no-tabs { padding-bottom: 40px; }
.loading, .noscript { padding: 48px 20px; color: var(--muted); text-align: center; }

/* ── Кнопки ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border: 0; border-radius: 14px;
  font-size: 17px; font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--blue); color: #fff; width: 100%; }
.btn.tinted { background: var(--phrase-bg); color: var(--en); }
.btn.tinted.done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--story); }
.btn.plain { background: var(--fill); color: var(--text); }
.btn.small { min-height: 40px; font-size: 15px; padding: 0 14px; border-radius: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip b {
  padding: 1px 5px; border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}

.play {
  display: inline-grid; place-items: center; flex: none;
  width: 54px; height: 54px; border: 0; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 22px;
}
.play.small { width: 38px; height: 38px; font-size: 15px; }
.play.playing { background: var(--blue); box-shadow: 0 0 0 6px color-mix(in srgb, var(--blue) 22%, transparent); }
.no-speech .play { display: none; }

/* ── Главная: лента ─────────────────────────────────────────────────────── */

/* Посты прокручиваются, как в Instagram и в приложении для iOS; на компьютере — колонка шириной с телефон.
   Макет — artifacts/2026-10-27-feed-instagram. */
.app.feed-mode { min-height: 0; padding: 0; }
.feed-shell { position: fixed; inset: 0; display: flex; justify-content: center; background: var(--bg); }
.feed-column { position: relative; width: 100%; max-width: 480px; height: 100%; background: var(--bg); }
@media (min-width: 560px) { .feed-column { box-shadow: 0 0 0 0.5px var(--line), 0 16px 48px rgba(0, 0, 0, 0.1); } }
.feed-column > .chip {
  position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 16px; z-index: 3;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}
.feed-status { display: grid; place-items: center; height: 100%; padding-bottom: var(--tabs-h); }

.feed {
  height: 100%; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 20px);
}
.feed::-webkit-scrollbar { display: none; }
.page { position: relative; }
.page + .page { margin-top: 12px; }

/* Пост: вид и тема, заголовок, обложка, первая фраза и «Читать». */
.post { margin-inline: 12px; border-radius: 22px; background: var(--card); overflow: hidden; }
.post.news { --kind-bg: var(--red); }
.post.story { --kind-bg: var(--green); }
.post.fact { --kind-bg: var(--yellow); }
.post-meta { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px 0 16px; }
/* Цвета логотипа, подпись тёмная: белый на красном и зелёном читается хуже 4,5:1. */
.kind {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 4px 9px; border-radius: 999px; color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.kind.news { background: var(--red); }
.kind.story { background: var(--green); }
.kind.fact { background: var(--yellow); }
.post-meta .meta { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.post-meta .free {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 8px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 12px; font-weight: 600;
}
/* ⋯ справа от темы, рядом со ссылкой на текст, цель 44 px. */
.page-more {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 20px; cursor: pointer;
}
.page-more[aria-expanded="true"] { background: var(--fill); color: var(--text); }
.page-more:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.text-menu {
  position: absolute; top: 100%; right: 8px; z-index: 4;
  display: grid; width: max-content; max-width: calc(100% - 16px); padding: 6px; border-radius: 14px;
  background: var(--card); box-shadow: 0 0 0 0.5px var(--line), 0 16px 40px rgba(0, 0, 0, 0.28);
}
.text-menu button {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 9px;
  background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left;
}
.text-menu button:hover, .text-menu button:focus-visible { background: var(--fill); outline: none; }
.text-menu .i { flex: none; font-size: 18px; }

.page-link { display: block; color: var(--text); text-decoration: none; }
.page-link:focus-visible { outline-offset: -4px; }
.post-title { padding: 0 16px; }
.post-title h2 {
  margin: 0; font-size: 22px; line-height: 1.22; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-title .alt {
  margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Текст без картинки — шапка цвета вида с крупным заголовком, всё в ней тёмное. */
.post.no-photo .post-meta, .post.no-photo .post-title { background: var(--kind-bg); color: var(--ink); }
.post.no-photo .post-title { padding-bottom: 18px; }
.post.no-photo .post-title h2 { color: var(--ink); font-size: 27px; font-weight: 800; line-height: 1.15; -webkit-line-clamp: 4; }
.post.no-photo .post-title .alt, .post.no-photo .post-meta .meta, .post.no-photo .page-more { color: var(--ink); }
.post.no-photo .post-meta .kind { background: rgba(255, 255, 255, 0.92); }

/* «Живая обложка»: когда пост впервые за загрузку на экране, картинка 5 секунд медленно приближается
   и останавливается — дольше без кнопки «Остановить» по WCAG 2.2.2 нельзя. Без движения, если оно выключено. */
.post-cover { height: 180px; margin-top: 12px; }
.post-cover img { transform-origin: 50% 40%; }
.post-cover.live img { animation: cover-zoom 5s ease-out both; }
.post-cover.zoomed img { transform: scale(1.08) translate(-1.5%, -1%); }
@keyframes cover-zoom { to { transform: scale(1.08) translate(-1.5%, -1%); } }
@media (prefers-reduced-motion: reduce) {
  .post-cover.live img { animation: none; }
  .post-cover.zoomed img { transform: none; }
}

.post-body { padding: 0 16px 4px; }
.post-text { margin-top: 12px; font-size: 17px; line-height: 1.45; overflow-wrap: break-word; }
.post-text p { margin: 0; }
.page-foot { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.page-foot .time { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; color: var(--muted); font-size: 15px; }
/* Светло-синяя «Читать»: залитая синяя кнопка — одна, «Читать дальше» в конце текста. */
.page-foot .go {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--phrase-bg); color: var(--en); font-size: 15px; font-weight: 600;
}
.page-foot .done { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--story); font-size: 15px; font-weight: 600; }

/* Верх ленты: приветствие, «Нет сети» и подборка на сегодня кружками. Справа — место под «EN 45%». */
.today-post { padding-top: calc(env(safe-area-inset-top) + 8px); }
/* minmax(0, 1fr): ряд кружков листается внутри, а не растягивает колонку на всю свою длину. */
.today-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.greet {
  display: flex; align-items: center; min-height: 40px; max-width: calc(100% - 156px); margin: 0 16px;
  font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.offline { display: flex; align-items: center; gap: 12px; margin: 0 12px; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--card); }
.offline > .i { flex: none; color: var(--muted); font-size: 20px; }
.offline p { flex: 1; margin: 0; font-size: 15px; }
.offline .btn { min-height: 44px; border-radius: 999px; }

/* Тонкая шапка, когда подборка уехала вверх. Справа — место под «EN 45%». */
.feed-bar {
  position: absolute; inset: 0 0 auto; z-index: 2;
  display: flex; align-items: center; gap: 10px; min-height: calc(env(safe-area-inset-top) + 52px);
  padding: env(safe-area-inset-top) 150px 0 16px;
  background: var(--bar); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 0.5px solid var(--line); font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.feed-bar.shown { opacity: 1; }
.feed-bar .ring { width: 26px; height: 26px; }
.feed-bar .ring > span, .feed-bar .ring > .i { display: none; }
.feed-bar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Конец выпуска — карточкой в ленте. */
.end-post { margin-inline: 12px; }
.end {
  display: grid; justify-items: center; gap: 12px; padding: 24px 20px; border-radius: 22px;
  background: var(--card); text-align: center;
}
.end-icon { font-size: 40px; color: var(--story); line-height: 1; }
.end h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.end p { margin: 0; color: var(--muted); }
.btn.more {
  padding: 0 22px; border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.end .tip { margin: 4px 0 0; text-align: left; }
/* Ищем тексты в прошлых выпусках. */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--muted); animation: spin 0.8s linear infinite;
}

/* Кнопки «предыдущий / следующий» справа от колонки — для мыши: в ленте и в читалке (.reader-nav ниже). */
.feed-nav, .reader-nav { display: none; }
.feed-nav button, .reader-nav button {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--card); color: var(--text); font-size: 22px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.feed-nav button:disabled, .reader-nav button:disabled { opacity: 0.35; cursor: default; }
@media (min-width: 640px) and (hover: hover) and (pointer: fine) {
  .feed-nav { position: absolute; top: 50%; left: calc(100% + 24px); transform: translateY(-50%); display: grid; gap: 12px; }
}

.tip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px;
  background: var(--phrase-bg); font-size: 15px;
}
.tip p { margin: 0; flex: 1; color: var(--text); }
.tip .x { border: 0; background: none; padding: 0 2px; color: var(--muted); font-size: 18px; line-height: 1; }

.meta { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta.news { color: var(--news); }
.meta.story { color: var(--story); }
.meta.fact { color: var(--fact); }
.en-text { color: var(--en); }

.cover {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.9); font-size: 44px;
}
.cover.news { background: linear-gradient(135deg, var(--red), color-mix(in srgb, var(--red) 60%, transparent)); }
.cover.story { background: linear-gradient(135deg, var(--green), color-mix(in srgb, var(--green) 60%, transparent)); }
.cover.fact { background: linear-gradient(135deg, var(--yellow), color-mix(in srgb, var(--yellow) 60%, transparent)); color: rgba(30, 30, 30, 0.55); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.empty { margin: 48px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 20px; margin: 12px 0 6px; }
.empty .big-icon { font-size: 44px; color: var(--muted); }

/* ── Шапка внутренних экранов ───────────────────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  padding: calc(env(safe-area-inset-top) + 6px) 12px 6px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line);
}
.bar .back {
  justify-self: start; display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: none; padding: 8px 4px; color: var(--en); font-size: 17px; text-decoration: none;
}
.bar .back .i { font-size: 22px; }
/* Длинное название книги в «Назад» обрезается многоточием. */
.bar .back { min-width: 0; max-width: 100%; }
.bar .back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .title { font-weight: 600; }
.bar .actions { justify-self: end; display: flex; align-items: center; gap: 2px; }
.bar .chip { background: var(--fill); }
.bar .share { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--en); font-size: 22px; }

.page-title { margin: 0; padding: calc(env(safe-area-inset-top) + 20px) 20px 8px; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; }

/* ── Читалка ────────────────────────────────────────────────────────────── */

.reader .hero { height: 230px; }
@media (min-width: 720px) { .reader .hero { height: 320px; border-radius: 0 0 20px 20px; } }
.credit { margin: 6px 20px 0; font-size: 11px; color: var(--muted); }
.credit a { color: inherit; }
.article { padding: 16px 20px 0; }
.article h1 { margin: 6px 0 4px; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.article .alt { margin: 0; color: var(--muted); font-size: 20px; line-height: 1.3; }
.stats { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
/* «Слушать»: текст целиком голосом ElevenLabs, если у текста есть озвучка. */
.listen {
  display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0;
  padding: 8px 14px 8px 10px; border: 0; border-radius: 999px;
  background: var(--phrase-bg); color: var(--blue); font-size: 15px; font-weight: 600;
}
.listen .i { font-size: 20px; }
.listen .time { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.listen[disabled] { opacity: 0.55; }
/* Пока текст читается вслух, кнопка паузы едет вместе с текстом под шапкой. */
.listen.active { position: sticky; top: calc(env(safe-area-inset-top) + 58px); z-index: 4; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); }

/* Подсказка до первого нажатия на слово — одной строкой, как на карточке ленты в приложении. */
.hint { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 13px; }
.hint .i { color: var(--blue); font-size: 18px; }

.text { margin-top: 20px; font-size: var(--reading); line-height: 1.6; overflow-wrap: break-word; }
.text p { margin: 0 0 0.9em; }
.seg { border-radius: 5px; padding: 2px 0; transition: background-color 0.15s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.seg.en { color: var(--en); font-weight: 500; }
.t { border-radius: 5px; cursor: pointer; }
.t.punct { cursor: default; }
.seg.mark-phrase { background: var(--phrase-bg); box-shadow: 0 0 0 2px var(--phrase-bg); }
.t.mark-word { background: var(--word-bg); box-shadow: 0 0 0 2px var(--word-bg); }
.seg.speaking { background: var(--speaking-bg); box-shadow: 0 0 0 2px var(--speaking-bg); }

.box { margin-top: 24px; padding: 16px; border-radius: 16px; background: var(--card); }
.box h2 { margin: 0 0 12px; font-size: 17px; }
.box .note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
/* Конец текста: показалась — текст дочитан. */
.text-end { height: 1px; }

/* Соседние тексты ленты: на телефоне — «Предыдущий / Следующий» под текстом, на компьютере — ↑ ↓ справа
   от колонки, с названием текста при наведении. */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.pager button {
  display: grid; gap: 2px; min-width: 0; padding: 10px 14px; border: 0; border-radius: 12px;
  background: var(--fill); text-align: left;
}
.pager button + button { text-align: right; }
.pager .dir { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 600; }
.pager button + button .dir { justify-content: flex-end; }
.pager .dir .i { font-size: 18px; }
.pager .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager button:disabled { opacity: 0.4; cursor: default; }
/* Справа от колонки шириной 720 px должны поместиться кнопки и подсказка с названием, иначе — кнопки под текстом. */
@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  .pager { display: none; }
  .reader-nav { position: fixed; top: 50%; left: calc(50% + 384px); z-index: 4; transform: translateY(-50%); display: grid; gap: 12px; }
  .reader-nav button { position: relative; }
  .reader-nav button[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; top: 50%; left: calc(100% + 12px); transform: translateY(-50%);
    width: max-content; max-width: 200px; padding: 6px 10px; border-radius: 8px;
    background: var(--fill); color: var(--text); font-size: 13px; line-height: 1.35; text-align: left; pointer-events: none;
  }
}

/* Источники — мелким шрифтом в конце, как подпись к фото. */
.sources { margin-top: 24px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.sources p { margin: 0 0 4px; }
.sources a { color: inherit; }
.fine { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* ── Книги ──────────────────────────────────────────────────────────────── */

/* Вкладка «Книги», страница книги и глава — как BooksView, BookView и ChapterView в приложении для iOS.
   Макет — artifacts/2026-11-03-books-section. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 16px; }
.page-head .page-title { min-width: 0; }
.page-head .chip { flex: none; margin-top: calc(env(safe-area-inset-top) + 12px); }

.books-intro { padding: 4px 20px 0; }
.books-intro h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.books-intro p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.books { display: grid; gap: 16px; padding: 16px 16px 0; }
.books-note { margin: 0; padding: 0 16px; color: var(--muted); font-size: 15px; text-align: center; }

/* Типографская обложка: цвета (--cover-*) и кегль названия (--cover-size) ставит скрипт, размеры — от ширины 96. */
.book-cover {
  --s: 1;
  position: relative; flex: none; display: flex; flex-direction: column;
  width: calc(96px * var(--s)); height: calc(144px * var(--s)); padding: calc(10px * var(--s));
  border-radius: calc(8px * var(--s)); overflow: hidden;
  background: var(--cover-bg, var(--ink)); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.book-cover.large { --s: 1.375; }
/* Линия воды и огонёк на другом берегу. */
.book-cover::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 34px * var(--s)); height: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.book-cover::after {
  content: ""; position: absolute; left: calc(100% - 30px * var(--s)); top: calc(100% - 46px * var(--s));
  width: calc(8px * var(--s)); height: calc(8px * var(--s)); border-radius: 50%;
  background: var(--cover-light, var(--green)); box-shadow: 0 0 calc(6px * var(--s)) var(--cover-light, var(--green));
}
.book-cover p { margin: 0; }
.book-cover .by {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--cover-author, #fff); font-size: calc(8px * var(--s)); font-weight: 700; line-height: 1.2;
  letter-spacing: calc(0.6px * var(--s)); text-transform: uppercase;
}
.book-cover .name {
  margin-top: calc(12px * var(--s)); color: var(--cover-title, #fff);
  font-size: calc(var(--cover-size, 17) * var(--s) * 1px); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em;
}
.book-cover .name span { display: block; white-space: nowrap; }
/* Год — цветом названия без прозрачности: с 75% строка была бледнее 4,5:1 на зелёной и красной обложке.
   В одну строку, как .lineLimit(1) на iPhone: в SF Pro она шире поля на 0,2–0,8 px и уходит в правый отступ, а не рвётся. */
.book-cover .year {
  position: relative; margin-top: auto; color: var(--cover-title, #fff); white-space: nowrap;
  font-size: calc(8px * var(--s)); font-weight: 700; letter-spacing: calc(0.6px * var(--s));
}
/* Чёрная обложка (.ink ставит скрипт) на тёмной карточке без рамки сливается с ней: #1E1E1E на #1C1C1E — 1,02:1. */
@media (prefers-color-scheme: dark) {
  .book-cover.ink { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
}

.book-card {
  display: grid; gap: 14px; padding: 16px; border-radius: 22px;
  background: var(--card); color: var(--text); text-decoration: none;
}
.book-card .top { display: flex; align-items: flex-start; gap: 14px; }
.book-card .info { display: grid; gap: 3px; min-width: 0; }
.book-card p { margin: 0; }
.book-card .genre { color: var(--story); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.book-card h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.book-card .en, .book-card .length { color: var(--muted); font-size: 15px; }
.book-card .author { font-size: 15px; }
.book-card .length { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.book-card .about { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; }
.book-card .go {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--phrase-bg); color: var(--en); font-size: 17px; font-weight: 600;
}
@media (hover: hover) { .book-card:hover .go { background: color-mix(in srgb, var(--phrase-bg) 80%, var(--blue)); } }
.book-card.placeholder .ph-cover { flex: none; width: 96px; height: 144px; border-radius: 8px; background: var(--fill); }
.book-card.placeholder .ph-lines { display: grid; gap: 10px; padding-top: 4px; }
.book-card.placeholder .ph-lines span, .book-card.placeholder .ph-line { display: block; height: 12px; border-radius: 999px; background: var(--fill); }
.book-card.placeholder .ph-lines span:nth-child(1) { width: 90px; }
.book-card.placeholder .ph-lines span:nth-child(2) { width: 160px; height: 18px; }
.book-card.placeholder .ph-lines span:nth-child(3) { width: 120px; }
.book-card.placeholder .ph-lines span:nth-child(4) { width: 140px; }
.book-card.placeholder .ph-line.short { width: 220px; max-width: 70%; }

/* Главы полосками: прочитанная — зелёная, начатая — светло-зелёная. */
.reading { display: grid; gap: 6px; }
.reading p { margin: 0; color: var(--muted); font-size: 13px; }
.chapter-bar { display: flex; gap: 4px; }
.chapter-bar span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.chapter-bar .read { background: var(--green); }
.chapter-bar .started { background: color-mix(in srgb, var(--green) 40%, transparent); }

.book-page { display: grid; gap: 22px; padding: 16px 16px 0; }
.book-page p { margin: 0; }
.book-hero { display: grid; justify-items: center; gap: 6px; text-align: center; }
.book-hero .book-cover { margin-bottom: 10px; text-align: left; }
.book-hero h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.book-hero .en { color: var(--muted); font-size: 17px; }
.book-hero .author { font-size: 15px; }
.book-about { display: grid; gap: 6px; }
.book-about .kicker, .chapter-end .kicker { color: var(--story); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.book-about .length { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.book-about .description { margin-top: 6px; }
.book-start { display: grid; gap: 8px; }
.book-start .note { color: var(--muted); font-size: 13px; text-align: center; }
.toc h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.2; }
.toc ol { margin: 0; padding: 0; list-style: none; border-radius: 18px; background: var(--card); overflow: hidden; }
.toc li + li::before { content: ""; display: block; margin-left: 52px; border-top: 0.5px solid var(--line); }
.chapter-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 16px; color: var(--text); text-decoration: none; }
.chapter-row:focus-visible { outline-offset: -4px; }
.chapter-row .num { flex: none; width: 22px; color: var(--muted); font-weight: 600; text-align: center; }
.chapter-row .num .i { font-size: 18px; stroke-width: 3; vertical-align: -3px; }
.chapter-row .name { flex: 1; display: grid; gap: 2px; min-width: 0; }
.chapter-row .name b { font-weight: 400; }
.chapter-row .state { font-size: 13px; }
.chapter-row .time { flex: none; color: var(--muted); font-size: 15px; }
.chapter-row .time .i { margin-left: 4px; font-size: 14px; vertical-align: -2px; }
.toc .read .num, .toc .read .state { color: var(--story); }
.toc .started .num, .toc .started .state { color: var(--en); }
.toc .started .name b { font-weight: 600; }
@media (hover: hover) { .chapter-row:hover { background: var(--fill); } }
.book-rights { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.book-rights a { color: inherit; }

/* Конец главы: что прочитано и что дальше. */
.chapter-end { display: grid; gap: 14px; margin-top: 24px; padding: 18px; border-radius: 22px; background: var(--card); }
.chapter-end p { margin: 0; }
.chapter-end .done { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; line-height: 1.2; }
.chapter-end .done .i { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--green); color: var(--ink); stroke-width: 3; }
.chapter-end .reading p { font-size: 15px; }
.chapter-end .upcoming { display: grid; gap: 3px; }
.chapter-end .upcoming b { font-size: 20px; font-weight: 600; line-height: 1.3; }
.chapter-end .upcoming p { font-size: 15px; }
.chapter-end .fine { margin: 0; font-size: 15px; }
.btn.link { width: 100%; background: none; color: var(--en); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

/* ── Нижняя панель перевода ─────────────────────────────────────────────── */

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 720px; margin: 0 auto;
  padding: 22px 22px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 22px 22px 0 0; background: var(--card); box-shadow: var(--shadow);
  animation: rise 0.22s ease-out;
}
.sheet .x {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--fill); color: var(--muted); font-size: 15px; display: grid; place-items: center;
}
.word-row { display: flex; align-items: center; gap: 14px; padding-right: 28px; }
.word-row > div { flex: 1; min-width: 0; }
.headword { margin: 0; color: var(--en); font-size: 30px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.headword.phrase { font-size: 24px; }
.translation { margin: 4px 0 0; font-size: 20px; line-height: 1.3; }
.translation.missing { color: var(--muted); font-size: 17px; }
.label { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.phrase-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--fill); }
.phrase-card > div { flex: 1; min-width: 0; }
.phrase-card p { margin: 0; font-size: 16px; line-height: 1.35; }
.phrase-card .en-text { font-weight: 500; }
.phrase-card .ru { color: var(--muted); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.app.sheet-open { padding-bottom: 320px; }

/* ── Окно «Доля английского» ────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.modal .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); animation: fade 0.2s; }
.modal .panel {
  position: relative; width: 100%; max-width: 520px;
  padding: 24px 24px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 22px 22px 0 0; background: var(--card); text-align: center;
  animation: rise 0.22s ease-out;
}
@media (min-width: 640px) { .modal { align-items: center; } .modal .panel { border-radius: 22px; } }
.modal h2 { margin: 0; font-size: 17px; }
.big-percent { display: block; margin: 6px 0 4px; color: var(--en); font-size: 52px; font-weight: 700; font-variant-numeric: tabular-nums; }
.level-note { margin: 10px 0 18px; color: var(--muted); font-size: 15px; }

.range { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
input[type="range"] {
  flex: 1; height: 28px; margin: 0; background: transparent;
  -webkit-appearance: none; appearance: none;
  --fill-to: 25%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--blue) var(--fill-to), var(--line) var(--fill-to));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--blue); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }

/* ── Списки (словарь, настройки) ────────────────────────────────────────── */

.group { margin: 22px 20px 0; }
.group > h2 { margin: 0 0 6px 16px; color: var(--muted); font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; }
.group > .foot { margin: 6px 16px 0; color: var(--muted); font-size: 13px; }
.rows { margin: 0; padding: 0; list-style: none; border-radius: 12px; background: var(--card); overflow: hidden; }
.rows > li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; }
.rows > li + li { border-top: 0.5px solid var(--line); }
.rows .grow { flex: 1; min-width: 0; }
.rows .value { color: var(--en); font-weight: 600; font-variant-numeric: tabular-nums; }
.rows a { color: var(--text); text-decoration: none; }
.rows a.row-link { display: flex; align-items: center; gap: 12px; flex: 1; }
.rows .sub { color: var(--muted); font-size: 13px; }
.rows .danger { border: 0; background: none; padding: 0; color: var(--news); font-size: 17px; }
.rows .action { border: 0; background: none; padding: 0; color: var(--en); font-size: 17px; display: inline-flex; align-items: center; gap: 8px; }
.rows > li.slider-row, .rows > li.stacked { display: block; }
.stacked .segmented { margin-top: 8px; }
.slider-row .top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.slider-row .sub { margin-top: 4px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented button { border: 0; border-radius: 7px; background: none; padding: 6px 10px; font-size: 14px; font-weight: 500; }
.segmented button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); font-weight: 600; }

.topics { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.topics button { border: 0; border-radius: 999px; background: var(--fill); padding: 7px 13px; font-size: 15px; font-weight: 500; }
.topics button[aria-pressed="true"] { background: var(--blue); color: #fff; font-weight: 600; }

.switch { position: relative; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.vocab .en-word { margin: 0; color: var(--en); font-weight: 600; }
.vocab .ru-word { margin: 1px 0 0; }
.vocab .ctx { margin: 2px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vocab .remove { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 6px; }

/* ── Первый запуск ──────────────────────────────────────────────────────── */

.onboarding { padding: calc(env(safe-area-inset-top) + 28px) 20px 32px; }
.onboarding .logo { width: 56px; height: auto; display: block; }
.onboarding h1 { margin: 18px 0 8px; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.onboarding .lead { margin: 0 0 18px; color: var(--muted); }
.levels { display: grid; gap: 8px; }
.levels button {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 2px solid transparent; border-radius: 14px; background: var(--card);
}
.levels button[aria-checked="true"] { border-color: var(--blue); }
.levels .pct { min-width: 46px; color: var(--en); font-weight: 700; font-variant-numeric: tabular-nums; }
.levels b { display: block; font-size: 16px; }
.levels small { color: var(--muted); font-size: 13px; }
.sample { margin: 18px 0; padding: 16px; border-radius: 16px; background: var(--card); font-size: 17px; line-height: 1.55; }
.sample .label { margin-bottom: 8px; }
.sample p { margin: 0; }
.onboarding .fine { text-align: center; }
.onboarding .cta {
  position: sticky; bottom: 0; margin: 0 -20px; padding: 16px 20px calc(env(safe-area-inset-bottom) + 12px);
  background: linear-gradient(to bottom, transparent, var(--bg) 24px);
}

/* ── Нижние вкладки ─────────────────────────────────────────────────────── */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar); border-top: 0.5px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.tabs a {
  flex: 1; max-width: 200px; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 10px; font-weight: 500; text-decoration: none;
}
.tabs a .i { font-size: 24px; }
.tabs a[aria-current="page"] { color: var(--en); }

@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Аккаунт ────────────────────────────────────────────────────────────── */

.signin-box { display: grid; gap: 10px; padding: 16px; border-radius: 12px; background: var(--card); }
.signin-box p { margin: 0 0 4px; font-size: 15px; }
.btn.signin { width: 100%; min-height: 48px; font-size: 16px; }
.btn.signin.apple { background: #000; color: #fff; }
.btn.signin.apple .i { font-size: 18px; margin-top: -2px; }
.btn.signin.google { background: #fff; color: #1f1f1f; box-shadow: inset 0 0 0 1px #747775; }
@media (prefers-color-scheme: dark) {
  .btn.signin.apple { background: #fff; color: #000; }
  .btn.signin.google { background: #131314; color: #e3e3e3; box-shadow: inset 0 0 0 1px #8e918f; }
}
.g-logo { flex: none; }
.notice { margin: 0 0 8px; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.notice.ok { background: color-mix(in srgb, var(--green) 16%, transparent); }
.notice.warn { background: color-mix(in srgb, var(--yellow) 24%, transparent); }
.sync-tip { margin: 10px 20px 0; color: var(--muted); font-size: 13px; }

/* ── Профиль ────────────────────────────────────────────────────────────── */

.me { display: flex; align-items: center; gap: 16px; margin: 4px 20px 0; padding: 16px; border-radius: 16px; background: var(--card); }
.me .who { flex: 1; min-width: 0; }
.me-name { margin: 0; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.me-mail { margin: 2px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.me-since { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.me-since:empty { display: none; }
.link-button { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--en); font-size: 15px; font-weight: 600; }
.sync-tip .link-button { margin: 0; font-size: 13px; }

.avatar {
  position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; letter-spacing: 0.02em;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 72px; height: 72px; font-size: 26px; }
.avatar.small { width: 36px; height: 36px; font-size: 14px; }
.avatar.tab { width: 26px; height: 26px; font-size: 11px; }
.avatar.guest { background: var(--fill); color: var(--muted); }
.avatar.guest .i { font-size: 36px; }
.tabs a[aria-current="page"] .avatar { box-shadow: 0 0 0 2px var(--bar), 0 0 0 4px var(--blue); }

.name-form { display: grid; gap: 8px; }
.name-form .label { margin: 0; }
.name-form input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 17px;
}
.name-actions { display: flex; gap: 8px; }
.name-actions .btn { flex: 1; width: auto; }
.fine.error { margin: 0; color: var(--red); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px;
  border: 0; border-radius: 14px; background: var(--card); color: var(--text);
  font: inherit; text-align: left; text-decoration: none;
}
.stat-card b { color: var(--en); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: 13px; }
.week-box { margin-top: 10px; padding: 12px 16px 10px; border-radius: 14px; background: var(--card); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 8px 0 0; padding: 0; list-style: none; text-align: center; }
.week .dot {
  display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 4px;
  border-radius: 50%; background: var(--fill); color: #fff; font-size: 16px;
}
.week li.on .dot { background: var(--green); }
.week small { color: var(--muted); font-size: 11px; }
.week li.today small { color: var(--text); font-weight: 700; }

.rows .val { max-width: 60%; color: var(--muted); font-size: 15px; text-align: right; overflow-wrap: anywhere; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 25;
  transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  padding: 10px 14px; border-radius: 14px; background: var(--ink); color: #fff;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); animation: rise 0.22s ease-out;
}
.toast { display: flex; align-items: center; gap: 4px; }
/* Кнопка — 44 px в высоту, а подсказка той же высоты: лишнее уходит в отрицательные поля. */
.toast button {
  min-height: 44px; margin: -12px -8px -12px 0; padding: 0 10px; border: 0; background: none;
  color: #8aaeff; font-weight: 600; font-size: 14px;
}
/* На странице ленты — над строкой «1 мин · Читать», а не поверх неё. */
.toast.over-feed { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 68px); max-width: min(448px, calc(100% - 32px)); outline: 0.5px solid var(--line); }


/* ── Подборка на сегодня ────────────────────────────────────────────────── */

/* Над лентой — строка цели и ряд кружков, как истории в Instagram (TodayCard в приложении). */
.today { margin: 0; }
.today-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 0 16px; }
.today-head h1 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.today-head .sub { margin: 0; color: var(--muted); font-size: 13px; }
.stories {
  display: flex; gap: 12px; margin: 10px 0 0; padding: 2px 16px 4px; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.stories li { flex: none; }
.story-link { display: grid; justify-items: center; gap: 5px; width: 72px; color: var(--text); text-decoration: none; }
.story-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 12px; }
.story-ring { position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--ring, var(--line)); }
.story-link.news { --ring: var(--red); }
.story-link.story { --ring: var(--green); }
.story-link.fact { --ring: var(--yellow); }
.story-link.review { --ring: var(--blue); }
.story-link.read { --ring: var(--line); }
.story-ring .cover { width: 58px; height: 58px; border-radius: 50%; font-size: 24px; }
.story-link.read .story-ring .cover { opacity: 0.55; }
.cover.review { background: var(--phrase-bg); color: var(--en); }
.story-link.goal .story-ring { box-shadow: none; }
.story-link.goal .ring { width: 68px; height: 68px; }
.story-link .label {
  width: 76px; color: var(--text); font-size: 12px; font-weight: 400; letter-spacing: normal; text-transform: none;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.story-link.read .label { color: var(--muted); }
.streak-badge {
  position: absolute; right: -6px; bottom: -3px; display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px 0 5px;
  border-radius: 999px; background: var(--red); color: var(--ink); font-size: 12px; font-weight: 700; box-shadow: 0 0 0 2px var(--bg);
}
.streak-badge .i { font-size: 11px; }
.check-badge {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: #00793f; color: #fff; font-size: 12px; box-shadow: 0 0 0 2px var(--bg);
}
.streak { display: flex; align-items: center; gap: 4px; margin: 3px 0 0; color: var(--news); font-size: 13px; font-weight: 600; }
.ring { position: relative; flex: none; width: 58px; height: 58px; display: grid; place-items: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--fill); }
.ring .value { stroke: var(--blue); stroke-linecap: round; transition: stroke-dasharray 0.3s; }
.ring.completed .value { stroke: var(--green); }
.ring.completed .i { color: var(--story); font-size: 24px; stroke-width: 3; }
.ring.exhausted .i { color: var(--muted); font-size: 22px; }
.steps { margin: 12px 0 0; padding: 0; list-style: none; }
.steps li + li { border-top: 0.5px solid var(--line); }
.steps a { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--text); text-decoration: none; font-size: 15px; }
.steps .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .min { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.steps .more { padding: 10px 0 2px 38px; color: var(--muted); font-size: 13px; }
.steps-label { margin: 14px 0 -6px; color: var(--muted); font-size: 13px; }
.today .btn.primary { margin-top: 12px; }
.btn.wide { width: 100%; margin-top: 12px; }
.badge.small { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.badge.review { background: var(--blue); }

/* Конец текста: «Дальше в подборке» и «Цель дня выполнена». */
.next {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 16px; border-radius: 16px;
  background: var(--card); color: var(--text); text-decoration: none;
}
.next .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.next .caption { color: var(--muted); font-size: 13px; }
.next b { font-size: 17px; line-height: 1.3; }
.next .time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.next > .i { color: var(--en); font-size: 22px; }
.goal-done .done-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 600; }
.goal-done .done-title .i { color: var(--story); font-size: 22px; stroke-width: 3; }
.goal-done .next { margin-top: 12px; padding: 12px 0 0; border-radius: 0; border-top: 0.5px solid var(--line); }
/* Следующий текст с обложкой и синей «Читать дальше» — главное действие в конце текста. */
.next.with-cover, .goal-done .next.with-cover { display: block; padding: 0; overflow: hidden; border-top: 0; border-radius: 16px; }
.next-cover { display: grid; height: 140px; }
.next-cover .kind { position: absolute; left: 12px; bottom: 12px; z-index: 1; }
.next.with-cover .grow { display: grid; gap: 4px; padding: 12px 16px 16px; }
.next-go {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; margin-top: 10px;
  border-radius: 999px; background: #2257d6; color: #fff; font-size: 17px; font-weight: 600;
}

/* ── Повторение слов ────────────────────────────────────────────────────── */

.bar .count { justify-self: end; color: var(--muted); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.review { display: flex; flex-direction: column; min-height: calc(100vh - 60px); padding: 12px 20px calc(env(safe-area-inset-bottom) + 16px); text-align: center; }
.review progress { width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--fill); appearance: none; -webkit-appearance: none; }
.review progress::-webkit-progress-bar { background: var(--fill); border-radius: 2px; }
.review progress::-webkit-progress-value { background: var(--blue); border-radius: 2px; }
.review progress::-moz-progress-bar { background: var(--blue); border-radius: 2px; }
.review-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 8px; }
.review-card .headword { margin: 0; color: var(--en); font-size: 34px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.review-card .ctx { margin: 0; color: var(--muted); font-size: 17px; }
.review-card hr { width: 60%; margin: 4px 0; border: 0; border-top: 0.5px solid var(--line); }
.review-card .answer { margin: 0; font-size: 22px; font-weight: 600; }
.review-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.review.finished { justify-content: center; gap: 8px; }
.review.finished h1 { margin: 0; font-size: 28px; }
.review.finished p { margin: 0; }
.review.finished .muted { color: var(--muted); }
.review.finished .big-icon { color: var(--story); font-size: 56px; }
.review.finished .i { stroke-width: 3; }
.review.finished .btn { margin-top: 24px; }
.review-cta {
  display: flex; align-items: center; gap: 12px; margin: 8px 20px 0; padding: 12px 16px; border-radius: 12px;
  background: var(--card); color: var(--text); text-decoration: none;
}
.review-cta > .i:first-child { color: var(--en); font-size: 22px; }
.review-cta > .i:last-child { color: var(--muted); }
.review-cta b { display: block; font-size: 17px; }
.review-cta small { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; line-height: 1.35; }
/* Игра, для которой пока мало слов: без ссылки, иконка приглушена. */
.review-cta.locked > .i:first-child { color: var(--muted); }

/* Минуты в день на первом экране. */
.onboarding .ask { margin: 24px 0 10px; font-size: 20px; }
.minutes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.minutes button {
  display: grid; gap: 2px; text-align: left;
  padding: 10px 12px; border: 2px solid transparent; border-radius: 14px; background: var(--card);
}
.minutes button[aria-checked="true"] { border-color: var(--blue); }
.minutes b { font-size: 16px; }
.minutes small { color: var(--muted); font-size: 13px; line-height: 1.3; }

/* ── Полоса про cookie (site.js, как на сайте) ──────────────────────────── */

.consent {
  position: fixed; left: 12px; right: 12px; z-index: 20; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 696px; margin: 0 auto; padding: 10px 14px;
  border: 0.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text);
  font-size: 14px; line-height: 1.4; box-shadow: 0 10px 30px -12px rgba(20, 30, 60, 0.3);
}
body:has(.tabs:not([hidden])) .consent { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 8px); }
.consent p { flex: 1 1 220px; margin: 0; }
.consent-actions { display: flex; gap: 6px; }
.consent-actions .btn { min-height: 36px; padding: 0 14px; border-radius: 10px; background: var(--fill); color: var(--text); font-size: 14px; }
.app:has(~ .consent) { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + var(--consent-h, 0px) + 32px); }

/* Readmix Premium: метка текста дня в ленте и рассказ о Premium вместо закрытого текста. */
.page-meta .free {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 8px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 12px; font-weight: 600;
}
.box.premium h2 { margin: 6px 0 8px; font-size: 20px; }
.box.premium > p:not(.premium-mark):not(.fine) { margin: 0; }
.premium-mark { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.premium-actions { display: grid; gap: 8px; margin-top: 16px; }
.premium-actions .btn { width: 100%; }
.locked-note { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--muted); font-size: 15px; font-weight: 600; }

/* ── Пригласить друга ───────────────────────────────────────────────────── */

/* Карточка в профиле и экран /read/invite. Подарок — жёлтый, как метка факта. */
.invite-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--card); color: var(--text); text-decoration: none;
}
.invite-card b { display: block; font-size: 17px; }
.invite-card small { display: block; color: var(--muted); font-size: 14px; }
.invite-card > .i { color: var(--muted); }
.invite-gift {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--yellow); color: var(--ink); font-size: 22px;
}
.invite-gift.big { width: 64px; height: 64px; border-radius: 20px; font-size: 34px; }
.invite-hero { margin: 16px 20px 0; padding: 20px 16px; border-radius: 16px; background: var(--card); text-align: center; }
.invite-hero .invite-gift { margin: 0 auto 10px; }
.invite-hero h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; }
.invite-hero p { margin: 0; color: var(--muted); font-size: 15px; }
.invite-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 16px; border-radius: 12px; background: var(--card);
}
.invite-link code { min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-link .link-button { flex: none; }
.invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.invite-actions .btn.primary { grid-column: 1 / -1; }
ol.rows.steps { counter-reset: step; }
ol.rows.steps > li { counter-increment: step; align-items: flex-start; font-size: 15px; }
ol.rows.steps > li::before {
  content: counter(step); display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--fill); font-size: 14px; font-weight: 700;
}
.invite-pending p { margin: 0 0 12px; }

/* ── AI-чат ─────────────────────────────────────────────────────────────── */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.chat-head .link-button { margin: 0 20px 12px 0; }
.chat-card { margin: 8px 20px 0; padding: 16px; border-radius: 16px; background: var(--card); }
.chat-card .big-icon { color: var(--en); font-size: 32px; }
.chat-card h2 { margin: 6px 0 6px; font-size: 20px; line-height: 1.25; }
.chat-card p { margin: 0 0 10px; font-size: 15px; }
.chat-card .btn.primary { margin-top: 6px; }
.chat-card .fine { margin-bottom: 0; text-align: center; }
.starters { display: grid; gap: 8px; margin-top: 4px; }
.starters button {
  padding: 10px 14px; border: 0; border-radius: 12px; background: var(--phrase-bg); color: var(--en);
  font-size: 15px; font-weight: 600; text-align: left;
}
.chat-log { display: flex; flex-direction: column; gap: 10px; padding: 8px 20px 16px; }
.chat-log .chat-card { margin: 0; }
.msg {
  max-width: 85%; padding: 9px 14px; border-radius: 18px;
  font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.user { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--blue); color: #fff; }
.msg.bot { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--card); color: var(--text); }
.msg.typing { display: inline-flex; gap: 5px; padding: 15px 16px; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 70%, 100% { opacity: 0.3; } 35% { opacity: 1; } }
/* Поле вопроса держится над вкладками, как в мессенджерах. */
.composer {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px); z-index: 5;
  display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 5px 5px 5px 16px;
  border: 0.5px solid var(--line); border-radius: 24px; background: var(--card);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}
/* 16px — иначе Safari на iPhone увеличивает страницу при фокусе. */
.composer textarea {
  flex: 1; min-width: 0; min-height: 38px; max-height: 160px; margin: 0; padding: 8px 0;
  border: 0; background: none; color: inherit; font: inherit; font-size: 16px; line-height: 1.4;
  resize: none; outline: none;
}
.composer .send {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 20px;
}
.composer .send .i { stroke-width: 2.5; }
.composer .send:disabled { background: var(--fill); color: var(--muted); cursor: default; }
.chat-meta { margin: 8px 20px 0; color: var(--muted); font-size: 12px; text-align: center; }
.chat-error { margin: 0 20px 8px; color: var(--news); font-size: 14px; }
.chat-stop { margin: 0 20px; padding: 14px 16px; border-radius: 14px; background: var(--card); font-size: 15px; }
.chat-stop b { display: block; margin-bottom: 2px; font-size: 17px; }
/* Голосовые: в поле — микрофон вместо «Отправить», пока ничего не написано. */
.composer [hidden] { display: none; }
.composer.recording { align-items: center; gap: 10px; padding: 5px; }
.voice-cancel {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--fill); color: var(--muted); font-size: 18px;
}
.rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--news); animation: rec 1.2s infinite ease-in-out; }
.rec-dot.waiting { background: var(--muted); animation: none; }
@keyframes rec { 50% { opacity: 0.25; } }
.rec-time { flex: none; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-hint { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
/* Согласие перед первым вопросом и первой подсказкой и окно «Вопрос голосом» — на месте поля. Сам вопрос — «пузырём»,
   как в переписке. */
.chat-consent, .voice-ask { margin: 0 12px; }
.chat-card .chat-ask-question {
  width: fit-content; max-width: 85%; margin: 0 0 10px auto; padding: 9px 14px;
  border-radius: 18px; border-bottom-right-radius: 6px; background: var(--button); color: #fff;
  font-size: 16px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Черновик перед первой подсказкой — с подписью и на сером, как текст в поле, а не отправленное сообщение. */
.chat-card .chat-ask-label { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.chat-card .chat-ask-draft {
  padding: 10px 14px; border-radius: 14px; background: var(--fill);
  font-size: 16px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-ask-draft .mx-en { color: var(--en); }
.chat-card .chat-ask-note { color: var(--muted); font-size: 14px; }
.chat-ask-actions { display: grid; gap: 8px; }
.chat-ask-actions .btn { width: 100%; margin-top: 0; }
.chat-ask-actions .btn.primary { background: var(--button); }
.chat-consent .fine a { display: inline-flex; align-items: center; min-height: 44px; }
/* Своё голосовое: прослушать, «волна», длина и ниже — что расслышал AI. */
/* Отступы в разметке голосового — не строки текста: переносы сохраняем только в расшифровке. */
.msg.voice { width: min(85%, 300px); white-space: normal; }
.voice-row { display: flex; align-items: center; gap: 10px; }
.voice-play {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.24); color: #fff; font-size: 15px;
}
.voice-wave { flex: 1; min-width: 0; height: 20px; fill: currentColor; opacity: 0.7; }
.voice-time { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.85; }
.voice-text { margin-top: 6px; white-space: pre-wrap; }
.voice-note { margin-top: 6px; font-size: 14px; opacity: 0.85; }
.voice-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.voice-actions button { padding: 0; border: 0; background: none; color: #fff; font-size: 14px; font-weight: 600; text-decoration: underline; }
.voice-actions button:disabled { opacity: 0.6; }

/* ── Смешанная переписка: сколько английского, цель и подсказки вокруг поля ─ */

.mixer {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px); z-index: 5;
  margin: 0 12px; padding: 4px 12px 10px; border: 0.5px solid var(--line); border-radius: 22px;
  background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}
.mix-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mix-now { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mix-now b { color: var(--en); }
/* Видимая плашка ниже 44 px, но место нажатия — вся кнопка. */
.mix-goal { min-height: 44px; margin-right: -4px; padding: 0 4px; border: 0; background: none; color: var(--text); }
.mix-goal span {
  display: inline-block; padding: 6px 12px; border-radius: 15px; background: var(--fill);
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.mix-bar { position: relative; height: 4px; margin: -4px 0 8px; border-radius: 2px; background: var(--fill); }
.mix-bar i { position: absolute; inset: 0 auto 0 0; width: min(var(--mix-pct, 0%), 100%); border-radius: 2px; background: var(--blue); transition: width 0.2s; }
.mix-bar b { position: absolute; top: -4px; left: var(--mix-goal, 0%); width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--text); opacity: 0.6; }
.mix-hints:empty { display: none; }
.mix-hints { margin-bottom: 8px; }
.mix-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.mix-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mix-chips button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--en); font-size: 16px; font-weight: 500;
}
.mix-chips small { color: var(--muted); font-size: 12px; font-weight: 400; }
.mix-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: 44px; margin: 0; color: var(--muted); font-size: 14px; }
.mix-note button { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--en); font-size: 14px; font-weight: 600; }
/* Поле: прозрачный текст поверх «подложки» с тем же текстом, где английские слова синие, а фразы с подсказкой
   подчёркнуты. Шрифт, отступы и переносы у них общие, иначе курсор разойдётся с буквами. */
.composer.mixed { position: static; display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.mix-field { position: relative; border: 0.5px solid var(--line); border-radius: 20px; background: var(--card); }
.mix-field:focus-within { border-color: var(--en); box-shadow: 0 0 0 1px var(--en); }
.composer.mixed .mix-field textarea,
.mix-mirror {
  display: block; width: 100%; margin: 0; padding: 10px 14px; border: 0;
  font: inherit; font-size: 17px; line-height: 1.4; letter-spacing: normal; text-align: left;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
}
.mix-mirror { position: absolute; inset: 0; overflow: hidden; color: var(--text); pointer-events: none; }
.composer.mixed .mix-field textarea {
  position: relative; min-height: 46px; max-height: 160px; background: none;
  color: transparent; caret-color: var(--text); -webkit-appearance: none; appearance: none;
  resize: none; outline: none; scrollbar-width: none;
}
.composer.mixed .mix-field textarea::-webkit-scrollbar { display: none; }
.composer.mixed .mix-field textarea::placeholder { color: var(--muted); }
.composer.mixed .mix-field textarea::selection { background: rgba(47, 107, 255, 0.3); color: transparent; }
/* Только цвет и фон: другая толщина шрифта сдвинула бы буквы относительно курсора. */
.mix-mirror .mx-en { color: var(--en); }
.mix-mirror .mx-hint { text-decoration: underline dotted var(--muted); text-underline-offset: 4px; }
.mix-mirror .mx-sel { border-radius: 5px; background: var(--phrase-bg); text-decoration: none; }
.mix-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.mix-suggest {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; border: 0; background: none;
  color: var(--text); font-size: 15px;
}
.mix-suggest .i { font-size: 18px; }
.mix-send { display: flex; gap: 8px; }
.composer.mixed .send { width: 44px; height: 44px; }
.mix-status { display: flex; align-items: flex-start; gap: 6px; min-height: 18px; margin: 4px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.mix-status.ok { color: var(--text); }
.mix-status .i { flex: none; margin-top: 1px; color: var(--story); font-size: 16px; }
.mixer .chat-meta { margin: 6px 0 0; }
.msg.user .mx-en { font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.55); text-underline-offset: 3px; }
.goal-steps { margin: 16px 0 0; }
.goal-steps button { min-height: 44px; font-variant-numeric: tabular-nums; }
.goal-steps button[aria-checked="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .mix-bar i { transition: none; } }

/* Платные книги (макет artifacts/2026-11-20-paid-books): сводка и метки доступа без Premium, тизер закрытой главы,
   шторка «Как открыть книгу». Белый текст главной кнопки — на --button (6,2:1), а не на --blue (4,50:1). */
.books-intro .books-summary { margin: 8px 0 0; color: var(--text); font-weight: 600; }
.book-card .genre-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.access-mark {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 2px 9px; border-radius: 999px;
  background: var(--fill); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-transform: none;
}
.book-hero .access-mark { margin-top: 4px; }
.book-start .note .i { font-size: 13px; vertical-align: -2px; }
.book-start .btn.primary, .premium-actions .btn.primary { background: var(--button); }
.chapter-teaser { margin: 16px 0 0; font-size: 17px; line-height: 1.45; }
.access-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; margin: 6px 0 0; font-size: 15px; font-weight: 600; }
.access-links a { display: inline-flex; align-items: center; min-height: 44px; }
.access-sheet .premium-mark, .access-sheet h2 { padding-right: 40px; }
.access-sheet h2 { margin: 6px 0 8px; font-size: 22px; }
.access-sheet h2:focus { outline: none; }
.access-sheet > p:not(.premium-mark):not(.fine) { margin: 0; }
/* Крестик панели — 30 px на вид, 44 px для пальца. */
.sheet .x::after { content: ""; position: absolute; inset: -7px; }
.sheet:has(> .access-sheet) { max-height: calc(100dvh - 16px); overflow-y: auto; }
