/* Сказочник — «фетровая аппликация на ночь».
   Один выразительный приём — прострочка (пунктирный «стежок») на луне, заплатке с формой и выбранном тарифе.
   Всё остальное спокойное: никаких градиентов, эмодзи-иконок и одинаковых карточек. */

@font-face { font-family: "Unbounded"; src: url("/static/fonts/unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/static/fonts/literata.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/static/fonts/literata-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --night: #233067;      /* ночной фетр */
  --night-2: #2C3A78;    /* плашка на ночи */
  --night-line: #45539A;
  --ground: #F1F3F9;     /* «наволочка» */
  --paper: #FFFFFF;
  --field: #F7F8FC;
  --moon: #E9B949;       /* горчичная луна, главная кнопка */
  --moon-edge: #B88A1E;
  --moon-stitch: #9A7419;
  --mint: #9CCFBF;
  --cranberry: #A8324A;
  --ink: #1B2148;
  --ink-2: #3D4370;
  --ink-3: #5A6088;
  --thread: #FFF8E7;     /* нитка на тёмном */
  --on-night: #E4E7F3;
  --on-night-2: #C9CEE6;
  --line: #D5DAEA;
  --field-line: #8189B2;  /* рамки полей и кнопок выбора: контраст ≥ 3:1 (WCAG 1.4.11) */
  --stitch: #C3CAE2;
  --track: #7F8CCB;       /* дорожка плеера: ≥3:1 к карточке */
  --warn: #FFF4D6;
  --focus: var(--night);  /* кольцо фокуса: на светлом фоне тёмное, на тёмных блоках — луна */

  --display: "Unbounded", "Arial Black", sans-serif;
  --text: "Literata", Georgia, "Times New Roman", serif;
  --wrap: 1200px;
  --gutter: 16px;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--thread); color: var(--ink); padding: 12px 16px; border-radius: 10px; }
main:focus { outline: none; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.55 var(--text); overflow-wrap: break-word; }
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--night); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.top, .foot, .night, .player-card, .sample-player, .voice-card { --focus: var(--moon); }
.night .patch { --focus: var(--night); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); font-size: 15px; }
.center { text-align: center; }

/* ---------- шапка и подвал ---------- */
.top { background: var(--night); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
@media (min-width: 720px) { .top .wrap { min-height: 76px; } }
.logo { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--thread); text-decoration: none; font: 700 18px var(--display); }
.logo:hover { color: var(--thread); }
@media (min-width: 720px) { .logo { font-size: 20px; } }
.top nav { display: flex; gap: 4px 20px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--thread); font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
/* узкие телефоны: «Цены» и «Мои сказки» рядом с логотипом в одну строку */
.logo { flex: none; }
@media (max-width: 440px) { .top .wrap { gap: 10px; } .logo { font-size: 16px; gap: 8px; } .top nav { gap: 0 12px; flex-wrap: nowrap; } .top nav a { font-size: 14px; white-space: nowrap; } }
@media (max-width: 360px) { .logo { font-size: 14px; gap: 6px; } .logo svg { width: 20px; height: 20px; } .top nav { gap: 0 10px; } }
/* на самых узких экранах (320) имя «Мой сказочник» и два пункта меню в одну строку не помещаются: меню уходит строкой ниже */
@media (max-width: 335px) { .top .wrap { flex-wrap: wrap; row-gap: 0; padding-bottom: 4px; } .top nav { justify-content: flex-start; } }

.foot { background: var(--night); color: var(--on-night-2); font-size: 14px; line-height: 1.7; }
.foot .wrap { padding-top: 32px; padding-bottom: 40px; display: grid; gap: 20px; }
@media (min-width: 900px) { .foot .wrap { grid-template-columns: 1fr 1fr 1.3fr; gap: 48px; } }
.foot a { color: var(--thread); }
.foot-links { display: flex; flex-direction: column; }
.foot-links a { display: flex; align-items: center; min-height: 44px; }

.form ::placeholder { color: #666E8C; opacity: 1; }

.chips-label { flex: 1 0 100%; margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.gift-preview { border: 1.5px solid var(--field-line); border-radius: 14px; padding: 14px; background: var(--field); }
.btn-wait:disabled { opacity: 1; background: transparent; color: var(--ink-2); box-shadow: none; border: 1.5px dashed var(--stitch); cursor: default; }
@media (max-width: 359px) { .patch { padding: 5px; } .patch-inner { padding: 20px 12px; } }
@media (min-width: 600px) and (max-width: 959px) { .story-head { grid-template-columns: 160px minmax(0, 1fr); } .hero .patch { max-width: 560px; } }
@media (min-width: 900px) { .hero-text { position: sticky; top: 24px; } }

/* ---------- ночь (верх главной) ---------- */
.night { background: var(--night); color: var(--thread); position: relative; overflow: hidden; padding-bottom: 64px; }
@media (min-width: 900px) { .night { padding-bottom: 110px; } }
.night-moon { position: absolute; right: -40px; top: 62px; width: 128px; height: 128px; pointer-events: none; }
@media (min-width: 600px) { .night-moon { width: 170px; height: 170px; right: -30px; top: 70px; } }
@media (min-width: 900px) { .night-moon { display: none; } }
.hero-moon { display: none; }
@media (min-width: 900px) { .hero-moon { display: block; width: 300px; height: 300px; margin: 28px 0 -40px -36px; } }
.night-edge { position: absolute; left: 0; bottom: -1px; width: 100%; height: 40px; display: block; }
@media (min-width: 900px) { .night-edge { height: 70px; } }

.hero { position: relative; display: grid; gap: 28px; padding-top: 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-top: 48px; } }
.hero h1 { font: 700 clamp(28px, 7.4vw, 52px)/1.13 var(--display); letter-spacing: -0.01em; margin-bottom: 16px; max-width: 13em; padding-right: 76px; }
@media (min-width: 600px) { .hero h1 { padding-right: 130px; } }
@media (min-width: 900px) { .hero h1 { padding-right: 0; } }
.hero-lead { font-size: clamp(17px, 2.2vw, 21px); line-height: 1.55; color: var(--on-night); max-width: 30em; margin: 0 0 20px; }
.hero-price { font-size: clamp(16px, 2vw, 19px); font-weight: 600; line-height: 1.45; color: var(--thread); max-width: 30em; margin: 0 0 20px; }
.hero-facts { list-style: none; padding: 0; margin: 0; display: none; flex-direction: column; gap: 12px; color: var(--on-night); max-width: 30em; }
.hero-facts li { display: flex; gap: 12px; align-items: baseline; }
.hero-facts li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--moon); transform: translateY(-2px); }
@media (min-width: 900px) { .hero-facts { display: flex; } .hero-text { padding-top: 16px; } }

/* ---------- заплатка (форма и блоки с прострочкой) ---------- */
.patch { background: var(--paper); border-radius: 22px; padding: 7px; color: var(--ink); }
.patch-inner { border: 2px dashed var(--stitch); border-radius: 16px; padding: 22px 16px; }
@media (min-width: 720px) { .patch-inner { padding: 28px 24px; } }
.night .patch { box-shadow: 0 4px 0 #18224D; }
.patch h2 { font: 500 19px var(--display); margin-bottom: 14px; }
@media (min-width: 720px) { .patch h2 { font-size: 22px; } }

.form { display: flex; flex-direction: column; gap: 16px; }
.form label.field, .form .field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; }
.form .opt { font-weight: 400; color: var(--ink-3); }
.form input[type=text], .form input[type=password], .form input[type=email], .form .field input[type=number], .form input:not([type]), .form select, .form textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--field-line); border-radius: 10px;
  background: var(--field); color: var(--ink); font: 400 17px var(--text);
}
.form textarea { min-height: 88px; resize: vertical; }
.form input:not([type=checkbox]):not([type=radio]):focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--night); background: var(--paper); }
.form input[type=checkbox]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form legend { font-size: 15px; font-weight: 600; padding: 0; margin-bottom: 8px; }

/* «мальчик/девочка»: две равные кнопки на настоящих radio, выбранная — с прострочкой */
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice label { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.choice span { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 12px;
  border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--paper); font-size: 16px; font-weight: 600; cursor: pointer; }
.choice input:checked + span { background: var(--night); border-color: var(--night); color: var(--thread); }
.choice input:checked + span::after { content: ""; position: absolute; inset: 4px; border: 1.5px dashed rgba(255, 248, 231, .5); border-radius: 9px; pointer-events: none; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* возраст: подпись слева, «− 5 лет +» справа; без JavaScript остаётся обычный список */
.age-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.age-label { font-size: 15px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--paper); }
.stepper button { width: 44px; height: 44px; border: 0; border-radius: 9px; background: var(--ground); color: var(--ink); font: 500 22px/1 var(--display); cursor: pointer; }
.stepper button:hover { background: #E3E7F2; }
.stepper button:disabled { color: inherit; opacity: .35; cursor: default; background: var(--ground); }
.age-box { display: flex; align-items: baseline; justify-content: center; gap: 6px; min-width: 88px; padding: 0 6px; font-size: 17px; font-weight: 600; }
.form .age-box input { width: 3.2ch; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: right; font: 600 17px var(--text); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.form .age-box input:focus { outline: none; background: transparent; }
.age-box:focus-within { box-shadow: inset 0 -2px 0 var(--night); }
.age-box input::-webkit-outer-spin-button, .age-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* темы — таблетки на radio */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--field-line); background: var(--paper); font-size: 15px; font-weight: 400; cursor: pointer; line-height: 1.25; }
.chip input:checked + span { background: var(--night); border-color: var(--night); color: var(--thread); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip .paid { font-size: 13px; font-style: normal; color: var(--ink-3); }
.chip input:checked + span .paid { color: var(--on-night-2); }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); font-weight: 400; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--night); }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 12px 20px; border: 0; border-radius: 14px;
  background: var(--moon); color: var(--ink); font: 700 16px/1.2 var(--display); text-align: center; text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 var(--moon-edge); }
.btn:hover { color: var(--ink); background: #EFC45E; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--moon-edge); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.btn-plain { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 18px; border-radius: 14px;
  border: 1.5px solid var(--field-line); background: var(--paper); color: var(--ink); font: 600 16px var(--text); text-decoration: none; cursor: pointer; }
.btn-plain:hover { border-color: var(--night); color: var(--ink); }
.btn-outline { border-color: var(--night); color: var(--night); background: transparent; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--cranberry); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
@media (min-width: 720px) { .btn { font-size: 17px; } }

/* ---------- секции главной ---------- */
.section { padding-top: 48px; padding-bottom: 8px; }
@media (min-width: 900px) { .section { padding-top: 80px; } }
.section h2 { font: 500 clamp(23px, 3vw, 32px)/1.22 var(--display); margin-bottom: 14px; }
.section p.lead { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; color: var(--ink-2); margin: 0 0 20px; max-width: 32em; }

.sample { display: grid; gap: 20px; }
@media (min-width: 900px) { .sample { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; } }
.book { background: var(--paper); border-radius: 4px 20px 20px 4px; border-left: 8px solid var(--night); padding: 22px 18px; box-shadow: 0 2px 0 var(--line); }
@media (min-width: 720px) { .book { border-left-width: 10px; padding: 32px 36px; } }
.book h3 { font: 600 clamp(20px, 2vw, 24px) var(--text); margin-bottom: 12px; }
.book p { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.75; margin: 0 0 12px; }
.book p:last-child { margin-bottom: 0; }

.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 22px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.steps li { display: flex; gap: 14px; }
.steps .num { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--mint); display: flex; align-items: center; justify-content: center; font: 700 17px var(--display); }
.steps h3 { font-size: 18px; margin: 6px 0 6px; }
.steps p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }

.price-strip { background: var(--paper); border-radius: 20px; padding: 22px 18px; display: grid; gap: 18px; }
@media (min-width: 900px) { .price-strip { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 32px 36px; } }
.price-strip h2 { margin-bottom: 8px; }
.price-strip p { margin: 0; color: var(--ink-2); }
.price-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.price-pill { padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; min-width: 128px; flex: 1 1 128px; }
.price-pill b { display: block; font: 700 21px var(--display); }
.price-pill span { font-size: 14px; color: var(--ink-3); }
.price-pill.best { border: 2px dashed var(--night); background: #FFF6DC; }

.faq { display: grid; gap: 12px 48px; padding-bottom: 64px; }
@media (min-width: 900px) { .faq { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); padding-bottom: 96px; } }
.faq details { border-top: 1.5px solid var(--line); padding: 8px 0; }
.faq details:last-child { border-bottom: 1.5px solid var(--line); }
.faq summary { font-size: 17px; font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--night); border-bottom: 2px solid var(--night); transform: rotate(45deg) translateY(-3px); }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
@media (min-width: 720px) { .faq summary { font-size: 19px; } }
.faq details p { font-size: 16px; line-height: 1.6; margin: 4px 0 10px; color: var(--ink-2); max-width: 40em; }

/* ---------- обычные страницы ---------- */
.page { padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 900px) { .page { padding-top: 48px; padding-bottom: 96px; } }
.page h1 { font: 700 clamp(26px, 4vw, 38px)/1.2 var(--display); margin-bottom: 14px; }
.narrow { max-width: 760px; }
.card { background: var(--paper); border-radius: 20px; padding: 22px 18px; margin: 16px 0; }
@media (min-width: 720px) { .card { padding: 28px 32px; } }
.card h2 { font: 500 19px var(--display); margin-bottom: 12px; }
.notice { background: var(--warn); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.5; margin: 12px 0; }
.copy { display: block; width: 100%; min-height: 48px; margin: 8px 0; padding: 10px 14px; border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--field); font: 400 15px var(--text); color: var(--ink); }

/* сказка */
.story-layout { display: grid; gap: 0; }
@media (min-width: 960px) { .story-layout { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 48px; padding-bottom: 96px; } }
.player-card { background: var(--night); color: var(--thread); padding: 8px var(--gutter) 28px; border-radius: 0 0 28px 28px; margin: 0 calc(-1 * var(--gutter)); }
@media (min-width: 960px) { .player-card { margin: 0; border-radius: 24px; padding: 28px; } }
.player-card .for { margin: 0 0 6px; font-size: 15px; color: var(--on-night-2); }
.player-card h1 { font: 700 clamp(24px, 3vw, 28px)/1.2 var(--display); margin-bottom: 20px; }
.player { background: var(--night-2); border-radius: 18px; padding: 16px; }
@media (min-width: 960px) { .player { background: transparent; padding: 0; } }
.player-row { display: flex; align-items: center; gap: 14px; }
.play { width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--moon); display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; box-shadow: 0 3px 0 var(--moon-edge); }
.play:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--moon-edge); }
.play .i-pause { display: none; }
.play.on .i-pause { display: block; }
.play.on .i-play { display: none; }
.track { flex: 1; min-width: 0; }
.bar { position: relative; height: 6px; background: var(--track); border-radius: 3px; cursor: pointer; }
.bar:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 6px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--moon); border-radius: 3px; }
.bar i::after { content: ""; position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 0 2px var(--night); }
.bar input { position: absolute; inset: -19px 0; width: 100%; opacity: 0; cursor: pointer; margin: 0; }
.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--on-night-2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.download { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--night-line); color: var(--thread); font-size: 15px; display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.download:hover { color: var(--thread); text-decoration: underline; }
.story-aside { display: flex; flex-direction: column; gap: 20px; }
.story-aside .patch { margin-top: 0; }
.story-text { padding: 28px 2px 8px; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.78; max-width: 34em; }
@media (min-width: 960px) {
  .player-card { grid-column: 1; grid-row: 1 / span 6; align-self: start; position: sticky; top: 16px; }
  .story-text, .keep-note, .rate-block, .story-next, .share-block { grid-column: 2; grid-row: auto; }
  .story-text { padding: 0; }
  .rate-block, .story-next, .share-block { max-width: 34em; padding-top: 32px; }
}
.story-text p { margin: 0 0 1em; }
.story-next { margin-top: 24px; }
.next-price { margin: 0; font-weight: 600; color: var(--ink); }
@media (min-width: 960px) { .story-next { margin-top: 0; } }
.story-next .patch-inner { display: flex; flex-direction: column; gap: 12px; }
.story-next h2 { margin-bottom: 2px; }
.share-block { padding: 28px 0 48px; }
@media (min-width: 960px) { .share-block { padding: 0; } }
.share-block h2 { font: 500 18px var(--display); margin-bottom: 10px; }
.pending { text-align: center; padding-top: 56px; padding-bottom: 72px; }
.pending h1 { font: 700 clamp(22px, 3vw, 30px)/1.25 var(--display); margin: 20px auto 10px; max-width: 18em; }
.pending .moon { width: 120px; height: 120px; animation: sway 4s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-10deg) translateY(-6px); } }

/* обложка */
.story-head { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; margin: 12px 0 20px; }
.story-head h1 { margin-bottom: 0; hyphens: auto; }
@media (max-width: 380px) { .story-head { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; } .player-card h1 { font-size: 20px; } }
@media (min-width: 960px) { .story-head { grid-template-columns: 1fr; margin-top: 0; } }
.cover { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; object-fit: cover; background: var(--night-2); }
img.cover { border: 3px dashed var(--night-line); }
.with-cover { flex-direction: row !important; align-items: center; gap: 14px !important; }
.with-cover > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cover.thumb { width: 56px; flex: none; border-radius: 10px; border-width: 2px; }

/* оценка */
.rate-block { padding: 8px 0 4px; }
@media (min-width: 960px) { .rate-block { padding: 0; } }
.rate-block h2 { font: 500 18px var(--display); margin-bottom: 10px; }
.rate-note { font-size: 14px; max-width: 520px; margin: 0 0 14px; }
.rate-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.rate-row > form, .rate-down { flex: 1 1 140px; margin: 0; }
.rate-down[open] { flex-basis: 100%; }
.rate-down summary { list-style: none; cursor: pointer; }
.rate-down summary::-webkit-details-marker { display: none; }
.rate-down[open] summary { border-color: var(--night); }
.rate-down > form { margin-top: 10px; background: var(--paper); border-radius: 16px; padding: 16px; }

/* продолжение после аудио */
.story-next.lit .patch { outline: 3px solid var(--moon); outline-offset: 2px; }

/* отправить */
.send-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0 4px; }

/* короткая форма */
.more { border: 1.5px solid var(--field-line); border-radius: 14px; padding: 0 14px; }
.more summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; font-size: 16px; color: var(--ink-2); }
.more[open] > .form { padding-top: 12px; }
.more[open] { padding-bottom: 14px; }

/* пример с голосом */
.sample-player { margin-top: 18px; background: var(--night); color: var(--thread); border-radius: 20px; padding: 14px; }
.sample-listen { margin: 0 0 10px; font: 500 15px var(--display); }
.sample-player .player { background: transparent; padding: 0; }

/* несколько героев */
.chip input:disabled + span { opacity: .45; cursor: not-allowed; }
.hero-extra { display: flex; flex-direction: column; gap: 16px; border-top: 2px dashed var(--stitch); padding-top: 16px; }
.hero-extra-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-extra-head h3 { font: 500 16px var(--display); }
.btn-stitch { border: 2px dashed var(--stitch); background: transparent; color: var(--ink-2); }
.btn-stitch:hover { border-color: var(--night); }

/* полки по детям */
.shelves { margin: -4px 0 14px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; font-size: 15px; }
.chip-link span { color: var(--ink-3); font-size: 13px; }
.chip-link.on { background: var(--night); border-color: var(--night); color: var(--thread); }
.chip-link.on span { color: var(--on-night-2); }
.shelf-about { margin: 0 0 4px; }

/* подарок: выбор пакета */
.plan.pick { cursor: pointer; position: relative; }
.plan.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan.pick .plan-title { font: 600 19px var(--text); }
.plan.pick:has(input:checked) { outline: 3px solid var(--moon); }
.plan.pick:has(input:checked) .plan-inner { border-color: var(--night); }
.plan.pick input:focus-visible + .plan-inner { outline: 3px solid var(--focus); outline-offset: 2px; }
.plan.pick.best:not(:has(input:checked)) { outline: 0; }
.gift-form { max-width: 1100px; gap: 24px; }
.gift-form .plans { margin: 0; }
@media (min-width: 640px) { .gift-form .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gift-form .patch { max-width: 560px; }

/* открытка */
.gift-wrap { display: grid; gap: 28px; padding-top: 32px; padding-bottom: 24px; }
@media (min-width: 900px) { .gift-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-top: 56px; } }
.gift-card .patch-inner { position: relative; overflow: hidden; }
.gift-moon { position: absolute; width: 104px; height: 104px; right: 6px; top: 6px; }
.gift-kicker { margin: 0 0 6px; font: 500 15px var(--display); color: var(--ink-3); }
.gift-card h1 { font: 700 clamp(24px, 3.2vw, 32px)/1.2 var(--display); margin: 0 0 14px; padding-right: 96px; }
.gift-from { font-weight: 600; margin: 0 0 8px; }
.gift-message { margin: 0 0 14px; padding: 12px 16px; border-left: 4px solid var(--mint); background: var(--field); border-radius: 0 12px 12px 0; font-size: 18px; line-height: 1.6; }
.gift-take { color: var(--thread); }
.gift-take h2 { font: 700 22px var(--display); margin-bottom: 10px; }
.gift-take p { color: var(--on-night); }
.gift-take .muted { color: var(--on-night-2); }
.gift-take .field { color: var(--thread); }
.gift-take .more { border-color: var(--night-line); }
.gift-take .more summary { color: var(--on-night); }
.gift-take .btn-outline { border-color: var(--thread); color: var(--thread); }
.gift-take .gift-terms { margin: 18px 0 0; font-size: 14px; }
.gift-take .gift-terms a { color: var(--thread); }

/* цены */
.plans { display: grid; gap: 14px; margin: 20px 0; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; } }
@media (min-width: 1100px) { .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.plan { background: var(--paper); border-radius: 20px; padding: 6px; display: flex; }
.plan-inner { flex: 1; border: 2px dashed var(--line); border-radius: 15px; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.plan.best { outline: 3px solid var(--moon); }
.plan.best .plan-inner { border-color: var(--night); }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.plan h2 { font-size: 19px; font-weight: 600; }
.plan-badge { align-self: flex-start; font: 600 13px var(--text); background: var(--moon); color: var(--ink); padding: 2px 10px; border-radius: 999px; }
.plan form .btn, .plan form .btn-plain { min-height: 56px; }
.more-info { margin: 0 0 16px; color: var(--ink-2); }
.more-info summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.plan .price { font: 700 24px var(--display); white-space: nowrap; }
.plan form { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.plan .note { margin: 0; font-size: 15px; color: var(--ink-3); }

/* библиотека */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.list li:last-child { border-bottom: 0; }
.list a { font-weight: 600; font-size: 17px; min-height: 44px; display: flex; align-items: center; }
.danger h2 { color: var(--cranberry); }

/* документы */
.legal { font-size: 16px; line-height: 1.65; }
.legal h2 { font: 600 19px var(--text); margin: 24px 0 8px; }
.legal p, .legal li { max-width: 46em; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; display: block; overflow-x: auto; }
.legal th, .legal td { text-align: left; padding: 8px; border: 1px solid var(--line); vertical-align: top; min-width: 140px; }
@media (max-width: 720px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; min-width: 0; }
  .legal tr:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal td { border: 0; padding: 4px 0; }
  .legal tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
  .legal td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); }
}
.receipt-row { border: 1.5px solid var(--field-line); border-radius: 14px; padding: 0 14px; margin: 0 0 10px; }
.receipt-row summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; min-height: 52px; cursor: pointer; list-style: none; }
.receipt-row summary::-webkit-details-marker { display: none; }
.receipt-row .receipt-add { width: auto; min-height: 40px; margin-left: auto; }
.receipt-row[open] { padding-bottom: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* админка */
.wide table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wide th, .wide td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-box { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stats div { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stats b { display: block; font: 700 20px var(--display); }
.stats span { color: var(--ink-3); font-size: 13px; }
.story-next .btn { font-size: 15px; }

/* админка: кампании */
.good { color: #1F7A55; }
.bad { color: var(--cranberry); }
.campaigns td { min-width: 64px; }
.campaigns th { font-size: 13px; }
.admin-wrap { max-width: 1440px; }
.campaigns td:first-child { min-width: 200px; }
.campaign-form { margin-top: 28px; padding-top: 20px; border-top: 1.5px solid var(--line); }
.campaign-form h3 { font: 500 18px var(--display); }
.grid2 { display: grid; gap: 14px 20px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form input[type=date] { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--ink); font: 400 17px var(--text); }
code { font-size: .9em; background: var(--ground); padding: 1px 5px; border-radius: 5px; }
.camp-cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.camp-cards li { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; }
.camp-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 17px; }
.camp-head b:last-child { white-space: nowrap; }
.camp-cards p { margin: 4px 0 10px; }
.camp-cards dl { margin: 0 0 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.camp-cards dt { font-size: 13px; color: var(--ink-3); }
.camp-cards dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.camp-cards a { display: inline-flex; min-height: 44px; align-items: center; }
/* показ по ширине экрана — в самом конце и с !important, чтобы display компонентов его не перебивал */
@media (max-width: 1239.98px) { .only-wide { display: none !important; } }
@media (min-width: 1240px) { .only-narrow { display: none !important; } }
.money-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
@media (min-width: 900px) { .money-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.money-sum div { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.money-sum dt { font-size: 13px; color: var(--ink-3); }
.money-sum dd { margin: 2px 0 0; font: 700 18px var(--display); font-variant-numeric: tabular-nums; }
.camp-cards dl.money { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1.5px solid var(--line); }
.camp-cards dl.money .net dd { font-size: 17px; }
.nowrap { white-space: nowrap; }
.money-sum small, .camp-cards small { font: 400 13px var(--text); color: var(--ink-3); }
.tbl-title { font: 600 15px var(--text); margin: 18px 0 4px; color: var(--ink-2); }
.camp-cards h4 { font: 600 13px var(--text); color: var(--ink-3); margin: 10px 0 6px; }
.camp-cards dl { border-bottom: 1.5px solid var(--line); padding-bottom: 10px; }
.glossary { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.glossary summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.glossary li { margin: 4px 0; }

/* ---------- кнопки, которые ждут галочку: пока не поставили, выглядят пунктиром и не нажимаются ---------- */
[data-gate] button[type=submit]:disabled { background: transparent; color: var(--ink-3); border: 1.5px dashed var(--stitch);
  box-shadow: none; opacity: 1; cursor: not-allowed; transform: none; }
.gate-hint { margin: 0; font-size: 14px; color: var(--ink-3); }
[data-gate].ready .gate-hint { display: none; }

/* ---------- ожидание сказки: шаги, бегущая «строчка», живые подсказки ---------- */
.wait-steps { list-style: none; margin: 24px auto 0; padding: 0; max-width: 340px; display: grid; gap: 12px; text-align: left; }
.wait-steps li { display: flex; gap: 12px; align-items: center; color: var(--ink-3); font-size: 16px; }
.wait-steps .dot { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px dashed var(--stitch); }
.wait-steps li.now { color: var(--ink); font-weight: 600; }
.wait-steps li.now .dot { border-color: var(--night); animation: spin 8s linear infinite; }
.wait-steps li.done { color: var(--ink-2); }
.wait-steps li.done .dot { background: var(--mint); border: 2px solid var(--night); }
@keyframes spin { to { transform: rotate(360deg); } }
.stitch-run { display: block; width: min(320px, 80%); height: 6px; margin: 24px auto 8px; }
.stitch-run line { stroke: var(--night); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 8 8; animation: run 1.2s linear infinite; }
@keyframes run { to { stroke-dashoffset: -16; } }
.note-line { min-height: 3.2em; margin: 8px auto 4px; max-width: 28em; transition: opacity .35s; }
.note-line.fade { opacity: 0; }

/* настройка продолжения */
.tune { margin: 0; }
.tune summary { list-style: none; cursor: pointer; }
.tune summary::-webkit-details-marker { display: none; }
.tune[open] summary { margin-bottom: 12px; }

/* Уведомление о cookie: прострочка, без тени, одна кнопка. Лежит над подвалом, а не поверх страницы:
   иначе на телефоне оно закрывает поля формы (cookie только собственные, согласие не требуется). */
.cookie { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--wrap) - 2 * var(--gutter)); margin: 0 auto 16px; padding: 14px 16px; background: var(--paper); border: 1.5px dashed var(--stitch); border-radius: 16px;
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.cookie p { margin: 0; flex: 1 1 240px; }
.cookie a { color: var(--ink); }
.cookie .btn-plain { width: auto; min-height: 44px; padding: 8px 24px; }

/* До запуска: плашка вверху страницы */
.prelaunch { background: var(--warn); color: var(--ink); text-align: center; font-size: 14px; line-height: 1.5; padding: 10px var(--gutter); border-bottom: 1.5px dashed var(--stitch); }

/* Примеры голосов на главной */
.voice-list { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 560px) { .voice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) { .voice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.voice-card { background: var(--night); color: var(--thread); border-radius: 20px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.voice-head { display: grid; gap: 2px; }
.voice-head b { font: 600 17px var(--display); }
.voice-head span { font-size: 15px; color: var(--on-night-2); }
.voice-card .player { background: transparent; padding: 0; }
.voice-card .btn-plain { min-height: 44px; justify-self: start; }
.voice-card .btn-plain.picked { border-style: solid; }
.voice-card .btn-outline { border-color: var(--thread); color: var(--thread); }
