/* Справка CRM для Макса: только то, чего нет в site.css и crm.css. Цвета и шрифт — переменные site.css. */

/* Шапка: две крошки и поиск */
.help .top .wrap { flex-wrap: wrap; }
.help .crumb + .crumb::before { content: "/"; }
.hsearch { display: none; position: relative; align-items: center; flex: 1 1 16rem; max-width: 26rem; margin-left: auto; }
.js .hsearch { display: flex; }
.hsearch svg { position: absolute; left: 0.8rem; width: 1.05rem; height: 1.05rem; color: var(--muted); pointer-events: none; }
.hsearch input { width: 100%; padding: 0.55rem 0.9rem 0.55rem 2.4rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.95rem; }
.hsearch input::placeholder { color: var(--muted); }
.hsearch input:focus-visible { outline-offset: 1px; border-color: var(--link); }
#hq-list { position: absolute; top: calc(100% + 0.4rem); left: 0; right: 0; z-index: 30; max-height: min(26rem, 70dvh); margin: 0; padding: 0.35rem; overflow: auto; list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 50px -24px var(--shadow); }
#hq-list li { display: grid; gap: 0.1rem; padding: 0.55rem 0.7rem; border-radius: 10px; cursor: pointer; }
#hq-list li[aria-selected="true"], #hq-list li[role="option"]:hover { background: var(--band); }
#hq-list li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--amber); }
.hq-head { font-weight: 650; line-height: 1.3; }
.hq-page { color: var(--muted); font-size: 0.8rem; }
.hq-snip { color: var(--ink); font-size: 0.86rem; line-height: 1.4; }
.hq-empty { color: var(--muted); font-size: 0.9rem; cursor: default; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Три колонки: разделы, статья, оглавление */
.hgrid { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr) 12.5rem; align-items: start; gap: 2.5rem clamp(1.5rem, 3vw, 3rem); padding-block: 2.2rem 4rem; }
.hnav, .htoc { position: sticky; top: 5rem; max-height: calc(100dvh - 6rem); overflow: auto; font-size: 0.93rem; }
.hnav-group { margin: 1.3rem 0 0.4rem; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.hnav-group:first-child { margin-top: 0; }
.hnav ul, .htoc ul { margin: 0; padding: 0; list-style: none; }
.hnav a, .htoc a { display: block; padding: 0.3rem 0 0.3rem 0.8rem; border-left: 2px solid var(--line); color: var(--ink); line-height: 1.35; text-decoration: none; }
.hnav a:hover, .htoc a:hover { color: var(--link); }
.hnav a[aria-current="page"] { border-left-color: var(--amber); font-weight: 650; }
/* Меню разделов — <details>: на узком экране свёрнуто, на широком раскрыто всегда; работает без JS и без сдвига вёрстки */
.hnav-toggle { display: none; align-items: center; justify-content: space-between; width: 100%; padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 600; cursor: pointer; }
.hnav-toggle::after { content: ""; width: 0.55rem; height: 0.55rem; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -0.15rem; transition: rotate 0.2s; }
.hnav-toggle::-webkit-details-marker { display: none; }
.hnav-box[open] > .hnav-toggle::after { rotate: 225deg; translate: 0 0.1rem; }
/* Широкий экран: содержимое закрытого details видно. Браузер без ::details-content покажет «Разделы справки» — раскроется щелчком. */
@media (min-width: 60.01rem) { .hnav-box::details-content { content-visibility: visible; height: auto; } }
@supports not selector(::details-content) { .hnav-toggle { display: flex; list-style: none; } }
.htoc p { margin-bottom: 0.5rem; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.htoc ul { scroll-target-group: auto; }
.htoc a { color: var(--muted); }
/* :is() — чтобы незнакомый браузеру :target-current не отменил всё правило */
.htoc a:is(:target-current, .target-current) { border-left-color: var(--amber); color: var(--ink); font-weight: 600; }

/* Статья */
.hdoc { min-width: 0; }
.hdoc:focus { outline: none; }
.hdoc .prose { max-width: 44rem; }
.hdoc h1 { font-size: clamp(2rem, 4.2vw, 2.75rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; }
.hdoc h1 + p { margin-top: 1rem; font-size: 1.15rem; line-height: 1.5; }
.hdoc h2 { margin-top: 2.8rem; font-size: clamp(1.4rem, 2.6vw, 1.7rem); font-weight: 750; line-height: 1.15; letter-spacing: -0.015em; scroll-margin-top: 5rem; }
.hdoc h3 { scroll-margin-top: 5rem; }
.hdoc h2 + *, .hdoc h3 + * { margin-top: 0.7rem; }
.hdoc kbd { padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); font: 500 0.85em var(--mono); }
.hdoc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.hdoc th, .hdoc td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hdoc thead th { font-size: 0.86rem; font-weight: 650; color: var(--muted); }
.hdoc .table { overflow-x: auto; }
/* site.css не переносит последнюю колонку статей (.doc td:last-child) — в справке там длинный текст */
.hdoc td:last-child { white-space: normal; }
@media (max-width: 34rem) { .hdoc th, .hdoc td { padding: 0.5rem 0.45rem; font-size: 0.9rem; } }

/* Шаги: настоящая последовательность, поэтому номера */
.prose ol.hsteps { padding: 0; list-style: none; counter-reset: step; }
.prose .hsteps > li { position: relative; margin: 0; padding-left: 2.6rem; counter-increment: step; }
.prose .hsteps > li + li { margin-top: 0.85rem; }
.hsteps > li::before { content: counter(step); position: absolute; left: 0; top: 0.05rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: color-mix(in srgb, var(--amber) 28%, var(--surface)); color: var(--ink); font-weight: 750; font-size: 0.88rem; }

/* Метка платной функции */
.pro { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--amber); color: var(--on-amber); font-size: 0.75rem; font-weight: 700; line-height: 1.5; vertical-align: 0.2em; }
h2 .pro, h3 .pro { font-size: 0.5em; letter-spacing: 0; }

/* Врезки */
.prose .callout { margin-top: 1.2rem; }
.callout.warn { border-left-color: var(--no); }
.callout > * + * { margin-top: 0.5rem; }

/* Скриншоты */
.hdoc figure { margin-top: 1.4rem; }
.hdoc figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 50px -36px var(--shadow); }
.hdoc figure.narrow img { max-width: min(100%, 22.5rem); }

/* Частые вопросы: значок раскрытия — из .faq в site.css, как на лендинге */
.hdoc summary { scroll-margin-top: 5rem; font-size: 1.02rem; }
.hdoc .faq { margin-top: 0.8rem; border-top: 1px solid var(--line); }
.hdoc details { border-bottom: 1px solid var(--line); }
.hdoc details > :not(summary) { margin-bottom: 0.9rem; }
.hdoc details > * + :not(summary) { margin-top: 0.5rem; }

/* Соседние страницы */
.hpager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 44rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.hpager a { display: grid; gap: 0.15rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; text-decoration: none; }
.hpager a:hover { border-color: var(--amber); }
.hpager a[rel="next"] { text-align: right; }
.hpager span { color: var(--muted); font-size: 0.82rem; font-weight: 400; }

@media (max-width: 75rem) {
  .hgrid { grid-template-columns: 13rem minmax(0, 1fr); }
  .htoc { display: none; }
}
@media (max-width: 60rem) {
  .hgrid { grid-template-columns: minmax(0, 1fr); padding-top: 1.2rem; gap: 1.5rem; }
  .hnav { position: static; max-height: none; }
  .hnav-toggle { display: flex; list-style: none; }
  #hnav-list { margin-top: 0.6rem; padding: 0.4rem 1rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .hsearch { order: 5; flex-basis: 100%; max-width: none; margin: 0 0 0.6rem; }
  .help .top .crumb:nth-of-type(2) { display: none; }
}
@media (max-width: 34rem) {
  .hpager { grid-template-columns: 1fr; }
  .hpager a[rel="next"] { text-align: left; }
}
@media print {
  .hnav, .htoc, .hsearch, .hpager { display: none; }
  .hgrid { display: block; }
  .hdoc details::details-content { content-visibility: visible; height: auto; } /* ответы FAQ печатаются раскрытыми */
}

/* Главная справки: карта расширения — схема окна Chrome с MAX и панелью, зоны ведут на страницы */
.hmap { margin-top: 1.4rem; }
.hmap-window { border: 1px solid var(--line); border-radius: 16px; background: var(--band); overflow: hidden; box-shadow: 0 30px 60px -44px var(--shadow); }
.hmap-bar { display: flex; align-items: center; gap: 0.35rem; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); }
.hmap-bar i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line); }
.hmap-bar span { margin-left: 0.8rem; padding: 0.1rem 0.8rem; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 0.78rem; }
.hmap-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr) minmax(0, 1fr); }
.hmap-zone { display: flex; flex-direction: column; gap: 0.65rem; padding: 1rem; }
.hmap-body .hmap-zone + .hmap-zone { border-left: 1px solid var(--line); }
.hmap-panel { background: var(--surface); box-shadow: inset 3px 0 0 var(--amber); }
.hmap h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.hmap .hmap-zone > * + * { margin-top: 0; }
.hmap ul { margin: 0; padding: 0; list-style: none; }
.prose .hmap li + li { margin-top: 0.35rem; }
.hmap-links { font-size: 0.93rem; line-height: 1.35; }
.hmap-links a { display: inline-block; }
.hmap-rows li { display: flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.45rem; border-radius: 8px; background: var(--surface); font-size: 0.72rem; }
.hmap-rows b { width: 1.2rem; height: 1.2rem; flex: none; border-radius: 50%; background: var(--line); }
.hmap-rows i { padding: 0 0.4rem; border-radius: 999px; background: var(--c); color: #fff; font-style: normal; font-weight: 600; }
.hmap-rows em { margin-left: auto; color: var(--muted); font-style: normal; }
.hmap-compose { display: grid; gap: 0.3rem; font-size: 0.78rem; }
.hmap-compose ul { padding: 0.3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hmap-compose li { padding: 0.2rem 0.4rem; border-radius: 6px; }
.hmap-compose li:first-child { background: var(--band); box-shadow: inset 2px 0 0 var(--amber); }
.hmap-compose p { padding: 0.35rem 0.6rem; border-radius: 999px; background: var(--surface); color: var(--ink); }
.hmap-tabs { display: flex; gap: 0.25rem; font-size: 0.72rem; }
.hmap-tabs span { padding: 0.15rem 0.45rem; border-radius: 6px; background: var(--band); }
.hmap-tabs span:first-child { background: var(--amber); color: var(--on-amber); font-weight: 600; }
.hmap-outside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.hmap-outside .hmap-zone { gap: 0.35rem; border: 1px dashed var(--line); border-radius: 14px; font-size: 0.93rem; }
.hmap-outside p { color: var(--muted); }
.hmap-outside p:last-child { color: var(--ink); }
@media (max-width: 46rem) {
  .hmap-body, .hmap-outside { grid-template-columns: minmax(0, 1fr); }
  .hmap-body .hmap-zone + .hmap-zone { border-left: 0; border-top: 1px solid var(--line); }
}

/* Главная справки: все разделы */
.hdoc .hlist { padding: 0; list-style: none; }
.prose .hlist li { display: grid; gap: 0.1rem; margin: 0; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.hlist a { font-weight: 650; }
.hlist span { color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.hdoc h2 + h3 { margin-top: 1rem; }
.hdoc .hlist + h3 { margin-top: 1.6rem; }

/* Главная справки: без оглавления, статья шире ради карты; абзацы остаются узкими */
.help-index .hgrid { grid-template-columns: 13.5rem minmax(0, 1fr); }
.help-index .hdoc .prose { max-width: 60rem; }
.help-index .hdoc .prose > :is(p, ol, ul, h3) { max-width: 44rem; }
@media (max-width: 60rem) { .help-index .hgrid { grid-template-columns: minmax(0, 1fr); } }
