/* ============================================================
   serp-base — СТИЛИ ДОКУМЕНТАЦИИ (13.10.2026, новые доки)
   Тёмная тема, фиолет/оранж — как на главной
   ============================================================ */

:root {
  --bg: #0f0f14; --bg-soft: #13131b; --card: #171720; --card-hi: #1b1b26;
  --line: #262636; --line-hi: #35354e; --text: #ececf5; --muted: #9a9ab4;
  --violet: #8b5cf6; --violet-soft: rgba(139,92,246,.13);
  --orange: #f97316; --orange-soft: rgba(249,115,22,.13);
  --green: #3fbf7f; --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--orange-soft);
  color: var(--orange);
  padding: 2px 6px;
  border-radius: 6px;
}
pre {
  background: #0b0b12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
}
pre code { background: none; color: #cfcfe6; padding: 0; font-size: 12.5px; line-height: 1.65; }

/* ---------- ШАПКА ---------- */
.doc-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(15,15,20,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.doc-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.doc-brand:hover { text-decoration: none; }
.doc-brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet-soft); border: 1px solid var(--line-hi);
}
.doc-brand .mark svg { width: 17px; height: 17px; color: var(--violet); }
.brand-text { font-size: 17px; font-weight: 700; }
.brand-text span { color: var(--orange); }
.doc-tag {
  font-size: 12px; color: var(--muted);
  padding: 3px 10px; border: 1px solid var(--line);
  border-radius: 999px; margin-left: 4px;
}
.doc-links { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.doc-links a { color: var(--muted); }
.doc-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- СЕТКА ---------- */
.doc-wrap {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}
.doc-nav {
  position: sticky; top: 76px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 6px;
}
.doc-nav b {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); margin: 20px 0 8px;
}
.doc-nav b:first-child { margin-top: 0; }
.doc-nav a {
  display: block; padding: 6px 10px; margin: 1px 0;
  border-radius: 8px; font-size: 13.5px; color: var(--muted);
}
.doc-nav a:hover {
  background: var(--card); color: var(--text); text-decoration: none;
}

.doc-main { min-width: 0; }
.doc-main h1 { font-size: 32px; margin: 0 0 12px; letter-spacing: -.5px; }
.doc-main h2 {
  font-size: 23px; margin: 44px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.doc-main h3 { font-size: 17px; margin: 26px 0 8px; }
.doc-main .lead { color: var(--muted); font-size: 16px; margin: 0 0 22px; }
.doc-main p { margin: 12px 0; }
.doc-main ul { margin: 12px 0; padding-left: 22px; }
.doc-main li { margin: 6px 0; }

/* ---------- ТАБЛИЦЫ ---------- */
.doc-main table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  margin: 16px 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.doc-main th, .doc-main td {
  padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc-main thead th {
  background: var(--bg-soft); color: var(--muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
}
.doc-main tbody tr:last-child td { border-bottom: none; }
.doc-main tbody tr:hover { background: var(--card-hi); }
.doc-main td.p { color: var(--green); font-weight: 700; white-space: nowrap; }

/* ---------- ВЫНОСКИ ---------- */
.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
}
.callout b { display: block; margin-bottom: 4px; }
.callout p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- FAQ ---------- */
details {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 18px; margin: 10px 0;
}
details summary {
  cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "+"; color: var(--violet); font-weight: 700; width: 16px;
}
details[open] summary::before { content: "−"; }
details p { color: var(--muted); margin: 0 0 14px 26px; font-size: 14px; }

/* ---------- КНОПКИ / CTA ---------- */
.doc-cta {
  margin-top: 48px; padding: 30px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r);
}
.doc-cta h3 { margin: 0 0 8px; font-size: 20px; }
.doc-cta p { color: var(--muted); margin: 0 0 18px; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 10px;
  background: var(--violet); color: #fff; font-weight: 600; font-size: 14px;
  margin-right: 0px;
}
.btn:hover { background: #7c4ce8; text-decoration: none; }
.btn.ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line-hi);
}
.btn.ghost:hover { background: var(--card-hi); }

/* ---------- ФУТЕР ---------- */
.doc-foot {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 24px 28px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
  max-width: 1240px; margin: 0 auto;
}

/* ---------- АДАПТИВ ---------- */
@media (max-width: 940px) {
  .doc-wrap { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 60px; }
  .doc-nav {
    position: static; max-height: none;
    display: flex; flex-wrap: wrap; gap: 6px;
    padding-bottom: 14px; border-bottom: 1px solid var(--line);
  }
  .doc-nav b { width: 100%; margin: 10px 0 4px; }
  .doc-nav a { padding: 5px 9px; background: var(--card); }
  .doc-main h1 { font-size: 26px; }
  .doc-main h2 { font-size: 20px; }
  .doc-top { padding: 12px 16px; }
  .doc-foot { flex-direction: column; padding: 20px 16px; }
}

/*

/* 14.10.2026: элегантная полоса прокрутки — ТОЛЬКО меню доков и код */
.doc-nav::-webkit-scrollbar,
.doc-wrap::-webkit-scrollbar,
.doc-body pre::-webkit-scrollbar,
.doc-body table::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.doc-nav::-webkit-scrollbar-track,
.doc-wrap::-webkit-scrollbar-track,
.doc-body pre::-webkit-scrollbar-track,
.doc-body table::-webkit-scrollbar-track {
  background: transparent;
}
.doc-nav::-webkit-scrollbar-thumb,
.doc-wrap::-webkit-scrollbar-thumb,
.doc-body pre::-webkit-scrollbar-thumb,
.doc-body table::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, .30);
  border-radius: 999px;
}
.doc-nav::-webkit-scrollbar-thumb:hover,
.doc-wrap::-webkit-scrollbar-thumb:hover,
.doc-body pre::-webkit-scrollbar-thumb:hover,
.doc-body table::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, .65);
}
.doc-nav::-webkit-scrollbar-corner,
.doc-wrap::-webkit-scrollbar-corner {
  background: transparent;
}
.doc-nav,
.doc-wrap,
.doc-body pre {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, .35) transparent;
}

/* ===== ПЕРЕОПРЕДЕЛЕНИЕ: в самом конце файла, чтобы перекрыть @media ===== */
/* ══════════════════════════════════════════════════════════════════════════
   20.10.2026 — ВЫРАВНИВАНИЕ ШАПКИ DETAIL-СТРАНИЦ ПО ЭТАЛОНУ ГЛАВНОЙ
   ПРОБЛЕМА (замерено в браузере при 1280): шапка .doc-top шла от 0 до 1265,
   то есть во всю ширину окна, а контент — 1240. На главной внутренний
   контейнер .top-in ограничен 1120px и стоит по центру.
   РЕШЕНИЕ: .doc-top-in — внутренний ограничитель той же ширины, что контент
   docs (1240px), с выравниванием по центру. Шапка остаётся липкой.
   ══════════════════════════════════════════════════════════════════════════ */
/* ⚠️ ТОЛЬКО при наличии .doc-top-in: на /docs/ обёртки нет, и там действует
   своя раскладка из docs-top-215147.css (display:flex !important в строку). */
header.doc-top:has(.doc-top-in) {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  padding: 0 !important;
}
.doc-top-in {
  display: flex !important; align-items: center; gap: 16px;
  width: 100% !important; max-width: 1240px !important; margin: 0 auto !important;
  padding: 14px 28px !important;
}

/* 🔴 ПРОКСИ-БЛОК: раньше <h2>Proxy routing</h2> лежал прямо в .doc-wrap —
   в grid 250px + 1fr он попадал в ПЕРВУЮ колонку и «висел» поверх меню.
   Теперь он вне сетки, отдельной секцией под контентом. */
.doc-proxy {
  max-width: 1240px !important; margin: 0 auto !important; padding: 0 28px 60px !important;
  display: block !important;
}
.doc-proxy h2 { margin-top: 0; }
.doc-proxy p { color: var(--muted); max-width: 860px; }

@media (max-width: 980px) {
  header.doc-top:has(.doc-top-in) .doc-top-in { padding: 12px 16px; }
  .doc-proxy { padding: 0 16px 40px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   20.10.2026 — СТРАНИЦЫ УСЛУГ (/services/*.html)
   ЗАМЕР: шапка (.doc-top-in) 1240, а контент .wrap — 1000. Шапка шире контента
   на 240px, из-за чего логотип не встаёт на линию контента.
   Причина: у .wrap в услугах свой max-width 1000.
   РЕШЕНИЕ: на страницах услуг шапку выравниваем по ШИРИНЕ КОНТЕНТА (1000),
   а не наоборот — контент услуг уже свёрстан под 1000.
   ══════════════════════════════════════════════════════════════════════════ */
body:has(.wrap) header.doc-top .doc-top-in {
  max-width: 1000px !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   20.10.2026 — ЭФФЕКТ ШАПКИ ПРИ СКРОЛЛЕ, КАК НА ГЛАВНОЙ (detail-страницы)
   Хозяин: «сразу при открытии полосочки под шапкой нет, она появляется только
   когда скроллишь — скопируй стиль с главной».
   ЭТАЛОН (главная, style-sticky): в покое фон .72 без тени; после скролла
   класс is-scrolled → фон .92 + тень + тонкая линия.
   ══════════════════════════════════════════════════════════════════════════ */

/* 1. В ПОКОЕ: без линии и без тени (полоска появляется только при скролле) */
header.doc-top,
html body header.doc-top {
  border-bottom: 0 !important;
  box-shadow: none !important;
  background: rgba(15, 15, 20, .72) !important;
  transition: background .25s ease, box-shadow .25s ease !important;
}

/* 2. ПОСЛЕ СКРОЛЛА: как header.top.is-scrolled на главной */
header.doc-top.is-scrolled,
html body header.doc-top.is-scrolled {
  background: rgba(13, 13, 18, .92) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 1px 0 rgba(139, 92, 246, .12) !important;
  border-bottom: 0 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   20.10.2026 — ШАПКА И ПОДВАЛ ДЕТАЛЬНЫХ СТРАНИЦ = ТОЧНО КАК /docs/
   Хозяин: «у страниц с подробными api шапка и подвал по стилю отличаются
   от /docs/ — нужно сделать также».

   ЗАМЕРЫ ЭТАЛОНА /docs/ (при 1280): шапка высота 76, padding 10px 104px,
   логотип left 104 (30px), метка left 258 (30px, 13px), меню left 961 right 1141
   (39px, gap 22, шрифт 14.5); подвал ширина 1120, padding 24px, 13px.

   ЗАМЕРЫ ДЕТАЛЬНОЙ ДО ФИКСА: шапка 57, padding 0, логотип left 41,
   метка left 177, меню 1101-1225; подвал 1240 / 24px 28px.

   ПРИЧИНА: у детальных страниц есть обёртка .doc-top-in (на /docs/ её нет),
   и внешний HTML-файл стилей задавал свои padding/max-width.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── ШАПКА: геометрия эталона /docs/ ── */
html body header.doc-top {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 20px !important;
  flex-wrap: nowrap !important;
  padding: 10px max(24px, calc((100vw - 1120px) / 2 + 24px)) !important;
  min-height: 76px !important;
  max-width: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ── ВНУТРЕННЯЯ ОБЁРТКА: не мешает, растягиваем на всю ширину шапки ── */
html body header.doc-top .doc-top-in {
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── ЛОГОТИП: 30px, как на /docs/ ── */
html body header.doc-top .doc-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  height: 30px !important;
  flex: 0 0 auto !important;
  text-decoration: none !important;
}
html body header.doc-top .doc-brand .mark {
  width: 30px !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(139, 92, 246, .35) !important;
  border-radius: 8px !important;
  flex: 0 0 auto !important;
}
html body header.doc-top .doc-brand .mark svg {
  width: 18px !important;
  height: 18px !important;
}
html body header.doc-top .doc-brand .brand-text {
  font-size: 15.5px !important;
  font-weight: 700 !important;
  letter-spacing: -.2px !important;
  color: #ececf5 !important;
}

/* ── МЕТКА «API Documentation»: 30px, 13px, как на /docs/ ── */
html body header.doc-top .doc-tag {
  display: inline-flex !important;
  align-items: center !important;
  height: 30px !important;
  padding: 0 10px !important;
  margin-left: 16px !important;   /* эталон /docs/: метка левее на 8px */
  border: 1px solid rgba(139, 92, 246, .28) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  color: #9a9ab0 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

/* ── МЕНЮ справа: 39px, gap 22, 14.5px, отступ 20 справа (эталон right 1141) ── */
html body header.doc-top nav.doc-links {
  margin-left: auto !important;
  margin-right: 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 22px !important;
  height: 39px !important;
  font-size: 14.5px !important;
}
html body header.doc-top nav.doc-links a {
  padding: 8px 12px !important;
  border-radius: 9px !important;
  color: #9a9ab0 !important;
  text-decoration: none !important;
  transition: color .18s, background .18s !important;
}
html body header.doc-top nav.doc-links a:hover {
  color: #fff !important;
  background: rgba(139, 92, 246, .16) !important;
}

/* ── ПОДВАЛ: 1120 ширины, 24px отступы, 13px — как на /docs/ ── */
html body footer.doc-foot {
  max-width: 1120px !important;
  width: auto !important;
  margin: 0 auto !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  display: flex !important;
  justify-content: space-between !important;
  gap: 16px !important;
  border-top: 1px solid rgba(38, 38, 54, 1) !important;
  color: #9a9ab4 !important;
  font-size: 13px !important;
}

@media (max-width: 1168px) {
  html body header.doc-top { padding: 10px 24px !important; gap: 12px !important; }
}
@media (max-width: 880px) {
  html body header.doc-top { padding: 8px 18px !important; min-height: 60px !important; gap: 8px !important; }
  html body header.doc-top .doc-tag { display: none !important; }
  html body header.doc-top nav.doc-links { gap: 8px !important; font-size: 13.5px !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   20.10.2026 — САЙДБАР ДЕТАЛЬНЫХ СТРАНИЦ = ТОЧНО ПОД ЛОГО, КАК НА /docs/
   Хозяин: «боковой сайдбар остался на том же уровне, а должен быть чётко
   под лого».

   ЗАМЕРЫ ЭТАЛОНА /docs/ (1280): логотип left 104; сайдбар left 104 (= лого!),
   ширина 250, статья left 394, ширина 775; контейнер 1120 по центру.

   ЗАМЕРЫ ДЕТАЛЬНОЙ ДО ФИКСА: логотип left 104, а САЙДБАР left 41 —
   на 63px левее логотипа. Причина: .doc-wrap имел padding 32px 28px
   и max-width 1240 (а не 1120), поэтому сетка начиналась от края окна,
   а не от линии логотипа.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Контейнер: 1120 по центру, как на /docs/ ── */
html body .doc-wrap {
  max-width: 1120px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 32px 24px 80px 31.5px !important;   /* эталон /docs/: логотип и сайдбар на 104 */
  box-sizing: border-box !important;
}

/* ── Сетка: 250 + статья, зазор 40 (как на /docs/) ── */
html body .doc-wrap {
  display: grid !important;
  grid-template-columns: 250px minmax(0, 1fr) !important;
  gap: 40px !important;
  align-items: start !important;
}

/* ── Сайдбар: ровно под логотипом, sticky с тем же top ── */
html body .doc-wrap .doc-nav,
html body .doc-nav {
  position: sticky !important;
  top: 96px !important;
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
  padding: 4px 6px 0 0 !important;
  margin: 0 !important;
  grid-column: 1 !important;
}

/* ── Статья: вторая колонка ── */
html body .doc-wrap .doc-body,
html body .doc-wrap article {
  grid-column: 2 !important;
  min-width: 0 !important;
}

/* ── Прокси-блок вне сетки: та же ширина 1120 ── */
html body .doc-proxy {
  max-width: 1120px !important;
  margin: 0 auto !important;
  padding: 0 0 60px !important;
}

/* ── Обёртка шапки: 1120 (было 1240) ── */
.doc-top-in {
  max-width: 1120px !important;
  padding: 0 !important;
}

/* ── Мобильные ── */
@media (max-width: 1168px) {
  html body .doc-wrap { padding: 24px 20px 60px !important; }
}
@media (max-width: 980px) {
  html body .doc-wrap { grid-template-columns: 1fr !important; gap: 20px !important; }
  html body .doc-wrap .doc-nav { position: static !important; max-height: none !important; }
  html body .doc-wrap .doc-body, html body .doc-wrap article { grid-column: 1 !important; }
}
