/* own copies of the fonts (SIL OFL, src/book/assets/fonts): no visitor requests to Google servers abroad */
@font-face { font-family: "Playfair Display"; src: url("/fonts/PlayfairDisplay-VF.ttf") format("truetype"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/PlayfairDisplay-Italic-VF.ttf") format("truetype"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/fonts/PTSerif-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/fonts/PTSerif-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/fonts/PTSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
/* Айлетопись: стиль «Тушь» (design/STYLE.md). Яркий фон, чёрная тушь, белый овал. Mobile-first, no frameworks. */
:root {
  --ground: #6BE04F;
  --paper: #FBF7EC;
  --paper-2: #F1ECDD;
  --card: #fff;
  --ink: #111;
  --ink-soft: #4a4a42;
  --line: #111;
  --line-soft: #d9d3c2;
  --accent: #111;
  --accent-ink: #FBF7EC;
  --accent-soft: #d8f6cd;
  --ok: #2f7a3a;
  --warn: #b7791f;
  --bad: #b3261e;
  --radius: 8px;
  --shadow: none;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Serif", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 18px/1.55 var(--serif);
}
a { color: var(--ink); text-underline-offset: 4px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(36px, 8vw, 64px); }
h2 { font-size: clamp(28px, 6vw, 48px); margin-top: 1.4em; }
h3 { font-size: 24px; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }
.label { font-size: 14px; letter-spacing: .22em; text-transform: uppercase; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* header / footer */
.top { background: var(--ground); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-size: 24px; color: var(--ink); text-decoration: none; }
.logo span { color: inherit; }
.nav { display: none; gap: 6px 18px; flex-wrap: wrap; margin-left: auto; font-size: 16px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.top-cta { margin-left: auto; }
@media (max-width: 719px) {
  .top .wrap { gap: 8px; flex-wrap: nowrap; min-height: 58px; }
  .logo { font-size: 20px; white-space: nowrap; }
  .top .top-cta { padding: 8px 12px; font-size: 14px; white-space: nowrap; }
  .mnav summary { padding: 6px 12px; font-size: 14px; }
}
.mnav { position: relative; }
.mnav summary { list-style: none; cursor: pointer; border: 2px solid var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 15px; }
.mnav summary::-webkit-details-marker { display: none; }
.mnav nav { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 10px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 210px; z-index: 10; }
.mnav nav a { color: var(--ink); text-decoration: none; font-size: 17px; }
.foot { background: var(--ink); color: var(--paper); margin-top: 72px; padding: 36px 0 44px; font-size: 15px; }
.foot a { color: var(--paper); }
.foot .brand { font-family: var(--display); font-size: 26px; margin-bottom: 14px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 12px; }

/* buttons */
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 14px 28px; font: 18px var(--serif);
  background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: #333; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost:hover { background: rgba(0, 0, 0, .06); }
.btn.soft { background: var(--accent-soft); color: var(--ink); }
.btn.small { padding: 9px 16px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--ink); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* landing */
.hero { background: var(--ground); padding: 16px 0 56px; }
.hero .wrap { display: grid; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(42px, 11vw, 64px); line-height: .98; letter-spacing: -.02em; margin: 14px 0 20px; }
.facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 16px; }
.facts b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.hero p.lead { font-size: clamp(19px, 2.4vw, 25px); font-style: italic; max-width: 520px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.hero .art { width: 100%; max-width: 540px; justify-self: center; }
.counter { display: inline-block; margin-top: 18px; font-size: 16px; border-bottom: 1.5px solid var(--ink); }
.steps3 { display: grid; gap: 32px; margin: 28px 0 8px; }
.step3 img { width: 200px; height: auto; margin-bottom: 6px; }
.step3 b { display: block; font-family: var(--display); font-weight: 400; font-size: 52px; line-height: 1; margin: 4px 0 6px; }
.step3 strong { font-size: 22px; }
.gift { background: var(--ground); padding: 56px 0; margin-top: 72px; }
.gift .wrap { display: grid; gap: 24px; align-items: center; }
.gift h2 { margin-top: 0; }

/* cards / grids */
.grid { display: grid; gap: 14px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; }
.bookcard { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.bookcard img { border-radius: 3px; border: 1.5px solid var(--ink); }
.tag { display: inline-block; font-size: 13px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 10px; margin: 0 4px 6px 0; }
.price { font-family: var(--display); font-size: 40px; }
.tier { display: flex; flex-direction: column; }
.tier:nth-child(3n+1) { background: #6BE04F; } .tier:nth-child(3n+2) { background: #FF8F3A; } .tier:nth-child(3n+3) { background: #62C8F2; }
.tier h3 { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.tier .muted { color: var(--ink); font-style: italic; }
.tier.recommended { border-width: 3px; }
.badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.review { font-family: var(--serif); }
.review .stars { letter-spacing: 2px; }
details.faq { border-bottom: 1.5px solid var(--line); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 700; }

/* forms */
label { display: block; font-weight: 700; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: 14px; }
input[type=text], input[type=email], input[type=tel], input[type=number], textarea, select {
  width: 100%; font: 17px var(--serif); color: var(--ink); background: #fff; border: 1.5px solid var(--line);
  border-radius: 6px; padding: 12px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--ground); outline-offset: 1px; }
.err { color: var(--bad); font-size: 14px; margin-top: 6px; }
input.field-error, textarea.field-error, select.field-error { border-color: var(--bad); }
.choices.field-error .choice { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.check input { margin-top: 5px; width: 20px; height: 20px; flex: none; }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { border: 2px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.choice small { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.choice.on { box-shadow: inset 0 0 0 1px var(--ink); background: var(--ground); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-box { border: 2px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 12px; font: 14px var(--serif); cursor: pointer; }
.chip:hover { background: var(--ground); }
.likebtn { display: inline-flex; align-items: center; gap: 6px; }
.listen { max-width: 680px; margin: 14px auto; }
.reader .speaking { background: var(--accent-soft); border-radius: 6px; }
.og-card { text-align: center; padding: 40px 16px; }
.og-card h1 { font-size: clamp(30px, 8vw, 48px); }

/* wizard */
.flowtop .wrap { justify-content: space-between; }
.progress { height: 10px; background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 99px; overflow: hidden; margin: 18px 0 6px; }
.progress div { height: 100%; background: var(--ground); transition: width .25s; }
.stepno { font-size: 14px; color: var(--ink-soft); }
.wstep { display: none; }
.wstep.on { display: block; }
.wnav { display: flex; gap: 10px; justify-content: space-between; margin: 26px 0; }
.summary dt { font-weight: 600; margin-top: 10px; }
.summary dd { margin: 2px 0 0; color: var(--ink-soft); }
.notice { background: var(--paper-2); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.notice.bad { background: #fbe4e1; color: #6b1a14; }
.notice.ok { background: #e2f1e4; color: #1f4a28; }

/* order */
.status-line { display: flex; align-items: center; gap: 10px; font-size: 24px; font-family: var(--display); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); flex: none; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
.pipeline { list-style: none; padding: 0; margin: 16px 0; }
.pipeline li { padding: 6px 0 6px 28px; position: relative; color: var(--ink-soft); }
.pipeline li::before { content: ""; position: absolute; left: 6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-soft); }
.pipeline li.done { color: var(--ink); } .pipeline li.done::before { background: var(--ok); border-color: var(--ok); }
.pipeline li.now { color: var(--ink); font-weight: 600; } .pipeline li.now::before { background: var(--warn); border-color: var(--warn); }

/* reader */
.reader { font-family: var(--serif); font-size: 19px; line-height: 1.7; max-width: 680px; margin: 0 auto; }
.reader p { text-indent: 1.4em; margin: 0 0 .35em; }
.reader h2 { text-align: center; margin: 28px 0 22px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 28px auto; max-width: 680px; }

/* admin */
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { border-bottom: 1px solid var(--line-soft); padding: 7px 6px; text-align: left; vertical-align: top; }
.admin .num { text-align: right; white-space: nowrap; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 8px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.alert.red { background: #b3261e; color: #fff; } .alert.yellow { background: #fbe8c8; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-family: var(--serif); font-size: 24px; }
.bar { background: var(--accent-soft); height: 10px; border-radius: 99px; }
.bar div { background: var(--ink); height: 100%; border-radius: 99px; }
pre.json { white-space: pre-wrap; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px; font-size: 13px; }

@media (min-width: 720px) {
  .top { position: sticky; top: 0; z-index: 5; }
  .nav { display: flex; }
  .top-cta { margin-left: 8px; }
  .mnav { display: none; }
  .steps3 { grid-template-columns: repeat(3, 1fr); }
  .gift .wrap { grid-template-columns: 1fr 1fr; }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .bookcard { grid-template-columns: 120px 1fr; }
}

@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.05fr 1fr; }
  .hero h1 { font-size: clamp(56px, 5.6vw, 78px); }
  .hero .art { justify-self: end; }
}

.promo { margin: 14px 0 4px; }
.promo summary { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

.choices.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.choices.compact .choice { padding: 10px 12px; font-size: 15px; line-height: 1.3; }
.forself .lead-sm { font-size: 19px; max-width: 640px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 22px; max-width: 680px; }
.ticks li { padding-left: 28px; position: relative; margin: 10px 0; }
.ticks li::before { content: "✦"; position: absolute; left: 0; color: var(--accent, currentColor); }
.hero .hint-line { font-size: 18px; margin: 4px 0 22px; max-width: 520px; }
/* online consultant */
.chat-open { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; align-items: center; gap: 8px; background: var(--ink, #111); color: #FBF7EC; border: 3px solid var(--ground); border-radius: 999px; padding: 12px 20px 12px 16px; font: inherit; font-size: 17px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.28); animation: chat-pulse 2.4s ease-out 2s 3; }
.chat-open:hover { transform: translateY(-2px); }
.chat-open svg { display: block; }
.chat-dot { position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ground); border: 2px solid var(--ink, #111); }
.chat-open .chat-dot { top: -2px; right: 2px; }
.chat-online { display: flex; align-items: center; gap: 6px; font-family: var(--body, inherit); font-size: 13px; color: #555; }
.chat-online .chat-dot { position: static; border-color: #fff; box-shadow: 0 0 0 1px #9c9; }
@keyframes chat-pulse { 0% { box-shadow: 0 6px 20px rgba(0,0,0,.28), 0 0 0 0 rgba(107,224,79,.7); } 70% { box-shadow: 0 6px 20px rgba(0,0,0,.28), 0 0 0 16px rgba(107,224,79,0); } 100% { box-shadow: 0 6px 20px rgba(0,0,0,.28), 0 0 0 0 rgba(107,224,79,0); } }
.chat-hello { position: fixed; right: 18px; bottom: 86px; z-index: 50; width: min(280px, calc(100vw - 36px)); box-sizing: border-box; background: #fff; border: 2px solid var(--ink, #111); border-radius: 14px 14px 4px 14px; padding: 12px 30px 12px 14px; font-size: 15px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; animation: chat-in .35s ease-out; }
.chat-hello[hidden] { display: none; }
.chat-hello-x { position: absolute; top: 4px; right: 6px; background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: #666; }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chat-open, .chat-hello { animation: none; } }
@media (max-width: 600px) { .chat-open { padding: 12px; } .chat-open-label { display: none; } .chat-hello { bottom: 84px; } }
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 51; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column; background: #fff; border: 2px solid var(--ink, #111); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.chat[hidden], .chat-open[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #ddd; font-family: var(--display); background: var(--ground); border-radius: 12px 12px 0 0; }
.chat-head button { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.chat .msg { padding: 8px 12px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; font-size: 15px; line-height: 1.4; }
.chat .msg.bot { background: #f3efe3; align-self: flex-start; }
.chat .msg.me { background: var(--ink, #111); color: #FBF7EC; align-self: flex-end; }
.chat-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #ddd; }
.chat-form input { flex: 1; min-width: 0; margin: 0; }
.chat-note { margin: 0; padding: 0 14px 10px; font-size: 12px; color: #666; }
.chat .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat .chip { border: 1px solid var(--ink, #111); background: #fff; border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.chat .chip:hover { background: #f3efe3; }
/* reader as a book */
.book { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 18px auto 10px; perspective: 1800px; max-width: none; }
.book .page { box-sizing: border-box; width: min(460px, 100%); min-height: 600px; background: #fffdf7; border: 1px solid #d9d2bf; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 34px 32px 48px; position: relative; font-size: 17px; line-height: 1.6; }
.book .page h2 { margin-top: 0; }
.book .pno { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 13px; color: #8a8372; }
.book .cover-page { padding: 0; overflow: hidden; background: none; border: 0; box-shadow: none; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.book .cover-page img { box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.book .cover-page img { width: 100%; height: auto; display: block; }
.book.js { gap: 0; flex-wrap: nowrap; }
.book.js .page { display: none; }
.book.js .page.on { display: block; }
.book.js .cover-page.on { display: flex; }
@media (min-width: 960px) {
  .book.js .page.on + .page.on { border-left: 1px dashed #e4dccb; }
}
.book .page.turn-next { animation: turn-next .35s ease; transform-origin: left center; }
.book .page.turn-prev { animation: turn-prev .35s ease; transform-origin: right center; }
@keyframes turn-next { from { transform: rotateY(-35deg); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes turn-prev { from { transform: rotateY(35deg); opacity: .35; } to { transform: none; opacity: 1; } }
.book-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 6px 0 18px; }
.book-nav[hidden] { display: none; }
.chat .chip.cta { background: var(--ink, #111); color: #FBF7EC; text-decoration: none; border-color: var(--ink, #111); }
/* order flow: keep the chat button clear of the «Далее» button on phones */
@media (max-width: 600px) { body:has(.flowtop) .chat-open { right: auto; left: 18px; } body:has(.flowtop) .chat-hello { right: auto; left: 18px; border-radius: 14px 14px 14px 4px; } }
/* referral bonuses: available vs waiting (greyed, unlocks in 24 h) */
.bonus-box { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
.bonus-box > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 12px; min-width: 130px; }
.bonus-box b { font-family: var(--display); font-size: 26px; font-weight: 400; }
.bonus-active { background: var(--ground); border: 2px solid var(--ink, #111); }
.bonus-pending { background: #f1efe9; border: 2px dashed #b9b4a6; color: #8a8578; }
.bonus-pending b::before { content: "⏳ "; font-size: 18px; }
/* checkout: the promo code is visible, not hidden */
.promo-box { border: 2px dashed var(--ink, #111); border-radius: 12px; padding: 12px 14px; margin: 14px 0; background: #fffdf5; }
.promo-row { gap: 8px; margin-top: 6px; flex-wrap: nowrap; }
.promo-row input { flex: 1; min-width: 0; margin: 0; text-transform: uppercase; }
.audio-sample { border: 2px solid var(--ink, #111); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: #fff; }
.btn.gift-btn { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.gift-btn:hover { background: #fffdf5; }
.pager[hidden] { display: none; }
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 720px; margin: 0 auto;
  background: #fff; border: 2px solid var(--ink, #111); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1 1 280px; font-size: 14px; }
.cookie-actions { display: flex; gap: 8px; }
