  :root {
    --accent: #2563eb;
    --accent-soft: #eff4ff;
    --accent-border: #c7d8fe;
    --bg: #f5f6f8;
    --card: #ffffff;
    --ink: #1a2233;
    --ink-soft: #4b5568;
    --ink-muted: #7a8499;
    --line: #e6e8ee;
    --line-strong: #d4d8e2;
    --radius: 16px;
    --radius-sm: 10px;
    --green: #16a34a;
    --green-soft: #ecfdf3;
    --amber: #d97706;
    --amber-soft: #fff7ed;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --gray-soft: #f1f3f6;
    --shadow-card: 0 1px 2px rgba(20,30,55,.04), 0 8px 24px rgba(20,30,55,.05);
    --sidebar-w: 268px;
    --maxw: 1180px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245,246,248,.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.01em;
    color: var(--ink);
  }
  .brand:hover { text-decoration: none; }
  .brand-mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
  }
  .brand-mark img { width: 100%; height: 100%; display: block; }
  .brand small {
    display: block;
    font-weight: 450;
    font-size: 11px;
    color: var(--ink-muted);
    letter-spacing: .02em;
  }
  .topbar-spacer { flex: 1; }
  .topbar-link {
    font-size: 14px;
    color: var(--ink-soft);
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 8px;
  }
  .topbar-link:hover { background: var(--card); text-decoration: none; color: var(--ink); }
  .topbar-cta {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    padding: 8px 16px;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
  }
  .topbar-cta:hover { background: #1d56d8; text-decoration: none; color: #fff; }

  .layout {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 36px 28px 96px;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 48px;
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 84px;
    align-self: start;
  }
  .toc-head {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 600;
    color: var(--ink-muted);
    margin: 4px 0 14px 14px;
  }
  .toc-list { list-style: none; margin: 0; padding: 0; }
  .toc-list li { margin: 1px 0; }
  .toc-list a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border-left: 2px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
  }
  .toc-list a:hover { background: var(--card); color: var(--ink); text-decoration: none; }
  .toc-list a .num {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    min-width: 14px;
    transition: color .15s;
  }
  .toc-list a.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
  }
  .toc-list a.active .num { color: var(--accent); }
  .toc-foot {
    margin: 22px 14px 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-muted);
    line-height: 1.6;
  }
  .toc-foot strong { color: var(--ink-soft); font-weight: 600; display: block; margin-bottom: 4px; }

  .content { min-width: 0; max-width: 760px; }

  .page-head { margin-bottom: 40px; }
  .page-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    padding: 5px 11px;
    border-radius: 999px;
    margin-bottom: 16px;
  }
  .page-head h1 {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: 1.12;
    letter-spacing: -.025em;
    font-weight: 700;
  }
  .page-head .lede {
    margin: 0;
    font-size: 18px;
    color: var(--ink-soft);
    line-height: 1.6;
    max-width: 620px;
  }

  section.doc {
    scroll-margin-top: 92px;
    margin-bottom: 56px;
  }
  section.doc > h2 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -.02em;
    font-weight: 700;
    line-height: 1.2;
  }
  section.doc > h2 .sec-num {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    padding: 3px 9px;
    border-radius: 7px;
    line-height: 1.4;
    position: relative;
    top: -3px;
    box-shadow: 0 2px 6px rgba(37,99,235,.3);
  }
  section.doc > .section-intro {
    color: var(--ink-soft);
    font-size: 16.5px;
    margin: 0 0 22px;
    max-width: 660px;
  }
  section.doc h3 {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.01em;
    margin: 28px 0 6px;
    color: var(--ink);
  }
  section.doc p { margin: 0 0 14px; color: var(--ink-soft); }
  section.doc p strong, section.doc li strong { color: var(--ink); font-weight: 600; }
  section.doc ul { margin: 0 0 16px; padding-left: 0; list-style: none; }
  section.doc ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 9px;
    color: var(--ink-soft);
  }
  section.doc ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 11px;
    width: 6px; height: 6px;
    border-radius: 2px;
    background: var(--accent-border);
    transform: rotate(45deg);
  }

  .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
    margin: 18px 0;
  }
  .card.tight { padding: 18px 20px; }

  .step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 16px 0;
  }
  .step-num {
    flex: none;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    display: grid; place-items: center;
  }
  .step-body { flex: 1; min-width: 0; }
  .step-body h4 { margin: 4px 0 5px; font-size: 16px; font-weight: 650; color: var(--ink); }
  .step-body p { margin: 0; font-size: 15px; }

  figure.shot {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow-card);
  }
  figure.shot img {
    display: block;
    width: 100%;
    height: auto;
  }
  figure.shot figcaption {
    font-size: 13px;
    color: var(--ink-muted);
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 7px;
  }
  figure.shot figcaption::before {
    content: "▸";
    color: var(--accent);
    font-size: 11px;
  }
  .callout {
    display: flex;
    gap: 14px;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 15px;
    line-height: 1.6;
    border: 1px solid;
  }
  .callout .c-icon { flex: none; font-size: 18px; line-height: 1.4; }
  .callout p { margin: 0; }
  .callout.tip { background: var(--accent-soft); border-color: var(--accent-border); color: #1e3a8a; }
  .callout.tip p { color: #1e3a8a; }
  .callout.warn { background: var(--amber-soft); border-color: #fed7aa; color: #92400e; }
  .callout.warn p { color: #92400e; }

  /* §9 Релизы — changelog cards */
  .card.release { margin: 16px 0; }
  .release-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .release-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
  }
  .release-title { font-size: 16px; font-weight: 650; color: var(--ink); }
  .card.release ul.release-changes { margin: 0; }
  .card.release ul.release-changes li {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding-left: 0;
    margin-bottom: 10px;
  }
  .card.release ul.release-changes li:last-child { margin-bottom: 0; }
  .card.release ul.release-changes li::before { content: none; }
  .rel-badge {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.6;
    margin-top: 1px;
  }
  .rel-new { background: var(--green-soft); color: var(--green); }
  .rel-fix { background: var(--accent-soft); color: var(--accent); }
  .rel-improve { background: var(--amber-soft); color: var(--amber); }
  .rel-text { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 15px; }

  /* Sidebar «Релизы» — отдельный заметный блок над оглавлением */
  .toc-releases {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
  }
  .toc-releases:hover {
    background: #e4edff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(37,99,235,.12);
  }
  .toc-releases-icon { font-size: 17px; line-height: 1; }
  .toc-releases-text { display: flex; flex-direction: column; line-height: 1.25; }
  .toc-releases-text strong { font-size: 14px; font-weight: 650; color: var(--accent); }
  .toc-releases-text small { font-size: 11.5px; color: var(--ink-muted); font-weight: 500; }

  /* Активный раздел «Релизы» в сайдбаре (страница /releases) */
  .toc-releases--active {
    background: #dbe7ff;
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  .toc-releases--active:hover { background: #dbe7ff; }

  .releases-empty { color: var(--ink-soft); font-size: 15.5px; }

  .status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
  }
  .status-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 14.5px;
  }
  .status-dot {
    flex: none;
    width: 12px; height: 12px;
    border-radius: 4px;
    margin-top: 4px;
  }
  .status-item b { display: block; color: var(--ink); font-weight: 600; }
  .status-item span { color: var(--ink-muted); font-size: 13.5px; }
  .dot-green { background: var(--green); }
  .dot-amber { background: var(--amber); }
  .dot-gray  { background: #9aa3b5; }
  .dot-red   { background: var(--red); }

  .kbd {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 2px 7px;
    line-height: 1.5;
    white-space: nowrap;
  }
  .keys-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
  }
  .keys-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-muted);
    font-weight: 600;
    padding: 12px 18px;
    background: var(--gray-soft);
    border-bottom: 1px solid var(--line);
  }
  .keys-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
    color: var(--ink-soft);
    vertical-align: top;
  }
  .keys-table tr:last-child td { border-bottom: none; }
  .keys-table td:first-child { white-space: nowrap; width: 1%; }
  .keys-table .keycombo { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
  .keys-table .plus { color: var(--ink-muted); font-size: 12px; }

  code.inline {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--gray-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 6px;
    color: #b0367a;
  }

  .help-foot {
    margin-top: 64px;
    padding: 28px 30px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #1d2740, #243150);
    color: #dde3ef;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
  }
  section.doc .help-foot h3 { margin: 0 0 4px; color: #fff; font-size: 19px; font-weight: 650; }
  section.doc .help-foot p { margin: 0; color: #aeb8cd; font-size: 14.5px; }
  .help-foot .foot-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .help-foot .foot-btn {
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 9px;
    color: #fff;
    background: var(--accent);
  }
  .help-foot .foot-btn:hover { background: #1d56d8; text-decoration: none; }
  .help-foot .foot-btn.ghost { background: rgba(255,255,255,.1); }
  .help-foot .foot-btn.ghost:hover { background: rgba(255,255,255,.18); }

  @media (max-width: 980px) {
    .layout {
      grid-template-columns: 1fr;
      gap: 24px;
      padding: 24px 20px 80px;
    }
    .toc {
      position: static;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 16px 12px;
      box-shadow: var(--shadow-card);
    }
    .toc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; }
    .toc-foot { grid-column: 1 / -1; }
    .content { max-width: 100%; }
  }
  @media (max-width: 768px) {
    .topbar-inner { padding: 12px 18px; }
    .topbar-link { display: none; }
    .brand small { display: none; }
    .page-head h1 { font-size: 30px; }
    .page-head .lede { font-size: 16px; }
    section.doc > h2 { font-size: 22px; }
    .status-grid { grid-template-columns: 1fr; }
    .toc-list { grid-template-columns: 1fr; }
    .keys-table th, .keys-table td { padding: 10px 12px; }
    .help-foot { flex-direction: column; align-items: flex-start; }
  }
  @media (max-width: 480px) {
    .page-head h1 { font-size: 26px; }
  }
