/* ОБЩАЯ ТЕМА vStack. Источник правды — корневая репа vstack/docs.
 * Выкладывается ОДИН РАЗ в корень раздачи как /_shared/vstack-theme.css и
 * подключается КАЖДЫМ продуктовым бандлом по абсолютному пути (headTags в
 * docusaurus.config.js). Поэтому это РАНТАЙМ-синхронизация: правишь этот файл и
 * выкладываешь его один раз — перекрашиваются ВСЕ продукты и ВСЕ версии сразу,
 * без пересборки бандлов. (Бандл нельзя «перекрасить» иначе — его собственный
 * custom.css вшит; сюда выносим только брендовый слой: цвета/шрифт/лого/шапку/подвал.)
 *
 * Дизайн — Figma «vStack Pages», страница «Раздел DOCS в vStack» (тёмная тема):
 * шрифт Inter (код — Roboto Mono), фон #111111, текст #E7E7E7 и его прозрачности,
 * акцент #768FFF, рамки 8% от цвета текста. Ссылка на тему стоит в <head> РАНЬШЕ
 * стилей бандла, поэтому правила подняты по специфичности через html[data-theme='dark'] —
 * иначе Infima из бандла перебьёт их порядком. Сайты тёмные (disableSwitch), светлой темы нет. */

@font-face {
  font-display: swap; font-family: Inter; font-style: normal; font-weight: 100 900;
  src: url(/_shared/fonts/inter-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-display: swap; font-family: Inter; font-style: normal; font-weight: 100 900;
  src: url(/_shared/fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-display: swap; font-family: "Roboto Mono"; font-style: normal; font-weight: 400;
  src: url(/_shared/fonts/roboto-mono-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-display: swap; font-family: "Roboto Mono"; font-style: normal; font-weight: 400;
  src: url(/_shared/fonts/roboto-mono-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Токены макета ── */
:root {
  --vs-bg: #111111;               /* color/bg/page */
  --vs-bg-container: #1f1f1f;     /* color/bg/container — фон инлайн-кода */
  --vs-bg-button: #242424;        /* button/secondary-alt/fill — карточки пагинации */
  --vs-surface: #ffffff05;        /* color/bg/secondary alpha (2%) — таблицы, карточки */
  --vs-text: #e7e7e7;             /* color/text/primary */
  --vs-text-2: #e7e7e7cc;         /* 80% — текущая крошка */
  --vs-text-3: #e7e7e78f;         /* color/text/tertiary (56%) */
  --vs-text-4: #e7e7e752;         /* 32% — плейсхолдер, второстепенные ссылки шапки */
  --vs-text-5: #e7e7e729;         /* color/text/disabled (16%) — имя продукта в шапке */
  --vs-border: #e7e7e714;         /* color/border/default (8%) */
  --vs-border-strong: #e7e7e71f;  /* 12% — рамка блока кода */
  --vs-hover: #e7e7e70a;          /* Sidebar/Hover/bg (4%) */
  --vs-selected: #e7e7e714;       /* Sidebar/Selected/bg (8%) */
  --vs-tree: #343434;             /* линия вложенного меню */
  --vs-accent: #768fff;           /* color/accent/default */
  --vs-logo: #6d6d6d;
  --vs-popover: #2a2a2a99;        /* color/bg/popover (60%) + blur */
  --vs-shadow: 0 8px 20px #00000040;
}

html[data-theme='dark']:root {
  --ifm-font-family-base: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ifm-font-family-monospace: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ifm-heading-font-family: var(--ifm-font-family-base);
  --ifm-font-size-base: 14px;
  --ifm-line-height-base: 1.4;
  --ifm-font-weight-semibold: 500;
  --ifm-font-weight-bold: 500;
  --ifm-heading-font-weight: 500;
  --ifm-heading-line-height: 1.3;
  --ifm-heading-color: var(--vs-text);
  --ifm-code-font-size: 100%;
  --ifm-code-border-radius: 4px;
  --ifm-code-padding-horizontal: 6px;
  --ifm-code-padding-vertical: 2px;
  --ifm-leading: 12px;
  --ifm-paragraph-margin-bottom: 12px;
  --ifm-global-radius: 8px;

  --ifm-color-primary: #768fff;
  --ifm-color-primary-dark: #5b79ff;
  --ifm-color-primary-darker: #4d6eff;
  --ifm-color-primary-darkest: #2549ff;
  --ifm-color-primary-light: #91a5ff;
  --ifm-color-primary-lighter: #9fb0ff;
  --ifm-color-primary-lightest: #c7d1ff;

  --ifm-background-color: var(--vs-bg);
  --ifm-background-surface-color: var(--vs-bg);
  --ifm-font-color-base: var(--vs-text);
  --ifm-color-content: var(--vs-text);
  --ifm-color-content-secondary: var(--vs-text-3);
  --ifm-link-color: var(--vs-accent);
  --ifm-link-hover-color: var(--vs-accent);
  --ifm-hr-background-color: var(--vs-border);
  --ifm-toc-border-color: var(--vs-border);
  --ifm-table-border-color: var(--vs-border);
  --ifm-color-emphasis-200: var(--vs-selected);
  --ifm-color-emphasis-300: var(--vs-border);

  --ifm-navbar-height: 60px;
  --ifm-navbar-padding-vertical: 12px;
  --ifm-navbar-padding-horizontal: 24px;
  --ifm-navbar-background-color: var(--vs-bg);
  --ifm-navbar-link-color: var(--vs-text);
  --ifm-navbar-link-hover-color: var(--vs-text);
  --ifm-footer-background-color: var(--vs-bg);

  --doc-sidebar-width: 256px;
  --ifm-menu-color: var(--vs-text-3);
  --ifm-menu-color-active: var(--vs-text);
  --ifm-menu-color-background-active: var(--vs-selected);
  --ifm-menu-color-background-hover: var(--vs-hover);
  --ifm-menu-link-padding-horizontal: 10px;
  --ifm-menu-link-padding-vertical: 8px;
  /* шеврон вниз, 56% от цвета текста */
  --ifm-menu-link-sublist-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='none' stroke='%23e7e7e7' stroke-opacity='.56' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M4 10l4-4 4 4'/></svg>");

  --ifm-toc-padding-horizontal: 16px;
  --ifm-toc-link-color: var(--vs-text-3);

  --ifm-breadcrumb-color-active: var(--vs-text-2);
  --ifm-breadcrumb-item-background-active: transparent;

  --ifm-dropdown-background-color: var(--vs-popover);
  --ifm-dropdown-link-color: var(--vs-text);
  --ifm-dropdown-hover-background-color: var(--vs-hover);
}

html[data-theme='dark'] body,
html[data-theme='dark'] .theme-layout-main { background-color: var(--vs-bg); color: var(--vs-text); }
html[data-theme='dark'] ::selection { background: #768fff59; }

/* ── Шапка ── */
html[data-theme='dark'] .navbar {
  border-bottom: 1px solid var(--vs-border);
  box-shadow: none;
}
html[data-theme='dark'] .navbar__items { gap: 16px; }
html[data-theme='dark'] .navbar__items--right { gap: 12px; }
html[data-theme='dark'] .navbar__item { padding: 0; }
html[data-theme='dark'] .navbar__link { font-size: 14px; font-weight: 400; }
html[data-theme='dark'] .navbar__link:hover { color: var(--vs-text); }

/* Логотип — маской из /_shared/img/logo.svg, серый, как в макете. Свой <img> корня
 * и сырой заголовок бандла («vStack center · dev») скрыты: имя продукта показывает
 * выпадашка продуктов, её ставит /_shared/vstack.js. Если скрипт не нашёл продукт,
 * он помечает заголовок data-vstack="fallback" — тогда заголовок виден. */
html[data-theme='dark'] .navbar__brand { margin-right: 0; }
html[data-theme='dark'] .navbar__brand::before {
  content: "";
  flex: none;
  width: 56px;
  height: 14px;
  background: var(--vs-logo);
  -webkit-mask: url(/_shared/img/logo.svg) no-repeat left center / contain;
  mask: url(/_shared/img/logo.svg) no-repeat left center / contain;
}
html[data-theme='dark'] .navbar__brand:hover::before { background: var(--vs-text-3); }
html[data-theme='dark'] .navbar__brand .navbar__logo { display: none; }
html[data-theme='dark'] .navbar__brand .navbar__title:not([data-vstack='fallback']) { display: none; }
html[data-theme='dark'] .navbar__brand .navbar__title {
  margin-left: 12px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--vs-text-5);
}

/* выпадашка продуктов рядом с логотипом: «Center ▾» / «Продукты ▾» */
html[data-theme='dark'] .vstack-products > .navbar__link {
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.02em;
  color: var(--vs-text-5);
}
html[data-theme='dark'] .vstack-products > .navbar__link:hover,
html[data-theme='dark'] .vstack-products.dropdown--show > .navbar__link { color: var(--vs-text-3); }
html[data-theme='dark'] .vstack-site { color: var(--vs-text-4); }
html[data-theme='dark'] .vstack-site:hover { color: var(--vs-text-3); }

/* выпадашки шапки (продукты, версия, язык) — всплывающая панель макета */
html[data-theme='dark'] .navbar .dropdown > .navbar__link:after {
  border: 0;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  top: 0;
  transform: none;
  vertical-align: -3px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='%23e7e7e7' fill-opacity='.56' d='M4.5 6.5h7L8 10z'/></svg>") no-repeat center;
}
html[data-theme='dark'] .dropdown__menu {
  min-width: 200px;
  padding: 4px;
  border: 1px solid var(--vs-border);
  border-radius: 8px;
  background: var(--vs-popover);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--vs-shadow);
}
html[data-theme='dark'] .dropdown__link {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 20px;
  color: var(--vs-text);
}
html[data-theme='dark'] .dropdown__link:hover { background: var(--vs-hover); color: var(--vs-text); }
html[data-theme='dark'] .dropdown__link--active,
html[data-theme='dark'] .dropdown__link--active:hover { background: var(--vs-selected); color: var(--vs-text); }
/* поле «Поиск» в длинных выпадашках (версии) — вставляет vstack.js */
.vstack-dd-filter { padding: 0 0 4px; margin-bottom: 4px; border-bottom: 1px solid var(--vs-border); }
.vstack-dd-filter input {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--vs-text);
}
.vstack-dd-filter input::placeholder { color: var(--vs-text-4); }
.vstack-dd-filter input:focus { outline: none; }
.vstack-dd-list { max-height: 260px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.vstack-dd-filter, .vstack-dd-list li { list-style: none; }

/* Shared navigation is independent of Infima's desktop-only navbar__item. */
.navbar[data-vstack-navigation='ready'] .navbar__inner > .navbar__items:not(.navbar__items--right) {
  flex: 0 0 auto;
}
.navbar[data-vstack-navigation='ready'] .navbar__items--right { order: 2; }
.vstack-switchers {
  display: flex;
  flex: 1;
  order: 1;
  align-items: center;
  gap: 16px;
  min-width: 0;
  margin-left: 16px;
}
.vstack-dropdown { position: relative; min-width: 0; }
.vstack-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 36px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--vs-text-2);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}
.vstack-dropdown-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vstack-dropdown-toggle::after {
  content: '';
  flex: none;
  border: 4px solid transparent;
  border-bottom: 0;
  border-top-color: currentColor;
}
.vstack-dropdown-toggle:hover, .vstack-dropdown[data-open='true'] > button { color: var(--vs-text); }
.vstack-products > button { font-size: 18px; font-weight: 500; }
.vstack-versions { margin-left: auto; }
.vstack-current-language { color: var(--vs-text-3); font-size: 14px; }
html[data-theme='dark'] .vstack-switchers > .vstack-site { color: var(--vs-text-3); font-size: 14px; white-space: nowrap; }
.vstack-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 2;
  width: max-content;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: 70vh;
  max-height: min(360px, calc(100dvh - 160px));
  margin: 0;
  padding: 4px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--vs-border-strong);
  border-radius: 8px;
  background: var(--vs-bg-container);
  box-shadow: var(--vs-shadow);
}
.vstack-menu[hidden], .vstack-menu li[hidden] { display: none !important; }
.vstack-menu li { margin: 0; padding: 0; list-style: none; }
.vstack-language .vstack-menu, .vstack-versions .vstack-menu { left: auto; right: 0; }
.vstack-menu-link {
  display: block;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--vs-text-2);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}
.vstack-menu-link:hover, .vstack-menu-link[aria-current='page'] {
  background: var(--vs-selected);
  color: var(--vs-text);
  text-decoration: none;
}
.vstack-dropdown-toggle:focus-visible, .vstack-menu-link:focus-visible,
.vstack-sidebar-home:focus-visible, .vstack-sidebar-field select:focus-visible,
.vstack-menu input:focus-visible {
  outline: 2px solid var(--vs-accent);
  outline-offset: 2px;
}
.vstack-sidebar-navigation { display: none; }

/* ── Боковое меню ── */
html[data-theme='dark'] .theme-doc-sidebar-container { border-right: 1px solid var(--vs-border) !important; }
html[data-theme='dark'] .theme-doc-sidebar-menu { padding: 8px; }
html[data-theme='dark'] .menu { padding: 0; font-weight: 500; }
html[data-theme='dark'] .menu__list-item:not(:first-child) { margin-top: 4px; }
html[data-theme='dark'] .menu__link {
  border-radius: 6px;
  font-size: 14px;
  line-height: 20px;
  color: var(--vs-text-3);
}
html[data-theme='dark'] .menu__link:hover { color: var(--vs-text-2); }
html[data-theme='dark'] .menu__link--active:not(.menu__link--sublist) { color: var(--vs-text); background: var(--vs-selected); }
html[data-theme='dark'] .menu__link--sublist.menu__link--active { color: var(--vs-text-2); background: none; }
html[data-theme='dark'] .menu__link--sublist.menu__link--active:hover { background: var(--vs-hover); }
html[data-theme='dark'] .menu__list .menu__list {
  margin: 4px 0 0 18px;
  padding-left: 9px;
  border-left: 1px solid var(--vs-tree);
}
html[data-theme='dark'] .menu__link--sublist { padding-right: 4px; }
html[data-theme='dark'] .menu__caret { padding: 0 6px; border-radius: 6px; }
html[data-theme='dark'] .menu__caret:hover { background: var(--vs-hover); }
/* шеврон как в макете: свёрнуто — вниз, раскрыто — вверх; фильтр-инверсию бандла снимаем */
html[data-theme='dark'] .menu__caret:before,
html[data-theme='dark'] .menu__link--sublist-caret:after {
  background: var(--ifm-menu-link-sublist-icon) 50% / 16px 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  filter: none;
  transform: none;
}
html[data-theme='dark'] .menu__list-item--collapsed .menu__caret:before,
html[data-theme='dark'] .menu__list-item--collapsed .menu__link--sublist-caret:after { transform: rotate(180deg); }

/* ── Колонка статьи ── */
html[data-theme='dark'] main[class*='docMainContainer'] > .container { padding: 24px; }
html[data-theme='dark'] .theme-doc-breadcrumbs { margin-bottom: 40px; }
html[data-theme='dark'] .breadcrumbs { font-size: 14px; font-weight: 500; }
html[data-theme='dark'] .breadcrumbs__link {
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--vs-text-3);
}
html[data-theme='dark'] a.breadcrumbs__link:hover { background: none; color: var(--vs-text-2); }
html[data-theme='dark'] .breadcrumbs__item--active .breadcrumbs__link { color: var(--vs-text-2); }
html[data-theme='dark'] .breadcrumbs__item:not(:last-child):after {
  content: "/";
  background: none;
  filter: none;
  width: auto;
  height: auto;
  margin: 0 8px;
  opacity: 1;
  color: var(--vs-text-4);
}
html[data-theme='dark'] .breadcrumbs__link svg { vertical-align: -2px; }

/* ── Текст ── */
html[data-theme='dark'] .markdown { font-size: 14px; line-height: 1.4; }
html[data-theme='dark'] .markdown h1,
html[data-theme='dark'] .markdown h2 {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
html[data-theme='dark'] .markdown h1 { --ifm-h1-font-size: 28px; margin-bottom: 12px; }
html[data-theme='dark'] .markdown h2 { --ifm-h2-font-size: 28px; margin: 40px 0 12px; }
html[data-theme='dark'] .markdown h3 { --ifm-h3-font-size: 18px; font-size: 18px; line-height: 1.4; margin: 28px 0 8px; }
html[data-theme='dark'] .markdown h4 { --ifm-h4-font-size: 16px; font-size: 16px; line-height: 1.4; margin: 20px 0 8px; }
html[data-theme='dark'] .markdown h5,
html[data-theme='dark'] .markdown h6 { font-size: 14px; margin: 16px 0 8px; }
html[data-theme='dark'] .markdown > h2:first-child,
html[data-theme='dark'] .markdown > header + h2 { margin-top: 28px; }
html[data-theme='dark'] .theme-doc-markdown.markdown span[id],
html[data-theme='dark'] .markdown :is(h1, h2, h3, h4)[id] { scroll-margin-top: calc(var(--ifm-navbar-height) + 16px); }
html[data-theme='dark'] .markdown a:not(.hash-link) { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
html[data-theme='dark'] .markdown a:hover { text-decoration: underline; text-underline-offset: 3px; }
html[data-theme='dark'] b,
html[data-theme='dark'] strong { color: var(--vs-text); font-weight: 500; }
html[data-theme='dark'] mark { background-color: #768fff40; color: var(--vs-text); }
html[data-theme='dark'] hr { height: 1px; background-color: var(--vs-border); }
html[data-theme='dark'] .markdown li + li { margin-top: 4px; }
html[data-theme='dark'] blockquote {
  border-left: 2px solid var(--vs-border-strong);
  color: var(--vs-text-3);
  padding: 0 16px;
}

/* инлайн-код */
html[data-theme='dark'] code {
  border: 0;
  background: var(--vs-bg-container);
  color: var(--vs-text-3);
  font-size: 14px;
  vertical-align: baseline;
}
html[data-theme='dark'] a code { color: inherit; }
html[data-theme='dark'] .markdown table code { white-space: nowrap; }

/* ── Таблицы: скруглённая рамка, без зебры, шапка приглушённая ── */
html[data-theme='dark'] .markdown table {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--vs-border);
  border-radius: 8px;
  background: var(--vs-surface);
  overflow: hidden;
}
html[data-theme='dark'] .markdown table thead,
html[data-theme='dark'] .markdown table tr { background: none; border: 0; }
html[data-theme='dark'] .markdown table th,
html[data-theme='dark'] .markdown table td {
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--vs-border);
  border-bottom: 1px solid var(--vs-border);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  vertical-align: top;
}
html[data-theme='dark'] .markdown table th { color: var(--vs-text-3); font-weight: 400; }
html[data-theme='dark'] .markdown table tr > :last-child { border-right: 0; }
html[data-theme='dark'] .markdown table tbody tr:last-child > * { border-bottom: 0; }
html[data-theme='dark'] .markdown table tr:nth-child(2n) { background: none; }

/* ── Блоки кода ── */
html[data-theme='dark'] .theme-code-block {
  --prism-background-color: #151515 !important;
  --prism-color: var(--vs-text) !important;
  border: 1px solid var(--vs-border-strong);
  border-radius: 8px;
  box-shadow: none;
}
html[data-theme='dark'] .theme-code-block pre { border-radius: 8px; }
html[data-theme='dark'] .theme-code-block pre code { font-size: 14px; line-height: 1.4; padding: 12px 13px; }
html[data-theme='dark'] .theme-code-block [class*='codeBlockTitle'] {
  border-bottom: 1px solid var(--vs-border-strong);
  font-size: 14px;
  color: var(--vs-text-3);
}
html[data-theme='dark'] .theme-code-block button { color: var(--vs-text-4); border-color: var(--vs-border); background: var(--vs-bg); }
/* подсветка: ключи — акцент, ключевые слова — фиолетовый, значения — цвет текста */
html[data-theme='dark'] .theme-code-block .token.comment,
html[data-theme='dark'] .theme-code-block .token.prolog,
html[data-theme='dark'] .theme-code-block .token.doctype,
html[data-theme='dark'] .theme-code-block .token.cdata { color: #e7e7e766 !important; font-style: normal !important; }
html[data-theme='dark'] .theme-code-block .token.punctuation,
html[data-theme='dark'] .theme-code-block .token.operator { color: var(--vs-text-3) !important; }
html[data-theme='dark'] .theme-code-block .token.keyword,
html[data-theme='dark'] .theme-code-block .token.atrule,
html[data-theme='dark'] .theme-code-block .token.builtin,
html[data-theme='dark'] .theme-code-block .token.important,
html[data-theme='dark'] .theme-code-block .token.boolean,
html[data-theme='dark'] .theme-code-block .token.constant,
html[data-theme='dark'] .theme-code-block .token.number { color: #a68cff !important; }
html[data-theme='dark'] .theme-code-block .token.key,
html[data-theme='dark'] .theme-code-block .token.property,
html[data-theme='dark'] .theme-code-block .token.attr-name,
html[data-theme='dark'] .theme-code-block .token.tag,
html[data-theme='dark'] .theme-code-block .token.function,
html[data-theme='dark'] .theme-code-block .token.class-name,
html[data-theme='dark'] .theme-code-block .token.variable,
html[data-theme='dark'] .theme-code-block .token.selector { color: var(--vs-accent) !important; }
html[data-theme='dark'] .theme-code-block .token.string,
html[data-theme='dark'] .theme-code-block .token.char,
html[data-theme='dark'] .theme-code-block .token.attr-value,
html[data-theme='dark'] .theme-code-block .token.url,
html[data-theme='dark'] .theme-code-block .token.plain { color: var(--vs-text) !important; }
html[data-theme='dark'] .theme-code-block .token-line.theme-code-block-highlighted-line { background: var(--vs-selected); }

/* ── Оглавление справа ── */
html[data-theme='dark'] .table-of-contents { font-size: 14px; line-height: 20px; }
html[data-theme='dark'] .table-of-contents li { margin: 0; }
html[data-theme='dark'] .table-of-contents ul { padding-left: 12px; }
html[data-theme='dark'] .table-of-contents__link { display: block; padding: 8px 0; color: var(--vs-text-3); }
html[data-theme='dark'] .table-of-contents__link:hover { color: var(--vs-text-2); text-decoration: none; }
html[data-theme='dark'] .table-of-contents__link--active { position: relative; color: var(--vs-accent); }
html[data-theme='dark'] .table-of-contents__link--active:hover { color: var(--vs-accent); }
html[data-theme='dark'] .table-of-contents__left-border > li > .table-of-contents__link--active::before,
html[data-theme='dark'] .table-of-contents__left-border ul > li > .table-of-contents__link--active::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -17px;
  width: 1px;
  background: var(--vs-accent);
}
html[data-theme='dark'] .table-of-contents__left-border ul > li > .table-of-contents__link--active::before { left: -29px; }

/* ── Пагинация «Предыдущая / Следующая страница» ── */
html[data-theme='dark'] .pagination-nav { gap: 12px; margin-top: 40px; }
html[data-theme='dark'] .pagination-nav__link {
  padding: 12px;
  border: 1px solid var(--vs-border);
  border-radius: 8px;
  background: var(--vs-bg-button);
  transition: border-color .15s;
}
html[data-theme='dark'] .pagination-nav__link:hover { border-color: var(--vs-border-strong); background: var(--vs-bg-button); }
html[data-theme='dark'] .pagination-nav__sublabel {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--vs-text-3);
}
html[data-theme='dark'] .pagination-nav__label {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--vs-text);
}
html[data-theme='dark'] .pagination-nav__link--prev .pagination-nav__label { padding-left: 28px; }
html[data-theme='dark'] .pagination-nav__link--next .pagination-nav__label { padding-right: 28px; }
html[data-theme='dark'] .pagination-nav__link--prev .pagination-nav__label::before,
html[data-theme='dark'] .pagination-nav__link--next .pagination-nav__label::after { content: none; }
html[data-theme='dark'] .pagination-nav__link--prev .pagination-nav__sublabel::before { content: "←"; margin: 0 12px 0 0; color: #626262; }
html[data-theme='dark'] .pagination-nav__link--next .pagination-nav__sublabel::after { content: "→"; margin: 0 0 0 12px; color: #626262; }

/* ── Карточки категорий (generated-index) — как карточки разделов на главной ── */
html[data-theme='dark'] a.card[class*='cardContainer'] {
  padding: 16px !important;
  border: 1px solid var(--vs-border);
  border-radius: 12px;
  background: var(--vs-surface);
  box-shadow: none;
  transition: border-color .15s, background-color .15s;
}
html[data-theme='dark'] a.card[class*='cardContainer']:hover { border-color: var(--vs-border-strong); background: var(--vs-hover); }
html[data-theme='dark'] a.card [class*='cardTitle'] { font-size: 18px; font-weight: 400; line-height: 1.4; color: var(--vs-text); }
html[data-theme='dark'] a.card [class*='cardDescription'] { font-size: 14px; color: var(--vs-text-3); }

/* ── Врезки (admonitions) ── */
html[data-theme='dark'] .theme-admonition {
  --ifm-alert-background-color: var(--vs-surface);
  --ifm-alert-background-color-highlight: var(--vs-hover);
  --ifm-alert-foreground-color: var(--vs-text);
  border: 1px solid var(--vs-border);
  border-left: 2px solid var(--ifm-alert-border-color);
  border-radius: 8px;
  box-shadow: none;
}
html[data-theme='dark'] details.alert,
html[data-theme='dark'] .markdown details {
  --ifm-alert-background-color: var(--vs-surface);
  --ifm-alert-border-color: var(--vs-border);
  border: 1px solid var(--vs-border);
  border-radius: 8px;
  box-shadow: none;
}

/* ── Подвал: иконки слева, копирайт справа (иконки вставляет vstack.js) ── */
html[data-theme='dark'] .footer {
  height: 60px;
  padding: 0 24px;
  border-top: 1px solid var(--vs-border);
  background: var(--vs-bg);
}
html[data-theme='dark'] .footer .container {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  max-width: none;
  padding: 0;
}
html[data-theme='dark'] .footer__bottom { line-height: 28px; }
html[data-theme='dark'] .footer__copyright { font-size: 12px; color: var(--vs-text-3); }
.vstack-social { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.vstack-social a {
  display: block;
  width: 28px;
  height: 28px;
  font-size: 0;
  background: no-repeat center / contain;
  opacity: .56;
  transition: opacity .15s;
}
.vstack-social a:hover { opacity: 1; }
.vstack-social .vstack  { background-image: url(/_shared/img/social-vstack.svg); }
.vstack-social .rutube  { background-image: url(/_shared/img/social-rutube.svg); }
.vstack-social .youtube { background-image: url(/_shared/img/social-youtube.svg); }

/* ── Узкие экраны ── */
@media (max-width: 996px) {
  html[data-theme='dark']:root { --ifm-navbar-padding-horizontal: 16px; --ifm-navbar-height: 112px; }
  html[data-theme='dark'] .navbar__items { gap: 8px; }
  html[data-theme='dark'] .markdown table { display: block; overflow-x: auto; }
  html[data-theme='dark'] main[class*='docMainContainer'] > .container { padding: 16px; }
  html[data-theme='dark'] .navbar[data-vstack-navigation='ready'] { padding: 8px 16px; }
  .navbar[data-vstack-navigation='ready'] .navbar__inner { flex-wrap: wrap; row-gap: 4px; }
  .navbar[data-vstack-navigation='ready'] .navbar__inner > .navbar__items:not(.navbar__items--right) { flex: 1; }
  .navbar[data-vstack-navigation='ready'] .navbar__toggle { min-width: 44px; min-height: 44px; padding: 8px; }
  .vstack-switchers {
    flex: 0 0 100%;
    order: 3;
    gap: 12px;
    width: 100%;
    margin-left: 0;
    border-top: 1px solid var(--vs-border);
  }
  .vstack-switchers > .vstack-site { display: none; }
  .vstack-dropdown-toggle { min-height: 44px; font-size: 14px; }
  .vstack-products { flex: 1; }
  .vstack-products > button { font-size: 15px; max-width: 100%; }
  .vstack-versions, .vstack-language { flex: none; }
  .vstack-menu-link { min-height: 44px; font-size: 15px; }
  .vstack-dd-filter input { font-size: 16px; min-height: 44px; }
  html[data-theme='dark'] .markdown { font-size: 16px; line-height: 1.55; }
  html[data-theme='dark'] .markdown h1 { line-height: 1.2; }
  html[data-theme='dark'] .breadcrumbs { overflow-x: auto; white-space: nowrap; max-width: 100%; }
  .navbar[data-vstack-navigation='ready'] .navbar-sidebar { display: flex; flex-direction: column; }
  .navbar[data-vstack-navigation='ready'] .navbar-sidebar__brand { flex: none; height: 60px; min-height: 60px; }
  .navbar[data-vstack-navigation='ready'] .navbar-sidebar__items { flex: 1; min-height: 0; }
  .vstack-sidebar-navigation {
    display: block;
    flex: none;
    padding: 8px 16px 16px;
    border-bottom: 1px solid var(--vs-border-strong);
  }
  .vstack-sidebar-home { display: flex; align-items: center; min-height: 44px; color: var(--vs-accent); font-size: 15px; }
  .vstack-sidebar-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--vs-text-3); font-size: 13px; }
  .vstack-sidebar-field select {
    width: 100%;
    min-height: 44px;
    padding: 8px;
    border: 1px solid var(--vs-border-strong);
    border-radius: 6px;
    background: var(--vs-bg-container);
    color: var(--vs-text);
    font: inherit;
    font-size: 16px;
    color-scheme: dark;
  }
  .vstack-sidebar-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
}
@media (max-width: 576px) {
  html[data-theme='dark'] .markdown h1,
  html[data-theme='dark'] .markdown h2 { font-size: 24px; }
  html[data-theme='dark'] .footer { padding: 0 16px; }
}
