/* ── Тема ─────────────────────────────────────────────────────────────── */

:root {
  --paper: #fbf7f0;
  --paper-raised: #fffdf9;
  --ink: #23201c;
  --ink-soft: #6c6459;
  --ink-faint: #a99e8f;
  --line: #e6ded1;
  --accent: #b4553f;
  --accent-soft: #f3e5df;
  --shadow: 0 1px 2px rgba(35, 32, 28, .05), 0 8px 24px -12px rgba(35, 32, 28, .18);

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  --radius: 14px;
  --gutter: 20px;
  --measure: 34rem;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120f;
    --paper-raised: #1e1b17;
    --ink: #eae3d8;
    --ink-soft: #a79c8d;
    --ink-faint: #6d6459;
    --line: #2e2922;
    --accent: #e0906d;
    --accent-soft: #33241d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

/* ── База ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, textarea { font: inherit; color: inherit; }

.screen { display: flex; flex-direction: column; min-height: 100dvh; }
[hidden] { display: none !important; }

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

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease, background .2s ease;
}

.button:active { transform: scale(.98); }
.button:disabled { opacity: .5; cursor: default; transform: none; }

.button--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .button--primary { color: #1a120e; } }

.button--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}

/* ── Главный экран ────────────────────────────────────────────────────── */

/* Ночная палитра: главный экран и полка с историями всегда тёмные. */
.is-night {
  --paper: #0f0e0c;
  --paper-raised: #1c1915;
  --ink: #ece6db;
  --ink-soft: #a9a094;
  --ink-faint: #6f6659;
  --line: #2c2720;
  --accent: #e0906d;
  --accent-soft: #33241d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -14px rgba(0, 0, 0, .8);
  color: var(--ink);
}

.is-night .button--primary { color: #1a120e; }

.screen--home {
  position: relative;
  justify-content: center;
  padding: calc(var(--safe-top) + 32px) var(--gutter) calc(var(--safe-bottom) + 40px);
}

body.is-home { background: #0f0e0c; }

/* Контент лежит поверх печатающегося фона. */
.home-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

/* ── Кнопки в углу главного экрана ────────────────────────────────────── */

.shelf-button, .device-button {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(28, 25, 21, .82);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* Устройство стоит левее полки, а без полки занимает её место. */
.device-button { right: 64px; }
.device-button--alone { right: 12px; }

.shelf-button svg, .device-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.device-button svg { stroke-linecap: round; }

.shelf-button:active, .device-button:active { transform: scale(.94); border-color: var(--accent); color: var(--accent); }

.device-button.is-live { border-color: var(--accent); color: var(--accent); }

.shelf-button__count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #1a120e;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* ── Фон из чужих историй ─────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* Приглушаем строки вокруг центрального блока, к краям отпускаем. */
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 95% 42% at 50% 50%,
    rgba(15, 14, 12, .74) 0%,
    rgba(15, 14, 12, .48) 52%,
    rgba(15, 14, 12, .10) 84%,
    transparent 100%);
}

.backdrop__line {
  position: absolute;
  width: min(78vw, 420px);
  margin: 0;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.6;
  color: #f0e4d2;
  opacity: 0;
  transition: opacity .9s ease;
}

.backdrop__line.is-on { opacity: .45; }

.backdrop__line.is-typing::after {
  content: '';
  display: inline-block;
  width: .42em;
  height: .95em;
  margin-left: 2px;
  vertical-align: -.14em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

/* ── Заголовок ────────────────────────────────────────────────────────── */

.brand { text-align: center; padding: 6px 0 2px; }

.brand__title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.015em;
}

.brand__soft { font-size: 26px; color: var(--ink-soft); }

.brand__accent { font-size: 44px; font-style: italic; color: var(--accent); }

.brand__dots { display: inline-block; white-space: nowrap; }

.brand__dots i {
  display: inline-block;
  width: .13em;
  height: .13em;
  margin-left: .11em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: .1em;
  animation: dot 1.7s ease-in-out infinite;
}
.brand__dots i:nth-child(2) { animation-delay: .18s; }
.brand__dots i:nth-child(3) { animation-delay: .36s; }

@keyframes dot { 0%, 65%, 100% { opacity: .22; } 32% { opacity: 1; } }

.setup { display: flex; flex-direction: column; gap: 18px; }

.field { display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field__input {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px; /* меньше 16px — iOS зумит при фокусе */
  line-height: 1.5;
  resize: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field__input::placeholder { color: var(--ink-faint); }

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.setup__error { margin: -6px 0 0; color: var(--accent); font-size: 14px; }

/* ── Полка с историями ────────────────────────────────────────────────── */

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.sheet::backdrop {
  background: rgba(6, 5, 4, .7);
  backdrop-filter: blur(3px);
}

.sheet__inner {
  max-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 20px calc(var(--safe-bottom) + 20px);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .9);
}

.sheet[open] .sheet__inner { animation: sheet-up .3s cubic-bezier(.2, .8, .3, 1) both; }
.sheet[open]::backdrop { animation: fade-in .3s ease both; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } }

.sheet__grip {
  width: 38px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 999px;
  background: var(--line);
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet__title {
  flex: 1;
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
}

.sheet__close {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--ink-faint);
  cursor: pointer;
}
.sheet__close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.sheet__close:active { background: var(--accent-soft); color: var(--accent); }

.sheet__note { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--ink-faint); }

.library__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 8px 14px 16px;
}

.card__open {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__meta { margin: 3px 0 0; font-size: 13px; color: var(--ink-faint); }

.card__delete {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--ink-faint);
  cursor: pointer;
}
.card__delete svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.card__delete:active { background: var(--accent-soft); color: var(--accent); }

/* ── Шторка устройства ────────────────────────────────────────────────── */

.device__switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.device__switch-body { flex: 1; min-width: 0; }
.device__switch-title { display: block; font-size: 15px; font-weight: 500; }

/* Родной чекбокс, только крупнее и в акцентном цвете. */
.device__checkbox {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Статус живёт прямо под заголовком тумблера. */
.device__status { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--ink-faint); }
.device__status.is-live { color: var(--accent); }
.device__status.is-bad { color: var(--ink-soft); }
.device__status.is-live::before,
.device__status.is-bad::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}
.device__status.is-bad::before { background: var(--ink-faint); }

.device__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.device__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: 14.5px;
}

.device__motors { flex: none; font-size: 12.5px; color: var(--ink-faint); }

/* ── Мини-инструкция, когда Intiface не найден ── */

.device__help {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.device__help-title { margin: 0; font-size: 15px; font-weight: 500; }

.device__steps {
  margin: 10px 0 14px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.device__steps b { color: var(--ink); font-weight: 600; }

.device__store { min-height: 46px; padding: 11px 16px; font-size: 15px; text-decoration: none; }

.device__other { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-faint); }
.device__other a { color: var(--ink-soft); }

/* ── Мощность и проверка — одной строкой ── */

.device__controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.device__row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.device__label { flex: none; font-size: 13px; color: var(--ink-faint); }
.device__slider { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
.device__value { flex: none; width: 3.2em; text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.device__test { flex: none; width: auto; min-height: 46px; padding: 0 16px; font-size: 14px; }
.device__test:disabled { opacity: .45; cursor: default; }

/* ── Адрес — спрятан, нужен редко ── */

.device__more { margin-top: 14px; }

.device__more summary {
  width: max-content;
  margin: 0 auto;
  padding: 4px 8px;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-faint);
  cursor: pointer;
}
.device__more summary::-webkit-details-marker { display: none; }
.device__more summary::after { content: ' ▾'; }
.device__more[open] summary::after { content: ' ▴'; }

.device__more .field__input { margin-top: 8px; padding: 12px 14px; font-size: 14px; }

.device__hint { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-faint); }
.device__hint code { font-size: 11.5px; }

/* ── Верхняя панель истории ───────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(var(--safe-top) + 8px) 8px 8px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__back, .topbar__icon { flex: none; width: 44px; height: 44px; }

.topbar__back, .topbar__icon {
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  cursor: pointer;
}
.topbar__back svg, .topbar__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar__back:active, .topbar__icon:active { background: var(--accent-soft); }

/* Пока девайс подключён и слушает историю, иконка светится акцентом. */
.topbar__icon.is-live { color: var(--accent); }

.topbar__center { flex: 1; min-width: 0; text-align: center; }

.topbar__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__progress { margin: 2px 0 0; font-size: 12px; color: var(--ink-faint); }

.topbar__bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--line); }
.topbar__bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s ease; }

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

.screen--story { height: 100dvh; overflow: hidden; }

.book {
  position: relative;
  flex: 1;
  min-height: 0;
  perspective: 1800px;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform-origin: left center;
  backface-visibility: hidden;
  will-change: transform;
}

/* Тень у корешка появляется только на время переворота. */
.page::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, .34), rgba(0, 0, 0, .06) 30%, transparent 60%);
}

.page.is-turning { z-index: 2; box-shadow: 8px 0 28px -6px rgba(0, 0, 0, .45); }
.page.is-turning::after { animation: page-shade .62s ease both; }

.page--out { animation: page-out .62s cubic-bezier(.42, 0, .28, 1) both; }
.page--in { animation: page-in .62s cubic-bezier(.42, 0, .28, 1) both; }

@keyframes page-out { from { transform: rotateY(0); } to { transform: rotateY(-172deg); } }
@keyframes page-in { from { transform: rotateY(-172deg); } to { transform: rotateY(0); } }
@keyframes page-shade { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: .3; } }

/* ── Место под иллюстрацию ────────────────────────────────────────────── */

.plate {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 18dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, var(--accent-soft), transparent 70%),
    var(--paper-raised);
  border-bottom: 1px solid var(--line);
}

/* Готово принять <img class="plate__image">, когда появятся картинки. */
.plate__image { width: 100%; height: 100%; object-fit: cover; }

.plate__mark { width: 46px; height: 46px; fill: none; stroke: var(--ink-faint); stroke-width: 1.2; opacity: .4; }

/* ── Текст страницы ───────────────────────────────────────────────────── */

.page__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 14px var(--gutter) 18px;
}

.page__chapter {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -.01em;
}

.page__text {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.56;
  hyphens: auto;
}
.page__text p { margin: 0 0 .66em; }
.page__text p:last-child { margin-bottom: 0; }

/* Курсор печатной машинки */
.page__text.is-typing > p:last-child::after {
  content: '';
  display: inline-block;
  width: .5em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -.18em;
  background: var(--accent);
  opacity: .8;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.page__mark {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  text-align: center;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

/* ── Статус и ошибка на странице ──────────────────────────────────────── */

.status { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink-faint); font-size: 14px; }

.status__quill {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.failure {
  margin: 8px 0;
  padding: 18px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.failure__text { margin: 0 0 14px; font-size: 15px; color: var(--ink-soft); }

/* ── Нижняя панель страницы ───────────────────────────────────────────── */

.pagebar {
  position: relative;
  flex: none;
  z-index: 3;
  padding: 9px var(--gutter) calc(var(--safe-bottom) + 10px);
  background: var(--paper);
  border-top: 1px solid var(--line);
  animation: rise .3s ease both;
}

/* Текст не обрывается под панелью, а мягко уходит — видно, что есть продолжение. */
.pagebar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 30px;
  background: linear-gradient(to top, var(--paper), transparent);
  pointer-events: none;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.pagebar__head {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: var(--measure);
  margin: 0 auto 7px;
}

.pagebar__label {
  flex: 1;
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pagenav {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  cursor: pointer;
}
.pagenav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pagenav:active { border-color: var(--accent); color: var(--accent); }

.pagebar__taken {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 11px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.pagebar__taken b { flex: none; color: var(--accent); font-weight: 600; }

.finale__actions { display: flex; flex-direction: column; gap: 8px; max-width: var(--measure); margin: 0 auto; }

/* ── Выборы ───────────────────────────────────────────────────────────── */

.choices__list { max-width: var(--measure); margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }

.choice {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .2s ease, background .2s ease;
}

.choice:active { transform: scale(.985); border-color: var(--accent); }
.choice.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.is-picked) { opacity: .45; }

.choice__key {
  flex: none;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.choice__body { min-width: 0; }
.choice__label { display: block; font-size: 15px; line-height: 1.32; font-weight: 500; }
.choice__tone { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-faint); }

/* ── Тост ─────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  z-index: 50;
  transform: translateX(-50%);
  padding: 11px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: rise .25s ease both;
}

/* ── Экран пошире ─────────────────────────────────────────────────────── */

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .brand__soft { font-size: 30px; }
  .brand__accent { font-size: 56px; }
  .backdrop__line { font-size: 16px; }
  .page__text { font-size: 18px; }
  .page__chapter { font-size: 24px; }
  .plate { max-height: 26dvh; aspect-ratio: 21 / 9; }
  .finale__actions { flex-direction: row; justify-content: center; }
  .finale__actions .button { width: auto; min-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
