/* База знаний «Рекорда» — rekordclub.ru/help/.
 *
 * Только на токенах razryad.css (--bg, --surface, --ink, --line, --shift-accent,
 * шрифты): тема идёт за устройством, как в кабинете, и светлая с тёмной
 * получаются сами. Раскладка — как у привычной документации: шапка с поиском,
 * дерево слева, статья, оглавление справа. От 1180 px — три колонки, от 860 —
 * две (оглавление уходит в свёрнутый блок над статьёй), уже — одна, дерево
 * выезжает по кнопке. Прокрутки вбок нет ни на одной ширине.
 */

.hb-body { --hb-top: 64px; --hb-side: 272px; --hb-toc: 228px; --hb-read: 760px;
  background: var(--bg); color: var(--ink); font-family: var(--font-body); }
.hb-body a { color: inherit; }
.hb-muted { color: var(--ink-3); font-size: 13.5px; }
.hb-accent { color: var(--shift-accent-text, var(--shift-accent)); }
[hidden] { display: none !important; }

/* ── шапка ──────────────────────────────────────────────────────────── */
.hb-top { position: sticky; top: 0; z-index: 30; height: var(--hb-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); }
.hb-top-in { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 14px; }
.hb-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; flex: none; }
.hb-brand-tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap; }
.hb-iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.hb-iconbtn:hover { border-color: var(--line-strong); }
.hb-menu-btn { display: none; }
.hb-cabinet { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px;
  background: var(--shift-accent); color: var(--shift-accent-ink, #1a0d04) !important; font-weight: 700;
  font-size: 13.5px; text-decoration: none; white-space: nowrap; flex: none; }

/* поиск */
.hb-search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.hb-search input { width: 100%; height: 40px; padding: 0 40px 0 38px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; outline: none; }
.hb-search input:focus { border-color: var(--shift-accent); box-shadow: 0 0 0 3px var(--shift-accent-soft); }
.hb-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.hb-kbd { font-family: ui-monospace, monospace; font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.hb-search .hb-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.hb-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: min(70vh, 520px);
  overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); padding: 6px; }
.hb-res { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.hb-res:hover, .hb-res.on { background: var(--surface-2); }
.hb-res-t { font-weight: 700; font-size: 14px; }
.hb-res-c { font-size: 11.5px; color: var(--ink-3); margin-left: 6px; }
.hb-res-s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hb-res mark { background: var(--shift-accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.hb-res-none { padding: 14px 12px; color: var(--ink-3); font-size: 13.5px; }

/* ── каркас ─────────────────────────────────────────────────────────── */
.hb-shell { max-width: 1440px; margin: 0 auto; display: grid;
  grid-template-columns: var(--hb-side) minmax(0, 1fr); gap: 0; }
/* overflow-anchor: none — прокрутку дерева ставит скрипт (help/base.html) до
   отрисовки; привязка прокрутки браузера потом «доворачивала» её на несколько
   пикселей, когда достраивалось то, что выше. */
.hb-side { position: sticky; top: var(--hb-top); align-self: start; height: calc(100vh - var(--hb-top)); overflow-anchor: none;
  overflow-y: auto; padding: 22px 14px 28px 20px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; }
.hb-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.hb-role { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2) !important; text-decoration: none; }
.hb-role.on { background: var(--shift-accent-soft); border-color: transparent; color: var(--shift-accent-text, var(--shift-accent)) !important; }
.hb-tree { display: flex; flex-direction: column; gap: 14px; }
.hb-tree-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3) !important; text-decoration: none;
  padding: 2px 10px; }
.hb-tree-head.on { color: var(--ink) !important; }
.hb-tree ul { list-style: none; margin: 6px 0 0; padding: 0; }
.hb-tree li a { display: block; padding: 6px 10px 6px 33px; border-radius: 8px; font-size: 13.5px;
  color: var(--ink-2) !important; text-decoration: none; line-height: 1.35; }
.hb-tree li a:hover { background: var(--surface-2); color: var(--ink) !important; }
.hb-tree li a.on { background: var(--shift-accent-soft); color: var(--shift-accent-text, var(--shift-accent)) !important; font-weight: 700; }
.hb-side-foot { margin-top: auto; font-size: 12.5px; }
.hb-side-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3) !important; text-decoration: none; }
.hb-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.45); }

.hb-main { min-width: 0; padding: 34px 40px 60px; }
.hb-main-article { display: grid; grid-template-columns: minmax(0, var(--hb-read)) var(--hb-toc);
  gap: 48px; justify-content: center; }

/* ── заголовки и общие элементы ─────────────────────────────────────── */
.hb-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--shift-accent-text, var(--shift-accent)); margin-bottom: 14px; }
.hb-h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.04; letter-spacing: -.02em; margin: 0; }
.hb-h1-sm { font-size: clamp(26px, 3.4vw, 38px); }
.hb-h2 { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: 0 0 16px; }
.hb-h3 { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.hb-lead { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); margin: 14px 0 0; max-width: 64ch; }
.hb-chip { font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); text-decoration: none; color: var(--ink) !important; background: var(--surface); }
.hb-chip.on { background: var(--shift-accent); border-color: transparent; color: var(--shift-accent-ink, #1a0d04) !important; }
.hb-chip-quiet { background: transparent; color: var(--ink-3) !important; }
.hb-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.hb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px;
  text-decoration: none; white-space: nowrap; }
.hb-linkbtn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px;
  color: var(--ink-3) !important; background: none; border: 0; padding: 4px 6px; border-radius: 6px;
  cursor: pointer; text-decoration: none; }
.hb-linkbtn:hover { color: var(--ink) !important; background: var(--surface-2); }
.hb-copy { font: inherit; font-family: ui-monospace, monospace; font-size: 13px; padding: 2px 8px;
  border-radius: 6px; border: 1px dashed var(--line-strong); background: var(--surface-2); color: var(--ink);
  cursor: pointer; overflow-wrap: anywhere; text-align: left; }
.hb-copied { color: var(--att-present) !important; }

/* ── главная ────────────────────────────────────────────────────────── */
.hb-hero { padding: 26px 0 36px; max-width: 860px; }
.hb-hero-search { margin-top: 28px; width: 100%; max-width: 560px; display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-3); font: inherit; font-size: 15.5px; cursor: text; text-align: left;
  box-shadow: 0 14px 40px -24px rgba(0,0,0,.45); }
.hb-hero-search span { flex: 1; }
.hb-hero-search:hover { border-color: var(--shift-accent); }
.hb-hero-roles { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hb-block { margin-top: 30px; }
.hb-start { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hb-start-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 18px 58px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none;
  transition: border-color .15s, transform .15s var(--ease); }
.hb-start-card:hover { border-color: var(--shift-accent); transform: translateY(-2px); }
.hb-start-num { position: absolute; left: 18px; top: 18px; width: 28px; height: 28px; border-radius: 9px;
  background: var(--shift-accent); color: var(--shift-accent-ink, #1a0d04); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 13px; }
.hb-start-t { font-weight: 700; font-size: 15px; }
.hb-start-s { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hb-sec-card { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; }
.hb-sec-head { display: flex; gap: 14px; text-decoration: none; align-items: flex-start; }
.hb-sec-ico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--shift-accent-soft); color: var(--shift-accent-text, var(--shift-accent)); }
.hb-sec-ico-lg { width: 56px; height: 56px; border-radius: 16px; }
.hb-sec-t { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.hb-sec-n { display: block; font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.hb-sec-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hb-sec-list li a { display: block; padding: 9px 0; font-size: 14px; text-decoration: none;
  border-bottom: 1px solid var(--line); color: var(--ink-2) !important; }
.hb-sec-list li a:hover { color: var(--ink) !important; }
.hb-more { font-size: 13px; font-weight: 700; color: var(--shift-accent-text, var(--shift-accent)) !important; text-decoration: none; }
.hb-ai { margin-top: 34px; display: flex; gap: 16px; padding: 22px; border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong); background: var(--surface-2); }
.hb-ai p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.hb-ai-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--surface); color: var(--shift-accent-text, var(--shift-accent)); }

/* ── раздел ─────────────────────────────────────────────────────────── */
.hb-sec-hero { display: flex; gap: 18px; align-items: center; margin: 6px 0 26px; }
.hb-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.hb-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 18px;
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.hb-list-row:hover { border-color: var(--shift-accent); }
.hb-list-t { font-weight: 700; font-size: 15px; }
.hb-list-s { grid-column: 1; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.hb-list-r { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── статья ─────────────────────────────────────────────────────────── */
.hb-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.hb-crumbs a { text-decoration: none; color: var(--ink-3) !important; }
.hb-crumbs a:hover { color: var(--ink) !important; }
.hb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 18px 0 8px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hb-meta-sp { flex: 1; }

.hb-prose { font-size: 16px; line-height: 1.72; color: var(--ink); overflow-wrap: anywhere; }
.hb-prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.25;
  margin: 42px 0 12px; scroll-margin-top: calc(var(--hb-top) + 16px); }
.hb-prose h3 { font-weight: 800; font-size: 17px; margin: 28px 0 8px; scroll-margin-top: calc(var(--hb-top) + 16px); }
.hb-prose .hb-anchor { margin-left: 8px; font-size: .8em; color: var(--ink-3) !important; text-decoration: none; opacity: 0; transition: opacity .15s; }
.hb-prose h2:hover .hb-anchor, .hb-prose h3:hover .hb-anchor, .hb-prose .hb-anchor:focus { opacity: 1; }
.hb-prose p { margin: 12px 0; }
.hb-prose a { color: var(--shift-accent-text, var(--shift-accent)); text-underline-offset: 3px; }
.hb-prose strong { font-weight: 700; }
.hb-prose code { font-family: ui-monospace, monospace; font-size: .88em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.hb-prose ul { padding-left: 22px; margin: 12px 0; }
.hb-prose ul li { margin: 6px 0; }
.hb-prose ul li::marker { color: var(--shift-accent); }
/* Шаги — нумерованный список. Номер крупный, в плашке: шаг ищут глазами. */
.hb-prose ol { list-style: none; counter-reset: step; padding: 0; margin: 18px 0; }
.hb-prose ol > li { counter-increment: step; position: relative; padding: 2px 0 14px 50px; margin: 0; }
.hb-prose ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  border-radius: 10px; background: var(--shift-accent-soft); color: var(--shift-accent-text, var(--shift-accent));
  font-family: var(--font-display); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.hb-prose ol > li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 38px; bottom: 4px;
  width: 1px; background: var(--line-strong); }
.hb-prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; display: block; overflow-x: auto; }
.hb-prose th, .hb-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hb-prose th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.hb-prose kbd { font-family: ui-monospace, monospace; font-size: .85em; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; }

/* снимки экранов */
.hb-shot { margin: 18px 0 22px; }
.hb-shot img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface-2); box-shadow: 0 24px 60px -34px rgba(0,0,0,.55); }
.hb-shot-phone { max-width: 320px; }
.hb-shot figcaption { font-size: 13px; color: var(--ink-3); margin-top: 9px; line-height: 1.5; }
.hb-prose ol > li .hb-shot { margin-top: 14px; }

/* врезки: !!! tip / warning / note */
.hb-prose .admonition { margin: 20px 0; padding: 14px 16px 14px 18px; border-radius: 12px;
  background: var(--surface-2); border-left: 4px solid var(--line-strong); }
.hb-prose .admonition-title { font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 4px; }
.hb-prose .admonition p:last-child { margin-bottom: 0; }
.hb-prose .admonition.tip { border-left-color: var(--att-present); }
.hb-prose .admonition.tip .admonition-title { color: var(--att-present); }
.hb-prose .admonition.warning { border-left-color: var(--att-late); }
.hb-prose .admonition.warning .admonition-title { color: var(--att-late); }
.hb-prose .admonition.note { border-left-color: var(--shift-accent); }
.hb-prose .admonition.note .admonition-title { color: var(--shift-accent-text, var(--shift-accent)); }

.hb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 44px 0 18px; }
.hb-pager-a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.hb-pager-a span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.hb-pager-a:hover { border-color: var(--shift-accent); }
.hb-pager-next { text-align: right; grid-column: 2; }
.hb-help-more { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.hb-help-more div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.hb-help-more span { color: var(--ink-3); font-size: 13.5px; }
.hb-related { margin-top: 28px; }
.hb-related ul { margin: 0; padding-left: 18px; line-height: 1.9; font-size: 14.5px; }

/* оглавление */
.hb-toc { position: sticky; top: calc(var(--hb-top) + 24px); align-self: start; max-height: calc(100vh - var(--hb-top) - 48px);
  overflow-y: auto; font-size: 13px; }
.hb-toc-t { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.hb-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.hb-toc ul ul { border: 0; padding-left: 12px; }
.hb-toc a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent;
  text-decoration: none; color: var(--ink-3) !important; line-height: 1.4; }
.hb-toc a:hover { color: var(--ink) !important; }
.hb-toc a.on { border-left-color: var(--shift-accent); color: var(--ink) !important; font-weight: 700; }
.hb-toc-mobile { display: none; margin: 4px 0 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.hb-toc-mobile summary { font-weight: 700; font-size: 14px; cursor: pointer; }
.hb-toc-mobile ul { margin: 10px 0 0; padding-left: 18px; line-height: 1.9; font-size: 14px; }

/* подвал */
.hb-foot { border-top: 1px solid var(--line); }
.hb-foot-in { max-width: 1440px; margin: 0 auto; padding: 22px 20px 30px; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-3); }
.hb-foot a { color: var(--ink-2) !important; }

/* ── ширины ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .hb-main-article { grid-template-columns: minmax(0, 1fr); }
  .hb-toc { display: none; }
  .hb-toc-mobile { display: block; }
}
@media (max-width: 860px) {
  .hb-body { --hb-top: 58px; }
  .hb-shell { grid-template-columns: minmax(0, 1fr); }
  .hb-menu-btn { display: grid; }
  .hb-side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; height: 100vh; width: min(86vw, 320px);
    background: var(--bg); border-right: 1px solid var(--line-strong); transform: translateX(-100%);
    transition: transform .22s var(--ease); padding-top: 20px; }
  .hb-side.open { transform: none; }
  .hb-main { padding: 22px 16px 48px; }
  .hb-brand-tag { display: none; }
  .hb-cabinet { padding: 9px 10px; font-size: 0; gap: 0; }
  .hb-cabinet svg { width: 18px; height: 18px; }
  .hb-top-in { padding: 0 12px; gap: 8px; }
  .hb-search .hb-kbd { display: none; }
  .hb-search input { padding-right: 12px; }
  .hb-list-row { grid-template-columns: minmax(0, 1fr); }
  .hb-list-r { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .hb-pager { grid-template-columns: minmax(0, 1fr); }
  .hb-pager-next { grid-column: 1; }
  .hb-prose { font-size: 15.5px; }
  .hb-prose ol > li { padding-left: 44px; }
}
@media (max-width: 520px) {
  .hb-brand .rz-wm { font-size: 22px; }
  .hb-search input::placeholder { color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-start-card, .hb-side { transition: none; }
}
