@font-face {
    font-family: 'Geologica';
    src: url('fonts/web/Geologica-cyrillic-ext.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: block;
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: 'Geologica';
    src: url('fonts/web/Geologica-cyrillic.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: block;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Geologica';
    src: url('fonts/web/Geologica-latin-ext.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: block;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Geologica';
    src: url('fonts/web/Geologica-latin.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: block;
    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-family: 'Geologica';
    src: url('fonts/web/Geologica-Cursive-ExtraLight.woff2') format('woff2');
    font-style: italic;
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'Geologica Cursive';
    src: url('fonts/web/Geologica-Cursive-ExtraLight.woff2') format('woff2');
    font-style: normal;
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'Geologica';
    src: url('fonts/web/Geologica-Cursive-Medium.woff2') format('woff2');
    font-style: italic;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Geologica Cursive';
    src: url('fonts/web/Geologica-Cursive-Medium.woff2') format('woff2');
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Consolas';
    src: url('fonts/web/Consolas-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Consolas';
    src: url('fonts/web/Consolas-Bold.woff2') format('woff2');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Consolas';
    src: url('fonts/web/Consolas-Italic.woff2') format('woff2');
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   1) СИСТЕМА
   -------------------------------------------------------------------------- */
:root {
    /* Шрифты */
    --font-text: 'Geologica', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-code: 'Consolas', 'Courier New', monospace;
    --weight-text: 200;
    --weight-strong: 500;

    /* Типографика */
    --text-xs: 0.625rem;
    --text-sm: 0.875rem;
    --text-code: 0.95em;
    --line-text: 1.45;
    --line-heading: 1.25;
    --line-code: 1.35;
    --line-ui: 1.4;

    /* Цвета */
    --color-text: #40484f;
    --color-page: #fcfcfc;
    --color-surface: #ffffff;
    --color-surface-hover: #f7f7f7;
    --color-surface-active: #f0f0f0;
    --color-border: #e5e7eb;
    --color-focus: #cbd5e1;

    --color-code: var(--color-text);
    --color-code-inline-bg: #f5f5f5;
    --color-code-bg: var(--color-code-inline-bg);
    --color-code-border: #d9d9d9;

    --color-sidebar: #1d1b27;
    --color-sidebar-panel: #2e2b3d;
    --color-sidebar-muted: #84889c;
    --color-sidebar-caption: #9b99ff;
    --color-breadcrumbs: #81848f;
    --color-on-dark: var(--color-surface);

    --color-danger: #d32f2f;
    --color-success: #1b5e20;
    --color-note-bg: #efefff;
    --color-note-title: #5754c1;
    --color-attention-bg: #f2e4e1;
    --color-attention-title: #dc573e;
    --color-important-bg: #dbfaf4;
    --color-important-title: #1abc9c;

    /* Отступы: 1rem = 16 px, шаг шкалы = 4 px. */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Радиусы */
    --radius-sm: 0.25rem;
    --radius-lg: 0.75rem;
    --radius-pill: 999rem;

    /* Макет */
    --layout-sidebar-width: 18.75rem;
    --layout-sidebar-search-width: 16.25rem;
    --layout-content-pad-block: var(--space-12);
    --layout-content-pad-left: var(--space-5);
    --layout-content-pad-right: var(--space-16);
    --layout-figure-max-width: 68.75rem;

    /* Списки */
    --list-indent: 1.5em;
    --list-nested-indent: 1ch;

    --header-row-height: 50px;
    --sidebar-collapsed-width: 56px;
    --radius-s: 4px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-page);
    color: var(--color-text);
    font-family: var(--font-text);
    font-size: 1rem;
    font-weight: var(--weight-text);
    line-height: var(--line-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Принудительно сохраняет шрифт документации внутри основного контента. */
.wy-nav-content,
.wy-nav-content .rst-content,
.wy-nav-content .rst-content p,
.wy-nav-content .rst-content li,
.wy-nav-content .rst-content table,
.wy-nav-content .rst-content th,
.wy-nav-content .rst-content td,
.wy-nav-content .rst-content .line-block,
.wy-nav-content .rst-content .line {
    font-family: var(--font-text);
}

/* --------------------------------------------------------------------------
   2) ТЕКСТ
   -------------------------------------------------------------------------- */
.rst-content strong {
    font-weight: var(--weight-strong);
}

.rst-content strong :is(code, em) {
    color: inherit;
    font-weight: inherit;
}

.rst-content em {
    font-family: 'Geologica Cursive', 'Geologica', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-style: normal;
    display: inline-block;
    transform: skewX(-10deg);
}

.page-title,
.rst-content :is(h1, h2, h3, h4, h5, h6) {
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    color: var(--color-text);
    font-family: var(--font-text) !important;
    font-weight: var(--weight-strong) !important;
    line-height: var(--line-heading);
}

.page-title {
    font-size: 2.2rem;
}

.rst-content h1 {
    font-size: 1.85rem;
}

.rst-content h2 {
    font-size: 1.65rem;
}

.rst-content h3 {
    font-size: 1.35rem;
}

.rst-content h4 {
    font-size: 1.15rem;
}

.rst-content h5 {
    font-size: 1rem;
}

.rst-content h6 {
    font-size: var(--text-sm);
}

.rst-content .red {
    color: var(--color-danger);
    font-weight: var(--weight-strong);
}

.rst-content .green {
    color: var(--color-success);
    font-weight: var(--weight-strong);
}

/* --------------------------------------------------------------------------
   3) ОТСТУПЫ АБЗАЦЕВ И СПИСКОВ
   -------------------------------------------------------------------------- */
.wy-nav-content .rst-content p {
    margin-top: var(--space-1);
    margin-bottom: var(--space-2);
}

/* Первый уровень списка */
.wy-nav-content .rst-content ol,
.wy-nav-content .rst-content ol.arabic,
.wy-nav-content .rst-content ul,
.wy-nav-content .rst-content ul.simple {
    margin-top: var(--space-1);
    margin-right: 0;
    margin-bottom: var(--space-2);
    margin-left: 0;
    padding-left: var(--list-indent);
    list-style-position: outside;
}

/* Пункты списка. .rst-content.rst-content (класс продублирован специально
   для специфичности, без изменения смысла) - тема (theme.css) применяет
   margin-left:24px через сквозной селектор ".rst-content .section
   ol.arabic li", который "дотягивается" через любую глубину вложенности;
   для списка без класса .simple внутри ol.arabic специфичность темы иначе
   выше нашей, и 24px протекают на li третьего уровня вложенности и
   глубже. */
.wy-nav-content .rst-content.rst-content ol > li,
.wy-nav-content .rst-content.rst-content ol.arabic > li,
.wy-nav-content .rst-content.rst-content ul > li,
.wy-nav-content .rst-content.rst-content ul.simple > li {
    margin: 0 0 var(--space-1);
    padding-left: 0;
    line-height: var(--line-text);
}

/* Вложенные списки */
.wy-nav-content .rst-content li > ol,
.wy-nav-content .rst-content li > ol.arabic,
.wy-nav-content .rst-content li > ul,
.wy-nav-content .rst-content li > ul.simple {
    margin-top: var(--space-1);
    margin-right: 0;
    margin-bottom: var(--space-2);
    margin-left: var(--list-nested-indent);
    padding-left: var(--list-indent);
}

/* Типы маркеров */
.wy-nav-content .rst-content ol,
.wy-nav-content .rst-content ol.arabic {
    list-style-type: decimal;
}

.wy-nav-content .rst-content ul,
.wy-nav-content .rst-content ul.simple {
    list-style-type: disc;
}

.wy-nav-content .rst-content ul ul,
.wy-nav-content .rst-content ul.simple ul {
    list-style-type: circle;
}

.wy-nav-content .rst-content ul ul ul,
.wy-nav-content .rst-content ul.simple ul ul {
    list-style-type: square;
}

/* Абзацы внутри пунктов */
.wy-nav-content .rst-content li > p {
    margin-top: 0;
    margin-bottom: var(--space-1);
}

.wy-nav-content .rst-content li > p:only-child,
.wy-nav-content .rst-content li > p:last-child {
    margin-bottom: 0;
}

.wy-nav-content .rst-content p + :is(ul, ol, div.highlight, .admonition),
.wy-nav-content .rst-content p + [class^="highlight-"]:not(.highlight) {
    margin-top: var(--space-2);
}

/* --------------------------------------------------------------------------
   4) КОД
   -------------------------------------------------------------------------- */
.rst-content :is(
    code.literal,
    p code,
    li code,
    td code,
    span code,
    h1 code,
    h2 code,
    h3 code,
    h4 code,
    h5 code
) {
    padding: 0.1em 0.25em;
    border-radius: var(--radius-sm);
    background: var(--color-code-inline-bg);
    color: var(--color-code);
    font-family: var(--font-code);
    font-size: var(--text-code);
}

/* Pygments задаёт цвет токенов точечно, поэтому здесь нужен приоритет. */
.rst-content :is(
    code.literal,
    code.literal .pre,
    pre,
    .highlight pre,
    .highlight pre span,
    [class^="highlight-"]:not(.highlight) pre,
    [class^="highlight-"]:not(.highlight) pre span
) {
    color: var(--color-code) !important;
}

.rst-content [class^="highlight-"]:not(.highlight) {
    position: relative;
    display: block;
    margin: var(--space-3) 0;
    overflow: hidden;
    border: 1px solid var(--color-code-border);
    border-radius: var(--radius-sm);
    background: var(--color-code-bg);
    background-clip: padding-box;
}

.rst-content [class^="highlight-"]:not(.highlight) > .highlight {
    margin: 0;
    border: 0;
    background: transparent;
}

.rst-content :is(pre, .highlight pre, [class^="highlight-"]:not(.highlight) pre) {
    margin: 0;
    padding: var(--space-2) var(--space-3);
    overflow: auto;
    background: transparent;
    color: var(--color-code);
    font-family: var(--font-code);
    font-size: var(--text-code);
    line-height: var(--line-code);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.wy-nav-content .rst-content li > :is(
    [class^="highlight-"]:not(.highlight),
    .highlight,
    .admonition,
    .figure,
    figure
) {
    margin-left: 0;
    margin-right: 0;
}

.rst-content .copybtn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.0625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: inherit;
    font-size: var(--text-sm);
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.rst-content .copybtn:hover {
    background: var(--color-surface-hover);
}

.rst-content .copybtn:active {
    background: var(--color-surface-active);
    box-shadow: none;
}

.rst-content .copybtn:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.rst-content .copybtn svg,
.rst-content .copybtn [title] {
    pointer-events: none;
}

.rst-content .copybtn.success {
    border-color: var(--color-important-title);
    background: var(--color-important-title);
    color: var(--color-on-dark);
}

/* --------------------------------------------------------------------------
   5) ИЗОБРАЖЕНИЯ И ТАБЛИЦЫ
   -------------------------------------------------------------------------- */
.rst-content :is(.figure, figure) {
    max-width: var(--layout-figure-max-width);
    margin: var(--space-2) 0;
    text-align: left;
}

.rst-content :is(.figure img, figure img) {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: var(--space-2) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.08);
}

.rst-content :is(.figure.align-center, img.align-center) {
    margin-left: 0;
    margin-right: 0;
}

.rst-content img.inline-icon {
    display: inline-block;
    width: auto;
    height: 1em;
    margin: 0 0.125rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.10);
    vertical-align: middle;
}

.wy-nav-content .rst-content table.docutils {
    width: 100%;
    margin: var(--space-2) 0;
    border: 1px solid var(--color-code-border);
    border-collapse: collapse;
    table-layout: auto;
    word-break: break-word;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.wy-nav-content .rst-content table.docutils :is(td, th) {
    border: 1px solid var(--color-code-border);
    padding: var(--space-2) var(--space-3);
    white-space: normal;
    line-height: 1.55;
}

.wy-nav-content .rst-content table.docutils td {
    vertical-align: top;
}

.wy-nav-content .rst-content table.docutils :is(td, th) > :is(p, .line-block, .line) {
    line-height: inherit;
}

.wy-nav-content .rst-content table.docutils tbody tr,
.wy-nav-content .rst-content table.docutils tbody tr:nth-child(2n-1),
.wy-nav-content .rst-content table.docutils tbody tr:nth-child(2n) {
    background: var(--color-surface) !important;
}

.wy-nav-content .rst-content table.docutils tbody tr :is(td, th),
.wy-nav-content .rst-content table.docutils tbody tr:nth-child(2n-1) :is(td, th),
.wy-nav-content .rst-content table.docutils tbody tr:nth-child(2n) :is(td, th) {
    background: var(--color-surface) !important;
}

.wy-nav-content .rst-content table.docutils th {
    background: var(--color-surface) !important;
    color: var(--color-text);
    font-weight: var(--weight-strong);
    text-align: center;
    vertical-align: middle;
    word-break: keep-all;
}

.wy-nav-content .rst-content table.grouped-line-table .line-block {
    margin: 0;
}

.wy-nav-content .rst-content table.grouped-line-table .line {
    margin: 0;
}

.wy-nav-content .rst-content table.grouped-line-table :is(td, th) > :last-child {
    margin-bottom: 0;
}

.rst-content :is(h1, h2, h3, h4, h5) + :is(ul, ol) {
    margin-top: var(--space-1);
}

.rst-content :is(ul, ol) + :is(h1, h2, h3, h4, h5) {
    margin-top: var(--space-8);
}

.rst-content .toctree-wrapper.compound {
    margin: var(--space-2) 0 var(--space-4);
}

.rst-content .toctree-wrapper.compound .caption {
    margin-top: 0;
    margin-bottom: var(--space-1);
}

.rst-content .toctree-wrapper.compound ul {
    margin: 0 0 var(--space-3);
    padding-left: 0;
    list-style: none !important;
}

.rst-content .toctree-wrapper.compound ul > li {
    margin: 0 0 var(--space-1);
    padding-left: 0;
    list-style: none !important;
}

.rst-content .toctree-wrapper.compound ul > li::marker {
    content: "";
}

/* --------------------------------------------------------------------------
   6) ВЫДЕЛЕННЫЕ БЛОКИ
   -------------------------------------------------------------------------- */
.rst-content .admonition {
    margin: var(--space-2) 0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    line-height: var(--line-text);
    text-align: left;
}

.rst-content .admonition :is(p, li) {
    text-align: left;
}

.rst-content .admonition:is(.note, .attention, .important) {
    padding: var(--space-4);
    background: var(--admonition-bg);
}

.rst-content .admonition.note {
    --admonition-bg: var(--color-note-bg);
    --admonition-title-bg: var(--color-note-title);
}

.rst-content .admonition.attention {
    --admonition-bg: var(--color-attention-bg);
    --admonition-title-bg: var(--color-attention-title);
}

.rst-content .admonition.important {
    --admonition-bg: var(--color-important-bg);
    --admonition-title-bg: var(--color-important-title);
}

.rst-content .admonition:is(.note, .attention, .important) > .admonition-title {
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-1);
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--admonition-title-bg);
    color: var(--color-on-dark);
    font-weight: var(--weight-strong);
}

.rst-content .admonition > :not(.admonition-title) {
    color: var(--color-text);
}

.rst-content .admonition > p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   7) ЛЕВОЕ МЕНЮ
   -------------------------------------------------------------------------- */
.wy-nav-side {
    display: flex;
    flex-direction: column;
    width: var(--layout-sidebar-width);
    min-height: 100vh;
    height: 100dvh;
    /* Строка с лого должна быть прижата к самому верху вьюпорта. */
    padding: 0 var(--space-1) var(--space-8);
    gap: var(--space-10);
    overflow-y: auto;
    background: var(--color-sidebar);
}

.wy-nav-content-wrap {
    margin-left: var(--layout-sidebar-width);
    background: var(--color-surface);
}

.wy-nav-content {
    max-width: none;
    /* Отступ на высоту зафиксированной полосы крошек - иначе контент
       заезжает под неё. */
    padding: calc(var(--header-row-height) + var(--layout-content-pad-block)) var(--layout-content-pad-right)
        var(--layout-content-pad-block) var(--layout-content-pad-left);
}

.wy-side-nav-search {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--space-3) var(--space-5);
    gap: var(--space-2);
    background: transparent;
}

.wy-side-nav-search a.icon.icon-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 1.75rem;
    margin: 0;
    /* Паддинг справа - место под кнопку сворачивания меню (sidebar-
       collapse.css), иначе текст центрируется с её учётом и уезжает влево. */
    padding: var(--space-1) calc(var(--space-2) + 44px) var(--space-1) var(--space-2);
    gap: var(--space-2);
    background: transparent;
    color: var(--color-on-dark);
    font-family: var(--font-text);
    font-weight: var(--weight-strong);
    line-height: var(--line-ui);
    text-align: center;
    /* Строка с лого фиксированной высоты - перенос текста на вторую
       строку вылез бы за пределы фона. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wy-side-nav-search a.icon.icon-home::before {
    content: "";
    display: block;
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    background-image: url('mindsoft.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.wy-side-nav-search input[type="text"] {
    width: 100%;
    padding: var(--space-1) var(--space-4);
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-sidebar-panel);
    color: var(--color-sidebar-muted);
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: var(--weight-text);
}

.wy-breadcrumbs {
    padding-left: 0;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25rem;
    color: var(--color-breadcrumbs);
}

.wy-breadcrumbs > li {
    flex: 0 0 auto;
}

.wy-breadcrumbs > li.breadcrumb-item {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

html:not([data-theme="dark"]) .wy-breadcrumbs a.icon-home {
    color: #5754C1;
}

.breadcrumb-item::before {
    font-size: inherit;
}

.wy-menu-vertical p.caption {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-sidebar-caption) !important;
    text-transform: uppercase;
    line-height: 20px;
    max-width: 280px;
    display: block;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wy-menu-vertical li.toctree-l2 > a,
.wy-menu-vertical li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l4 > a {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    padding-right: 10px;
    display: block;
}

/* --------------------------------------------------------------------------
   8) МОБИЛЬНАЯ ВЕРСИЯ
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .wy-nav-side {
        padding-block: var(--space-5);
        gap: var(--space-4);
        max-width: 100vw;
    }

    .wy-nav-content-wrap {
        margin-left: 0;
    }

    .wy-nav-content {
        padding: var(--space-5);
    }

    .wy-side-nav-search {
        width: calc(100% - var(--space-5));
    }

    .page-title,
    .rst-content h1 {
        font-size: 1.6rem;
    }

    .rst-content h2 {
        font-size: 1.4rem;
    }

    .wy-breadcrumbs {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .rst-content :is(pre, .highlight pre, [class^="highlight-"]:not(.highlight) pre) {
        padding: var(--space-2);
        font-size: 0.875rem;
    }

    .rst-content .copybtn {
        top: var(--space-1);
        right: var(--space-1);
    }

    .wy-nav-content .rst-content table.docutils {
        display: block;
        width: 100%;
        max-width: 100%;
        table-layout: auto;
        border: none;
        box-sizing: border-box;
    }

    .wy-nav-content .rst-content table.docutils thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .wy-nav-content .rst-content table.docutils tbody,
    .wy-nav-content .rst-content table.docutils tr {
        display: block;
        width: 100%;
    }

    .wy-nav-content .rst-content table.docutils tr {
        border: 1px solid var(--color-border, #e5e7eb);
        border-radius: var(--radius-sm);
        margin-bottom: var(--space-4);
        padding: 0 var(--space-4);
        background: var(--color-surface, #fafbfc);
        box-sizing: border-box;
    }

    .wy-nav-content .rst-content table.docutils td,
    .wy-nav-content .rst-content table.docutils th {
        display: block;
        width: auto;
        border: none;
        border-top: 1px solid var(--color-border, #eef0f3);
        padding: var(--space-4) 0;
    }

    .wy-nav-content .rst-content table.docutils tr > td:first-child,
    .wy-nav-content .rst-content table.docutils tr > th:first-child {
        border-top: none;
    }

    .wy-nav-content .rst-content table.docutils td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: .75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .02em;
        color: var(--color-breadcrumbs);
        margin-bottom: var(--space-1);
    }

    .wy-nav-content .rst-content table.docutils code {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* Клоны значений объединённых (rowspan) ячеек для карточек на мобильном —
   на десктопе и планшете скрыты, чтобы не добавлять лишнюю ячейку в таблицу. */
@media screen and (min-width: 769px) {
    .wy-nav-content .rst-content table.docutils .table-labels-clone {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .wy-nav-content {
        padding: var(--space-4);
    }

    .page-title,
    .rst-content h1 {
        font-size: 1.45rem;
    }

    .rst-content h2 {
        font-size: 1.25rem;
    }
}

/* Заголовки toctree и captions внутри контента.
   Тема RTD по умолчанию подставляет сюда Roboto Slab. */
.rst-content p.caption,
.toctree-wrapper p.caption,
.rst-content p.caption .caption-text,
.toctree-wrapper p.caption .caption-text,
.wy-menu-vertical p.caption,
.wy-menu-vertical p.caption .caption-text,
span.caption-text {
    font-family: var(--font-text) !important;
    font-weight: var(--weight-strong) !important;
    line-height: var(--line-heading) !important;
    letter-spacing: 0;
}

.rst-content p.caption,
.toctree-wrapper p.caption {
    margin-top: var(--space-10);
    margin-bottom: var(--space-3);
    color: var(--color-text) !important;
    font-size: 1.65rem !important;
}

.rst-content p.caption .caption-text,
.toctree-wrapper p.caption .caption-text,
span.caption-text {
    color: inherit !important;
}

/* Заголовки внутренних sidebar-блоков темы.
   RTD подставляет сюда Roboto Slab. */
.rst-content .sidebar .sidebar-title {
    font-family: var(--font-text) !important;
    font-weight: var(--weight-strong) !important;
}

/* Скрывает кнопки перехода между документами
   "предыдущая/следующая". */
.rst-footer-buttons {
    display: none !important;
}

/* --------------------------------------------------------------------------
   9) СНОСКИ
   -------------------------------------------------------------------------- */

/* Убирает обратные ссылки из текста сносок: (1, 2, 3, 4). */
.footnote-backrefs,
.footnote .backrefs,
dl.footnote span.backrefs,
aside.footnote span.backrefs {
    display: none !important;
}

/* Сноски, собранные Docutils как таблицы. */
.wy-nav-content .rst-content table.docutils.footnote {
    width: auto !important;
    min-width: 0 !important;
    table-layout: auto !important;
    margin: var(--space-1) 0 !important;
    border: 0 !important;
    word-break: normal !important;
}

.wy-nav-content .rst-content table.docutils.footnote td {
    padding-top: var(--space-1) !important;
    padding-bottom: var(--space-1) !important;
    border: 0 !important;
    vertical-align: top !important;
}

.wy-nav-content .rst-content table.docutils.footnote td.label {
    width: auto !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: var(--space-2) !important;
    white-space: nowrap !important;
    text-align: left !important;
}

.wy-nav-content .rst-content table.docutils.footnote td:last-child {
    padding-left: 0 !important;
}

.wy-nav-content .rst-content table.docutils.footnote p {
    display: inline !important;
    margin: 0 !important;
}

/* Сноски, собранные новыми версиями Docutils как aside. */
.wy-nav-content .rst-content aside.footnote {
    display: block !important;
    margin: var(--space-1) 0 !important;
    padding: 0 !important;
}

.wy-nav-content .rst-content aside.footnote > .label {
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 var(--space-2) 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.wy-nav-content .rst-content aside.footnote > p {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* --------------------------------------------------------------------------
   10) ПОИСК В ШАПКЕ И МОБИЛЬНОЕ МЕНЮ
   -------------------------------------------------------------------------- */
/* Фиксированная полоса крошек с плавающей кнопкой поиска (header-search.
   css/js), растягиваемое/сворачиваемое левое меню (sidebar-resize.css/js,
   sidebar-collapse.css/js) и оверлейное мобильное меню (mobile-nav.js,
   mobile-menu-close.js). */

/* Переход по якорю (обычная навигация #id, в т.ч. из результатов поиска)
   не должен прятать заголовок раздела под зафиксированной полосой крошек. */
.rst-content [id] {
    scroll-margin-top: calc(var(--header-row-height) + 16px);
}

/* Через всю ширину, зафиксирована при скролле. padding-right -
   динамический отступ под переключатель Wide/Boxed и пилюлю поиска
   (--breadcrumbs-reserved-right, reading-mode.js), запасное значение
   100px - для планшета, где справа только один значок поиска. */
.rst-content > div[role="navigation"] {
    position: fixed;
    top: 0;
    left: var(--sidebar-width, 300px);
    right: 0;
    height: var(--header-row-height);
    z-index: 690;
    margin: 0;
    padding: 0 var(--breadcrumbs-reserved-right, 100px) 0 20px;
    display: flex;
    align-items: center;
    background: var(--color-page, #fcfcfc);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.rst-content > div[role="navigation"] hr {
    display: none;
}

/* Блок с лого остаётся видимым при прокрутке длинного меню - вместе с
   полосой крошек выше образует одну горизонтальную полосу через всю
   ширину страницы. Высота и непрозрачный фон обязательны: без них блок
   становится прозрачным sticky-элементом произвольной высоты, и текст
   проскроллившего под ним меню просвечивает и накладывается поверх лого. */
.wy-side-nav-search {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-row-height);
    justify-content: center;
    background: var(--color-sidebar-panel);
}

/* Тема красит hover/active любой ссылки в меню в жёстко заданный синий, а
   не в var(--color-surface-hover) - тот рассчитан на светлую тему
   страницы и на неизменно тёмном сайдбаре был бы светлой плашкой на
   тёмном фоне. Полупрозрачная белая подложка одинаково хорошо ложится на
   тёмный фон меню независимо от темы контента. */
.wy-menu-vertical a:hover,
.wy-nav .wy-menu-vertical a:hover,
.wy-menu-vertical a:active {
    background-color: rgba(255, 255, 255, .1);
}

/* Затемнение контента, пока раскрыто мобильное меню - создаётся и
   переключается в mobile-nav.js. z-index чуть ниже .wy-nav-side (200 в
   theme.css), чтобы само меню оставалось поверх затемнения. */
.wy-nav-shift-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 24, .45);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.wy-nav-shift-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Пилюлю Ctrl+K (десктоп) прячем, пока открыто мобильное меню - десктопное
   меню-раздвижка не рассчитано на клик по ней поверх себя. */
body.wy-nav-shift-open .header-search-shortcut-hint {
    display: none;
}

@media screen and (max-width: 768px) {
    /* Реальная высота мобильной шапки больше десктопной полосы крошек. */
    :root {
        --header-row-height: 64px;
    }

    html,
    body,
    .wy-body-for-nav {
        max-width: 100% !important;
        /* .wy-grid-for-nav не входит - иначе он стал бы собственным
           скролл-контейнером, и window/document перестали бы скроллиться. */
        overflow-x: hidden !important;
    }

    body {
        touch-action: pan-y;
    }

    .rst-content > div[role="navigation"] {
        position: static;
        padding: 0;
        background: transparent;
        border-bottom: none;
    }

    .rst-content > div[role="navigation"] hr {
        display: block;
        margin: 12px 0;
    }

    /* Верхняя мобильная полоса - гамбургер + лого, зафиксирована при
       скролле, чтобы гамбургер оставался доступен на длинных страницах
       (sticky-header.js переключает .is-pinned - см. ниже). */
    .wy-nav-top {
        position: relative;
        display: flex;
        align-items: center;
        height: var(--header-row-height);
        min-height: var(--header-row-height);
        padding: 0 1rem;
        box-sizing: border-box;
        line-height: normal;
        z-index: 150;
        background: var(--color-sidebar) !important;
        color: #fff;
        font-family: var(--font-text);
    }

    .wy-nav-top.is-pinned {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
    }

    body.wy-nav-top-pinned .wy-nav-content {
        padding-top: calc(var(--header-row-height) + 12px);
    }

    .wy-nav-top:before,
    .wy-nav-top:after {
        content: none;
    }

    .wy-nav-top i {
        position: absolute;
        left: .809em;
        top: 50%;
        transform: translateY(-50%);
        float: none;
        color: #fff;
        padding-top: 0;
    }

    .wy-nav-top i.wy-nav-top-bars {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wy-nav-top i.wy-nav-top-bars svg {
        width: 30px;
        height: 30px;
    }

    .wy-nav-top a {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 190px;
        overflow: hidden;
        white-space: nowrap;
        color: #fff !important;
        font-family: var(--font-text);
        font-weight: var(--weight-strong);
        text-decoration: none;
    }

    .wy-nav-top a:before {
        content: "";
        display: inline-block;
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
        margin-right: 8px;
        background-image: url('mindsoft.svg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .wy-nav-content-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        background: var(--color-page, #ffffff);
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .wy-nav-content {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
        padding: calc(var(--header-row-height) + 12px) 1.5rem 1.5rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .rst-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: break-word;
    }

    /* Боковое меню - оверлей поверх контента, а не "раздвижка" темы по
       умолчанию: задвинут за левый край и выезжает по клику на гамбургер
       (класс .shift переключает theme.js; затемнение и закрытие по клику
       вне меню/по ссылке - mobile-nav.js/mobile-menu-close.js). */
    .wy-nav-side {
        left: 0 !important;
        max-width: 85vw;
        padding: 0;
        gap: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .wy-nav-side.shift {
        transform: translateX(0);
    }

    .wy-nav-content-wrap.shift {
        position: static;
        left: auto;
        min-width: 0;
        height: auto;
        overflow: visible;
    }

    .wy-side-nav-search {
        position: static;
        width: auto;
        margin: 0;
        padding: 24px 14px 18px;
        border-radius: 0;
        box-sizing: border-box;
    }
}

/* --------------------------------------------------------------------------
   11) TOOLTIP ТЕРМИНОВ
   -------------------------------------------------------------------------- */

.mind-term-tooltip {
    position: absolute;
    z-index: 1000;
    width: max-content;
    max-width: min(22rem, calc(100vw - 24px));
    pointer-events: auto;
}

.mind-term-tooltip[hidden] {
    display: none;
}

.mind-term-tooltip__body {
    display: inline-block;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    background: #2f2b3d;
    color: #ffffff;
    font-family: var(--font-text);
    font-size: 0.875rem;
    line-height: 1.3;
    font-weight: var(--weight-text);
    box-shadow: 0 10px 30px rgba(20, 20, 30, 0.18);
}

.mind-term-tooltip__arrow {
    width: 0;
    height: 0;
    margin: 0 auto;
    border-top: 10px solid #2f2b3d;
    border-right: 10px solid transparent;
    border-left: 10px solid transparent;
}

.mind-term-tooltip--below .mind-term-tooltip__arrow {
    border-top: 0;
    border-bottom: 10px solid #2f2b3d;
}

.rst-content a.reference.internal[href*="#term-"] {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}
