/* «Сказка про вашего ребёнка» — этап 1 (ревизия).
   Каркас воронки и палитра — по паттернам sonata-ai (ресерч 05.11): кремовые карточки
   #FBF8F4, тёплый тёмный текст #2E241F, CTA-градиент orange→amber, цена на кнопке.
   Детский слой: ночное небо с заметно мерцающими звёздами + погоня лиса→заяц по периметру.
   Mobile-first: базовая вёрстка рассчитана на 375px (без горизонтали и на 320px),
   расширения — через @media (min-width: …). */

:root {
  /* Небо */
  --night-top: #191243;
  --night-mid: #251a55;
  --night-bottom: #3a2258;
  --star: #ffe9b8;
  /* Карточки и текст (палитра Сонаты) */
  --card: #fbf8f4;
  --card-edge: #efe6da;
  --ink: #2e241f;
  --ink-soft: #6b5d53;
  --ink-faint: #9c8d81;
  /* Действия */
  --cta-from: #f97316;
  --cta-to: #f59e0b;
  --accent: #8b7cff;
  --mint: #5effc8;
  --danger: #b4232a;
  --ok: #1f7a4d;
  /* Дисклеймер (голубой баннер, как у Сонаты) */
  --sky-bg: #e0f2fe;
  --sky-ink: #0c4a6e;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(15, 8, 40, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Onest', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 52%, var(--night-bottom) 100%) fixed;
  /* Страховка от горизонтального скролла на узких экранах (погоня ездит внутри .chase) */
  overflow-x: hidden;
}

/* ---------- Небо ---------- */

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

/* Мерцание реально заметное: глубокая амплитуда яркости и лёгкий зум,
   задержки/длительности задаются из app.js с большим разбросом */
.star {
  position: absolute;
  border-radius: 50%;
  background: var(--star);
  opacity: 0.85;
  animation: twinkle var(--tw-dur, 4s) ease-in-out var(--tw-delay, 0s) infinite alternate;
}

.star-big { box-shadow: 0 0 8px 2px rgba(255, 233, 184, 0.65); }

/* Крупные 4-лучевые искры ✦ (образец владельца «Сова1»): инлайн-SVG с вогнутыми гранями,
   тот же twinkle-механизм и палитра, что у круглых звёзд. Свечение по контуру лучей даёт
   drop-shadow — box-shadow повторяет прямоугольник спана, а не форму искры */
.star-spark {
  position: absolute;
  animation: twinkle var(--tw-dur, 4s) ease-in-out var(--tw-delay, 0s) infinite alternate;
  filter: drop-shadow(0 0 5px rgba(255, 233, 184, 0.9));
}

.star-spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.star-spark path {
  fill: var(--star);
}

.moon { position: absolute; top: 28px; right: 6%; opacity: 0.95; filter: drop-shadow(0 0 14px rgba(255, 233, 184, 0.35)); }

@keyframes twinkle {
  from { opacity: 0.15; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1.3); }
}

/* ---------- Погоня по периметру: заяц убегает, лиса позади ---------- */

/* Слой во весь экран под контентом: карточки (z-index 1) с непрозрачным фоном
   перекрывают зверюшек — они не «проплывают» по тексту, а мелькают по краям */
.chase {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Точки траектории: пол и потолок (зверюшки 60px + отступ) */
  --chase-top: 14px;
  --chase-floor: calc(100vh - 88px);
}

.chaser {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.55;
  will-change: transform;
  /* Базовая позиция = старт ключевых кадров (важно для задержки старта лисы) */
  transform: translate(-80px, var(--chase-floor));
}

.chaser svg {
  width: 60px;
  height: 60px;
  display: block;
  animation: hop-along 0.9s ease-in-out infinite alternate;
}

/* Заяц впереди; лиса — тот же маршрут с задержкой (отстаёт на 2.4 с ≈ 7% периметра) */
.chaser-bunny { animation: chase-loop 34s linear infinite; }

.chaser-fox { animation: chase-loop 34s linear infinite; animation-delay: 2.4s; }

/* Прямоугольный периметр вьюпорта: низ → правый край → верх → левый край, по кругу.
   Скорость сегментов равная (linear) — на изгибах не «замирают» */
@keyframes chase-loop {
  0%   { transform: translate(-80px, var(--chase-floor)); }
  25%  { transform: translate(calc(100vw + 10px), var(--chase-floor)); }
  50%  { transform: translate(calc(100vw + 10px), var(--chase-top)); }
  75%  { transform: translate(-80px, var(--chase-top)); }
  100% { transform: translate(-80px, var(--chase-floor)); }
}

@keyframes hop-along {
  from { transform: translateY(0) scaleY(1); }
  to { transform: translateY(-9px) scaleY(1.04); }
}

/* ---------- Шапка ---------- */

.hero {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 16px 20px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mint);
  border: 1px solid rgba(94, 255, 200, 0.35);
  background: rgba(94, 255, 200, 0.08);
}

.hero-title {
  margin: 14px 0 10px;
  font-family: 'Comfortaa', 'Onest', system-ui, sans-serif;
  font-size: clamp(30px, 7vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}

.hero-sub { margin: 0 auto; max-width: 480px; color: rgba(255, 255, 255, 0.78); font-size: 17px; }

/* ---------- Карточки ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
}

.card h2 {
  margin: 0 0 6px;
  font-family: 'Comfortaa', 'Onest', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.card-hint { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; }

/* ---------- Форма анкеты ---------- */

.field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }

.field > label,
.field > legend { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }

.legend-note { font-weight: 400; color: var(--ink-faint); font-size: 13px; }

/* Двухколоночность — только там, где хватает ширины (mobile-first) */
.field-row { display: grid; grid-template-columns: 1fr; gap: 14px; }

@media (min-width: 560px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

input[type='text'],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--card-edge);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s;
}

textarea { resize: vertical; min-height: 88px; }

input[type='text']:focus-visible,
select:focus-visible,
textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.2); }

.field-note { margin: 6px 0 0; font-size: 13px; color: var(--ok); }

.field-error { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--danger); }

/* Поле с ошибкой: заметная красная рамка (цвет + внутреннее «утолщение» через тень,
   чтобы не сдвигать вёрстку) и лёгкая розовая подложка. Не только цвет — рядом всегда
   текст ошибки в .field-error (доступность для дальтоников). */
.field.invalid input[type='text'],
.field.invalid select,
.field.invalid textarea,
input[type='text'][aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
  background: #fff7f7;
}

/* Подпись внутри раскрывающихся блоков «Ваш вариант» */
.custom-wrap { margin-top: 10px; }

.sub-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }

/* Чипы (пол, ценности) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { position: relative; }

.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--card-edge);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.chip input:checked + span { background: #fff4e8; border-color: var(--cta-from); color: #b4500f; font-weight: 600; }

.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.35); }

/* Кнопка «Ваш вариант» — пунктирный чип, раскрытое состояние — как выбранный */
.btn-variant {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px dashed #cbbfae;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.btn-variant:hover { border-color: var(--accent); color: var(--accent); }

.btn-variant[aria-expanded='true'] { border-style: solid; border-color: var(--cta-from); background: #fff4e8; color: #b4500f; font-weight: 600; }

/* Аватары: зверюшки + роли + «Ваш вариант» */
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

@media (min-width: 560px) {
  .avatar-grid { gap: 10px; }
}

.avatar {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  background: #fff;
  border: 1.5px solid var(--card-edge);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.avatar input { position: absolute; opacity: 0; pointer-events: none; }

.avatar svg { width: 46px; height: 46px; }

.avatar span { font-size: 11px; font-weight: 500; color: var(--ink-soft); text-align: center; }

@media (min-width: 560px) {
  .avatar span { font-size: 12.5px; }
}

.avatar:hover { border-color: #d9c9b6; }

.avatar input:checked + svg { transform: scale(1.06); }

.avatar:has(input:checked) { border-color: var(--cta-from); background: #fff4e8; }
.avatar:has(input:checked) span { color: #b4500f; font-weight: 600; }

.avatar:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.35); }

/* Согласие 152-ФЗ: рамка прозрачна по умолчанию, при ошибке — красная с фоном */
.consent {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  margin: 4px -12px 18px;
  transition: border-color 0.15s, background 0.15s;
}

.consent.invalid { border-color: var(--danger); background: #fdecec; }

.consent-label { display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }

.consent-label input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--cta-from);
}

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

.cta {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}

.cta:hover:not(:disabled) { filter: brightness(1.05); }

.cta:active:not(:disabled) { transform: translateY(1px); }

.cta:disabled { background: #cfc6bc; box-shadow: none; cursor: not-allowed; }

.cta:focus-visible,
.btn-secondary:focus-visible,
.btn-variant:focus-visible,
.btn-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1.5px solid var(--card-edge);
  border-radius: 12px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }

.btn-secondary:disabled { color: var(--ink-faint); cursor: not-allowed; }

.btn-secondary.btn-parent { width: 100%; margin-top: 10px; }

.btn-ico { width: 22px; height: 22px; color: var(--cta-from); flex: 0 0 auto; }

/* Тихая текстовая ссылка-кнопка («Пока не сейчас», «Назад») */
.btn-link {
  display: block;
  margin: 12px auto 0;
  padding: 8px 10px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover { color: var(--ink); }

/* «Сочинить заново» под статус-лентой: класс вместо инлайн-стиля (CSP style-src 'self'
   запрещает атрибут style — QA 09.11) */
.retry-margin { margin-top: 14px; }

.fine-print { margin: 10px 0 0; font-size: 13px; color: var(--ink-faint); text-align: center; }

/* Сумма к оплате в модалке: крупно и спокойно, цена — часть доверия к чекауту */
/* Выбранный голос в модалке оплаты: «Голос: Леда» — клиент видит, за что платит */
.pay-voice {
  margin: 2px 0 0;
  color: var(--ink);
  text-align: center;
  font-weight: 600;
}

.pay-amount {
  margin: 14px 0 4px;
  font-family: 'Comfortaa', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.form-error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdecec;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Статусы конвейера ---------- */

.status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff4e8;
  color: #8a4a12;
  font-weight: 600;
  font-size: 15.5px;
}

.spinner {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(249, 115, 22, 0.25);
  border-top-color: var(--cta-from);
  animation: spin 0.9s linear infinite;
}

.spinner.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Карточки сюжетов ---------- */

.variant-list { display: grid; gap: 14px; margin-top: 16px; }

.variant-card {
  padding: 18px;
  background: #fff;
  border: 1.5px solid var(--card-edge);
  border-radius: 16px;
}

.variant-card h3 { margin: 0 0 8px; font-family: 'Comfortaa', sans-serif; font-size: 18px; }

.variant-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; }

.variant-card .cta { padding: 12px 18px; font-size: 15.5px; }

.variant-card.picked { border-color: var(--ok); background: #f2fbf6; }

/* ---------- Готовая сказка: редактируемый текст ---------- */

.edit-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.edit-ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ok); }

/* Редактор: высота дорисовывается из app.js под содержимое */
#story-editor { min-height: 220px; font-size: 16px; line-height: 1.7; }

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

.saved-note { font-size: 13.5px; font-weight: 600; color: var(--ok); }

/* «Правки сохранены» у сайта: заметная зелёная плашка с галочкой (раньше — мелкий текст,
   пропадавший через 2,5 с, QA 04.12); видна до следующего ввода в редактор */
.saved-note:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e6f4ec;
  font-size: 14.5px;
}
.saved-note::before { content: '✓'; font-weight: 800; }

/* Сказка из чата: двухчастная плашка «откуда сказка и что дальше» + кнопка в чат */
.chat-note {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1.5px solid #c7d0fb;
  color: var(--ink);
  line-height: 1.5;
}
.chat-note p { margin: 0 0 8px; }
.chat-note-title { font-weight: 800; font-size: 16.5px; }
.chat-back { text-align: center; text-decoration: none; margin-top: 10px; }

/* Подтверждение сохранения у сказки из чата: зелёное, не исчезает само */
.chat-saved {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #e6f4ec;
  border: 1.5px solid #9fd3b5;
  color: #14532d;
  font-weight: 600;
  line-height: 1.5;
}
.chat-saved p { margin: 0; }

/* Счётчик длины «N знаков из M»: превышение — красным, чтобы родитель заметил до сохранения */
.text-counter { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

.text-counter.over { color: var(--danger); }

.voice-box { margin-top: 18px; }

/* Полная озвучка готова (dev-путь локалки): плеер под кнопкой «Озвучить» */
.full-audio-box {
  margin-top: 18px;
  padding: 16px;
  border: 1.5px solid var(--card-edge);
  border-radius: 16px;
  background: #fff;
}

.full-audio-box h3 { margin: 0 0 10px; font-size: 17px; }

.full-audio-box audio { display: block; width: 100%; }

/* Попап указания ударений: fixed у курсора двойного клика, поверх всего */
.stress-popup {
  position: fixed;
  z-index: 60;
  padding: 12px 14px;
  background: var(--card);
  border: 1.5px solid var(--card-edge);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-width: 280px;
}

.stress-popup-word { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); }

.stress-popup-vowels { display: flex; flex-wrap: wrap; gap: 6px; }

.stress-vowel {
  min-width: 34px;
  padding: 7px 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--card-edge);
  border-radius: 10px;
  cursor: pointer;
}

.stress-vowel:hover { border-color: var(--accent); color: var(--accent); }

.stress-popup-hint { margin: 8px 0 0; font-size: 12px; color: var(--ink-faint); }

.ttl-strip { margin: 16px 0 0; padding: 10px 14px; border-radius: 12px; background: #f2fbf6; color: var(--ok); font-size: 14px; font-weight: 600; text-align: center; }

/* Плашка возврата с платёжной формы (шаг сказки, ?pay=…): мягкий тон, чтобы
   «Проверяем оплату…» не выглядело ошибкой и не пугало в момент ожидания */
.pay-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ea;
  color: #8a5300;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* Возврат с отказом от оплаты — тот же блок, но тревожнее (без агрессивного красного:
   человек уже вернулся и просто выбирает другой способ) */
.pay-note.pay-note-failed { background: #fdf0f0; color: #a33; }

/* ---------- Тарифы ---------- */

.tariff-list { display: grid; gap: 12px; }

.tariff-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 1.5px solid var(--card-edge);
  border-radius: 16px;
}

@media (min-width: 560px) {
  .tariff-card { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .tariff-price { grid-column: 2; grid-row: 1 / span 3; }
}

.tariff-card h3 { margin: 0; font-size: 16.5px; }

.tariff-price { font-family: 'Comfortaa', sans-serif; font-size: 22px; font-weight: 700; white-space: nowrap; }

.tariff-meta { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

.tariff-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #6a5ae0);
}

/* ---------- Футер ---------- */

.footer { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 0 16px 120px; }

.ai-disclaimer {
  margin: 0 0 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--sky-bg);
  color: var(--sky-ink);
  font-size: 13.5px;
}

.footer-legal { margin: 0; text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }

/* Ссылки на юридические документы: заметные, но не спорящие с дисклеймером.
   Перенос по словам — на 375px четыре ссылки в строку не влезают, пусть лягут в две. */
.footer-docs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 12px 0 0;
}

.footer-docs a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-docs a:hover { color: #fff; }

.footer-docs a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Модалки ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 8, 40, 0.62);
}

.modal {
  width: min(420px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 22px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-wide { width: min(520px, 100%); text-align: left; }

.modal-wide h3, .modal-wide .modal-sub { text-align: left; }

.modal-ico { width: 54px; height: 54px; margin-bottom: 6px; }

.modal h3 { margin: 0 0 8px; font-family: 'Comfortaa', sans-serif; font-size: 20px; }

.modal p { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; }

.modal-sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }

/* Поле «Ссылка на сказку» + кнопка «Скопировать» в модалке «Поделиться»:
   в одну строку на широких, в столбик на узких (375px — обязательная ширина) */
.share-link-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  text-align: left;
}

.share-link-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--card-edge);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  /* Ссылку читают и копируют, править её не предполагается — но выделять для
     ручного копирования можно (readonly, не disabled: disabled не выделяется) */
}

.share-link-row input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 560px) {
  .share-link-row { flex-direction: row; align-items: stretch; }
  .share-link-row input { flex: 1; min-width: 0; }
  .share-link-row .btn-secondary { white-space: nowrap; }
}

/* Карточки голосов */
.voice-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; }

.voice-card {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--card-edge);
  border-radius: 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.voice-card:hover { border-color: #d9c9b6; }

.voice-card.selected { border-color: var(--cta-from); background: #fff4e8; }

.voice-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.voice-name { font-weight: 700; font-size: 15px; }

.voice-tag { font-size: 12.5px; color: var(--ink-soft); }

.voice-state { font-size: 12px; font-weight: 600; color: var(--cta-from); min-height: 1.2em; }

/* Запись голоса родителя */
.rec-consent { margin: 2px 0 12px; }

.rec-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }

.rec-row .cta, .rec-row .btn-secondary { width: auto; }

#btn-rec-upload { width: 100%; }

.rec-indicator { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--danger); }

.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-pulse 1s ease-in-out infinite; }

@keyframes rec-pulse {
  50% { opacity: 0.25; transform: scale(0.8); }
}

/* ---------- Баннер cookie (мягкий вариант, решение владельца 11.11.2026) ---------- */

/* Плашка снизу: контент НЕ уезжает под неё навсегда — баннер исчезает после «Принять»
   и не появляется снова (localStorage). Пока баннер виден, он перекрывает только
   нижнюю кромку экрана; основная воронка (анкета и кнопка «Сочинить сказку») живёт
   выше и остаётся доступной. z-index выше карточек, но ниже модалок (50): диалог
   оплаты и голосов должен быть поверх. */
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  /* Потолок ширины от вьюпорта: контент страницы (слой .sky/.chase) бывает шире
     экрана, и без потолка баннер растягивается за видимую кромку на 320px
     (fix QA 17.11) — 12px боковых отступов держим и слева, и справа */
  max-width: calc(100vw - 24px);
  bottom: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 14px 40px rgba(8, 4, 30, 0.55);
  font-size: 14px;
  line-height: 1.45;
}

.cookie-banner-text { margin: 0; }

.cookie-banner-link { color: #6a4fd8; text-decoration: underline; text-underline-offset: 2px; }

.cookie-banner-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.cookie-banner-actions { display: flex; justify-content: flex-end; }

.cookie-banner-accept {
  padding: 10px 22px;
  /* 44px — рекомендация WCAG 2.5.5/Apple HIG по тап-зоне: главное действие баннера
     нажимается с телефона, мимо тапа «Принять» = согласие не дано */
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  cursor: pointer;
}

.cookie-banner-accept:hover { transform: translateY(-1px); }

.cookie-banner-accept:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.cookie-banner-accept:active { transform: translateY(0); }

/* Широкий экран: плашка компактнее и не растягивается на всю ширину монитора */
@media (min-width: 720px) {
  .cookie-banner {
    left: auto;
    right: 20px;
    bottom: 20px;
    max-width: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner-accept:hover { transform: none; }
}

/* ---------- Служебное ---------- */

/* Каталог SVG-символов (<svg width=0 height=0> с defs): убран из потока — класс вместо
   инлайн-стиля, CSP style-src 'self' атрибут style блокирует (QA 09.11) */
.svg-defs { position: absolute; }

.hidden { display: none !important; }

.step { animation: rise 0.35s ease-out; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Широкие экраны: воздух в карточках и шапке */
@media (min-width: 560px) {
  .card { padding: 24px 22px; }
  .hero { padding-top: 44px; }
}

/* Доступность: убрать движение, если пользователь просил покой —
   глушим и мерцание звёзд с искрами, и погоню (слой прячем целиком) */
@media (prefers-reduced-motion: reduce) {
  .star, .star-spark, .rec-dot, .spinner, .step, .chaser svg { animation: none !important; }
  .chase { display: none; }
  html { scroll-behavior: auto; }
}
