/* forma Merchant API docs — те же токены, что app/globals.css (ЛК / транзакции / настройки) */

:root {
  /* Бренд и ссылки — как в globals */
  --forma-blue: #598ffa;
  --forma-dark: #1e293b;
  --forma-light: #ffffff;
  --color-primary: #0d6efd;
  --color-primary-hover: #0b5ed7;
  --color-border: #e2e8f0;

  /* Theme tokens — light (синхрон с html:not(.dark) в globals) */
  --th-bg: #ffffff;
  --th-bg-alt: #f8fafc;
  --th-card: #ffffff;
  --th-card-border: rgba(0, 0, 0, 0.09);
  --th-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --th-text: #1e293b;
  --th-text-muted: #475569;
  --th-text-subtle: #64748b;
  --th-header-bg: rgba(255, 255, 255, 0.9);
  --th-row-border: rgba(0, 0, 0, 0.07);
  --th-btn-hover: rgba(0, 0, 0, 0.05);

  /* Локальные алиасы (старые классы) */
  --text: var(--th-text);
  --muted: var(--th-text-muted);
  --border: var(--th-card-border);
  --accent: var(--forma-blue);
  --bg: var(--th-card);
  --bg-subtle: var(--th-bg-alt);

  --sidebar-w: min(280px, 88vw);
  --radius: 12px;
  /* Чуть шире основная колонка — удобнее читать таблицы рядом с кодом */
  --doc-max: min(68rem, 100%);
  --main-gutter: clamp(0.75rem, 2.5vw, 1.5rem);
  --doc-radius: 1.125rem;
  --doc-shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 24px rgba(15, 23, 42, 0.06);
  /* Нейтрали как у GitBook / OxaPay API (светлая тема) */
  --doc-page-bg: #f8f9fb;
  --doc-surface: #ffffff;
  --doc-tint-subtle: #f1f3f6;
  --doc-tint-code: #f6f8fa;
  --doc-border: #e5e7eb;
  --doc-border-muted: #eceef2;
}

html.dark,
html[data-theme="dark"] {
  --forma-dark: #ffffff;
  --forma-light: rgba(255, 255, 255, 0.06);
  --color-border: rgba(255, 255, 255, 0.12);

  --th-bg: #0c0c0e;
  --th-bg-alt: #111113;
  --th-card: rgba(255, 255, 255, 0.05);
  --th-card-border: rgba(255, 255, 255, 0.09);
  --th-card-shadow: none;
  --th-text: #f1f5f9;
  --th-text-muted: rgba(255, 255, 255, 0.6);
  --th-text-subtle: rgba(255, 255, 255, 0.4);
  --th-header-bg: rgba(12, 12, 14, 0.88);
  --th-row-border: rgba(255, 255, 255, 0.06);
  --th-btn-hover: rgba(255, 255, 255, 0.08);

  --text: var(--th-text);
  --muted: var(--th-text-muted);
  --border: var(--th-card-border);
  --accent: var(--forma-blue);
  --bg: var(--th-card);
  --bg-subtle: var(--th-bg-alt);

  --doc-page-bg: #0c0c0e;
  --doc-surface: transparent;
  --doc-tint-subtle: transparent;
  --doc-tint-code: transparent;
  --doc-border: rgba(255, 255, 255, 0.1);
  --doc-border-muted: rgba(255, 255, 255, 0.07);
}

/* Отступ под фиксированную шапку ЛК */
.md-docs {
  padding-top: 4rem;
}

html:not(.dark) .md-docs {
  background: var(--doc-page-bg);
}

@media (min-width: 768px) {
  .md-docs {
    padding-top: 5rem;
  }
}

/* ─── Шапка: те же токены и blur, что у .dsh-header в globals ─── */
.dsh-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--th-header-bg);
  color: var(--th-text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--th-row-border);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dsh-header__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .dsh-header__inner {
    height: 5rem;
  }
}

.dsh-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  text-decoration: none !important;
  color: inherit;
}

.dsh-logo:hover {
  text-decoration: none !important;
}

.dsh-logo-docs {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--forma-blue);
  letter-spacing: -0.02em;
  line-height: 1;
  opacity: 0.95;
}

.dsh-logo__img {
  height: 3.5rem;
  width: auto;
  display: block;
  flex-shrink: 0;
}

html.dark .dsh-logo__img {
  filter: brightness(0) invert(1);
}

.dsh-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

/* Глобальные нейтральные (серые) скроллы — те же, что в app/globals.css,
   чтобы доке не приходился системный белый bar при overflow body/<pre>/aside. */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.15s ease;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
html.dark { scrollbar-color: rgba(148, 163, 184, 0.4) transparent; }
html.dark *::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  background-clip: padding-box;
}
html.dark *::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
  background-clip: padding-box;
}

@media (min-width: 768px) {
  html {
    scroll-padding-top: 5rem;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--th-text);
  background: var(--th-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Merchant docs: убираем подчёркивание на ссылках, без transform-эффектов
   (раньше был scale(1.028), но в сайдбаре он увеличивал и фон активного/
   ховер пункта, выглядело тяжеловесно). Цветовой акцент даёт достаточный
   feedback. */
body.md-docs a:not(.dsh-logo) {
  transition: color 0.18s ease, background 0.15s ease;
}
body.md-docs a:not(.dsh-logo):hover {
  text-decoration: none;
}

.shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* Общая колонка: сайдбар + текст центрируются вместе */
.docs-frame {
  width: 100%;
  padding: 0 var(--main-gutter);
  box-sizing: border-box;
}

.sidebar {
  position: fixed;
  top: 4.75rem;
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  box-sizing: border-box;
  padding: 0.65rem 0.5rem 1rem 0.75rem;
  background: transparent;
  border: none;
  overflow: hidden;
  z-index: 20;
  transform: translateX(-100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* «Рамка» навигации: карточка со скруглением и глубиной, не полоса на весь край */
/* [hidden] на втором блоке языка; иначе display:flex у .sidebar-inner перебивает атрибут hidden */
.sidebar-inner[hidden] {
  display: none !important;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding-top: 1rem;
  border-radius: 1rem;
  background: var(--doc-surface);
  border: 1px solid var(--doc-border-muted);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.75) inset,
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 28px -6px rgba(15, 23, 42, 0.1),
    0 2px 8px -2px rgba(89, 143, 250, 0.06);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.dark .sidebar-inner {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, var(--th-bg-alt) 48%, var(--th-bg-alt) 100%);
  border-color: var(--th-row-border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 10px 36px -8px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

html.dark .sidebar {
  background: transparent;
}

@media (min-width: 768px) {
  .sidebar {
    top: 5.75rem;
  }
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-group {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--th-row-border);
}

.sidebar-group:last-of-type {
  border-bottom: none;
}

.sidebar-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 1.1rem 0.6rem 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--th-text-subtle);
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-group__summary::-webkit-details-marker {
  display: none;
}

.sidebar-group__summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  opacity: 0.65;
  flex-shrink: 0;
  margin-top: -0.2rem;
}

.sidebar-group[open] > .sidebar-group__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

.sidebar-group__summary:hover {
  color: var(--th-text-muted);
  background: var(--th-btn-hover);
}

.sidebar-group__nav {
  padding: 0 0 0.5rem;
}

.sidebar nav a,
.sidebar-group__nav a,
.sidebar-nav-lead a {
  display: block;
  padding: 0.45rem 1.1rem;
  margin: 0 0.5rem;
  border-radius: 0.65rem;
  color: var(--th-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar nav a:hover,
.sidebar-group__nav a:hover,
.sidebar-nav-lead a:hover {
  /* Чёткая подложка тон-в-тон с active-state (но светлее), без размытия. */
  background: rgba(89, 143, 250, 0.06);
  color: var(--forma-blue);
  text-decoration: none;
}
html.dark .sidebar nav a:hover,
html.dark .sidebar-group__nav a:hover,
html.dark .sidebar-nav-lead a:hover {
  background: rgba(138, 166, 255, 0.08);
  color: #8aa6ff;
}
/* Активный пункт — без боковой синей полоски (она ломала ровный левый отступ
   и спорила с rounded-фоном); оставляем только цветной текст и подложку. */
.sidebar nav a.is-active,
.sidebar-group__nav a.is-active,
.sidebar-nav-lead a.is-active {
  background: rgba(89, 143, 250, 0.1);
  color: var(--forma-blue);
  font-weight: 600;
}
html.dark .sidebar nav a.is-active,
html.dark .sidebar-group__nav a.is-active,
html.dark .sidebar-nav-lead a.is-active {
  background: rgba(89, 143, 250, 0.14);
  color: #93c5fd;
}

.sidebar-group__nav a {
  margin-left: 0.35rem;
  margin-right: 0.35rem;
  padding-left: 1.35rem;
}

.sidebar nav a:focus-visible,
.sidebar-group__nav a:focus-visible,
.sidebar-nav-lead a:focus-visible {
  outline: 2px solid var(--forma-blue);
  outline-offset: 2px;
}

.fab-nav:focus-visible {
  outline: 2px solid var(--forma-blue);
  outline-offset: 3px;
}

.endpoint-full-url--copy:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
}

/* Вкладка «Информация» — как плашка в GitBook: минимализм */
.doc-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.35rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid var(--doc-border-muted);
  background: transparent;
}

.doc-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--th-text-muted);
  border: none;
  background: transparent;
  box-shadow: none;
}

.doc-tab--active {
  background: var(--doc-tint-subtle);
  color: var(--th-text);
  font-weight: 600;
}

html.dark .doc-tab--active {
  background: var(--doc-tint-subtle);
  color: var(--th-text);
}

.doc-information {
  scroll-margin-top: 5.5rem;
}

/* Хлебные крошки — текстовая строка, без «карточки» */
.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--th-text-muted);
}

.doc-breadcrumb__link {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.doc-breadcrumb__link:hover {
  text-decoration: none;
}

.doc-breadcrumb__sep {
  color: var(--th-text-subtle);
  user-select: none;
}

.doc-breadcrumb__current {
  color: var(--th-text);
  font-weight: 600;
}

.doc-page:not(.doc-page--information) .endpoint-doc {
  margin-top: 0;
}

.doc-page:not(.doc-page--information) {
  padding-top: 0.15rem;
}

.api-overview {
  margin: 0 0 1.75rem;
}

.doc .api-overview__title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--forma-dark);
}

html.dark .doc .api-overview__title {
  color: var(--th-text);
}

.api-overview__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.api-overview__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 700px) {
  .api-overview__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.15rem;
  }
}

.api-overview__col {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--doc-border-muted);
  background: var(--doc-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

html.dark .api-overview__col {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--th-card-border);
}

.doc .api-overview__col-title {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-text-subtle);
}

.api-overview__col-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.api-overview__col-title-link:hover {
  color: var(--forma-blue);
  text-decoration: none;
}

html.dark .api-overview__col-title-link:hover {
  color: #93c5fd;
}

/* Обзор раздела (Мерчанты / Транзакции / Выплаты) — краткий текст и ссылки на эндпоинты */
.doc-section-hub {
  scroll-margin-top: 5.5rem;
  max-width: 42rem;
}

.doc-section-hub__title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--th-text);
}

.doc-section-hub__lead {
  margin: 0 0 1.15rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.doc-section-hub__label {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-text-subtle);
}

.doc-section-hub__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.doc-section-hub__link {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid var(--doc-border-muted);
  background: var(--doc-surface);
  color: var(--th-text);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.doc-section-hub__link:hover {
  border-color: rgba(89, 143, 250, 0.45);
  background: var(--doc-tint-subtle);
  color: var(--forma-blue);
  text-decoration: none;
}

html.dark .doc-section-hub__link {
  border-color: var(--th-card-border);
  background: rgba(0, 0, 0, 0.2);
}

html.dark .doc-section-hub__link:hover {
  border-color: rgba(147, 197, 253, 0.35);
  color: #93c5fd;
}

.doc-section-hub__list--detailed {
  gap: 1rem;
}

.doc-section-hub__list--detailed li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.doc-section-hub__endpoint-desc {
  margin: 0;
  padding: 0 0.1rem 0 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.doc-section-hub__endpoint-desc code {
  font-size: 0.85em;
}

.doc-section-hub__mono {
  display: inline;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--th-text);
}

html.dark .doc-section-hub__mono {
  color: rgba(255, 255, 255, 0.88);
}

.api-overview__list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--th-text-muted);
}

.api-overview__list li {
  margin: 0.38rem 0;
}

.api-overview__list a {
  font-weight: 500;
}

/* Верх страницы — как отступ у .dsh-content относительно шапки */
.md-docs .doc {
  padding-top: 1.25rem;
}

@media (min-width: 768px) {
  .md-docs .doc {
    padding-top: 1.5rem;
  }
}

/* Как на лендинге: текст EN/RU + dsh-action-btn */
.dsh-action-btn.dsh-lang-toggle {
  min-width: 2.25rem !important;
  width: auto !important;
  height: 2.25rem !important;
  padding: 0 0.6rem !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  line-height: 1;
}

.dsh-action-btn {
  width: 2.25rem !important;
  height: 2.25rem !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: rgba(0, 0, 0, 0.055) !important;
  border-radius: 0.875rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(51, 51, 57, 0.75) !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
  flex-shrink: 0;
  font: inherit;
  line-height: 0;
}

/* Иконка темы — SVG как в ЛК (прямой потомок кнопки), по центру */
#btn-theme.dsh-action-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dsh-action-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: var(--forma-dark) !important;
  border-color: rgba(0, 0, 0, 0.18) !important;
}

html.dark .dsh-action-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.75) !important;
}

html.dark .dsh-action-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}

html.dark #btn-theme .lucide-sun {
  color: #f59e0b;
  stroke: #f59e0b;
}

.doc {
  width: 100%;
  margin: 0;
  padding: 1.75rem 0 4rem;
  box-sizing: border-box;
}

html:not(.dark) .doc {
  background: transparent;
}

.doc h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--forma-dark);
  scroll-margin-top: 1.25rem;
}

html.dark .doc h1 {
  color: var(--th-text);
}

.lead {
  color: var(--th-text-muted);
  margin: 0 0 2rem;
  font-size: 1.02rem;
  line-height: 1.55;
}

/* Hero — как карточка настроек / tx-card: спокойный фон, без «неоновой» полосы */
.doc-hero {
  position: relative;
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.35rem 1.6rem;
  border-radius: 12px;
  background: var(--doc-surface);
  border: 1px solid var(--doc-border-muted);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

html.dark .doc-hero {
  background: var(--th-card);
  border-color: var(--th-card-border);
  box-shadow: none;
}

.doc-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--forma-blue) 0%, rgba(89, 143, 250, 0.45) 100%);
  border-radius: 4px 0 0 4px;
  opacity: 0.85;
}

.doc-hero__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--th-text-muted);
}

.doc .doc-hero h1 {
  margin-top: 0;
}

.doc-hero__lead {
  margin-bottom: 0;
}

.doc-info-stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin: 0 0 2rem;
}

.doc-panel {
  position: relative;
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--doc-border-muted);
  background: var(--doc-surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

html.dark .doc-panel {
  border-color: var(--th-card-border);
  background: var(--th-card);
  box-shadow: none;
}

.doc-panel:hover {
  border-color: var(--doc-border);
}

html.dark .doc-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.doc-panel--accent {
  border-left: 4px solid var(--forma-blue);
  padding-left: calc(1.25rem - 3px);
}

.doc-panel__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.doc-panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  color: var(--forma-blue);
  background: rgba(89, 143, 250, 0.12);
  flex-shrink: 0;
}

html.dark .doc-panel__icon {
  background: rgba(89, 143, 250, 0.16);
}

.doc-panel .doc-panel__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--forma-dark);
  scroll-margin-top: 1.25rem;
}

html.dark .doc-panel .doc-panel__title {
  color: var(--th-text);
}

.doc-panel__hint {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--th-text-muted);
  line-height: 1.5;
}

.doc-panel__hint code {
  font-size: 0.88em;
}

.code-block {
  position: relative;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--doc-border-muted);
  background: var(--doc-tint-code);
  /* Внутрь блока кладём header-строку с кнопкой «Копировать», потом <pre>.
     Кнопка живёт на своей строке сверху, текст не сминается её колонкой
     справа — раньше она была absolute и кусала первую строку JSON, или
     в прошлой версии висела за пределами блока и обрезалась parent
     overflow:hidden у .endpoint-code-panel/.endpoint-response-status. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.dark .code-block {
  background: var(--doc-tint-code);
  border-color: var(--doc-border);
}

.code-block__pre {
  margin: 0;
  /* Кнопка «Копировать» сидит в header-строке над <pre> через flex-column
     родителя — текст здесь не зажимается её колонкой, padding симметричный. */
  padding: 0.55rem 0.85rem;
  overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--th-text);
  /* Скроллы (Firefox + WebKit) наследуют глобальные серые токены сверху;
     специфично для код-блоков делать ничего не надо. */
}

.code-block__pre code {
  display: block;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  white-space: pre;
  word-break: normal;
}

/* Кнопка «Копировать» — собственная header-строка внутри .code-block
   (flex column: button -> pre). Не зависит от parent overflow, не
   наезжает на текст. */
.code-block__copy {
  position: relative;
  align-self: flex-end;
  margin: 0.35rem 0.4rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.6rem;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  background: rgba(89, 143, 250, 0.18);
  color: var(--forma-blue);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.code-block__copy:hover {
  background: rgba(89, 143, 250, 0.28);
  color: var(--forma-blue);
}

.code-block__copy:active {
  transform: scale(0.96);
}

html.dark .code-block__copy {
  background: rgba(138, 166, 255, 0.18);
  color: #8aa6ff;
}

html.dark .code-block__copy:hover {
  background: rgba(138, 166, 255, 0.32);
  color: #b6c7ff;
}

.code-block__copy:focus-visible {
  outline: 2px solid var(--forma-blue);
  outline-offset: 2px;
}

.code-block__copy.is-copied {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #15803d !important;
}

html.dark .code-block__copy.is-copied {
  background: rgba(74, 222, 128, 0.22) !important;
  color: #4ade80 !important;
}

.doc h2 {
  margin: 2.5rem 0 0.85rem;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--forma-dark);
  scroll-margin-top: 1.25rem;
}

html.dark .doc h2 {
  color: var(--th-text);
}

.doc h3 {
  margin: 1.85rem 0 0.65rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--forma-dark);
  scroll-margin-top: 1.25rem;
}

html.dark .doc h3 {
  color: var(--th-text);
}

.doc h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--th-text-muted);
}

/* Эндпоинты — порядок как в OxaPay/GitBook: заголовок → вводный текст → полоска метода + путь → детали */
.endpoint-doc {
  margin: 0 0 2.25rem;
  scroll-margin-top: 6rem;
}

.doc .endpoint-doc > .endpoint-doc__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.28;
  color: var(--forma-dark);
}

html.dark .doc .endpoint-doc > .endpoint-doc__title {
  color: var(--th-text);
}

.endpoint-doc__intro p {
  margin: 0 0 0.9rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

/* Inline-code в свободном тексте (вне таблиц/details-блоков) — компактные
   цветные «таблетки»: цветной текст на полупрозрачной синей заливке, без
   жирного бордюра. Шрифт остаётся monospace для узнаваемости литерала, но
   плашка читается легче, чем серый прямоугольник с обводкой. Таблицы и
   field-guide сохраняют свой стиль через .endpoint-kv td code,
   .endpoint-field-guide__dl code. */
.endpoint-doc__intro code,
.doc-information p code,
.doc-information li code,
.doc-page--information p code,
.doc-page--information li code {
  background: rgba(89, 143, 250, 0.12);
  border: 0;
  padding: 0.05em 0.4em;
  border-radius: 0.4em;
  color: var(--forma-blue);
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  line-height: 1.4;
}
html.dark .endpoint-doc__intro code,
html.dark .doc-information p code,
html.dark .doc-information li code,
html.dark .doc-page--information p code,
html.dark .doc-page--information li code {
  background: rgba(138, 166, 255, 0.18);
  color: #8aa6ff;
}

/* Не-моноширинный акцент для значений-литералов в свободном тексте
   (HTTP-коды и т.п.) — используется как `<span class="doc-accent">201</span>`. */
.doc-accent {
  background: rgba(89, 143, 250, 0.12);
  color: var(--forma-blue);
  padding: 0.05em 0.45em;
  border-radius: 0.4em;
  font-weight: 600;
  font-size: 0.9em;
}
html.dark .doc-accent {
  background: rgba(138, 166, 255, 0.18);
  color: #8aa6ff;
}

.endpoint-doc__shell {
  border: 1px solid var(--th-card-border);
  border-radius: var(--doc-radius);
  overflow: hidden;
  background: var(--th-card);
  box-shadow: var(--th-card-shadow);
  transition: border-color 0.2s ease;
}

.endpoint-doc__opbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  min-height: 2.85rem;
  flex-wrap: nowrap;
}

.endpoint-doc__opbar--get {
  border-left: 3px solid var(--forma-blue);
  background: linear-gradient(
    90deg,
    rgba(89, 143, 250, 0.1) 0%,
    rgba(248, 250, 252, 0.65) 45%,
    var(--th-bg-alt) 100%
  );
}

html.dark .endpoint-doc__opbar--get {
  background: linear-gradient(90deg, rgba(89, 143, 250, 0.14) 0%, rgba(17, 17, 19, 0.95) 100%);
}

.endpoint-doc__opbar--post {
  border-left: 3px solid #22c55e;
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.11) 0%,
    rgba(248, 250, 252, 0.65) 45%,
    var(--th-bg-alt) 100%
  );
}

html.dark .endpoint-doc__opbar--post {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.14) 0%, rgba(17, 17, 19, 0.95) 100%);
}

.endpoint-doc__path {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--th-text) !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  word-break: break-all;
}

.endpoint-doc__opbar-fill {
  flex: 1 1 auto;
  min-width: 0.25rem;
}

.endpoint-full-url.endpoint-full-url--copy {
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.endpoint-full-url.endpoint-full-url--copy:hover {
  border-color: var(--doc-border);
  background: var(--doc-tint-subtle);
}

html.dark .endpoint-full-url.endpoint-full-url--copy:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--doc-border);
}

.endpoint-full-url.endpoint-full-url--copy.is-copied {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

html.dark .endpoint-full-url.endpoint-full-url--copy.is-copied {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.15);
}

.endpoint-doc__details {
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid var(--th-row-border);
  background: var(--th-bg);
}

html.dark .endpoint-doc__details {
  background: rgba(0, 0, 0, 0.2);
}

.endpoint-doc__subsection {
  margin: 0 0 0.75rem;
}

.endpoint-doc__subsection:last-child {
  margin-bottom: 0;
}

.doc .endpoint-doc .endpoint-doc__subsection-title {
  margin: 0 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--th-text-subtle);
  line-height: 1.3;
}

.endpoint-doc__list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.endpoint-doc__list li {
  margin: 0.4rem 0;
}

.endpoint-doc__p {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.endpoint-doc__details .endpoint-doc__subsection:first-child .endpoint-doc__subsection-title {
  margin-top: 0;
}

/* API-страница: пропорции как у GitBook / OxaPay (проза слева, код справа) */
.endpoint-doc--split {
  margin-bottom: 2.5rem;
}

.endpoint-doc__layout {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .endpoint-doc__layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 440px);
    gap: 2rem;
    column-gap: clamp(1.75rem, 4vw, 3rem);
  }
}

.endpoint-doc__main {
  min-width: 0;
}

.endpoint-doc__aside {
  min-width: 0;
}

@media (min-width: 1024px) {
  .endpoint-doc__aside {
    position: sticky;
    top: 5.25rem;
  }
}

.endpoint-section {
  margin: 0 0 1.5rem;
}

.endpoint-section:last-child {
  margin-bottom: 0;
}

.endpoint-section__title {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-text-subtle);
  line-height: 1.35;
}

.endpoint-muted {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--th-text-muted);
}

.endpoint-full-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--doc-border-muted);
  background: var(--doc-surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

html.dark .endpoint-full-url {
  background: var(--doc-surface);
  border-color: var(--doc-border);
  box-shadow: none;
}

.endpoint-full-url .method {
  flex-shrink: 0;
}

.endpoint-full-url__href {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-all;
  color: var(--th-text);
}

.endpoint-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid var(--doc-border-muted);
  border-radius: 8px;
  overflow: hidden;
  background: var(--doc-surface);
}

.endpoint-kv th,
.endpoint-kv td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--doc-border-muted);
}

.endpoint-kv tbody tr:last-child td {
  border-bottom: none;
}

.endpoint-kv thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--th-text-muted);
  background: var(--doc-tint-subtle);
}

html.dark .endpoint-kv thead th {
  background: var(--doc-tint-subtle);
}

.endpoint-kv td code {
  font-size: 0.84em;
}

.endpoint-responses {
  margin: 0;
  padding: 0 0 0 1.15rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--th-text-muted);
  list-style-position: outside;
}

.endpoint-responses strong {
  color: var(--th-text);
  font-weight: 600;
}

.endpoint-responses li {
  margin: 0.4rem 0;
}

.endpoint-responses li:first-child {
  margin-top: 0;
}

.endpoint-responses li:last-child {
  margin-bottom: 0;
}

.endpoint-field-guide {
  margin: 0.65rem 0 0;
  border: 1px solid var(--doc-border-muted);
  border-radius: 8px;
  background: var(--doc-surface);
  overflow: hidden;
}

.endpoint-field-guide + .endpoint-field-guide {
  margin-top: 0.45rem;
}

.endpoint-field-guide__summary {
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--th-text);
  cursor: pointer;
  list-style: none;
  background: var(--doc-tint-subtle);
}

.endpoint-field-guide__summary::-webkit-details-marker {
  display: none;
}

.endpoint-field-guide__summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.4rem;
  border-right: 1.5px solid var(--th-text-muted);
  border-bottom: 1.5px solid var(--th-text-muted);
  transform: rotate(-45deg);
  vertical-align: 0.15em;
  transition: transform 0.15s ease;
}

.endpoint-field-guide[open] .endpoint-field-guide__summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05em;
}

.endpoint-field-guide__dl {
  margin: 0;
  padding: 0.35rem 0.65rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--th-text-muted);
  border-top: 1px solid var(--doc-border-muted);
}

.endpoint-field-guide__dl dt {
  margin: 0.5rem 0 0.15rem;
  font-weight: 600;
  color: var(--th-text);
}

.endpoint-field-guide__dl dt:first-child {
  margin-top: 0;
}

.endpoint-field-guide__dl dd {
  margin: 0 0 0 0.35rem;
  padding: 0;
}

.endpoint-field-guide__dl code {
  font-size: 0.92em;
}

.endpoint-code-panel {
  border: 1px solid var(--doc-border-muted);
  border-radius: 12px;
  background: var(--doc-surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

html.dark .endpoint-code-panel {
  box-shadow: none;
}

.endpoint-code-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem;
  border-bottom: 1px solid var(--doc-border-muted);
  background: var(--doc-tint-subtle);
}

html.dark .endpoint-code-tabs {
  border-bottom-color: var(--doc-border);
  background: rgba(0, 0, 0, 0.2);
}

.endpoint-code-tab {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0.38rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  margin-bottom: 0;
  background: transparent;
  color: var(--th-text-muted);
  transition:
    color 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.endpoint-code-tab:hover {
  color: var(--th-text);
  background: rgba(255, 255, 255, 0.6);
}

html.dark .endpoint-code-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.endpoint-code-tab.is-active {
  color: var(--th-text);
  border-color: var(--doc-border-muted);
  background: var(--doc-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html.dark .endpoint-code-tab.is-active {
  color: var(--th-text);
  border-color: var(--doc-border);
  background: var(--th-bg-alt);
  box-shadow: none;
}

.endpoint-code-snippets {
  position: relative;
  padding: 0.5rem 0.5rem 0.65rem;
  background: var(--doc-tint-code);
}

html.dark .endpoint-code-snippets {
  background: var(--doc-tint-code);
}

.endpoint-code-snippet {
  display: none;
}

.endpoint-code-snippet.is-active {
  display: block;
}

.endpoint-code-panel .code-block {
  border-radius: 8px;
  border: 1px solid var(--doc-border-muted);
  box-shadow: none;
  overflow: hidden;
  background: var(--doc-surface);
}

html.dark .endpoint-code-panel .code-block {
  border-color: var(--doc-border);
  background: rgba(0, 0, 0, 0.25);
}

.endpoint-code-panel .code-block__pre {
  max-height: 20rem;
  overflow: auto;
}

.endpoint-code-response-block {
  border-top: 1px solid var(--doc-border-muted);
  background: var(--doc-tint-subtle);
}

html.dark .endpoint-code-response-block {
  background: rgba(0, 0, 0, 0.15);
}

.endpoint-code-response-label {
  margin: 0;
  padding: 0.55rem 0.75rem 0.2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-text-subtle);
}

.endpoint-code-response-block .code-block {
  margin: 0 0.5rem 0.5rem;
  border-radius: 8px;
}

.endpoint-response-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.5rem 0.5rem;
}

.endpoint-response-status {
  border: 1px solid var(--doc-border-muted);
  border-radius: 8px;
  background: var(--doc-surface);
  overflow: hidden;
}

html.dark .endpoint-response-status {
  border-color: var(--doc-border);
  background: rgba(0, 0, 0, 0.22);
}

.endpoint-response-status__summary {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--th-text);
}

.endpoint-response-status__summary::-webkit-details-marker {
  display: none;
}

.endpoint-response-status__summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--th-text-subtle);
  border-bottom: 2px solid var(--th-text-subtle);
  transform: rotate(-45deg);
  flex-shrink: 0;
  margin-top: 0.25rem;
  margin-left: auto;
  opacity: 0.7;
}

.endpoint-response-status[open] > .endpoint-response-status__summary::after {
  transform: rotate(45deg);
  margin-top: 0.35rem;
}

.endpoint-statuscode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.endpoint-statuscode--2xx {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

html.dark .endpoint-statuscode--2xx {
  color: #86efac;
}

.endpoint-statuscode--4xx {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

html.dark .endpoint-statuscode--4xx {
  color: #fca5a5;
}

.endpoint-statuscode--429 {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

html.dark .endpoint-statuscode--429 {
  color: #fcd34d;
}

.endpoint-response-status__title {
  flex: 1;
  min-width: 0;
}

.endpoint-response-status__body {
  padding: 0 0.6rem 0.6rem;
  border-top: 1px solid var(--doc-border-muted);
}

html.dark .endpoint-response-status__body {
  border-top-color: var(--doc-border);
}

.endpoint-response-status__desc {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--th-text-muted);
}

.endpoint-response-status__body
  .endpoint-response-status__desc
  + .code-block
  + .endpoint-response-status__desc {
  margin-top: 0.75rem;
}

.endpoint-response-status .code-block {
  margin: 0;
}

.doc-footnote {
  margin-top: 3rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--th-text-muted);
}

.method {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
}

.endpoint-doc__opbar .method {
  flex-shrink: 0;
}
.method--get {
  background: rgba(89, 143, 250, 0.12);
  color: #2563eb;
}
html.dark .method--get {
  color: #93c5fd;
  background: rgba(89, 143, 250, 0.16);
}
.method--post {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
html.dark .method--post {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.doc p {
  margin: 0.65rem 0;
}

.doc ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}
.doc li {
  margin: 0.35rem 0;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: transparent;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  color: inherit;
}
html.dark code {
  background: transparent;
}

.callout {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  border-radius: var(--doc-radius);
  border: 1px solid var(--th-card-border);
  background: var(--th-card);
  box-shadow: var(--th-card-shadow);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--th-text-muted);
}

.callout strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--th-text);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 18;
}
.sidebar-backdrop.is-visible {
  display: block;
}

.sidebar-close {
  display: none;
  margin: 0.75rem 1rem 0.5rem;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--th-card-border);
  border-radius: 0.75rem;
  background: var(--th-card);
  color: var(--th-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-close:hover {
  background: var(--th-btn-hover);
}

.fab-nav {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 40;
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 50%;
  border: 1px solid rgba(89, 143, 250, 0.35);
  background: var(--forma-blue);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(89, 143, 250, 0.35), 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fab-nav:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 22px rgba(89, 143, 250, 0.42), 0 2px 10px rgba(15, 23, 42, 0.14);
}

.fab-nav:active {
  transform: scale(0.98);
}

/* Десктоп: две колонки в сетке — сайдбар в потоке, не перекрывает текст */
@media (min-width: 901px) {
  /* Дерево + контент одной группой по центру экрана (не прижато к левому краю viewport) */
  .docs-frame {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    column-gap: var(--main-gutter);
    width: 100%;
    max-width: min(92rem, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--main-gutter);
    padding-right: var(--main-gutter);
    box-sizing: border-box;
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 5.75rem;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: var(--sidebar-w);
    height: auto;
    margin-top: 0;
    padding: 0.15rem 0.35rem 1rem 0;
    transform: none !important;
    overflow: visible;
    z-index: 1;
    transition: none;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .sidebar-inner {
    max-height: calc(100vh - 5.75rem - 1.25rem);
  }

  .sidebar.is-open {
    transform: none !important;
  }

  /* Контент примыкает к сайдбару; вся сетка выше центрирована */
  .main {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--doc-max);
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
    position: relative;
    z-index: 0;
  }

  .fab-nav {
    display: none !important;
  }

  .sidebar-close {
    display: none !important;
  }

  .sidebar-backdrop,
  .sidebar-backdrop.is-visible {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .sidebar-close {
    display: block;
  }

  .fab-nav {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
