/* Playea API — документация для партнёров. Без фреймворков: index.html + docs.css + docs.js. */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --surface-3: #ecebe9;
  --border: #eceae7;
  --border-strong: #dcdad6;
  --text: #16171a;
  --text-2: #5f6166;
  --text-3: #9a9ca1;
  --accent: #17804a;
  --accent-hover: #126a3d;
  --accent-ink: #ffffff;
  --ok: #1f8a5a;
  --warn: #b0730a;
  --bad: #c23b3b;
  --info: #2b5fd9;
  --get: #2b5fd9;
  --post: #17804a;
  --shadow-sm: 0 1px 2px rgba(20, 20, 22, 0.05);
  --shadow-md: 0 1px 2px rgba(20, 20, 22, 0.04), 0 8px 24px -12px rgba(20, 20, 22, 0.14);
  --topbar-bg: rgba(250, 250, 249, 0.82);

  --code-bg: #0e1015;
  --code-bg-2: #151821;
  --code-line: #232734;
  --code-text: #d5d9e2;
  --code-dim: #7a8194;
  --tk-key: #8fb3ff;
  --tk-str: #a5d98f;
  --tk-num: #f1b475;
  --tk-kw: #c9a2ff;
  --tk-fn: #7fd4e6;
  --tk-com: #646b7c;
  --tk-bad: #ff8a8a;
  --tk-ok: #7ee2a8;

  --font: 'Golos Text', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --top-h: 60px;
  --toc-w: 228px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0c0e;
    --surface: #111214;
    --surface-2: #18191c;
    --surface-3: #202125;
    --border: #232427;
    --border-strong: #313338;
    --text: #f1f1f0;
    --text-2: #a8aaae;
    --text-3: #6f7176;
    --accent: #4cc38a;
    --accent-hover: #6fd3a2;
    --accent-ink: #06150d;
    --ok: #57b98a;
    --warn: #d6a24f;
    --bad: #e07a72;
    --info: #7f9bff;
    --get: #7f9bff;
    --post: #4cc38a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    --topbar-bg: rgba(11, 12, 14, 0.78);
    --code-bg: #0d0e12;
    --code-bg-2: #14161c;
    --code-line: #22252f;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b0c0e;
  --surface: #111214;
  --surface-2: #18191c;
  --surface-3: #202125;
  --border: #232427;
  --border-strong: #313338;
  --text: #f1f1f0;
  --text-2: #a8aaae;
  --text-3: #6f7176;
  --accent: #4cc38a;
  --accent-hover: #6fd3a2;
  --accent-ink: #06150d;
  --ok: #57b98a;
  --warn: #d6a24f;
  --bad: #e07a72;
  --info: #7f9bff;
  --get: #7f9bff;
  --post: #4cc38a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --topbar-bg: rgba(11, 12, 14, 0.78);
  --code-bg: #0d0e12;
  --code-bg-2: #14161c;
  --code-line: #22252f;
  color-scheme: dark;
}

/* ───── База ───── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.is-locked {
  overflow: hidden;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}
p {
  margin: 0;
}
b,
strong {
  font-weight: 600;
  color: var(--text);
}
.mono,
code,
pre,
kbd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
}
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}
.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip:focus {
  color: var(--surface);
  transform: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───── Верхняя панель ───── */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top-h);
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
.top-in {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-width: 0;
}
.brand:hover {
  color: var(--text);
}
.brand b {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.brand-sub {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.brand-sub::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 14px;
  margin: 0 10px 0 2px;
  background: var(--border-strong);
  vertical-align: -2px;
}
.top-ver {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.top-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.top-nav a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
}
.top-nav a svg {
  color: var(--text-3);
}
.top-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: -6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* Переключатель темы */
.theme {
  position: relative;
  display: inline-flex;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  flex-shrink: 0;
}
.theme button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.theme button:hover {
  color: var(--text);
}
.theme button[aria-checked='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(20, 20, 22, 0.14);
}

/* ───── Каркас страницы ───── */
.page {
  display: grid;
  grid-template-columns: var(--toc-w) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 40px;
}
.body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Оглавление */
.toc {
  position: sticky;
  top: calc(var(--top-h) + 24px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--top-h) - 48px);
  max-height: calc(100dvh - var(--top-h) - 48px);
  padding: 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.toc-t {
  margin: 0 0 8px 8px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.toc-list a span {
  width: 16px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.toc-list a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.toc-list a.is-active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.toc-list a.is-active span {
  color: var(--accent);
}
.toc-files {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.toc-files a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12.5px;
}
.toc-files a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.toc-files a svg {
  color: var(--text-3);
  flex-shrink: 0;
}
.toc-files a small {
  margin-left: auto;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.toc-scrim {
  display: none;
}

/* Ключевые факты в начале страницы */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
  padding: 13px 16px;
  border: 0;
  border-left: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.fact:first-child {
  border-left: 0;
}
.fact:hover {
  background: var(--surface-2);
}
.fact small {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: 11.5px;
}
.fact code {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fact i {
  display: inline-flex;
  color: var(--text-3);
  font-style: normal;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.fact:hover i,
.fact:focus-visible i,
.fact.is-done i {
  opacity: 1;
}
.fact.is-done i {
  color: var(--ok);
}

/* ───── Разделы ───── */
.sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.94fr);
  gap: 32px;
  padding: 28px 30px 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  scroll-margin-top: calc(var(--top-h) + 20px);
}
.sec.is-wide {
  grid-template-columns: minmax(0, 1fr);
}
.sec-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.sec-aside {
  position: sticky;
  top: calc(var(--top-h) + 20px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sec-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.sec-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.25;
}
.sec-head a.anchor {
  margin-left: -4px;
  padding: 2px 4px;
  color: var(--text-3);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sec-head:hover a.anchor,
.sec-head a.anchor:focus-visible {
  opacity: 1;
}
.lead {
  max-width: 68ch;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.65;
}
.p {
  max-width: 72ch;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}
.p b,
.lead b {
  color: var(--text);
}
.sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 -2px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.sub::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
h3.h3 {
  margin: 8px 0 -4px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Инлайн-код в тексте */
.sec code:not(pre code) {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.84em;
  overflow-wrap: anywhere;
}
.sec pre code,
.code code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  color: inherit;
}

/* Шаги */
.steps {
  display: flex;
  flex-direction: column;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps > li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 0 18px 38px;
  counter-increment: step;
}
.steps > li:last-child {
  padding-bottom: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.steps > li::after {
  content: '';
  position: absolute;
  top: 28px;
  bottom: 4px;
  left: 11.5px;
  width: 1px;
  background: var(--border-strong);
}
.steps > li:last-child::after {
  display: none;
}
.steps b {
  font-size: 14px;
  font-weight: 600;
  line-height: 24px;
}
.steps > li > span,
.steps > li > div {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.steps ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.steps ul li {
  position: relative;
  padding: 2px 0 2px 16px;
}
.steps ul li::before {
  content: '';
  position: absolute;
  top: 0.85em;
  left: 2px;
  width: 6px;
  height: 1px;
  background: var(--text-3);
}

/* Путь интеграции */
.path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
}
.path-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 15px;
  border-left: 1px solid var(--border);
  color: var(--text);
  min-width: 0;
  transition: background 0.15s ease;
}
.path-step:first-child {
  border-left: 0;
}
a.path-step:hover {
  background: var(--surface);
  color: var(--text);
}
.path-step small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.path-step b {
  font-size: 14px;
}
.path-step code {
  overflow: hidden;
  color: var(--text-2);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-50%) rotate(45deg);
}
a.path-step:hover::after {
  background: var(--surface);
}

/* Сноски */
.note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--info) 22%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--info) 6%, transparent);
}
.note > svg {
  margin-top: 3px;
  color: var(--info);
  flex-shrink: 0;
}
.note p {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.note p b {
  color: var(--text);
}
.note.is-warn {
  border-color: color-mix(in srgb, var(--warn) 30%, var(--border));
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}
.note.is-warn > svg {
  color: var(--warn);
}
.note.is-ok {
  border-color: color-mix(in srgb, var(--ok) 28%, var(--border));
  background: color-mix(in srgb, var(--ok) 7%, transparent);
}
.note.is-ok > svg {
  color: var(--ok);
}

/* Пары «хорошо / плохо» */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pair > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 14px 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--ok);
}
.pair > div.is-bad {
  box-shadow: inset 3px 0 0 var(--bad);
}
.pair b {
  font-size: 13.5px;
}
.pair span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

/* Две колонки без оформления */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px 24px;
}

/* Список с маркерами */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.list li::before {
  content: '';
  position: absolute;
  top: 0.66em;
  left: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.list li b {
  color: var(--text);
}

/* Таблицы */
.table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.tr {
  display: grid;
  grid-template-columns: minmax(190px, 0.62fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}
.tr:first-child {
  border-top: 0;
}
.tr > * {
  min-width: 0;
}
.th {
  padding-top: 8px;
  padding-bottom: 8px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}
.sec .tr code {
  color: var(--text);
  font-size: 11.5px;
}
.sec .tr > span:first-child > code {
  overflow-wrap: normal;
  word-break: break-word;
}
.sec-aside.is-static {
  position: static;
}
.tr .c-main {
  color: var(--text);
  font-weight: 500;
}
.table.cols-3 .tr {
  grid-template-columns: minmax(130px, 0.6fr) minmax(0, 1fr) minmax(0, 1fr);
}
.table.cols-4 .tr {
  grid-template-columns: minmax(150px, 0.9fr) minmax(90px, 0.55fr) minmax(0, 0.9fr) minmax(0, 1.5fr);
}
.table.cols-stock .tr {
  grid-template-columns: minmax(120px, 0.6fr) minmax(0, 1fr) minmax(0, 1fr);
}
.table.cols-idem .tr {
  grid-template-columns: minmax(215px, 0.8fr) minmax(0, 1.4fr);
}
.table.cols-retry .tr {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.2fr);
}
.table.cols-noreason .tr {
  grid-template-columns: 76px 52px minmax(0, 1.4fr) minmax(0, 1fr);
}
.table.cols-errors .tr {
  grid-template-columns: 58px minmax(196px, 1.05fr) minmax(0, 1.5fr) minmax(0, 1.2fr);
}
.err-r {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.err-r small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.act {
  color: var(--text);
  font-weight: 500;
}
.st {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.st.is-2 {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}
.st.is-5 {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad);
}
.st.is-info {
  background: color-mix(in srgb, var(--info) 13%, transparent);
  color: var(--info);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag.is-plus {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--border));
  background: color-mix(in srgb, var(--ok) 9%, transparent);
  color: var(--ok);
}
.tag.is-minus {
  border-color: color-mix(in srgb, var(--bad) 28%, var(--border));
  background: color-mix(in srgb, var(--bad) 8%, transparent);
  color: var(--bad);
}

/* Параметры */
.params {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.param {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.param > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.sec .param code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.param > div > b {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.param small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.param em {
  color: var(--bad);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}
.param i {
  color: var(--text-3);
  font-size: 11.5px;
  font-style: normal;
}
.param p {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}
.param p code {
  font-weight: 400 !important;
  font-size: 11.5px !important;
  padding: 1px 5px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface-2) !important;
}

/* Ход покупки */
.flow {
  display: flex;
  flex-direction: column;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 9px 0 9px 24px;
}
.flow-step::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 0;
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 2px solid var(--text-3);
  border-radius: 50%;
  background: var(--surface-2);
}
.flow-step::after {
  content: '';
  position: absolute;
  top: 24px;
  bottom: -15px;
  left: 4px;
  width: 1px;
  background: var(--border-strong);
}
.flow-step:last-child::after {
  display: none;
}
.flow-step b {
  font-size: 13px;
}
.flow-step span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.flow-step.is-done::before {
  border-color: var(--ok);
  background: var(--ok);
}
.flow-step.is-done b {
  color: var(--ok);
}
.stops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.stop {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
  border-left: 2px solid var(--border-strong);
}
.stop.is-bad {
  border-left-color: color-mix(in srgb, var(--bad) 60%, var(--border));
}
.stop b {
  font-size: 13px;
}
.stop span {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
}

/* Баланс: шкала */
.meter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.meter-top small {
  color: var(--text-3);
  font-size: 12px;
}
.meter-top b {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.meter-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
}
.meter-bar .m-av {
  flex: 0 0 99.2%;
  background: var(--ok);
}
.meter-bar .m-hold {
  flex: 0 0 0.8%;
  min-width: 6px;
  background: var(--warn);
}
.meter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--text-2);
  font-size: 12.5px;
}
.meter-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.meter-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}
.meter-legend .l-av {
  background: var(--ok);
}
.meter-legend .l-hold {
  background: var(--warn);
}
.meter-legend code {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  color: var(--text) !important;
  font-weight: 600;
}

/* ───── Тёмная панель с кодом ───── */
.code {
  min-width: 0;
  border: 1px solid var(--code-line);
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-bg-2);
}
.code-t {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--code-dim);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code-t.is-ok,
.code-t.is-bad,
.code-t.is-warn {
  font-family: var(--font-mono);
}
.code-t.is-ok::before,
.code-t.is-bad::before,
.code-t.is-warn::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tk-ok);
  flex-shrink: 0;
}
.code-t.is-bad::before {
  background: var(--tk-bad);
}
.code-t.is-warn::before {
  background: var(--tk-num);
}
.code-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.code-tabs::-webkit-scrollbar {
  display: none;
}
.code-tabs button {
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--code-dim);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.code-tabs button:hover {
  color: var(--code-text);
}
.code-tabs button[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--code-dim);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.code-copy:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.code-copy.is-done {
  color: var(--tk-ok);
}
.code pre {
  margin: 0;
  padding: 14px 16px;
  max-height: 440px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: #2a2f3d transparent;
}
.code pre[hidden] {
  display: none;
}
.code.is-short pre {
  max-height: 300px;
}
.tk-k {
  color: var(--tk-key);
}
.tk-s {
  color: var(--tk-str);
}
.tk-n {
  color: var(--tk-num);
}
.tk-w {
  color: var(--tk-kw);
}
.tk-f {
  color: var(--tk-fn);
}
.tk-c {
  color: var(--tk-com);
  font-style: italic;
}
.tk-p {
  color: var(--code-dim);
}
.tk-b {
  color: var(--tk-bad);
}
.tk-h {
  color: #fff;
  font-weight: 600;
}

/* ───── Справочник методов ───── */
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-3);
  transition: border-color 0.15s ease;
}
.search:focus-within {
  border-color: var(--accent);
  color: var(--accent);
}
.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.search input::placeholder {
  color: var(--text-3);
}
.search-n {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group[hidden] {
  display: none;
}
.group-t {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.group-t b {
  font-size: 14px;
}
.group-t span {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}
.routes {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.route {
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--top-h) + 20px);
}
.route:first-child {
  border-top: 0;
}
.route[hidden] {
  display: none;
}
.route > summary {
  display: grid;
  grid-template-columns: 46px minmax(0, 1.35fr) minmax(0, 1fr) 12px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text-2);
  font-size: 13px;
  list-style: none;
  cursor: pointer;
  transition: background 0.12s ease;
}
.route > summary::-webkit-details-marker {
  display: none;
}
.route > summary:hover,
.route[open] > summary {
  background: var(--surface-2);
}
.route > summary code {
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec .route > summary code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
}
.route > summary code i {
  color: var(--text-3);
  font-style: normal;
}
.route-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-chev {
  color: var(--text-3);
  transition: transform 0.2s ease;
}
.route[open] .route-chev {
  transform: rotate(90deg);
}
.m {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: 2px 0;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.m.get {
  background: color-mix(in srgb, var(--get) 12%, transparent);
  color: var(--get);
}
.m.post {
  background: color-mix(in srgb, var(--post) 13%, transparent);
  color: var(--post);
}
.route-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 22px;
  padding: 6px 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  animation: rIn 0.22s ease;
}
@keyframes rIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.route-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding-top: 10px;
}
.route-code {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding-top: 14px;
}
.route-info .params {
  border-top-color: var(--border-strong);
}
.route-info .param {
  border-bottom-color: var(--border-strong);
}
.route-path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.sec .route-path code {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-empty {
  padding: 28px 0;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}
.jump {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.jump:hover {
  background: var(--surface-2);
  color: var(--text);
}
.jump svg {
  color: var(--text-3);
  transition: transform 0.2s ease;
}
.jump:hover svg {
  transform: translateX(2px);
}
.jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Обзор методов */
.mlist {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.mlist a {
  display: grid;
  grid-template-columns: 46px minmax(0, 1.2fr) minmax(0, 1fr) 12px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  transition: background 0.12s ease;
}
.mlist a:first-child {
  border-top: 0;
}
.mlist a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sec .mlist code {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mlist code i {
  color: var(--text-3);
  font-style: normal;
}
.mlist svg {
  color: var(--text-3);
}

/* ───── Подвал ───── */
.foot {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 36px;
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 18px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12.5px;
}
.foot-in nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.foot-in a {
  color: var(--text-2);
}
.foot-in a:hover {
  color: var(--text);
}

/* ───── Swagger (reference.html); оформление самого Swagger UI — в swagger.css ───── */
.ref-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 40px;
}
.ref-box {
  position: relative;
  min-height: 60vh;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: clip;
}
.ref-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60vh;
  padding: 40px 20px;
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}
.ref-state[hidden] {
  display: none;
}
.spin {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ───── Адаптивность ───── */
@media (max-width: 1240px) {
  .sec {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .sec-aside {
    position: static;
  }
}
@media (max-width: 1080px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .route-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fact:nth-child(3) {
    border-left: 0;
  }
  .fact:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 920px) {
  :root {
    --top-h: 56px;
  }
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px 16px 32px;
  }
  .top-in {
    gap: 10px;
    padding: 0 16px;
  }
  .top-menu {
    display: inline-flex;
  }
  .top-nav {
    display: none;
  }
  .theme {
    margin-left: auto;
  }
  .toc {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(320px, 86vw);
    max-height: none;
    padding: 18px 12px 16px;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0 18px 18px 0;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
    transform: translateX(-104%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: hidden;
  }
  .toc.is-open {
    transform: none;
    visibility: visible;
  }
  .toc-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(8, 9, 12, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .toc-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .toc-list a {
    padding: 8px 10px;
    font-size: 14px;
  }
  .sec {
    padding: 20px 18px 22px;
    border-radius: 16px;
  }
  .sec-head h2 {
    font-size: 19px;
  }
  .path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .path-step:nth-child(3) {
    border-left: 0;
  }
  .path-step:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
  .path-step:nth-child(2)::after {
    display: none;
  }
  .ref-page {
    padding: 16px 16px 32px;
  }
  .top-nav.is-always {
    display: flex;
    margin-left: auto;
  }
  .top-nav.is-always a[aria-current],
  .top-nav.is-always a[download] {
    display: none;
  }
  .top-nav.is-always ~ .theme {
    margin-left: 0;
  }
}
@media (max-width: 680px) {
  body {
    font-size: 14px;
  }
  .brand-sub,
  .top-ver {
    display: none;
  }
  .facts,
  .pair,
  .split,
  .stops {
    grid-template-columns: minmax(0, 1fr);
  }
  .fact {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .fact:first-child {
    border-top: 0;
  }
  .path {
    grid-template-columns: minmax(0, 1fr);
  }
  .path-step {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .path-step:first-child {
    border-top: 0;
  }
  .path-step::after {
    display: none !important;
  }
  .tr,
  .table[class*='cols-'] .tr {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  .th {
    display: none;
  }
  .tr > :first-child {
    color: var(--text);
    font-weight: 500;
  }
  .tr [data-h]::before {
    content: attr(data-h) ': ';
    color: var(--text-3);
    font-size: 12px;
  }
  .flow-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  /* На телефоне: путь целиком (с переносом), под ним — краткое описание метода. */
  .route > summary,
  .mlist a {
    grid-template-columns: 46px minmax(0, 1fr) 12px;
    row-gap: 3px;
  }
  .route > summary .m,
  .mlist a .m {
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 1px;
  }
  .route > summary code,
  .sec .mlist code {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .route-text,
  .mlist .route-text {
    grid-column: 2;
    grid-row: 2;
    overflow: visible;
    color: var(--text-3);
    font-size: 12.5px;
    line-height: 1.4;
    white-space: normal;
  }
  .route > summary > svg,
  .mlist a > svg {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .route-body {
    padding: 4px 12px 14px;
  }
  /* Узкой панели не хватает места и на заголовок, и на вкладки языков — оставляем вкладки. */
  .code-bar.has-tabs .code-t {
    display: none;
  }
  .code-bar.has-tabs .code-tabs {
    flex: 1;
    min-width: 0;
  }
  .code pre {
    font-size: 12px;
  }
}
@media print {
  .top,
  .toc,
  .toc-scrim,
  .code-copy,
  .search {
    display: none !important;
  }
  .page {
    display: block;
  }
  .sec {
    break-inside: avoid-page;
  }
  .code pre {
    max-height: none;
    white-space: pre-wrap;
  }
  .route-body {
    display: grid !important;
  }
}
