@font-face { font-family: "Lit"; src: url("fonts/literata-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lit"; src: url("fonts/literata-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "One"; src: url("fonts/onest.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root { --ink: #1C1B19; --soft: #5E5A52; --faint: #8F8A80; --paper: #FAF8F3; --card: #FFFFFF; --rule: #E4DFD4;
  --tint: #F2EEE5; --accent: #C2410C; --ok: #2F6B3A; --r: 12px; --nav: 62px; --pad: 20px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 "One", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 12px); overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); }

/* шапка */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(250,248,243,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule); }
.bar-in { display: flex; justify-content: space-between; align-items: baseline; padding: 14px var(--pad) 12px; }
.logo { font: 600 20px "Lit", Georgia, serif; letter-spacing: -.01em; }
.logo i { font-style: normal; color: var(--accent); }
.bar-tag { font-size: 13px; color: var(--faint); }

.wrap { padding: 0 var(--pad); }
.screen { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } }

/* первый экран */
.hero { padding: 28px 0 8px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 10px; }
.hero h1 { font: 600 32px/1.18 "Lit", Georgia, serif; letter-spacing: -.015em; }
.hero p { margin-top: 14px; font-size: 16px; color: var(--soft); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0 4px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { padding: 14px 0 12px; }
.facts div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.facts b { display: block; font: 600 24px/1.1 "Lit", Georgia, serif; }
.facts small { font-size: 13px; color: var(--faint); }

/* фильтр уровней */
.chips { display: flex; gap: 22px; overflow-x: auto; margin: 22px calc(-1 * var(--pad)) 0; padding: 0 var(--pad); border-bottom: 1px solid var(--rule); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 10px 0 11px; font-size: 15px; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.chip.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

/* список курсов */
.list { display: block; }
.course { display: grid; grid-template-columns: 34px 1fr; gap: 0 12px; width: 100%; padding: 20px 0; border-bottom: 1px solid var(--rule);
  animation: fade .35s ease both; }
.course:active { background: var(--tint); }
.course .n { font: 500 15px/1.6 "Lit", Georgia, serif; color: var(--faint); padding-top: 1px; }
.course .body { min-width: 0; }
.course .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.course h3 { font: 600 19px/1.3 "Lit", Georgia, serif; letter-spacing: -.01em; }
.price { font-weight: 600; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.course p { margin-top: 6px; font-size: 14.5px; line-height: 1.5; color: var(--soft); }
.course .meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--faint); }
.lvl { color: var(--ink); font-weight: 600; }
.lvl.Флагман { color: var(--accent); }
.course.own .price { color: var(--ok); font-size: 13px; }
.course.flag { margin: 8px calc(-1 * var(--pad)) 0; padding: 22px var(--pad); width: calc(100% + 2 * var(--pad)); background: var(--tint); border-bottom: 0; }

.note { margin: 22px 0 10px; font-size: 13.5px; color: var(--faint); }

/* карточка курса */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet .dim { position: absolute; inset: 0; background: rgba(28,27,25,.4); animation: fade .2s both; }
.sheet .pane { position: relative; max-height: 93vh; overflow-y: auto; background: var(--paper); border-radius: 18px 18px 0 0;
  animation: up .3s cubic-bezier(.2,.8,.2,1) both; padding-bottom: 100px; }
@keyframes up { from { transform: translateY(100%); } }
.pane-head { padding: 26px var(--pad) 18px; border-bottom: 1px solid var(--rule); position: relative; }
.pane-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--rule); }
.pane-head .k { font-size: 13px; color: var(--faint); padding-right: 44px; }
.pane-head h2 { font: 600 27px/1.2 "Lit", Georgia, serif; letter-spacing: -.015em; margin: 8px 0 10px; padding-right: 30px; }
.pane-head p { color: var(--soft); }
.x { position: absolute; right: 14px; top: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--soft); font-size: 15px; text-align: center; }
.blk { padding: 18px var(--pad) 0; }
.blk h4 { font-size: 13px; font-weight: 600; color: var(--faint); margin-bottom: 8px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tools span { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--tint); }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { display: grid; grid-template-columns: 30px 1fr; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.toc li:last-child { border-bottom: 0; }
.toc li span { font: 500 14px "Lit", Georgia, serif; color: var(--faint); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stats3 div { padding: 12px 0; }
.stats3 div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.stats3 b { display: block; font: 600 22px/1.1 "Lit", Georgia, serif; }
.stats3 small { font-size: 13px; color: var(--faint); }

.peek-btn { width: 100%; padding: 13px 16px; border: 1px solid var(--ink); border-radius: var(--r); font-weight: 600; text-align: center; }
.peek { margin-top: 14px; padding: 18px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); font-size: 15px; position: relative; }
.peek p { margin: 0 0 10px; }
.peek h2 { font: 600 18px/1.3 "Lit", Georgia, serif; margin: 16px 0 8px; }
.peek ul, .peek ol { padding-left: 20px; margin: 0 0 10px; }
.peek table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.peek th { text-align: left; font-weight: 600; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--ink); }
.peek td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.peek .bx { margin: 14px 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--tint); border-radius: 0 8px 8px 0; }
.peek .bx-h { font-size: 12.5px; color: var(--soft); margin-bottom: 4px; }
.peek .bx-h b { color: var(--accent); }
.peek .bx.prompt pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; margin: 0; }
.peek::after { content: "Продолжение — в полной версии курса"; display: block; margin: 10px -18px -18px; padding: 34px 18px 16px;
  text-align: center; font-size: 13px; color: var(--faint); background: linear-gradient(rgba(255,255,255,0), #fff 55%); border-radius: 0 0 var(--r) var(--r); }

.buybar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: flex; gap: 14px; align-items: center;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--rule); }
.buybar .sum { font: 600 22px "Lit", Georgia, serif; white-space: nowrap; }
.btn { flex: 1; padding: 14px 16px; border-radius: var(--r); background: var(--ink); color: #fff; font-weight: 600; font-size: 16px; text-align: center;
  transition: opacity .15s; }
.btn:active { opacity: .82; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn[disabled] { opacity: .4; }

/* окна оплаты */
.sheet.modal { z-index: 50; }
.modal .pane { padding: 28px var(--pad) calc(22px + env(safe-area-inset-bottom)); }
.modal h3 { font: 600 23px/1.25 "Lit", Georgia, serif; margin-bottom: 10px; }
.modal p { color: var(--soft); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.way { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 16px; margin-top: 10px;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.way b { display: block; font-weight: 600; }
.way small { color: var(--faint); font-size: 13.5px; }
.way i { font-style: normal; color: var(--faint); }
.field { width: 100%; padding: 13px 14px; margin: 14px 0; font: 16px "One", sans-serif; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); outline: none; }
.field:focus { border-color: var(--ink); }
.req { white-space: pre-wrap; margin: 14px 0; padding: 14px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); font-size: 15px; }
.row2 { display: flex; gap: 10px; margin-top: 14px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* полка */
.h-sec { font: 600 28px/1.2 "Lit", Georgia, serif; letter-spacing: -.015em; margin: 28px 0 8px; }
.shelf-item { padding: 18px 0; border-bottom: 1px solid var(--rule); animation: fade .3s both; }
.shelf-item h3 { font: 600 19px/1.3 "Lit", Georgia, serif; margin: 4px 0 2px; }
.shelf-item .lvl { font-size: 13px; color: var(--faint); font-weight: 400; }
.shelf-item .btn { font-size: 15px; padding: 11px 12px; }
.empty { padding: 36px 0; color: var(--soft); }
.empty b { display: block; font: 600 22px "Lit", Georgia, serif; color: var(--ink); margin-bottom: 6px; }
.empty .btn { display: inline-block; flex: none; }
.pending { margin: 12px 0; padding: 12px 14px; border-radius: var(--r); background: #FFF4E5; font-size: 14px; color: #7A4A12; }

/* помощь */
.thread { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 15px; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.staff { align-self: flex-start; background: var(--card); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.msg small { display: block; margin-top: 4px; font-size: 11.5px; opacity: .6; }
textarea.field { min-height: 100px; resize: vertical; margin-bottom: 4px; }
.cnt { text-align: right; font-size: 12px; color: var(--faint); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.tickets { margin: 16px 0 4px; border-top: 1px solid var(--rule); }
.tk { display: block; width: 100%; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.tk-top { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.tk-top b { font: 600 17px "Lit", Georgia, serif; }
.tk-top em { font-style: normal; font-size: 12.5px; color: var(--ok); }
.tk.closed .tk-top em, .tk.closed b { color: var(--faint); }
.tk-top small { margin-left: auto; color: var(--faint); font-size: 12.5px; }
.tk-new { font-style: normal; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); padding: 1px 8px; border-radius: 999px; }
.tk-last { display: block; margin-top: 3px; font-size: 14.5px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-state { font-size: 14px; color: var(--ok); }
.tk-state.closed { color: var(--faint); }
.back { margin-top: 20px; font-size: 14px; color: var(--soft); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { padding: 14px 24px 14px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; color: var(--faint); font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 14px; color: var(--soft); font-size: 15px; }

/* соглашение */
.terms h2 { font: 600 18px/1.3 "Lit", Georgia, serif; margin: 22px 0 6px; }
.terms p, .terms li { font-size: 15px; color: #33312C; }
.terms ol { padding-left: 20px; margin: 0; }
.terms li { margin-bottom: 6px; }

/* навигация */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(250,248,243,.96); border-top: 1px solid var(--rule); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--faint); position: relative; text-align: center; }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--ink); font-weight: 600; }
.dot { position: absolute; top: 9px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.toast { position: fixed; z-index: 60; left: var(--pad); right: var(--pad); bottom: calc(var(--nav) + 16px); padding: 13px 16px;
  border-radius: var(--r); background: var(--ink); color: #fff; font-size: 15px; animation: fade .2s both; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.load { padding: 60px 0; text-align: center; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* демо-счёт USDT */
.demo-tag { display: inline-block; margin-bottom: 12px; padding: 4px 10px; border-radius: 999px; background: #FFF4E5; color: #7A4A12; font-size: 13px; font-weight: 600; }
.inv { margin: 16px 0 12px; padding: 4px 16px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.inv-sum { padding: 14px 0 12px; border-bottom: 1px solid var(--rule); font-size: 16px; color: var(--soft); }
.inv-sum b { font: 600 32px/1 "Lit", Georgia, serif; color: var(--ink); margin-right: 4px; }
.inv-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.inv-row:last-child { border-bottom: 0; }
.inv-row span { color: var(--faint); }
.inv-addr { padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r); background: var(--tint); font-size: 14px; color: var(--soft); }
.inv-steps { margin-bottom: 12px; font-size: 14px; color: var(--soft); }
.inv-steps div { padding: 3px 0; animation: fade .25s both; }
.inv-steps .ok { color: var(--ok); font-weight: 600; }
.inv-sum .cp { float: right; margin-top: 8px; }
.cp { font-size: 13px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.inv-wallet { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; padding: 12px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.inv-wallet img { flex: none; border-radius: 6px; }
.inv-wallet small { color: var(--faint); font-size: 12.5px; }
.inv-wallet .addr { font-size: 13px; word-break: break-all; margin: 4px 0 6px; font-family: ui-monospace, Menlo, monospace; }
