/* ===== Документация protokolist.ru/manual/ =====
   Поверх styles.css, site.css и doc.css; переменные (--ink, --muted, --accent, --line, --bg, --pad) — из styles.css. */

.man { max-width: 1400px; margin: 0 auto; padding: 24px var(--pad) 72px; }
.man-crumbs { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.man-crumbs a { color: var(--accent); }
.man-crumbs span { color: var(--muted); }

.man h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; color: var(--ink); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.01em; }
.man-lead { font-size: 18px; line-height: 1.55; color: #2b3852; margin: 0 0 18px; max-width: 760px; }
.man-where { display: inline-block; font-size: 14px; line-height: 1.5; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 8px 14px; margin: 0 0 26px; }

/* три колонки: разделы документации слева, текст, «На этой странице» справа */
.man-grid { display: grid; grid-template-columns: 228px minmax(0, 1fr) 210px; gap: 44px; align-items: start; }
.man-body { min-width: 0; max-width: 780px; }

/* слева — все страницы документации по группам */
.man-nav { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px 10px; font-size: 14.5px; line-height: 1.4; }
.man-nav__title { padding: 0 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.man-nav__title a { font-size: 13px; font-weight: 700; color: var(--accent); }
.man-nav__title a::before { content: "← "; }
.man-nav__group { padding: 10px 0 4px; }
.man-nav__group + .man-nav__group { border-top: 1px solid var(--line); }
.man-nav__gname { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); padding: 0 8px 6px; }
.man-nav ul { list-style: none; margin: 0; padding: 0; }
.man-nav li { margin: 0 0 2px; }
.man-nav a, .man-nav__cur { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 16px; border-radius: 9px; color: #2b3852; }
.man-nav a::after { content: "→"; color: var(--muted-2); opacity: 0; transition: opacity .15s ease; }
.man-nav a:hover { background: var(--bg); color: var(--accent); }
.man-nav a:hover::after { opacity: 1; }
.man-nav__cur { background: var(--accent); color: #fff; font-weight: 600; }

/* справа — якоря этой страницы: мельче, линия слева, текущий подраздел подсвечен */
.man-onpage { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow: auto; font-size: 13.5px; line-height: 1.4; }
.man-onpage__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.man-onpage__title::after { content: " ↓"; }
.man-onpage ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.man-onpage li { margin: 0; }
.man-onpage a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); }
.man-onpage a:hover { color: var(--ink); }
.man-onpage a.is-active { color: var(--accent); font-weight: 600; border-left-color: var(--accent); }

/* «Содержание страницы» в тексте — когда правой колонки нет */
.man-toc--inline { display: none; background: var(--bg); border-radius: 14px; padding: 12px 16px; margin: 0 0 28px; border-left: 3px solid var(--accent); }
.man-toc--inline summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink); }
.man-toc--inline ol { margin: 10px 0 2px; padding-left: 20px; }
.man-toc--inline li { font-size: 15px; line-height: 1.6; }
.man-toc--inline a { color: var(--accent); }
.man-toc--inline a.is-active { font-weight: 600; }

/* текст */
.man-body section { scroll-margin-top: 96px; }
.man-body h2 { font-size: 25px; font-weight: 700; color: var(--ink); margin: 44px 0 14px; line-height: 1.2; }
.man-body section:first-of-type h2 { margin-top: 8px; }
.man-body h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.man-body p, .man-body li { font-size: 16px; line-height: 1.65; color: #2b3852; }
.man-body p { margin: 0 0 12px; }
.man-body ul, .man-body ol { margin: 0 0 14px; padding-left: 22px; }
.man-body li { margin-bottom: 6px; }
.man-body a { color: var(--accent); }
.man-body a:hover { text-decoration: underline; }
.man-body code { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: .9em; background: var(--bg); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.man-body pre.code { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 13.5px; line-height: 1.55; background: #0E172C; color: #e2e8f0; border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; overflow-x: auto; white-space: pre; }

/* шаги */
.man-body ol.steps { list-style: none; counter-reset: st; padding: 0; margin: 4px 0 18px; }
.man-body ol.steps > li { counter-increment: st; position: relative; padding: 0 0 0 44px; margin: 0 0 12px; min-height: 30px; }
.man-body ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }

/* советы и предупреждения */
.man-body .tip, .man-body .warn { border-radius: 14px; padding: 14px 18px; margin: 16px 0 20px; font-size: 15px; line-height: 1.6; color: #2b3852; }
.man-body .tip { background: var(--accent-10); }
.man-body .warn { background: #fff4dc; }
.man-body .tip b, .man-body .warn b { color: var(--ink); }

/* таблицы */
.man-body .tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 18px; }
.man-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.man-body th, .man-body td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--line); line-height: 1.5; color: #2b3852; }
.man-body th { background: var(--bg); font-weight: 700; color: var(--ink); }

/* скриншоты */
.man-body .shot { margin: 18px 0 26px; }
.man-body .shot a { display: block; width: fit-content; max-width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 14px 36px -24px rgba(13,30,70,.35); background: #fff; }
.man-body .shot img { display: block; width: auto; max-width: 100%; height: auto; }
.man-body .shot--narrow a { max-width: min(100%, 600px); }
.man-body .shot figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 8px; max-width: 640px; }

.man-body .shot a { cursor: zoom-in; }

/* скриншот крупно поверх страницы (manual.js) */
.lb-open, .lb-open body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(8,13,26,.9); display: flex; align-items: center; justify-content: center; padding: 56px 72px 48px; }
.lb[hidden] { display: none; }
.lb__fig { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; min-width: 0; }
.lb__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; flex-shrink: 1; border-radius: 10px; background: #fff; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); cursor: default; }
.lb__cap { color: #e2e8f0; font-size: 15px; line-height: 1.5; text-align: center; max-width: 760px; }
.lb__close, .lb__nav { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center; font-family: inherit; transition: background .15s ease; }
.lb__close:hover, .lb__nav:hover { background: rgba(255,255,255,.24); }
.lb__close:focus-visible, .lb__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb__close { top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; font-size: 30px; line-height: 1; }
.lb__nav { top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border-radius: 12px; font-size: 40px; line-height: 1; }
.lb__nav[hidden] { display: none; }
.lb__nav--prev { left: 12px; }
.lb__nav--next { right: 12px; }
.lb__count { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); color: #cbd5e1; font-size: 14px; }
@media (max-width: 720px) {
  .lb { padding: 56px 0 64px; background: #080d1a; }
  .lb__img { border-radius: 0; }
  .lb__cap { font-size: 14px; padding: 0 16px; }
  .lb__nav { top: auto; bottom: 10px; transform: none; width: 52px; height: 44px; font-size: 32px; }
}

/* частые вопросы */
.man-body .faq details { border-bottom: 1px solid var(--line); }
.man-body .faq details:first-child { border-top: 1px solid var(--line); }
.man-body .faq summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.man-body .faq summary::-webkit-details-marker { display: none; }
.man-body .faq summary::after { content: "+"; position: absolute; right: 4px; top: 11px; font-size: 22px; font-weight: 400; color: var(--accent); }
.man-body .faq details[open] summary::after { content: "−"; }
.man-body .faq details > div { padding: 0 0 16px; font-size: 15.5px; line-height: 1.6; color: #2b3852; }

/* назад / дальше */
.man-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 48px 0 0; }
.man-pager a { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; color: var(--ink); transition: border-color .15s ease; }
.man-pager a:hover { border-color: var(--accent); }
.man-pager a span { font-size: 13px; color: var(--muted); }
.man-pager a b { font-size: 16px; color: var(--accent); }
.man-pager__next { text-align: right; grid-column: 2; }

/* оглавление документации */
.man--index .man-lead { max-width: 820px; }
.man-start { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 4px 0 40px; font-size: 15px; color: var(--muted); }
.man-start a:not(.btn) { color: var(--accent); }
.man-group { margin: 0 0 40px; }
.man-group h2 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 16px; }
.man-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.man-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.man-card:hover { border-color: var(--accent); box-shadow: 0 18px 40px -26px rgba(13,30,70,.4); transform: translateY(-2px); }
.man-card__img { display: block; height: 150px; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.man-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.man-card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; }
.man-card__body b { font-size: 17px; color: var(--ink); }
.man-card__body span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.man-note { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

@media (max-width: 1359px) {
  .man-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .man-onpage { display: none; }
  .man-toc--inline { display: block; }
}
@media (max-width: 1080px) {
  .man-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .man-body { max-width: none; }
  /* список разделов — внизу, после текста */
  .man-nav { order: 2; position: static; max-height: none; overflow: visible; margin-top: 40px; }
}
@media (max-width: 720px) {
  .man { padding-top: 16px; }
  .man-lead { font-size: 17px; }
  .man-body h2 { font-size: 22px; margin-top: 36px; }
  .man-body p, .man-body li { font-size: 15.5px; }
  .man-pager { grid-template-columns: 1fr; }
  .man-pager__next { grid-column: 1; }
  .man-cards { grid-template-columns: 1fr; }
  .man-body .shot--narrow a { max-width: 100%; }
}

/* «Для продвинутых, можно пропустить» */
.adv { display: inline-block; font-size: 12.5px; font-weight: 600; color: #6b4600; background: #fff4dc; border-radius: 999px; padding: 3px 10px; margin: 0 0 12px; }
.man-onpage small, .man-toc--inline small { color: var(--muted-2); font-size: 12px; }
.man-nav a small { display: block; font-size: 11.5px; color: var(--muted-2); font-weight: 400; }
.man-card__adv { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: #6b4600; background: #fff4dc; border-radius: 999px; padding: 2px 9px; width: fit-content; }

/* свёрнутые подробности */
.man-body details.more { border: 1px solid var(--line); border-radius: 14px; margin: 14px 0 20px; background: #fff; }
.man-body details.more > summary { cursor: pointer; padding: 12px 16px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.man-body details.more > div { padding: 0 16px 6px; }

/* готовое письмо */
.man-body pre.letter { font-family: inherit; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 0 0 14px; color: #2b3852; }

/* высокий скриншот в лайтбоксе: по ширине, с вертикальной прокруткой */
.lb.lb--scroll { overflow-y: auto; align-items: flex-start; }
.lb.lb--scroll .lb__fig { height: auto; justify-content: flex-start; }
.lb.lb--scroll .lb__img { max-height: none; }
.lb.lb--scroll .lb__close, .lb.lb--scroll .lb__nav, .lb.lb--scroll .lb__count { position: fixed; }
