/* brokapi documentation, design "Specification" (same tokens as the site brokapi.ru).
   A white cold page, ink-blue text, the blue of a wire for links and the active item, the orange only as a signal (the dot of
   the mark, the square of the stage, the active tab of a listing). IBM Plex Sans and IBM Plex Mono. Ruled rows instead of
   cards, square corners (0 for structure, up to 4 px for what can be pressed).
   Light is the main theme ("light"), the dark one is "coal": the same tones, cold, not brown. Code blocks are dark in both.
   mdBook gives the theme its colors through variables, so most of the work is the variables below. */

:root {
  --mono-font: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --bk-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bk-signal: #ff5b1f;
  --bk-code-bg: #0b1220;
  --bk-code-ink: #e7ecf3;
  --bk-code-muted: #93a0b4;
  --bk-code-line: #26314a;
  --bk-code-key: #8fa8ff;
  --bk-code-str: #7fd6ad;
  --bk-code-num: #f0c987;
  --bk-code-meta: #c6cffd;
  --sidebar-target-width: 260px;
  --menu-bar-height: 56px;
  --content-max-width: 760px;
  --code-font-size: 0.86em;
  --page-padding: 16px;
  /* One left axis, as on the site: the text of a cell stands on the axis of the page text, the zebra and the rules of the rows
     reach out into the margin by --inset, so a shaded row never touches its first letter. */
  --inset: 16px;
}
@media (max-width: 640px) { :root { --inset: 12px; } }

.light {
  --bg: #ffffff;
  --fg: #0b1220;
  --bk-heading: #0b1220;
  --bk-muted: #566170;
  --bk-line: #cdd3db;
  --bk-soft: #f2f4f7;
  --bk-box: #ffffff;
  --bk-hover: #f2f4f7;
  --bk-link: #1f3fe0;
  --bk-link-hover: #1733b8;
  --bk-signal-text: #c2410c;

  --sidebar-bg: #ffffff;
  --sidebar-fg: #566170;
  --sidebar-non-existant: #566170;
  --sidebar-active: #1f3fe0;
  --sidebar-spacer: #cdd3db;
  --sidebar-header-border-color: #1f3fe0;

  --scrollbar: #cdd3db;
  --icons: #566170;
  --icons-hover: #0b1220;
  --links: #1f3fe0;
  --inline-code-color: #0b1220;

  --theme-popup-bg: #ffffff;
  --theme-popup-border: #cdd3db;
  --theme-hover: #f2f4f7;

  --quote-bg: #f2f4f7;
  --quote-border: #cdd3db;
  --warning-border: #c42b1c;

  --table-border-color: #cdd3db;
  --table-header-bg: #ffffff;
  --table-alternate-bg: #f2f4f7;

  --searchbar-border-color: #8a94a3;
  --searchbar-bg: #ffffff;
  --searchbar-fg: #0b1220;
  --searchbar-shadow-color: rgba(31, 63, 224, 0.25);
  --searchresults-header-fg: #566170;
  --searchresults-border-color: #cdd3db;
  --searchresults-li-bg: #f2f4f7;
  --search-mark-bg: #dfe5ff;

  --color-scheme: light;
  --overlay-bg: rgba(11, 18, 32, 0.32);
  --footnote-highlight: #dfe5ff;
}

.coal {
  --bg: #0a0f1a;
  --fg: #e7ecf3;
  --bk-heading: #f3f6fb;
  --bk-muted: #93a0b4;
  --bk-line: #243049;
  --bk-soft: #111826;
  --bk-box: #0e1523;
  --bk-hover: #141c2e;
  --bk-link: #8fa8ff;
  --bk-link-hover: #b5c4ff;
  --bk-signal: #ff6a2b;
  --bk-signal-text: #ff6a2b;
  --bk-code-bg: #060a12;

  --sidebar-bg: #0a0f1a;
  --sidebar-fg: #93a0b4;
  --sidebar-non-existant: #93a0b4;
  --sidebar-active: #8fa8ff;
  --sidebar-spacer: #243049;
  --sidebar-header-border-color: #8fa8ff;

  --scrollbar: #243049;
  --icons: #93a0b4;
  --icons-hover: #f3f6fb;
  --links: #8fa8ff;
  --inline-code-color: #e7ecf3;

  --theme-popup-bg: #111826;
  --theme-popup-border: #243049;
  --theme-hover: #141c2e;

  --quote-bg: #111826;
  --quote-border: #243049;
  --warning-border: #ff7b6b;

  --table-border-color: #243049;
  --table-header-bg: #0a0f1a;
  --table-alternate-bg: #0e1523;

  --searchbar-border-color: #667699;
  --searchbar-bg: #0e1523;
  --searchbar-fg: #f3f6fb;
  --searchbar-shadow-color: rgba(143, 168, 255, 0.35);
  --searchresults-header-fg: #93a0b4;
  --searchresults-border-color: #243049;
  --searchresults-li-bg: #111826;
  --search-mark-bg: #26346b;

  --color-scheme: dark;
  --overlay-bg: rgba(2, 5, 12, 0.62);
  --footnote-highlight: #26346b;
}

/* Text */
html, body { font-family: var(--bk-sans); }
body { background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1; }
.content { font-size: 17px; line-height: 1.55; padding: 0 5px 50px; overflow: visible; }
.content p, .content li { line-height: 1.55; }
/* No ligatures anywhere: "->" must show as typed. */
html, body, code, pre, .hljs { font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'calt' 0, 'tnum' 1; }
h1, h2, h3, h4, h5, h6 { font-family: var(--bk-sans); color: var(--bk-heading); font-weight: 600; text-wrap: balance; }
h1, h2, h3, h4 { line-height: 1.2; }
h1 { font-size: 36px; letter-spacing: -0.015em; margin: 28px 0 16px; }
h2 { font-size: 27px; letter-spacing: -0.01em; margin-top: 2.1em; margin-bottom: 0.5em; padding-top: 0.55em; border-top: 1px solid var(--bk-line); }
h3 { font-size: 21px; margin-top: 1.9em; }
h4 { font-size: 17.5px; }
h1 code, h2 code, h3 code, h4 code { font-size: 0.88em; font-weight: 500; }
/* A heading is not a place for a chip: code in it is just set in the mono face. */
:is(h1, h2, h3, h4) > code, :is(h1, h2, h3, h4) > a > code { background: transparent !important; padding: 0 !important; }
.content a:link, .content a:visited { color: var(--bk-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.content a:hover { color: var(--bk-link-hover); }
.header-link, a.header, .content a.header, .content a.header:link, .content a.header:visited { color: inherit !important; text-decoration: none !important; }
strong { color: var(--bk-heading); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--bk-line); }
::selection { background: var(--footnote-highlight); }
.content img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--bk-link); outline-offset: 3px; }
main:focus, body:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 2000; padding: 9px 14px; border-radius: 3px;
  background: var(--bk-heading); color: var(--bg) !important; font-family: var(--mono-font); font-size: 14px; text-decoration: none !important;
}
.skip-link:focus { top: 10px; }

/* Menu bar: toggle, theme, search, print | mark and word (a link to brokapi.ru) | language */
.menu-bar { background: var(--bg); border-bottom: 1px solid var(--bk-line) !important; }
#mdbook-menu-bar { align-items: center; }
.menu-bar .menu-title { display: none; }
.brand { display: flex; align-items: center; gap: 22px; min-width: 0; flex: 1 1 auto; justify-content: flex-start; margin-inline-start: 8px; }
.brand a, .brand a:link, .brand a:visited { text-decoration: none !important; }
.brand-home { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; color: var(--bk-heading) !important; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand-mark path { fill: none; stroke: var(--bk-link); stroke-width: 2.4; stroke-linecap: round; }
.brand-mark circle { fill: var(--bk-signal); }
.brand-word { font-family: var(--bk-sans); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; color: var(--bk-heading); }
.right-buttons { align-items: center; display: flex; }
.left-buttons a.print-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--icons); }
.left-buttons a.print-link:hover { color: var(--icons-hover); }
.menu-bar .icon-button { color: var(--icons); }
.menu-bar .icon-button:hover { color: var(--icons-hover); }
.theme-popup { border-radius: 3px; font-size: 14px; box-shadow: none; }

/* Language: a segmented control, the active one is filled with the ink */
.lang-switch { display: inline-flex; border: 1px solid var(--bk-line); border-radius: 3px; overflow: hidden; margin-inline-end: 8px; }
.lang-switch button {
  appearance: none; border: 0; background: var(--bg); color: var(--bk-heading); cursor: pointer; min-height: 32px;
  padding: 0 12px; font-family: var(--mono-font); font-size: 13px; line-height: 1;
}
.lang-switch button + button { border-inline-start: 1px solid var(--bk-line); }
.lang-switch button:hover { background: var(--bk-soft); }
.lang-switch button.is-on { background: var(--bk-heading); color: var(--bg); }
.lang-switch button:focus-visible { outline-offset: -2px; }
@media (pointer: coarse) { .lang-switch button { min-height: 44px; } }

/* Revision line under the menu bar (text in theme/index.hbs, the only place with it) */
.stage-wrap { display: block; }
.stage-strip, .stage-strip:link, .stage-strip:visited {
  display: flex; flex-wrap: wrap; align-items: center; background: var(--bk-soft); color: var(--bk-muted);
  border-bottom: 1px solid var(--bk-line); font-family: var(--mono-font); font-size: 13px; line-height: 1.3; text-decoration: none;
  margin: 0 calc(0px - var(--page-padding));
}
.stage-strip:hover { color: var(--bk-heading); }
.stage-strip span { padding: 10px 18px 10px 0; }
/* The version starts on the axis of the text (docs/ui.js measures it into --strip-axis; the fallback is the margin of the page). */
.stage-strip .rev-ver { padding-left: var(--strip-axis, calc(var(--page-padding) + 5px)); margin-right: 18px; border-right: 1px solid var(--bk-line); }
.stage-strip .rev-stage { color: var(--bk-heading); }
.stage-strip .rev-stage i { display: inline-block; width: 8px; height: 8px; background: var(--bk-signal); margin-right: 8px; }

/* Sidebar: parts are bold words, a chapter with sections folds, the open page has a blue rail */
.sidebar { font-size: 15px; border-right: 1px solid var(--bk-line); }
.sidebar .sidebar-scrollbox { padding: 18px 12px 48px 20px; }
.sidebar-resize-handle .sidebar-resize-indicator { color: var(--bk-line); }
.chapter { line-height: 1.4; }
.chapter li.chapter-item { margin-block-start: 0; line-height: 1.4; }
.chapter li { color: var(--bk-muted); }
.chapter .part-title { font-weight: 600; font-size: 15px; color: var(--bk-heading); margin: 20px 0 4px; list-style: none; }
.chapter li a { color: var(--sidebar-fg); text-decoration: none; }
.chapter li a:hover { color: var(--bk-heading); }
.chapter-link-wrapper { align-items: stretch; }
.chapter-link-wrapper > a:not(.chapter-fold-toggle) { flex: 1 1 auto; min-width: 0; display: block; padding: 5px 0; }
.chapter > li > .chapter-link-wrapper > a { color: var(--bk-heading); font-weight: 400; }
.chapter li a.active { color: var(--sidebar-active); font-weight: 600; }
.chapter > li > .chapter-link-wrapper > a.active { color: var(--sidebar-active); }
.chapter strong[aria-hidden] { font: 400 13px var(--mono-font); color: var(--bk-muted); margin-right: 6px; display: inline-block; min-width: 3ch; }
.chapter a.active strong[aria-hidden] { color: inherit; }
.section { list-style: none; padding-inline-start: 0; margin: 2px 0 8px 4px; border-left: 1px solid var(--bk-line); line-height: 1.4; }
.section > li > .chapter-link-wrapper > a:not(.chapter-fold-toggle) { padding: 5px 0 5px 12px; }
.section > li > .chapter-link-wrapper > a.active { box-shadow: inset 2px 0 0 var(--bk-link); margin-left: -1px; padding-left: 13px; }
.chapter-fold-toggle { opacity: 1; color: var(--bk-muted) !important; padding: 0 8px; align-items: center; display: flex; font-size: 11px; }
.chapter-fold-toggle:hover { color: var(--bk-heading) !important; }
.chapter-fold-toggle div { transition: transform 0.15s; }
@media (-moz-touch-enabled: 1), (pointer: coarse) { .chapter li a { padding: 5px 0; } }

/* "On this page" under the open chapter inside the sidebar (on a narrow screen), a thin neutral rail, the current one is blue */
.on-this-page { margin: 2px 0 8px 4px; padding-left: 0; border-inline-start: 1px solid var(--bk-line); }
.on-this-page > ol { padding-left: 0; }
.chapter li.header-item { margin-block-end: 0; line-height: 1.4; }
.on-this-page a { color: var(--sidebar-fg); }
.on-this-page a:hover { color: var(--bk-heading); }
.on-this-page ol { list-style: none; padding-inline-start: 14px; }
.chapter a.current-header { color: var(--sidebar-active); font-weight: 500; box-shadow: inset 2px 0 0 var(--bk-link); margin-left: -1px; padding-left: 13px; }
.on-this-page a, .chapter a.header-in-summary, .chapter a.current-header { display: inline-block; min-height: 24px; line-height: 24px; box-sizing: border-box; }

/* Layout of a page: the text, and on a wide screen the column "On this page" at the right */
.doc-grid { display: block; }
.page-toc { display: none; font-size: 14px; }
.page-toc[hidden] { display: none !important; }
.page-toc b { display: block; margin-bottom: 8px; font-weight: 600; color: var(--bk-heading); }
.page-toc a, .page-toc a:link, .page-toc a:visited {
  display: block; color: var(--bk-muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 1px solid var(--bk-line); line-height: 1.35;
}
.page-toc a.h3 { padding-left: 24px; }
.page-toc a:hover { color: var(--bk-heading); }
.page-toc a.on { border-left: 2px solid var(--bk-link); padding-left: 11px; color: var(--bk-heading); }
.page-toc a.h3.on { padding-left: 23px; }
@media (min-width: 1240px) {
  html.has-page-toc .doc-grid { display: grid; grid-template-columns: minmax(0, var(--content-max-width)) 232px; gap: 48px; justify-content: center; }
  html.has-page-toc .page-toc { display: block; position: sticky; top: calc(var(--menu-bar-height) + 24px); align-self: start;
    max-height: calc(100vh - var(--menu-bar-height) - 48px); overflow-y: auto; margin-top: 30px; }
  html.has-page-toc .on-this-page { display: none; }
}
.doc-main { min-width: 0; }

/* Code: dark block in both themes, the inline code on a panel */
code, pre, .hljs, pre > .buttons { font-family: var(--mono-font); }
:not(pre) > code { background: var(--bk-soft); border-radius: 2px; padding: 0.05em 0.2em; color: var(--inline-code-color); font-size: 0.88em; }
pre { border: 0; border-radius: 2px; background: var(--bk-code-bg); margin: 1.2em 0; }
.coal pre { box-shadow: 0 0 0 1px var(--bk-line); }
pre > code, pre > .hljs { background: transparent; padding: 18px 20px; font-size: 14px; line-height: 1.65; }
.content pre code, .content pre .hljs { color: var(--bk-code-ink); }
.content pre .hljs-comment, .content pre .hljs-quote { color: var(--bk-code-muted); font-style: normal; }
.content pre .hljs-keyword, .content pre .hljs-selector-tag, .content pre .hljs-built_in { color: var(--bk-code-key); }
.content pre .hljs-string, .content pre .hljs-template-variable { color: var(--bk-code-str); }
.content pre .hljs-number, .content pre .hljs-literal, .content pre .hljs-symbol, .content pre .hljs-bullet { color: var(--bk-code-num); }
.content pre .hljs-attr, .content pre .hljs-attribute { color: var(--bk-code-meta); }
.content pre .hljs-title, .content pre .hljs-section, .content pre .hljs-type, .content pre .hljs-class .hljs-title { color: #ffffff; font-weight: 600; }
.content pre .hljs-meta, .content pre .hljs-variable { color: var(--bk-code-meta); }
pre > .buttons button, pre > .buttons .clip-button { color: var(--bk-code-muted); background: transparent; border: 1px solid var(--bk-code-line); border-radius: 3px; }
pre > .buttons button .fa-svg, pre > .buttons button svg { fill: currentColor; color: inherit; }
pre > .buttons button:hover { color: var(--bk-code-ink); }
:root { --copy-button-filter: invert(60%); --copy-button-filter-hover: invert(95%); }
/* The copy button is always reachable: by keyboard, and on a touch screen it is shown all the time. */
pre > .buttons { visibility: visible; opacity: 0; }
pre:hover > .buttons, pre:focus-within > .buttons, pre > .buttons:focus-within { opacity: 1; }
@media (hover: none), (pointer: coarse) { pre > .buttons { opacity: 1; } }
pre > .buttons button.clip-button { min-width: 44px; min-height: 34px; }
.tooltiptext { font-family: var(--bk-sans); font-size: 12px; white-space: nowrap; }
pre[tabindex]:focus-visible { outline-offset: 2px; }
/* A line that runs on to the right fades at the edge until the reader has scrolled to its end (docs/ui.js sets data-scrolls and data-end). */
pre > code[data-scrolls]:not([data-end]) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
/* On a phone the copy button goes under the code, 44 by 44, as on the site: it does not lie on the first line any more. */
@media (max-width: 640px) {
  pre > code, pre > .hljs { padding-bottom: 52px; }
  pre > .buttons { top: auto; bottom: 0; right: 0; padding: 4px 0; }
  pre > .buttons button.clip-button { min-width: 44px; min-height: 44px; }
}
/* A long block: limited height, scrolls inside, the first line stays in view. */
details.code-fold { margin: 1.2em 0; }
details.code-fold > summary { cursor: pointer; padding: 8px 14px; font-family: var(--mono-font); font-size: 13px; color: var(--bk-muted); background: var(--bk-soft); border: 1px solid var(--bk-line); list-style-position: inside; }
details.code-fold:not([open]) > summary { border-radius: 2px; }
details.code-fold > summary:hover { color: var(--bk-heading); }
details.code-fold > pre { margin: 0; border-radius: 0; max-height: 70vh; overflow: auto; }
.lang-tabs details.code-fold { margin: 0; }
.lang-tabs details.code-fold:has(> pre[hidden]) { display: none; }

/* Code in several languages: the group of fences is wrapped in <div class="lang-tabs">, see docs/README.md. The script
   docs/lang-tabs.js turns the group into tabs (class is-tabbed): the bar of the tabs is the head of the listing, the active
   tab has the orange line. Without the script the blocks stand one under another with a caption of the language. */
.lang-tabs { margin: 1.4em 0; }
.lang-tabs pre { margin: 0.4em 0 1em; }
.lang-tabs pre::before { display: block; padding: 12px 20px 0; font-family: var(--mono-font); font-size: 13px; color: var(--bk-code-muted); }
.lang-tabs.is-tabbed pre::before { content: none !important; }
.lang-tabs-bar { display: flex; background: var(--bk-code-bg); border-bottom: 1px solid var(--bk-code-line); padding: 0 16px; border-radius: 2px 2px 0 0; }
.coal .lang-tabs-bar { box-shadow: 0 0 0 1px var(--bk-line); }
.lang-tabs-bar button {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin: 0 0 -1px; padding: 14px 14px 12px; cursor: pointer;
  font-family: var(--mono-font); font-size: 13px; line-height: 1; color: var(--bk-code-muted);
}
.lang-tabs-bar button:hover { color: #fff; }
.lang-tabs-bar button.is-on { color: #fff; border-bottom-color: var(--bk-signal); }
.lang-tabs-bar button:focus-visible { outline: 2px solid var(--bk-code-key); outline-offset: -2px; }
.lang-tabs.is-tabbed > pre, .lang-tabs.is-tabbed > details.code-fold { margin: 0; border-radius: 0 0 2px 2px; }
.lang-tabs.is-tabbed + p, .lang-tabs.is-tabbed + h2, .lang-tabs.is-tabbed + h3 { margin-top: 1.2em; }
.lang-tabs pre:has(> code.language-rust)::before { content: "Rust"; }
.lang-tabs pre:has(> code.language-python)::before { content: "Python"; }
.lang-tabs pre:has(> code.language-proto)::before, .lang-tabs pre:has(> code.language-protobuf)::before { content: "gRPC"; }
.lang-tabs pre:has(> code.language-bash)::before, .lang-tabs pre:has(> code.language-sh)::before { content: "Shell"; }
.lang-tabs pre[role="tabpanel"]:focus-visible { outline: 2px solid var(--bk-code-key); }
/* Which language a lone block is written in (on the pages common to Rust and Python). */
pre.lang-solo::before { content: attr(data-lang-label); display: block; padding: 12px 20px 0; font-family: var(--mono-font); font-size: 13px; color: var(--bk-code-muted); }

/* Tables: ruled rows, the head under a black rule, a zebra. A wide table that does not fit scrolls inside its box (docs/ui.js
   marks it .is-scrollable): the first column stays in place and a hint under the table says so. On a phone a table of three
   columns or more becomes rows of blocks: one row, the name of the column in front of every cell (data-label is put by docs/ui.js). */
.table-wrapper { overflow-x: auto; margin: 1.4em calc(-1 * var(--inset)); }
.content table { margin: 0; border-collapse: collapse; font-size: 16px; line-height: 1.5; width: 100%; }
.content table th {
  background: transparent; color: var(--bk-muted); font-weight: 600; font-size: 14px; text-align: left; white-space: normal;
  border: 0; border-bottom: 1px solid var(--bk-heading); padding: 10px 16px 10px 0;
}
.content table td { border: 0; border-bottom: 1px solid var(--bk-line); vertical-align: top; min-width: 9em; padding: 14px 16px 14px 0; }
.content table td:first-child { min-width: 7em; }
.content table th:first-child, .content table td:first-child { padding-left: var(--inset); }
.content table th:last-child, .content table td:last-child { padding-right: var(--inset); }
/* Four columns or more (docs/ui.js puts .cols-many): the columns share the width of the text instead of each asking for 9em. */
.table-wrapper.cols-many td, .table-wrapper.cols-many td:first-child { min-width: 0; overflow-wrap: break-word; }
.content table tbody tr:nth-child(2n) td { background: var(--table-alternate-bg); }
.table-wrapper.is-scrollable { position: relative; }
.table-wrapper.is-scrollable th:first-child, .table-wrapper.is-scrollable td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: 1px 0 0 var(--bk-line); padding-right: 12px; }
.table-wrapper.is-scrollable th:first-child { z-index: 2; }
.table-wrapper.is-scrollable tbody tr:nth-child(2n) td:first-child { background: var(--table-alternate-bg); }
.table-wrapper.is-scrollable + .table-hint { display: block; }
.table-hint { display: none; margin: -0.8em 0 1.4em; font-size: 13px; color: var(--bk-muted); text-align: right; }
.table-wrapper[data-scrolls]:focus-visible { outline-offset: 2px; }
@media (max-width: 700px) {
  .table-wrapper.table-cards { overflow: visible; }
  .table-wrapper.table-cards table, .table-wrapper.table-cards tbody,
  .table-wrapper.table-cards tr, .table-wrapper.table-cards td { display: block; width: 100%; }
  .table-wrapper.table-cards thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .table-wrapper.table-cards tbody tr, .table-wrapper.table-cards tbody tr:nth-child(2n) { margin: 0; padding: 14px var(--inset); border-bottom: 1px solid var(--bk-line); background: none; }
  .table-wrapper.table-cards tbody tr:first-child { border-top: 1px solid var(--bk-heading); }
  .table-wrapper.table-cards td, .table-wrapper.table-cards tbody tr:nth-child(2n) td { box-sizing: border-box; min-width: 0; border: 0; padding: 3px 0; overflow-wrap: anywhere; background: none; box-shadow: none; }
  .table-wrapper.table-cards td:first-child { min-width: 0; font-weight: 600; color: var(--bk-heading); }
  .table-wrapper.table-cards tr { box-sizing: border-box; }
  .content .table-wrapper.table-cards.is-scrollable td:first-child, .content .table-wrapper.table-cards.is-scrollable tbody tr:nth-child(2n) td:first-child { position: static; background: none; box-shadow: none; }
  .content .table-wrapper.table-cards td, .content .table-wrapper.table-cards td:first-child, .content .table-wrapper.table-cards td:last-child { padding: 3px 0; }
  .table-wrapper.table-cards td:empty { display: none; }
  .table-wrapper.table-cards td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 400; color: var(--bk-muted); margin-top: 6px; }
  .table-wrapper.table-cards td:first-child[data-label]::before { content: none; }
  .table-hint { display: none !important; }
}

/* Notes: a frame of one pixel on a panel, no colored bar at the side */
blockquote { background: var(--quote-bg); border: 1px solid var(--quote-border); border-top: 2px solid var(--bk-heading); border-radius: 0; margin: 1.4em 0; padding: 14px 18px; }
blockquote > :first-child { margin-top: 0; }
blockquote > :last-child { margin-bottom: 0; }

/* Diagrams: a framed figure (colors: mermaid-init.js), does not push the page wider */
pre.mermaid, .mermaid { background: var(--bk-box); border: 1px solid var(--bk-line); border-radius: 0; color: var(--fg); padding: 20px 8px; margin: 1.4em 0; text-align: center; overflow-x: auto; }
.mermaid svg { max-width: 100%; height: auto; }
.mermaid-scroll-hint { margin: -0.6em 0 1.2em; font-size: 13px; color: var(--bk-muted); text-align: right; }

/* Back and forward: two large cards at the foot of a chapter, the only cards of the design (it is an action) */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager a, .pager a:link, .pager a:visited {
  display: block; min-height: 84px; padding: 16px 20px; border: 1px solid var(--bk-line); border-radius: 3px; text-decoration: none !important;
  color: var(--bk-heading); box-sizing: border-box; overflow-wrap: anywhere;
}
.pager a:hover { border-color: var(--bk-link); background: var(--bk-soft); }
.pager .nx { grid-column: 2; text-align: right; }
.pager .pv { grid-column: 1; }
.pager-label { display: block; color: var(--bk-muted); font-size: 13.5px; margin-bottom: 4px; }
.pager-title { display: block; font-weight: 600; font-size: 18px; line-height: 1.3; color: var(--bk-link); }
.pager-hint { margin: 10px 0 0; font-size: 13px; color: var(--bk-muted); }
@media (hover: none), (pointer: coarse) { .pager-hint { display: none; } }
/* The side arrows of mdBook are replaced by the cards (the keys stay: book.js presses the hidden ones). */
.nav-wide-wrapper, .nav-wrapper { display: none !important; }

/* Footer of a page */
.book-foot { margin: 40px 0 0; padding: 0 0 24px; font-size: 14px; color: var(--bk-muted); }
.book-foot a, .book-foot a:link, .book-foot a:visited { color: var(--bk-heading); }
/* As the footer of the site: "brokapi by RunInfra" on its own line in the middle, "Сообщить об ошибке" on the next one. */
.book-foot-line { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; padding-top: 14px; border-top: 1px solid var(--bk-heading); }
.book-foot .book-foot-line > span a { display: inline-block; padding: 7px 2px; font-weight: 400; }
.book-foot .book-foot-line > span { line-height: 32px; }
.book-foot button.report-error { appearance: none; background: none; border: 0; padding: 0 2px; min-height: 32px; font: inherit; cursor: pointer; color: var(--bk-link); text-decoration: underline; text-underline-offset: 3px; }
.book-foot button.report-error[hidden] { display: none; }
.book-foot button.report-error:hover { color: var(--bk-link-hover); }

/* Fork on the first page and the sections: a ruled list, one row per path. In the markdown it is a plain loose list inside
   <div class="paths">: the first link of an item is the name, the code span is the stage. Without this CSS the page stays
   a readable list (agents read the same markdown). */
.paths ul { list-style: none; padding: 0; margin: 1.4em 0; border-top: 1px solid var(--bk-heading); }
.paths li { position: relative; margin: 0; padding: 16px 12px 16px 0; border-bottom: 1px solid var(--bk-line); }
.paths li:hover, .paths li:focus-within { background: var(--bk-soft); }
.paths li > p { margin: 0; color: var(--bk-muted); line-height: 1.5; }
.paths li > p:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.paths li > p:first-child a, .paths li > p:first-child a:link, .paths li > p:first-child a:visited { font-size: 19px; font-weight: 600; text-decoration: none; color: var(--bk-link); }
.paths li > p:first-child a::after { content: ""; position: absolute; inset: 0; }
.paths li > p:first-child a:focus-visible::after { outline: 2px solid var(--bk-link); outline-offset: 2px; }
.paths li > p:first-child code, .stub-stage { font-family: var(--mono-font); font-size: 13px; line-height: 1; padding: 0; background: transparent; color: var(--bk-muted); white-space: nowrap; }
.paths li > p:first-child code::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border: 1.5px solid var(--bk-muted); box-sizing: border-box; }
/* The first three are Rust, Python and Gateway, the paths that work (alpha): their square is filled with the signal. */
.paths li:nth-child(-n+3) > p:first-child code { color: var(--bk-heading); }
.paths li:nth-child(-n+3) > p:first-child code::before { background: var(--bk-signal); border-color: var(--bk-signal); }

/* Placeholder of a product that does not exist yet (no page uses it now; the book has no product that is only planned): one component,
   all placeholders look the same. Markup (blank lines between the blocks keep markdown working inside):
     <div class="stub">  <p class="stub-stage"><span class="stub-dot"></span>К бете</p>  <p class="stub-state">...</p>
     <div class="stub-label">Что это будет</div> text  <div class="stub-label">Что работает уже сейчас</div> list
     <div class="stub-foot"> line with the link to the changelog </div>  </div> */
.stub { margin: 1.6em 0; padding: 22px 24px; background: var(--bk-box); border: 1px dashed var(--bk-muted); border-radius: 0; }
.stub > p, .stub > div > p { margin: 0 0 1em; }
.stub .stub-stage { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--bk-heading); font-size: 13px; }
.stub-dot { width: 8px; height: 8px; background: var(--bk-signal); flex: 0 0 auto; }
.stub .stub-state { font-weight: 600; color: var(--bk-heading); }
.stub .stub-label { font-weight: 600; font-size: 15px; color: var(--bk-heading); margin: 1.8em 0 0.5em; padding-bottom: 6px; border-bottom: 1px solid var(--bk-line); }
.stub ul { margin: 0.6em 0 0; padding-left: 1.4em; }
.stub .stub-foot { margin-top: 2em; padding-top: 14px; border-top: 1px solid var(--bk-line); font-size: 14.5px; color: var(--bk-muted); }
.stub .stub-foot p { margin: 0; }
.stub code { font-size: 0.9em; }

/* Search: the button in the menu bar and the window (docs/search.js) */
.search-toggle { display: inline-flex; align-items: center; gap: 8px; width: auto; }
.search-toggle .search-toggle-text { display: none; font-size: 14px; }
@media (min-width: 900px) { .search-toggle .search-toggle-text { display: inline; } }
.search-modal { position: fixed; inset: 0; z-index: 1500; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 12px 12px; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: var(--overlay-bg); }
.search-box {
  position: relative; width: 100%; max-width: 720px; max-height: 84vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bk-heading); border-radius: 3px; overflow: hidden; font-size: 15px;
}
.search-form { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--bk-line); }
.search-input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 17px; color: var(--fg); background: var(--bk-box);
  border: 1px solid var(--searchbar-border-color); border-radius: 3px; padding: 9px 12px;
}
.search-input:focus { outline: none; border-color: var(--bk-link); box-shadow: 0 0 0 3px var(--searchbar-shadow-color); }
.search-close {
  appearance: none; background: transparent; color: var(--bk-muted); border: 1px solid var(--bk-line); border-radius: 3px;
  padding: 6px 10px; font-family: var(--mono-font); font-size: 12px; cursor: pointer; min-height: 36px;
}
.search-close:hover { color: var(--bk-heading); border-color: var(--bk-heading); }
.search-status { margin: 0; padding: 8px 16px 0; min-height: 26px; font-size: 13px; color: var(--bk-muted); }
.search-results { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1 1 auto; }
.search-results li { margin: 0; padding: 0; }
.search-hit { display: block; padding: 10px 12px; border-radius: 3px; color: var(--fg) !important; text-decoration: none !important; }
.search-hit:hover, .search-hit:focus-visible { background: var(--bk-hover); outline-offset: -2px; }
.search-hit-title { display: block; font-weight: 600; color: var(--bk-heading); }
.search-hit-section { display: block; font-family: var(--mono-font); font-size: 12px; color: var(--bk-link); margin-top: 1px; }
.search-hit-text { display: block; margin-top: 3px; color: var(--bk-muted); line-height: 1.5; font-size: 13.5px; }
.search-hit-more, .search-hit-more:link, .search-hit-more:visited { text-decoration: none !important; }
.search-hit-more:hover { color: var(--bk-link) !important; }
.search-hit-more { display: block; margin: -3px 0 4px 12px; padding: 0 12px; font-size: 12px; color: var(--bk-muted) !important; }
.search-results mark { background: var(--search-mark-bg); color: inherit; border-radius: 2px; padding: 0 0.15em; margin: 0 0.12em; }
.search-hint { margin: 0; padding: 8px 16px; border-top: 1px solid var(--bk-line); font-family: var(--mono-font); font-size: 12px; color: var(--bk-muted); }
html.search-open .content { pointer-events: none; }
@media (max-width: 560px) {
  .search-modal { padding: 8px; align-items: stretch; }
  .search-box { max-height: none; }
  .search-hint { display: none; }
}

/* Report an error: the form in a <dialog> (docs/ui.js, the button is in the footer of a page) */
.report-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bk-heading); border-radius: 3px; font-size: 15px;
}
.report-dialog::backdrop { background: var(--overlay-bg); }
.report-form { display: flex; flex-direction: column; padding: 22px 24px 24px; }
.report-title { margin: 0 0 4px; padding: 0; border: 0; font-size: 22px; color: var(--bk-heading); }
.report-page { margin: 0 0 16px; color: var(--bk-muted); font-size: 13.5px; }
.report-quote { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--bk-line); background: var(--bk-soft); color: var(--bk-muted); font-size: 13.5px; max-height: 9em; overflow: auto; white-space: pre-wrap; }
.report-label { margin: 0 0 6px; font-weight: 600; color: var(--bk-heading); }
.report-label span { font-weight: 400; color: var(--bk-muted); margin-left: 6px; }
.report-form textarea, .report-form input[type="text"] {
  font: inherit; color: var(--fg); background: var(--bk-box); border: 1px solid var(--searchbar-border-color);
  border-radius: 3px; padding: 9px 12px; margin-bottom: 16px; width: 100%; box-sizing: border-box;
}
.report-form textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.report-form textarea:focus, .report-form input[type="text"]:focus { outline: none; border-color: var(--bk-link); box-shadow: 0 0 0 3px var(--searchbar-shadow-color); }
.report-form .report-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.report-status { margin: 0 0 12px; min-height: 1.5em; font-size: 13.5px; color: var(--bk-muted); }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.report-actions button {
  appearance: none; font: inherit; font-weight: 500; min-height: 44px; padding: 0 22px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--bk-link); background: var(--bg); color: var(--bk-link);
}
.report-actions button:hover { background: var(--bk-soft); }
.report-actions .report-send { background: var(--bk-link); color: var(--bg); }
.report-actions .report-send:hover { background: var(--bk-link-hover); }
.report-actions .report-send:disabled { opacity: 0.6; cursor: progress; }
.report-actions button[hidden] { display: none; }

/* Narrow screens */
@media (max-width: 700px) {
  .lang-switch { margin-inline-end: 2px; }
}
@media (max-width: 560px) {
  .content { font-size: 16.5px; }
  h1 { font-size: 29px; }
  h2 { font-size: 24px; }
  .brand { gap: 12px; margin-inline-start: 2px; }
  .brand-word { font-size: 19px; }
  .left-buttons a.print-link { display: none; }
  .right-buttons > a { display: none; }
  .brand-mark { width: 26px; height: 26px; }
  .right-buttons { margin: 0 8px 0 0; }
  .right-buttons .icon-button { display: none; }
  .lang-switch button { padding: 0 10px; min-height: 30px; }
  /* Both parts on one height, the first on the axis of the text (as on the site: 6px 20px). */
  .stage-strip { flex-wrap: nowrap; }
  .stage-strip span { padding: 6px 14px 6px 0; }
  .stage-strip .rev-ver { border-right: 0; margin-right: 0; }
  .pager { grid-template-columns: 1fr; }
  .pager .nx, .pager .pv { grid-column: 1; }
  .pager .nx { order: -1; text-align: left; }
  .paths li > p:first-child { flex-wrap: wrap; gap: 4px 16px; }
}
