/* Тема «ledger»: светлая бумага, тёмно-синий текст, голубой акцент, оранжевые партнёрские кнопки */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #0f1c2e;
  --text: #24303f;
  --muted: #5d6a7a;
  --line: #e2e6ec;
  --brand: #2f6fe4;
  --brand-soft: #eaf1fe;
  --accent: #f26b1d;
  --accent-hover: #dc5a0f;
  --accent-soft: #fff3ea;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 28, 46, .04), 0 6px 24px rgba(15, 28, 46, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.7 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s var(--ease); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid rgba(47, 111, 228, .45); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent;
  font: 600 16px/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #22344d; color: #fff; }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(242, 107, 29, .22); }
.btn--accent:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 8px 22px rgba(242, 107, 29, .3); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 10px; }
.btn--block { width: 100%; }
.ad-mark { display: block; margin: 8px 0 0; font-size: 12px; line-height: 1.3; color: var(--muted); }

/* ---------- шапка */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(245, 246, 248, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.logo:hover { color: var(--ink); }
.logo__mark svg { width: 32px; height: 32px; }
.topic-strip { border-top: 1px solid var(--line); }
.topic-strip__row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 8px; }
.topic-strip__row::-webkit-scrollbar { display: none; }
.topic-strip a {
  flex: none; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1.4;
  color: var(--text); text-decoration: none; border: 1px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.topic-strip a:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.topic-strip a[aria-current="page"] { background: var(--ink); color: #fff; }
@media (max-width: 420px) { .logo { font-size: 17px; } .header-cta { padding: 0 12px; font-size: 14px; } }

/* ---------- главная: первый экран */
.hero { padding: 40px 0 28px; }
.hero__grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 960px) { .hero { padding: 64px 0 40px; } .hero__grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 48px; } }
.hero__kicker { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 600; }
.hero h1 { margin: 0 0 16px; color: var(--ink); font-size: clamp(32px, 5.2vw, 52px); line-height: 1.08; letter-spacing: -.025em; font-weight: 800; }
.hero__lead { margin: 0 0 24px; font-size: 19px; color: var(--muted); max-width: 40em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
@media (max-width: 480px) { .hero__actions .btn { flex: 1 1 100%; } }

/* ---------- партнёрский баннер */
.banner { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.banner__kicker { margin: 0 0 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.banner__title { margin: 0 0 14px; font-size: 22px; line-height: 1.25; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.banner__list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.banner__list li { position: relative; padding-left: 26px; }
.banner__list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.3 2.3 4.7-5' fill='none' stroke='%23f26b1d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.banner .ad-mark { text-align: center; }
.banner--side { padding: 20px; margin-top: 20px; }
.banner--side .banner__title { font-size: 18px; }

/* ---------- карточки тем */
.topics { padding: 12px 0 8px; }
.topics__title { margin: 0 0 18px; font-size: 24px; color: var(--ink); letter-spacing: -.01em; }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .topics .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { border-color: #c5d5f3; box-shadow: var(--shadow); color: var(--text); }
.card__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; }
.card__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__title { margin: 4px 0 0; font-size: 17px; line-height: 1.3; font-weight: 700; color: var(--ink); }
.card__text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); flex: 1; }
.card__more { font-size: 14px; font-weight: 600; color: var(--brand); }
.card__more span { display: inline-block; transition: transform .2s var(--ease); }
.card:hover .card__more span { transform: translateX(3px); }

/* ---------- статья */
.page-grid { display: grid; gap: 32px; padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 1000px) { .page-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: 40px; } }
.home .page-grid { padding-top: 32px; }
.article { min-width: 0; max-width: 760px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.article h1 { margin: 0 0 10px; color: var(--ink); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
.meta { margin: 0 0 24px; font-size: 14px; color: var(--muted); }
.article h2 { margin: 44px 0 14px; color: var(--ink); font-size: clamp(23px, 3vw, 29px); line-height: 1.22; letter-spacing: -.015em; font-weight: 800; }
.article h3 { margin: 28px 0 8px; color: var(--ink); font-size: 20px; line-height: 1.3; font-weight: 700; }
.article p { margin: 0 0 16px; }
.inner .article .meta + p, .inner .article .toc-mobile + p, .home .article > p:first-of-type { font-size: 19px; color: var(--ink); }
.article ul, .article ol { margin: 0 0 18px; padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article li::marker { color: var(--brand); font-weight: 700; }
.article strong { color: var(--ink); font-weight: 650; }
.note { margin: 22px 0; padding: 16px 18px; border-radius: 14px; background: var(--brand-soft); border-left: 4px solid var(--brand); }
.note p { margin: 0 0 8px; }
.note p:last-child { margin: 0; }
.table-wrap { margin: 20px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { background: #f9fafb; color: var(--ink); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.text-cta { color: var(--accent); font-weight: 600; }
.text-cta:hover { color: var(--accent-hover); }

/* партнёрский блок внутри текста */
.cta-inline { margin: 28px 0; padding: 20px; border-radius: 18px; background: var(--accent-soft); border: 1px solid #fbd9c1; display: grid; gap: 16px; align-items: center; }
@media (min-width: 640px) { .cta-inline { grid-template-columns: minmax(0, 1fr) auto; padding: 22px 24px; } }
.cta-inline p { margin: 0; font-size: 16px; line-height: 1.55; }
.cta-inline .cta-inline__title { margin-bottom: 4px; font-size: 18px; font-weight: 750; color: var(--ink); }
.cta-inline__act { text-align: center; }
@media (max-width: 639px) { .cta-inline__act .btn { width: 100%; } }

/* FAQ */
.faq { display: grid; gap: 10px; margin: 8px 0 20px; }
.faq__item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s var(--ease); }
.faq__item[open] { border-color: #c5d5f3; }
.faq__item summary { list-style: none; cursor: pointer; padding: 16px 48px 16px 18px; position: relative; font-weight: 650; color: var(--ink); line-height: 1.45; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s var(--ease), margin-top .2s var(--ease); }
.faq__item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq__a { padding: 0 18px 4px; }
.faq__a p { margin: 0 0 14px; }

/* содержание */
.toc-mobile { margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.toc-mobile summary { cursor: pointer; padding: 12px 16px; font-weight: 650; color: var(--ink); }
.toc-mobile ol { margin: 0; padding: 0 16px 14px 36px; font-size: 15px; }
.toc-mobile a, .toc a { color: var(--text); text-decoration: none; }
.toc-mobile a:hover, .toc a:hover { color: var(--brand); }
@media (min-width: 1000px) { .toc-mobile { display: none; } }
.sidebar { display: none; }
@media (min-width: 1000px) { .sidebar { display: block; } }
.sidebar__sticky { position: sticky; top: 132px; max-height: calc(100vh - 152px); display: flex; flex-direction: column; }
.sidebar__sticky .banner { flex: none; }
.toc { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 10px; }
@media (max-height: 720px) { .toc { display: none; } .sidebar__sticky .banner { margin-top: 0; } }
.toc__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.toc li { margin-bottom: 8px; }
/* на телефоне баннер из сайдбара не показываем: его роль играют кнопки в шапке и в тексте */

/* связанные материалы */
.related { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.related__title { margin: 0 0 14px; font-size: 20px; font-weight: 800; color: var(--ink); }
.related .cards { grid-template-columns: 1fr; }
@media (min-width: 640px) { .related .cards { grid-template-columns: repeat(3, 1fr); } }

.notfound { padding: 56px 16px; }
.notfound h1 { color: var(--ink); font-size: 36px; margin: 0 0 12px; }

/* подвал */
.site-footer { background: var(--ink); color: #c3ccd8; padding: 40px 0 24px; font-size: 15px; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr 1.4fr; gap: 48px; } }
.footer-logo { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: #fff; font-weight: 800; font-size: 18px; }
.footer-logo svg { width: 28px; height: 28px; }
.footer-about { margin: 0; max-width: 34em; line-height: 1.6; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 20px; }
.footer-links a { color: #e6ecf3; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; line-height: 1.55; color: #98a5b5; }
.footer-bottom p { margin: 0 0 6px; }
