/* ---------- шрифт: Literata (книжный, с кириллицей), лежит локально и работает без сети ---------- */
@font-face {
  font-family: "Literata"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/literata-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Literata"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/literata-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Literata"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/literata-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/literata-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- шрифт интерфейса: Inter (кнопки, подписи, описания) ---------- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- темы ---------- */
:root {                       /* тёмная: тёплый уголь вместо чистого чёрного */
  color-scheme: dark;
  --bg: #151412;
  --panel: #1f1d1a;
  --panel-2: #2a2723;
  --line: #3a3630;
  --text: #ebe4d6;
  --dim: #958d80;
  --faint: #767067;           /* только для делений и линий, не для текста */
  --ctx: #9a9285;
  --accent: #e8674f;
  --pivot: #e8674f;           /* опорная буква в слове */
  --track: #575148;           /* дорожка ползунка и выключенный переключатель */
  --knob-ring: rgba(0, 0, 0, .1);
  --cur-bg: #44261f;
  --on-text: #151412;         /* цвет на элементах, залитых цветом текста */
  --action: #0a70dd;          /* заливка кнопок: белый текст на ней читается с запасом */
  --action-text: #4aa3ff;     /* синий текст и значки на тёмном фоне */
  --action-soft: rgba(10, 132, 255, .18);
  --knob: #f4f1ea;
  --star: #f0b445;
  --overlay: rgba(12, 11, 10, .86);
  --backdrop: rgba(0, 0, 0, .6);

  --serif: "Literata", Georgia, "Noto Serif", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pivot-x: 38%;
  --fs: 44px;
  --word-font: var(--serif);  /* шрифт слова: с засечками или без, выбирается в настройках */
  --word-weight: 450;
}
:root[data-word-font="sans"] { --word-font: var(--sans); --word-weight: 480; }
:root[data-theme="light"] {   /* светлая: бумага старой книги, без белого и без чёрного */
  color-scheme: light;
  --bg: #f3ead7;
  --panel: #eae0c9;
  --panel-2: #e0d4b9;
  --line: #d0c3a5;
  --text: #392f25;
  --dim: #6b5e4a;
  --faint: #93856b;
  --ctx: #675a47;
  --accent: #a53a25;
  --pivot: #cc4420;           /* ярче и светлее текста: буква заметна и при слабом различении красного */
  --track: #b3a585;
  --knob-ring: rgba(57, 47, 37, .3);
  --cur-bg: #ecccb9;
  --on-text: #f6eedd;
  --action: #255493;          /* приглушённый синий, чтобы не спорил с бумажным фоном */
  --action-text: #255493;
  --action-soft: rgba(37, 84, 147, .12);
  --knob: #fffaf0;
  --star: #ad7610;
  --overlay: rgba(243, 234, 215, .9);
  --backdrop: rgba(64, 54, 43, .4);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 16px; line-height: 1.4;
  overscroll-behavior: none;
  transition: background-color .2s, color .2s;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.dim { color: var(--dim); }

.view {
  max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}

/* ---------- кнопки ---------- */
.btn {
  border: 0; background: var(--action-soft); color: var(--action-text); border-radius: 12px;
  padding: 13px 18px; min-height: 50px; font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.97); opacity: .8; }
.btn.primary { background: var(--action); color: #fff; }
.btn.ghost { background: var(--action-soft); }
.icon-btn {
  background: none; border: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text); flex: none;
}
.icon-btn:active { background: var(--panel-2); }

/* ---------- библиотека ---------- */
.lib-head { display: flex; align-items: center; justify-content: space-between; }
.lib-head h1 { font-family: var(--serif); font-weight: 650; font-size: 28px; margin: 4px 0; letter-spacing: -.01em; }

.today { background: var(--panel); border-radius: 14px; padding: 14px 16px; margin: 12px 0 18px; }
/* приглашение пройти опрос */
.ask {
  display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; padding: 12px 6px 12px 16px;
  background: var(--action-soft); border-radius: 14px;
}
.ask-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ask-text b { font-weight: 600; font-size: 15px; }
.ask-text span { font-size: 13px; color: var(--dim); }
.ask .btn { flex: none; padding: 6px 16px; }
.ask .icon-btn { width: 36px; height: 36px; color: var(--dim); }
.today-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 15px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--action); border-radius: 3px; transition: width .3s; }

.book-list { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.book {
  background: var(--panel); border-radius: 14px; padding: 14px 8px 14px 16px;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.book:active { background: var(--panel-2); }
.book-main { flex: 1; min-width: 0; }
.book-title {
  font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.book-meta { font-size: 13px; color: var(--dim); margin: 4px 0 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book .bar { height: 3px; }
.book-del { color: var(--dim); }

.empty { text-align: center; padding: 40px 12px; flex: 1; }
.empty-title { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.empty .btn { margin-top: 14px; }

.lib-actions {
  position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 22%);
  padding: 26px 0 calc(4px + env(safe-area-inset-bottom)); margin-top: 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.formats { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 12px; letter-spacing: .04em; }

/* ---------- чтение ---------- */
.reader { position: relative; height: 100vh; height: 100dvh; min-height: 0; padding-left: 0; padding-right: 0; user-select: none; -webkit-user-select: none; }
/* при чтении строка со словом плавно съезжает в середину экрана (смещение считает app.js) */
.stage-wrap { position: relative; flex: none; transition: transform .35s cubic-bezier(.3, .7, .2, 1); will-change: transform; }
.r-top { display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.r-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: var(--dim); }
.r-today { font-size: 13px; padding-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.stage {
  position: relative; flex: none; margin: 7vh 16px 0; height: calc(var(--fs) * 2.5);
  border-top: 2px solid var(--line); border-bottom: 2px solid var(--line);
  overflow: hidden; cursor: pointer;
}
.stage::before, .stage::after {
  content: ""; position: absolute; left: var(--pivot-x); width: 2px; margin-left: -1px;
  height: calc(var(--fs) * .32); background: var(--line);
}
.stage::before { top: 0; }
.stage::after { bottom: 0; }
.word {
  position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center;
  white-space: pre; font-family: var(--word-font); font-weight: var(--word-weight);
  font-size: var(--fs); letter-spacing: .01em; will-change: transform;
}
.word .pivot { color: var(--pivot); }
/* передышка для глаз: вместо слова короткая подсказка и обратный отсчёт */
.rest {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 0 8px; text-align: center; animation: rise .5s both;
}
.rest-title { font-family: var(--serif); font-size: 18px; line-height: 1.25; }
.rest-count { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.resting .word { visibility: hidden; }
.wpm-label { transform-origin: right center; }
.wpm-label.bump { animation: bump 1.2s; }
@keyframes bump { 0%, 45% { color: var(--action-text); transform: scale(1.3); } }

.wpm-row { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 20px 0; font-size: 12px; min-height: 18px; }
.wpm-label { color: var(--dim); margin-left: auto; padding-left: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.context {
  flex: 1; min-height: 0; overflow-y: auto; margin: 14px 0 0; padding: 4px 20px 16px;
  font-family: var(--serif); font-size: 17px; line-height: 1.65; color: var(--ctx);
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 26px), transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 26px), transparent);
}
.context p { margin: 0 0 .8em; }
.context span { cursor: pointer; border-radius: 3px; }
.context .cur { color: var(--text); background: var(--cur-bg); box-shadow: 0 0 0 2px var(--cur-bg); }
.playing .context { visibility: hidden; }
.playing .r-top, .playing .r-bottom { opacity: .38; transition: opacity .4s; }
.playing #r-hint { visibility: hidden; }

.r-bottom { padding: 0 16px; flex: none; }
.r-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin: 2px 2px 10px; font-variant-numeric: tabular-nums; }
/* листание страниц: ‹ Стр. 41 из 130 › ; нажатие на номер открывает переход и поиск */
.pager { display: flex; align-items: stretch; background: var(--action-soft); border-radius: 999px; color: var(--action-text); flex: none; }
.pager button { background: none; border: 0; color: inherit; min-height: 40px; display: grid; place-items: center; transition: opacity .12s; }
.pager button:active { opacity: .5; }
.pager-arrow { width: 42px; }
.pager-arrow:first-child { border-radius: 999px 0 0 999px; }
.pager-arrow:last-child { border-radius: 0 999px 999px 0; }
.pager-arrow:disabled { opacity: .3; }
.pager-label { padding: 0 6px; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-bottom { position: relative; }
/* крупный номер страницы, пока двигают ползунок */
.seek-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%); z-index: 5;
  background: var(--text); color: var(--on-text); border-radius: 14px; padding: 10px 18px;
  font-size: 20px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}

/* кнопки управления: значки без подложки, крупная залитая кнопка старта */
.controls { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 6px; }
.ctl {
  background: none; border: 0; border-radius: 50%; width: 56px; height: 56px;
  display: grid; place-items: center; color: var(--text); flex: none; transition: transform .12s, opacity .12s;
}
.ctl:active { transform: scale(.9); opacity: .6; }
.ctl.play {
  width: 72px; height: 72px; background: var(--action); color: #fff;
  box-shadow: 0 6px 18px var(--action-soft), 0 2px 6px rgba(0, 0, 0, .12);
}

/* шкала скорости: лента с делениями, которую двигают пальцем */
.speed { margin: 0 -16px 2px; }
.speed-head { text-align: center; font-size: 12px; color: var(--dim); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.speed-head b { color: var(--text); font-weight: 600; }
.ruler { position: relative; height: 58px; touch-action: pan-x; }
.ruler-scroll {
  height: 100%; overflow-x: scroll; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; cursor: grab; overscroll-behavior: contain;
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.ruler-scroll::-webkit-scrollbar { display: none; }
.ruler.dragging .ruler-scroll { scroll-snap-type: none; cursor: grabbing; }
.ruler-track { display: flex; align-items: flex-end; height: 100%; width: max-content; padding: 0 calc(50% - 7px); }
.tick { position: relative; flex: none; width: 14px; height: 100%; scroll-snap-align: center; }
.tick::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 2px; margin-left: -1px; height: 10px;
  border-radius: 1px; background: var(--faint); opacity: .7;
}
.tick.major::after { height: 20px; background: var(--dim); opacity: 1; }
.tick span {
  position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
  font-size: 13px; color: var(--dim); font-style: normal; font-variant-numeric: tabular-nums; pointer-events: none;
}
.ruler-needle {
  position: absolute; left: 50%; bottom: 4px; width: 4px; margin-left: -2px; height: 26px; border-radius: 2px;
  background: var(--action-text); box-shadow: 0 0 10px var(--action-text); pointer-events: none;
}
.dlg .ruler { margin: 8px -20px 0; }

/* ползунки */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; }
/* пройденная часть дорожки закрашена (долю --p выставляет app.js) */
input[type=range] { --p: 0%; }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--action-text) var(--p), var(--track) var(--p));
}
input[type=range]::-moz-range-track { height: 4px; background: var(--track); border-radius: 2px; }
input[type=range]::-moz-range-progress { height: 4px; background: var(--action-text); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--knob); margin-top: -10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3), 0 0 0 1px var(--knob-ring);
}
input[type=range]::-moz-range-thumb {
  width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--knob);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3), 0 0 0 1px var(--knob-ring);
}

/* ---------- диалоги ---------- */
.dlg {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 18px;
  width: min(92vw, 460px); padding: 20px; max-height: 90dvh;
}
.dlg::backdrop { background: var(--backdrop); }
.dlg h2:focus { outline: none; }
.dlg h2 { font-family: var(--serif); font-weight: 650; margin: 0 0 16px; font-size: 21px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 4px; font-size: 15px; }
.field small { display: block; margin-top: 6px; font-size: 12px; }
.field input[type=number], .text-in {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.text-in { display: block; margin-bottom: 12px; resize: vertical; }
.text-in::placeholder { color: var(--dim); opacity: .85; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row .text-in { margin: 0; flex: 1; min-width: 0; }
.row .btn { flex: none; padding: 10px 16px; }
.check { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 15px; }
/* переключатель вместо галочки */
.check input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; position: relative; cursor: pointer;
  width: 50px; height: 30px; border-radius: 15px; background: var(--track); transition: background .2s;
}
.check input::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--knob); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.check input:checked { background: var(--action); }
.check input:checked::after { transform: translateX(20px); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.goto-tip { font-size: 13px; margin: 0 0 8px; }
.goto-msg { color: var(--accent); font-size: 14px; margin: 0; min-height: 20px; }

/* переключатель темы */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 4px; font-size: 14px; color: var(--dim); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--action); color: #fff; font-weight: 600; }
.seg { border: 0; border-radius: 999px; }
.seg button { border-radius: 999px; transition: background .15s, color .15s; }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-6 { grid-template-columns: repeat(6, 1fr); margin-top: 6px; }
.seg-4 button, .seg-6 button { font-variant-numeric: tabular-nums; padding-left: 2px; padding-right: 2px; white-space: nowrap; }
.seg-gap { margin-top: 6px; }
.field small { line-height: 1.4; }
/* настроек стало много: окно прокручивается, а кнопка «Готово» всегда на виду */
#dlg-settings { padding-bottom: 0; }
#dlg-settings .dlg-actions {
  position: sticky; bottom: 0; margin-top: 0; padding: 10px 0 16px;
  background: var(--panel); box-shadow: 0 -10px 10px -4px var(--panel);
}

.set-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 10px; }
.btn.small { min-height: 40px; padding: 6px 10px; font-size: 14px; white-space: nowrap; }
#dlg-settings .field, #dlg-settings .check { margin-bottom: 12px; }

/* ---------- полноэкранные листы: вступление и опрос ---------- */
.sheet {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); overflow: hidden;
}
.sheet::backdrop { background: var(--bg); }
.sheet-in {
  height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
}
.sheet-in:focus { outline: none; }
.sheet-top { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 -10px; flex: none; }
.dots { flex: 1; display: flex; gap: 5px; }
.dots i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background .3s; }
.dots i.on { background: var(--text); }
.link-btn { background: none; border: 0; color: var(--dim); font-size: 15px; padding: 10px; min-height: 44px; }
.link-btn:active { opacity: .5; }
.sheet-foot { display: grid; gap: 10px; flex: none; }
.sheet-foot .btn { width: 100%; min-height: 56px; font-size: 17px; border-radius: 16px; }
.sheet-foot .btn:disabled { opacity: .35; }

.slides { flex: 1; min-height: 0; display: flex; }
.slide { display: none; flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 24px; padding-bottom: 5vh; }
.slide.on { display: flex; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.hero, .title, .sv-q { margin: 0; font-family: var(--serif); font-weight: 650; letter-spacing: -.02em; text-wrap: balance; font-variant-numeric: lining-nums; }
.hero { font-size: clamp(40px, 12.5vw, 60px); line-height: 1.08; }
.title { font-size: clamp(27px, 8vw, 38px); line-height: 1.16; }
.hero em, .title em { font-style: normal; color: var(--accent); white-space: nowrap; }
.lead { margin: 0; font-size: 18px; line-height: 1.5; color: var(--dim); }

/* появление текста: слова поднимаются и проявляются одно за другим */
.rv {
  display: inline-block; animation: rv .7s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i) * 70ms + var(--d, 0s));
}
.lead .rv { animation-duration: .5s; animation-delay: calc(var(--i) * 30ms + var(--d, 0s)); }   /* мелкий текст быстрее */
@keyframes rv { from { opacity: 0; transform: translateY(.4em); filter: blur(8px); } }
.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.meter { display: grid; gap: 16px; }
.meter-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.meter-head b { font-family: var(--serif); font-size: 30px; font-weight: 650; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.meter-head span { color: var(--dim); font-size: 15px; }
.meter-bar { height: 10px; border-radius: 5px; background: var(--panel-2); overflow: hidden; }
.meter-bar i {
  display: block; height: 100%; width: var(--w); border-radius: 5px; background: var(--faint);
  transform-origin: left; animation: grow 1s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0s) + .2s);
}
.meter-row.hot b { color: var(--accent); }
.meter-row.hot .meter-bar i { background: var(--accent); }
@keyframes grow { from { transform: scaleX(0); } }

.eq { display: flex; flex-direction: column; gap: 2px; }
.eq-part { display: flex; align-items: baseline; gap: 14px; }
.eq-part b {
  font-family: var(--serif); font-weight: 650; font-size: clamp(76px, 25vw, 124px); line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums;
}
.eq-part span { font-family: var(--serif); font-size: clamp(26px, 8vw, 38px); color: var(--dim); }
.eq-part.hot b { color: var(--accent); }
.eq-note { margin: 0; font-size: 15px; color: var(--dim); }
.eq-sign { font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--faint); padding-left: 4px; }

/* маленькая строка чтения на экране «никаких отвлечений» */
.mini { position: relative; height: 84px; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); overflow: hidden; }
.mini::before, .mini::after { content: ""; position: absolute; left: var(--pivot-x); width: 2px; margin-left: -1px; height: 11px; background: var(--line); }
.mini::before { top: 0; }
.mini::after { bottom: 0; }
.mini-word {
  position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; white-space: pre;
  font-family: var(--word-font); font-weight: var(--word-weight); font-size: 34px; will-change: transform;
}
.mini-word .pivot { color: var(--pivot); }

/* опрос */
.sv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding-bottom: 4vh; }
.sv-sub { margin: 6px 0 0; color: var(--dim); font-size: 15px; }
.sv-q { font-size: clamp(26px, 7.6vw, 36px); line-height: 1.18; letter-spacing: -.01em; }
.sv-q.long { font-size: clamp(20px, 5.7vw, 26px); line-height: 1.3; font-weight: 600; }
.sv-q.long .rv { animation-delay: calc(var(--i) * 40ms); }
.stars { display: flex; justify-content: space-between; max-width: 340px; margin: 8px 0 6px -6px; }
.star { background: none; border: 0; padding: 6px; width: 62px; height: 62px; color: var(--line); transition: color .15s; }
.star svg { display: block; width: 100%; height: 100%; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.star.on { color: var(--star); }
.star.pop { animation: pop .32s; }
@keyframes pop { 45% { transform: scale(1.28); } }
.stars-cap { display: flex; justify-content: space-between; max-width: 334px; font-size: 13px; color: var(--dim); }
.text-in.big { font-size: 17px; padding: 15px 16px; border-radius: 14px; background: var(--panel); margin-bottom: 8px; }

@media (max-height: 620px) {
  .slide { gap: 16px; padding-bottom: 0; }
  .hero { font-size: 36px; }
  .title { font-size: 25px; }
  .lead { font-size: 16px; }
  .eq-part b { font-size: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv, .rise, .meter-bar i, .star.pop { animation: none; }
}

/* ---------- служебное ---------- */
.busy {
  position: fixed; inset: 0; background: var(--overlay); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center; padding: 24px;
}
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--text); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--on-text); border-radius: 12px; padding: 11px 16px; z-index: 60;
  max-width: 88vw; text-align: center; font-size: 15px;
}
