:root {
  --ink: #0b0d12;
  --text: #2a2d34;
  --muted: #5f6470;
  --soft: #8a8f99;
  --line: #e7e8ec;
  --line-soft: #f0f1f4;
  --brand: #2f4cf2;
  --brand-soft: #eef1ff;
  --navy: #000033;
  --canvas: #fafafb;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 16px/1.7 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
svg { flex-shrink: 0; }
.muted { color: var(--soft); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.top .bar { max-width: 1200px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand .home { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand .sub:hover { color: var(--ink); }
.brand .sub { color: var(--soft); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line); }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--navy); display: grid; place-items: center; }
.mark img { width: 22px; height: 22px; }
.mark.sm { width: 22px; height: 22px; border-radius: 7px; }
.mark.sm img { width: 16px; height: 16px; }
.open { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); white-space: nowrap; transition: background 0.15s; }
.open:hover { background: #f5f5f7; }
.top .search { flex: 1; max-width: 460px; }

/* Search */
.search { position: relative; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--soft); transition: border-color 0.15s, box-shadow 0.15s; }
.search:focus-within { border-color: #c9cffd; box-shadow: 0 0 0 4px rgba(47, 76, 242, 0.1); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font-family: inherit; font-size: 12px; font-weight: 500; line-height: 1; color: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.search.big { height: 58px; padding: 0 18px; border-radius: 16px; box-shadow: 0 10px 40px -12px rgba(0, 0, 51, 0.18); border-color: transparent; }
.search.big input { font-size: 17px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.18); padding: 6px; z-index: 30; text-align: left; max-height: 70vh; overflow: auto; }
.results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.results a.on, .results a:hover { background: #f4f5f8; }
.results .rt { display: block; font-weight: 600; font-size: 15px; }
.results .rc { display: block; font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .none { padding: 14px; font-size: 14px; color: var(--soft); }

/* Home */
.hero { background: radial-gradient(1200px 400px at 50% -80px, #e7ebff 0%, rgba(231, 235, 255, 0) 70%), linear-gradient(#fbfbfe, #fff); border-bottom: 1px solid var(--line-soft); }
.hero .inner { max-width: 720px; margin: 0 auto; padding: 72px 24px 64px; text-align: center; }
.hero h1 { margin: 0; font-size: 44px; line-height: 1.1; letter-spacing: -0.035em; color: var(--ink); font-weight: 700; }
.hero p { margin: 12px 0 30px; font-size: 18px; color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 48px 24px 72px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s; }
.card:hover { border-color: #d6d9e2; box-shadow: 0 12px 32px -16px rgba(0, 0, 51, 0.22); transform: translateY(-2px); }
.ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; }
.ico.lg { width: 56px; height: 56px; border-radius: 16px; margin: 0; }
.ctitle { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.cdesc { font-size: 14px; color: var(--muted); line-height: 1.55; }
.ccount { margin-top: 10px; font-size: 13px; color: var(--soft); }
.split { margin-top: 40px; align-items: start; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.panel h2 { margin: 0 0 8px; font-size: 17px; color: var(--ink); letter-spacing: -0.015em; }
.news { display: flex; flex-direction: column; gap: 6px; color: var(--ink); background: linear-gradient(160deg, #0a0a3d, var(--navy)); border-color: transparent; }
.news .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #a9b4ff; }
.news .ntitle { font-size: 20px; font-weight: 600; color: #fff; letter-spacing: -0.02em; margin-top: 4px; }
.news .cdesc { color: #b9bdd6; }
.news .more { margin-top: auto; padding-top: 16px; display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 14px; font-weight: 600; }

/* Lists */
.list a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 15px; font-weight: 500; }
.list a:last-child { border-bottom: 0; }
.list a > span:first-child { flex: 1; }
.list a .muted { font-size: 13px; font-weight: 400; }
.list a svg { color: #c2c5cd; transition: transform 0.15s, color 0.15s; }
.list a:hover svg { color: var(--brand); transform: translateX(2px); }
.list.boxed { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px; margin-top: 28px; }
.list.boxed a { flex-wrap: wrap; padding: 16px 0; }
.list.boxed .ltitle { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; font-weight: 600; }
.list.boxed .muted { flex: 1; }

/* Collection and article */
.narrow { max-width: 820px; margin: 0 auto; padding: 36px 24px 72px; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--soft); font-weight: 500; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.chead { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
h1 { color: var(--ink); }
.narrow h1, .article h1 { margin: 14px 0 0; font-size: 36px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
.chead h1 { margin: 0; }
.lead { margin: 10px 0 0; font-size: 18px; color: var(--muted); line-height: 1.55; }
.chead .lead { margin-top: 4px; font-size: 15px; }
.article-wrap { max-width: 1120px; margin: 0 auto; padding: 36px 24px 72px; display: grid; grid-template-columns: minmax(0, 720px) 220px; gap: 64px; justify-content: center; }
.meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 8px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.by { display: inline-flex; align-items: center; gap: 8px; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: #f2f3f6; color: var(--muted); font-size: 12px; font-weight: 600; }
.chip.pro { background: var(--ink); color: #fff; font-size: 10px; letter-spacing: 0.08em; border-radius: 6px; height: 20px; padding: 0 7px; }

/* Article text */
.prose { color: var(--text); font-size: 16px; }
.prose > :first-child { margin-top: 24px; }
.prose p { margin: 14px 0; }
.prose h2 { margin: 44px 0 10px; font-size: 23px; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); font-weight: 600; }
.prose h3 { margin: 30px 0 8px; font-size: 18px; color: var(--ink); }
.prose h2 .anchor, .prose h3 .anchor { color: inherit; }
.prose h2 .anchor:hover::after { content: ' #'; color: #c2c5cd; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { font-weight: 500; }
.prose a:hover { color: #1f37c9; }
.prose ul { padding-left: 0; list-style: none; margin: 14px 0; }
.prose ul > li { position: relative; padding-left: 22px; margin: 8px 0; }
.prose ul > li::before { content: ''; position: absolute; left: 6px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: #b8bdf5; }
.prose ul > li:has(> input[type='checkbox']) { padding-left: 30px; }
.prose ul > li:has(> input[type='checkbox'])::before { display: none; }
.prose input[type='checkbox'] { position: absolute; left: 2px; top: 0.36em; width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.prose ol { counter-reset: step; list-style: none; padding-left: 0; margin: 18px 0; }
.prose ol > li { counter-increment: step; position: relative; padding: 2px 0 12px 44px; margin: 0; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.prose ol > li:not(:last-child)::after { content: ''; position: absolute; left: 13.5px; top: 32px; bottom: 2px; width: 1px; background: #dfe3fb; }
.prose li ul, .prose li ol { margin: 6px 0; }
.prose .table { margin: 20px 0; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--soft); background: #fafbfc; }
.prose th, .prose td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--ink); font-weight: 500; }
.tip { display: flex; gap: 12px; margin: 20px 0; padding: 14px 16px; border-radius: 14px; background: #fff8e6; color: #6b4e00; }
.tip svg { margin-top: 3px; color: #d29a00; }
.tip p { margin: 0; color: inherit; }
.tip strong { color: #4a3600; }

/* Article footer */
.related { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.related h3 { margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.related a { display: flex; align-items: center; gap: 10px; padding: 9px 0; color: var(--text); font-size: 15px; }
.related a svg { color: var(--soft); }
.related a:hover { color: var(--brand); }
.pager { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; font-size: 15px; transition: border-color 0.15s; }
.pager a:hover { border-color: #c9cffd; }
.pager a.r { text-align: right; }
.pager .muted { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.pager a.r .muted { justify-content: flex-end; }

/* On this page */
.toc { position: sticky; top: 96px; align-self: start; padding-top: 108px; }
.toc .label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.4; transition: color 0.15s, border-color 0.15s; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--brand); border-color: var(--brand); font-weight: 500; }

/* Footer */
footer.site { border-top: 1px solid var(--line); background: var(--canvas); }
footer.site .inner { max-width: 1120px; margin: 0 auto; padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 13px; color: var(--soft); }
footer.site a { color: var(--muted); }

@media (max-width: 1000px) {
  .article-wrap { grid-template-columns: minmax(0, 1fr); max-width: 760px; gap: 0; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .top .search { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .top .bar { padding: 0 16px; gap: 12px; }
  .brand .sub { display: none; }
  .hero .inner { padding: 48px 16px 44px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; margin-bottom: 24px; }
  .search.big { height: 52px; }
  .search kbd { display: none; }
  .wrap { padding: 28px 16px 56px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 18px; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 14px; }
  .card .ico { margin: 0; }
  .card .ctitle { flex: 1; }
  .card .cdesc, .card .ccount { flex: 1 1 100%; }
  .card .ccount { margin-top: 2px; }
  .narrow, .article-wrap { padding: 24px 16px 56px; }
  .narrow h1, .article h1 { font-size: 28px; }
  .lead { font-size: 16px; }
  .prose h2 { font-size: 20px; margin-top: 36px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.r { text-align: left; }
  .pager a.r .muted { justify-content: flex-start; }
}
@media print {
  .top, .toc, .pager, .related, footer.site { display: none; }
}
