/* ==========================================================================
   ПСИЗМА — инструкции (help/<инструмент>/). Поверх landing.css.
   Раскладка: слева липкое оглавление всех семи инструкций с подразделами,
   справа статья. Компоненты статьи (таблицы, kbd, карточки-сетки) —
   общий словарь для всех семи страниц; цвета только токенами, чтобы
   тёмная тема работала сама.
   ========================================================================== */

.help-page .hero { display: none; }
.help-layout { max-width: 1080px; margin: 0 auto; padding: 40px 40px 80px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }

/* ── оглавление ── */
.help-toc a { color: inherit; text-decoration: none; }
.help-side-toggle { display: none; }
.help-side-wrap > summary { list-style: none; }
.help-side-wrap > summary::-webkit-details-marker { display: none; }
.help-side { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; padding-right: 4px; }
.help-toc-title { font: var(--text-label); text-transform: uppercase; letter-spacing: .1em; color: var(--muted-light); margin: 0 0 10px 12px; }
.help-toc details { border-radius: var(--r-md); }
.help-toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); font: var(--btn-font); color: var(--text-secondary); }
.help-toc summary::-webkit-details-marker { display: none; }
.help-toc summary:hover { background: var(--bg-hover); color: var(--text); }
.help-toc details[open] > summary { color: var(--text); font-weight: 600; }
.help-toc .toc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.help-toc .toc-chev { margin-left: auto; width: 14px; height: 14px; color: var(--muted-light); transition: transform .15s; }
.help-toc details[open] > summary .toc-chev { transform: rotate(180deg); }
.help-toc ol { list-style: none; margin: 2px 0 8px; padding: 0 0 0 18px; border-left: 1px solid var(--border); margin-left: 15px; }
.help-toc ol a { display: block; padding: 5px 10px; font: var(--text-caption); font-size: .82rem; color: var(--muted); border-radius: var(--r-sm); text-decoration: none; line-height: 1.4; }
.help-toc ol a:hover { color: var(--text); background: var(--bg-hover); }
.help-toc ol ol { margin: 0 0 4px; padding-left: 12px; border-left: 0; margin-left: 4px; }
.help-toc ol ol a { font-size: .78rem; padding: 3px 10px; }
.help-toc .is-current > a { color: var(--accent-ink); font-weight: 600; }

/* ── статья ── */
.help-article { min-width: 0; max-width: 720px; }
.help-head { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.help-badge { width: 48px; height: 48px; border-radius: var(--r-lg); background: var(--bg-card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.help-eyebrow { font: var(--text-label); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); margin-bottom: 8px; }
.help-article h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.02em; line-height: 1.1; margin-bottom: 10px; }
.help-subtitle { font: 400 var(--fs-md)/1.6 var(--font); color: var(--muted); }
.help-article section { margin-bottom: 56px; scroll-margin-top: 90px; }
.help-article h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; margin-bottom: 18px; padding-top: 6px; scroll-margin-top: 90px; }
.help-article h3 { font-weight: 700; font-size: .98rem; margin: 30px 0 8px; color: var(--text); scroll-margin-top: 90px; }
.help-article p { font-size: .93rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 12px; }
.help-article p:last-child { margin-bottom: 0; }
.help-article ul, .help-article ol.list { margin: 8px 0 12px 20px; font-size: .93rem; line-height: 1.7; color: var(--text-secondary); }
.help-article li { margin-bottom: 4px; }
.help-article a { color: var(--accent-ink); }
.help-article strong { color: var(--text); font-weight: 600; }

/* таблицы */
.help-article table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 12px; }
.help-article thead tr { border-bottom: 1px solid var(--text); }
.help-article th { text-align: left; font-weight: 400; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; padding: 0 20px 12px 0; color: var(--muted); }
.help-article td { vertical-align: middle; padding: 12px 20px 12px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); line-height: 1.6; }
.help-article td.label-cell { font-weight: 600; color: var(--text); white-space: nowrap; padding-right: 28px; width: 1%; }
.help-article tr:last-child td { border-bottom: none; }
.help-article .range-table { font-size: .86rem; margin-top: 8px; }
.help-article .range-table td { padding: 3px 20px 3px 0; border: none; font-weight: normal; }
.help-article .range-table td:first-child { color: var(--muted); width: 140px; }

/* иконка с подписью, kbd, заметка */
.icon-label { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.icon-wrap { width: 30px; height: 30px; flex-shrink: 0; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.icon-wrap svg { display: block; }
.help-article kbd { display: inline-block; font-family: inherit; font-size: .78rem; font-weight: 600; background: var(--bg-subtle); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 3px; padding: 1px 6px; white-space: nowrap; color: var(--text); }
.help-article .note { font-size: .84rem; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 14px; margin-top: 16px; line-height: 1.65; }

/* ряды-переключатели, под-блоки */
.toggle-row { display: flex; align-items: flex-start; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-icon { flex-shrink: 0; margin-top: 1px; opacity: .7; color: var(--text); }
.toggle-body { flex: 1; }
.toggle-name { font-weight: 700; font-size: .93rem; color: var(--text); margin-bottom: 3px; }
.toggle-desc { font-size: .86rem; color: var(--text-secondary); line-height: 1.6; }
.sub-block { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; margin-top: 16px; font-size: .88rem; color: var(--text-secondary); background: var(--bg-card); }
.sub-block-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.sub-block-row { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); line-height: 1.6; }
.sub-block-row:last-child { border-bottom: none; }
.sub-block-row-name { font-weight: 600; color: var(--text); width: 80px; flex-shrink: 0; }

/* сетки карточек */
.dir-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.dir-card { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 14px 6px 12px; background: var(--text); color: var(--white-pure); border-radius: 6px; }
.dir-card-label { font-size: .7rem; text-align: center; line-height: 1.3; }
.pin-grid, .ctrl-grid, .tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pin-card, .ctrl-card, .tech-card, .role-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 12px 10px; background: var(--bg-card); }
.pin-card-name, .ctrl-card-name, .tech-card-name, .role-card-name { font-weight: 700; font-size: .84rem; color: var(--text); margin-bottom: 4px; }
.pin-card-desc, .ctrl-card-desc, .tech-card-desc, .role-card-desc { font-size: .76rem; color: var(--muted); line-height: 1.5; }
.role-row { display: flex; gap: 12px; margin-top: 12px; }
.role-card { flex: 1; padding: 14px 14px 12px; }
.role-card-name { font-size: .88rem; margin-bottom: 6px; }
.role-card-desc { font-size: .8rem; color: var(--text-secondary); }
.sound-groups { margin-top: 12px; }
.sound-group { margin-bottom: 16px; }
.sound-group-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sound-group-items { display: flex; flex-wrap: wrap; gap: 6px; }
.sound-chip { font-size: .78rem; color: var(--text-secondary); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px; }
.folder-block { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.7; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; margin-top: 12px; overflow-x: auto; color: var(--text-secondary); }
.folder-block .opt { color: var(--muted-light); }

/* шаги (для новых инструкций) */
.help-steps { counter-reset: st; margin: 12px 0; }
.help-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .92rem; color: var(--text-secondary); line-height: 1.6; }
.help-step:last-child { border-bottom: 0; }
.help-step::before { counter-increment: st; content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.help-step b { color: var(--text); font-weight: 600; }

/* оглавление на узком экране — сворачивается наверх */
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px 60px; }
  .help-side { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px 12px; background: var(--bg-card); }
  .help-side-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 8px 4px; font: var(--btn-font); color: var(--text); }
  .help-side-toggle::after { content: "⌄"; color: var(--muted); }
  .help-side-wrap[open] > .help-side-toggle::after { content: "⌃"; }
  .help-toc { padding-top: 6px; }
  .dir-grid { grid-template-columns: repeat(3, 1fr); }
  .pin-grid, .ctrl-grid, .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .role-row { flex-direction: column; }
}

/* таблица скоростей БЛС (статичная; зоны цветом) */
.speed-table td { padding: 6px 14px 6px 0; font-variant-numeric: tabular-nums; }
.speed-table td.num { text-align: right; }
.speed-table tr.is-default td:first-child { font-weight: 700; color: var(--text); }
.speed-table .speed-def { font-size: .72rem; color: var(--muted); font-weight: 400; }
.speed-table .speed-zone td { padding: 10px 0 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border-top: 1px solid var(--border); border-bottom: 0; }
.speed-table td.zone { font-size: .8rem; }
.z-slow { color: var(--muted); } .z-work { color: #1a7f37; } .z-fast { color: #0969da; }
:root[data-theme="dark"] .z-work { color: #5fd37f; } :root[data-theme="dark"] .z-fast { color: #79b8ff; }

/* пункт без подразделов (ИИ-ассистент) и пометка «скоро» */
.help-toc .toc-flat { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); font: var(--btn-font); color: var(--text-secondary); }
.help-toc .toc-flat:hover { background: var(--bg-hover); color: var(--text); }
.help-toc .toc-flat.is-open { color: var(--text); font-weight: 600; }
.toc-badge, .help-badge-soon { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-hover); color: var(--muted); vertical-align: middle; }
.help-badge-soon { font-size: 12px; margin-left: 10px; }
