
:root {
  --bg: #faf9f7; --surface: #ffffff; --surface-2: #f4f3f0; --rule: #e7e5e1; --rule-2: #d6d3cd;
  --ink: #1d1d1f; --ink-2: #44403c; --muted: #78716c;
  --accent: #1d4ed8; --accent-soft: rgba(29,78,216,.08);
  --mark: rgba(250,204,21,.38); --minus: #b45309; --plus: #047857;
  --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px; --tap: 44px;
}
.dark {
  --bg: #131313; --surface: #1b1b1b; --surface-2: #222222; --rule: #2b2b2b; --rule-2: #3a3a3a;
  --ink: #e8e6e3; --ink-2: #c9c5bf; --muted: #9a948d;
  --accent: #8ab4ff; --accent-soft: rgba(138,180,255,.10);
  --mark: rgba(250,204,21,.20); --minus: #fbbf24; --plus: #6ee7b7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16.5px/1.7 var(--sans); }
b, strong { font-weight: 650; }
a { color: var(--accent); }


.bar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.bar.scrolled { border-bottom-color: var(--rule); }
.bar-in { max-width: 1160px; margin: 0 auto; height: 56px; padding: 0 8px; display: flex; align-items: center; gap: 2px; }
.ib { min-width: var(--tap); height: var(--tap); border: 0; background: none; color: var(--ink-2); border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; padding: 0; text-decoration: none; }
.ib:hover { background: var(--surface-2); color: var(--ink); }
.ib svg { width: 21px; height: 21px; }
.bar-t { flex: 1; min-width: 0; font: 700 15px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.bar.scrolled .bar-t { opacity: 1; transform: none; }
.mode { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--rule-2);
  background: var(--surface); color: var(--ink-2); font: 600 13px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.mode i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.mode[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mode[aria-pressed="true"] i { background: currentColor; }
.prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); }


.layout { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .layout { grid-template-columns: 240px minmax(0, 680px); gap: 64px; justify-content: center; } }
.toc { display: none; }
@media (min-width: 1080px) { .toc { display: block; position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 88px); overflow: auto; padding: 32px 0 24px; } }
.toc h6, .sheet h6 { margin: 18px 0 6px; font: 650 11.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc h6:first-child { margin-top: 0; }
.toc a, .sheet a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--rule); color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; }
.toc a:hover, .sheet a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
main { min-width: 0; padding-bottom: 96px; }
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 78vh; overflow: auto; background: var(--surface); border-radius: 999px 16px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateY(102%); transition: transform .25s ease; }
.sheet::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 8px; background: var(--rule-2); margin: 0 auto 6px; }
.sheet a { padding: 9px 0 9px 12px; font-size: 15px; }
.sheet-open .sheet-bg { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; }
@media (min-width: 1080px) { #tocBtn { display: none; } }


.head { padding: 36px 0 8px; }
.kicker { font: 600 12.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kicker a { color: inherit; text-decoration: none; }
h1 { margin: 10px 0 12px; font: 700 clamp(30px, 6.6vw, 42px)/1.12 var(--serif); letter-spacing: -.01em; }
.meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; color: var(--muted); }
.legend { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.mainq { margin: 26px 0 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); }
.mainq small { display: block; font: 600 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mainq p { margin: 2px 0 0; font: 400 18px/1.45 var(--serif); }
.recall-note { display: none; margin: 16px 0 0; padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink-2); font-size: 14px; }
.recall .recall-note { display: block; }


.mini { margin-top: 40px; }
.dl { margin: 12px 0 0; border-top: 1px solid var(--rule); }
.dl div { display: grid; grid-template-columns: 128px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 1.45; }
.dl dt { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--accent); }
.dl dd { margin: 0; color: var(--ink-2); }
@media (max-width: 420px) { .dl div { grid-template-columns: 100px 1fr; gap: 10px; } }


section.s { margin-top: 48px; }
h2.sec { margin: 0 0 12px; font: 700 23px/1.25 var(--serif); }
h2.sec .n { color: var(--muted); font-weight: 400; margin-right: 8px; }
h3 { margin: 26px 0 8px; font: 700 18px/1.3 var(--serif); }
.part { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--ink); }
.part-k { font: 600 12.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.part h2 { margin: 6px 0 0; font: 700 clamp(24px, 5vw, 30px)/1.15 var(--serif); }
p { margin: 0 0 14px; }
main p, main li { hyphens: auto; -webkit-hyphens: auto; }
mark { background: linear-gradient(transparent 58%, var(--mark) 58%); color: inherit; padding: 0 1px; border-radius: 8px; font-weight: 650; }
.bg, .aside { color: var(--muted); font-size: 14.5px; }
.ref { display: inline-block; font: 600 12px/1 var(--sans); color: var(--muted); border: 1px solid var(--rule-2); border-radius: 8px; padding: 3px 6px; vertical-align: 2px; white-space: nowrap; text-decoration: none; }
a.ref:hover { color: var(--accent); border-color: var(--accent); }
.q { display: block; margin: 16px 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--rule-2); font: italic 400 17.5px/1.55 var(--serif); color: var(--ink-2); }
.why { font-weight: 650; margin: 0 0 4px; }
.so { position: relative; padding-left: 22px; }
.so::before { content: '⇒'; position: absolute; left: 0; color: var(--accent); }
details.qs { margin: 6px 0 0; border-top: 1px solid var(--rule); }
details.qs summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: var(--tap); font-size: 14px; color: var(--muted); font-weight: 600; }
details.qs summary::-webkit-details-marker { display: none; }
details.qs summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin: 0 4px 0 2px; }
details.qs[open] summary::before { transform: rotate(45deg); }
details.qs ol { margin: 0 0 12px; padding-left: 22px; font-size: 15px; color: var(--ink-2); }


.fig { margin: 22px 0 24px; }
.figcap { margin-top: 8px; font-size: 13px; color: var(--muted); }
.fig h4 { margin: 0 0 6px; font: 600 11.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
b.h { display: block; font: 600 11.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }

.chain { display: flex; align-items: stretch; gap: 0; }
.chain > div { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.chain > div.k { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--rule)); }
.chain > div.k b.h { color: var(--accent); }
.chain > i { flex: 0 0 18px; display: flex; align-items: center; justify-content: center; font-style: normal; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
  .chain { flex-direction: column; }
  .chain > i { flex-basis: 20px; transform: rotate(90deg); }
}

.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.flow:has(> div:nth-child(4)) { grid-template-columns: repeat(2, 1fr); }
.flow > div { padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.arrowdown { text-align: center; color: var(--muted); font-size: 16px; line-height: 1; margin: 6px 0; }
.goal { padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); font-size: 15px; text-align: center; color: var(--ink); }
@media (max-width: 600px) { .flow, .flow:has(> div:nth-child(4)) { grid-template-columns: 1fr !important; } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > div { border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); padding: 12px 14px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.two > .view { border: 0; border-left: 3px solid var(--accent); border-radius: 0; background: none; }
.plus, .minus { display: grid; grid-template-columns: 16px 1fr; margin: 6px 0; }
.plus::before { content: '+'; color: var(--plus); font-weight: 700; }
.minus::before { content: '−'; color: var(--minus); font-weight: 700; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr !important; } }

.line { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.line > div { position: relative; padding: 22px 12px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.line > div::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: var(--rule-2); }
.line > div::after { content: ''; position: absolute; left: 0; top: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--muted); }
.line > div.now::after { background: var(--accent); border-color: var(--accent); }
.line b { display: block; color: var(--ink); font-weight: 650; margin-bottom: 2px; }
@media (max-width: 600px) {
  .line { grid-auto-flow: row; }
  .line > div { padding: 0 0 14px 22px; }
  .line > div::before { left: 4px; right: auto; top: 10px; bottom: 0; width: 1px; height: auto; }
  .line > div:last-child::before { display: none; }
  .line > div::after { top: 6px; }
}

.vert { display: grid; justify-items: center; }
.vert > .b { width: min(100%, 460px); text-align: center; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--surface); padding: 10px 14px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.vert > .b b { display: block; color: var(--ink); font-size: 15px; }
.vert > .a { font-size: 12.5px; color: var(--muted); padding: 4px 0; text-align: center; }

.tbl { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--rule); }
tr:first-child th { border-top: 0; font: 600 12.5px/1.3 var(--sans); color: var(--muted); background: var(--surface-2); }
td:first-child { color: var(--muted); }
td:first-child:has(mark, b) { color: var(--ink); }
tr.sim td { background: var(--surface-2); }
@media (max-width: 560px) { table { font-size: 13.5px; } th, td { padding: 9px 8px; } }

.mech { display: grid; grid-template-columns: 1fr 18px 1.4fr 18px 1fr; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); overflow: hidden; font-size: 14px; line-height: 1.4; }
.mech > div { padding: 10px 12px; color: var(--ink-2); border-top: 1px solid var(--rule); }
.mech > i { font-style: normal; color: var(--muted); display: flex; align-items: center; justify-content: center; border-top: 1px solid var(--rule); }
.mech > .hd { font: 600 12px/1.3 var(--sans); color: var(--muted); background: var(--surface-2); border-top: 0; }
.mech > i:nth-child(-n+5) { background: var(--surface-2); border-top: 0; }
.mech > .w { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
@media (max-width: 600px) {
  .mech { grid-template-columns: 1fr; }
  .mech > i, .mech > .hd { display: none; }
  .mech > div { border-top: 0; padding: 2px 14px; }
  .mech > :nth-child(5n+1) { border-top: 1px solid var(--rule); padding-top: 12px; font-weight: 650; color: var(--ink); }
  .mech > :nth-child(5n+1):nth-child(6) { border-top: 0; }
  .mech > :nth-child(5n+3)::before { content: 'как: '; color: var(--muted); }
  .mech > :nth-child(5n)::before { content: '→ '; color: var(--muted); }
  .mech > :nth-child(5n) { padding-bottom: 12px; }
}

.dates { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; font-size: 15px; margin: 0 0 14px; }
.dates > b { color: var(--accent); font-variant-numeric: tabular-nums; }


.ramp { display: grid; gap: 6px; }
.ramp > div { width: var(--w); min-width: 260px; max-width: 100%; padding: 8px 12px; border-radius: 8px; font-size: 14px; line-height: 1.35; color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--surface)); border: 1px solid var(--rule); }
.ramp > div b { display: inline-block; min-width: 92px; color: var(--ink); font-weight: 650; }
.ramp > div.top { background: var(--accent); border-color: var(--accent); color: #fff; }
.ramp > div.top b { color: #fff; }
.dark .ramp > div.top, .dark .ramp > div.top b { color: #0b1220; }
.ramp p { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 0; padding-top: 6px; border-top: 1px solid var(--rule-2); font-size: 12.5px; color: var(--muted); }


.dpw .top2 { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.dpw .row3 { display: grid; grid-template-columns: 1fr 100px 1fr; }
.dpw .bx { border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--surface); padding: 12px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.dpw .bx .big { display: block; margin: 6px 0 2px; font: 700 15px/1.25 var(--serif); color: var(--ink); text-transform: none; }
.dpw .sm2 { font-size: 12.5px; color: var(--muted); }
.dpw .ar { font-size: 12px; color: var(--muted); margin: 4px 0; }
.dpw .lab { margin-top: 6px; font-weight: 650; }
.dpw .mid2 { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--muted); font-size: 22px; line-height: 1; }
.dpw .mid2 span { font-size: 11px; line-height: 1.3; margin-top: 4px; }
.dpw .low > div { font-size: 12.5px; text-align: center; color: var(--muted); padding-top: 6px; line-height: 1.4; }
@media (max-width: 560px) { .dpw .row3 { grid-template-columns: 1fr; } .dpw .mid2 { padding: 8px 0; } .dpw .row3.low { display: none; } }


.mapbox { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: #fcfbf8; }
.mapbox > div { width: 100% !important; }
.mapbox svg { display: block; width: 100%; height: auto; }
.dark .mapbox { filter: brightness(.92); }


.ege details { border-top: 1px solid var(--rule); }
.ege details:last-child { border-bottom: 1px solid var(--rule); }
.ege summary { list-style: none; cursor: pointer; padding: 14px 32px 14px 0; position: relative; font-weight: 600; line-height: 1.45; }
.ege summary::-webkit-details-marker { display: none; }
.ege summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font: 400 22px/1 var(--sans); color: var(--muted); transition: transform .2s; }
.ege details[open] summary::after { transform: rotate(45deg); }
.ege .ans { padding: 0 0 16px; color: var(--ink-2); font-size: 15.5px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }


.cards { border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); padding: 14px; }
.card { min-height: 150px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--bg); padding: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; user-select: none; }
.card .ct { font: 700 21px/1.3 var(--serif); }
.card .cd { display: none; margin-top: 10px; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.card.open .cd { display: block; }
.card small { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.card.open small { display: none; }
.cards-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cards-foot span { flex: 1; font-size: 13.5px; color: var(--muted); min-width: 110px; }
.btn { min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 600 14px/1 var(--sans); cursor: pointer; }
.btn.ghost { background: none; color: var(--ink); border-color: var(--rule-2); }


.gl { margin: 8px 0 0; }
.gl div { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; }
.gl dt { font-weight: 650; display: inline; }
.gl dt::after { content: ' — '; font-weight: 400; color: var(--muted); }
.gl dd { display: inline; margin: 0; color: var(--ink-2); }


.pager { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--rule-2); }
.pager small { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.pager b { display: block; font: 700 15.5px/1.3 var(--serif); }
.pager .next { text-align: right; grid-column: 2; }
.foot { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }


.idx { max-width: 720px; margin: 0 auto; padding: 32px 20px 96px; }
.idx .lead { font: 400 18px/1.5 var(--serif); color: var(--ink-2); margin: 0 0 20px; }
.cont { display: block; margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--rule)); text-decoration: none; color: var(--ink); }
.cont small { display: block; font: 600 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.cont b { display: block; font: 700 17px/1.3 var(--serif); margin: 2px 0; }
.cont span { font-size: 13.5px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--surface); color: var(--muted); }
.search svg { width: 18px; height: 18px; flex: 0 0 auto; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 400 16px var(--sans); }
.search:focus-within { border-color: var(--accent); }
.empty { color: var(--muted); }
.chap { margin-top: 36px; }
.chap-h span { font: 600 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chap-h h2 { margin: 4px 0 10px; font: 700 22px/1.25 var(--serif); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list a { display: grid; grid-template-columns: 62px 1fr 44px; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.list a:hover { background: var(--surface); }
.list .par { font: 600 13px/1.2 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.list .tt b { display: block; font: 700 16px/1.3 var(--serif); }
.list .tt small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.list .pg { height: 4px; border-radius: 8px; background: var(--rule); overflow: hidden; }
.list .pg i { display: block; height: 100%; width: 0; background: var(--accent); }
.list a.done .pg i { background: var(--plus); }
.sample { display: block; margin-top: 40px; padding: 16px; border: 1px dashed var(--rule-2); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.sample small { display: block; font-size: 12.5px; color: var(--muted); }
.sample b { display: block; font: 700 17px/1.3 var(--serif); margin: 2px 0; }
.sample span { font-size: 13.5px; color: var(--ink-2); }


.recall mark, .recall .dl dt { color: transparent; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--rule-2); cursor: pointer; border-radius: 8px; user-select: none; }
.recall mark.shown { color: inherit; background: linear-gradient(transparent 58%, var(--mark) 58%); box-shadow: none; }
.recall .dl dt.shown { color: var(--accent); background: none; box-shadow: none; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print { .bar, .toc, .sheet, .sheet-bg, details.qs, .cards, .pager { display: none !important; } body { background: #fff; } }




:root { --bg: #f7f1e4; --surface: #fffaf0; --surface-2: #efe7d6; --rule: #e2d9c5; --rule-2: #cfc4ab; }
html.dark { --bg: #17140f; --surface: #211d16; --surface-2: #2a251c; --rule: #352f25; --rule-2: #463e30; }
body { font-size: var(--fs, 17px); line-height: 1.42; }
main p, main li { line-height: 1.42; }
main p { margin-block: 0 .7em; }
html { scroll-padding-top: 64px; }
main { padding-bottom: 120px; }
[hidden] { display: none !important; }


.k-aa { font: 700 15px/1 var(--serif); }
@media (max-width: 1079px) {
  #recallBtn, #tocBtn { display: none; }
  .bar-t { opacity: 1; transform: none; font-size: 14.5px; }
}
.head { padding-top: 20px; }
h1 { margin-top: 8px; }


.k-resume { display: block; width: 100%; margin: 20px 0 0; padding: 14px 16px; border: 0; border-radius: var(--r); background: var(--accent); color: #fff; text-align: left; cursor: pointer; }
.dark .k-resume { color: #0b1220; }
.k-resume small { display: block; font: 600 12.5px/1.3 var(--sans); opacity: .85; }
.k-resume b { display: block; margin-top: 3px; font: 700 18px/1.3 var(--serif); }


.k-fold { margin: 10px 0 0; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.k-fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 10px 14px; cursor: pointer; font: 700 16px/1.3 var(--serif); }
.k-fold > summary::-webkit-details-marker { display: none; }
.k-fold > summary span { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); font: 600 12.5px/1.5 var(--sans); color: var(--muted); text-align: center; }
.k-fold > summary::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.k-fold[open] > summary::after { transform: rotate(-135deg); }
.k-fold > :not(summary) { margin: 0; padding: 0 14px 14px; border: 0; background: none; }
.k-fold .dl { margin-top: 0; }
section.k-fold, .k-fold section.s { margin-top: 0; }


section.lesson { margin: 38px 0 0; padding: 0; border: 0; background: none; }
section.lesson .l-h2 { margin: 0 0 14px; padding: 0; border: 0; font: 700 clamp(22px, 5.6vw, 26px)/1.25 var(--serif); color: var(--ink); text-wrap: balance; }
section.lesson .l-h2 .n { display: block; margin: 0 0 4px; font: 600 13px/1.2 var(--sans); color: var(--accent); }
section.lesson .l-h2 small { display: block; margin-top: 4px; font: 400 13px/1.3 var(--sans); color: var(--muted); }


.k-group, .k-practice h2 { margin: 34px 0 4px; font: 700 21px/1.25 var(--serif); }
.k-practice { margin-top: 8px; }
.p-btn { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.p-btn b { display: block; font: 700 16px/1.3 var(--serif); }
.p-btn span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }


@media (max-width: 720px) {
  .chain { position: relative; padding-left: 20px; }
  .chain > i { display: none; }
  .chain > div { position: relative; padding: 0 0 12px; border: 0; border-radius: 0; background: none; }
  .chain > div.k { background: none; }
  .chain > div::before { content: ''; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--rule-2); background: var(--surface); box-sizing: border-box; z-index: 1; }
  .chain > div.k::before { border-color: var(--accent); background: var(--accent); }
  .chain > div::after { content: ''; position: absolute; left: -16px; top: 12px; bottom: -4px; width: 1px; background: var(--rule-2); }
  .chain > div:last-of-type { padding-bottom: 0; }
  .chain > div:last-of-type::after { display: none; }
  .vert > .a { padding: 2px 0; }
}


.kbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-top: 1px solid var(--rule); }
.kbar button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--tap); border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 13px/1 var(--sans); cursor: pointer; padding: 0 8px; }
.kbar svg { width: 20px; height: 20px; }
#kRecall i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
#kRecall[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
#kRecall[aria-pressed="true"] i { background: currentColor; }
.kstep { display: flex; align-items: center; margin-left: auto; }
.kstep span { min-width: 54px; text-align: center; font: 600 12.5px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.kstep button { min-width: var(--tap); padding: 0; }
@media (min-width: 1080px) { .kbar { display: none; } main { padding-bottom: 96px; } }
.sheet { z-index: 41; }
.pager { margin-top: 28px; }


.hub { background: var(--bg); }
.h-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px 0 6px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.h-top h1 { flex: 1; margin: 0; font: 700 22px/1.2 var(--serif); }
.h-stat { font: 500 12.5px/1.2 var(--sans); color: var(--muted); }
.h-main { max-width: 720px; margin: 0 auto; padding: 4px 16px 48px; }
.h-cont { display: block; margin: 0 0 12px; padding: 14px 16px; border-radius: var(--r); background: var(--accent); color: #fff; text-decoration: none; }
.dark .h-cont { color: #0b1220; }
.h-cont small { display: block; font: 600 12.5px/1.3 var(--sans); opacity: .85; }
.h-cont b { display: block; margin: 3px 0 10px; font: 700 18px/1.3 var(--serif); }
.h-cont-bar { display: block; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.h-cont-bar i { display: block; height: 100%; width: 0; background: currentColor; }
.h-cont-sub { display: block; margin-top: 6px; font: 400 12.5px/1.3 var(--sans); opacity: .85; }
.h-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--surface); color: var(--muted); }
.h-search svg { width: 18px; height: 18px; flex: 0 0 auto; }
.h-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 400 16px var(--sans); }
.h-search:focus-within { border-color: var(--accent); }
.h-tabs { position: sticky; top: 56px; z-index: 15; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 12px -16px 0; padding: 6px 16px; background: var(--bg); }
.h-tabs button { min-height: 40px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font: 600 13.5px/1.1 var(--sans); cursor: pointer; padding: 0 2px; }
.h-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.searching .h-tabs { display: none; }
.h-empty { margin: 24px 0; text-align: center; color: var(--muted); }
.h-era-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.h-sample { display: block; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; }
.h-sample b { display: block; font: 700 16px/1.3 var(--serif); }
.h-sample span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.h-chap { margin-top: 22px; }
.h-chap h3 { margin: 0 0 6px; font: 700 18px/1.3 var(--serif); }
.h-chap h3 span { display: block; margin-bottom: 2px; font: 600 11.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.h-list { list-style: none; margin: 0; padding: 0; }
.h-list a { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; min-height: 60px; padding: 8px 0; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; }
.h-ring { position: relative; display: block; width: 44px; height: 44px; }
.h-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.h-ring circle { fill: none; stroke-width: 2.5; }
.h-ring .t { stroke: var(--rule); }
.h-ring .v { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s; }
.h-ring i { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px/1 var(--sans); font-style: normal; color: var(--muted); text-align: center; letter-spacing: -.02em; }
.done .h-ring .v { stroke: var(--plus); }
.done .h-ring i { color: var(--plus); }
.h-tt b { display: block; font: 700 16px/1.3 var(--serif); }
.h-tt small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.h-note { margin: 28px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.h-news { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.h-new { display: block; padding: 14px; border-radius: var(--r); background: #121a2b; color: #f6eedd; text-decoration: none; }
.h-new small { display: block; font: 600 12px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #e8b64f; }
.h-new b { display: block; margin: 4px 0 4px; font: 700 18px/1.2 var(--serif); }
.h-new span { display: block; font-size: 13.5px; line-height: 1.35; color: #a9b0bd; }
.is-story .h-tt b::after { content: 'сюжет'; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: #121a2b; color: #e8b64f; font: 600 11px/1 var(--sans); vertical-align: 2px; }
