/* Meliora API docs. Цвета, шрифты, радиусы, тени и состояния из дизайн-системы кабинета Meliora, без внешних зависимостей. */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/assets/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/assets/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/assets/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/assets/fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }


/* Токены из дизайн-системы кабинета Meliora: полотно и поверхности, графит, лайм только заливкой,
   двойное кольцо фокуса, лесенка высот 28/32/36/44, радиусы 6/8/12/16, кривая .2,0,0,1. */
:root {
  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --ink: #313135;
  --ink-2: #5a5a5d;
  --ink-3: #6c6c6f;
  --line: #eaeaeb;
  --line-2: #d6d6d7;
  --line-3: #b7b7b9;
  --chip: #f3f3f4;
  --lime: #d7ff54;
  --lime-strong: #c9f23f;
  --accent-text: #5f7114;
  --pos-bg: #f2ffd0;
  --pos-border: #e2f2a8;
  --warn: #8f6014;
  --warn-bg: #fdf3e3;
  --warn-line: #b4791a;
  --warn-border: #eeddb9;
  --active-bg: #313135;
  --active-fg: #ffffff;
  --underline: #b9de3a;
  --mark-bg: #313135;
  --mark-fg: #d7ff54;
  --code-bg: #1e1e21;
  --code-head: #26262a;
  --code-line: #2a2a30;
  --code-text: #e9e9ea;
  --code-dim: #a9a9ad;
  --focus-ring: 0 0 0 3px #d7ff54, 0 0 0 4px #313135;
  --sh-sm: 0 2px 6px rgb(27 27 29 / 0.06);
  --sh-md: 0 8px 24px rgb(27 27 29 / 0.09);
  --sh-lg: 0 20px 56px rgb(27 27 29 / 0.14);
  --overlay: rgb(27 27 29 / 0.44);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --h-xs: 28px;
  --h-sm: 32px;
  --h-md: 36px;
  --h-lg: 44px;
  --top-h: 60px;
  --strip-h: 36px;
  --sans: 'Manrope', -apple-system, system-ui, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-1: 120ms;
  --dur-2: 180ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161618; --surface: #1e1e21; --surface-2: #26262a; --ink: #f3f3f4; --ink-2: #a9a9ad; --ink-3: #939396;
    --line: #2a2a30; --line-2: #33333a; --line-3: #45454b; --chip: #26262a; --accent-text: #c9f23f; --pos-bg: #2c3313; --pos-border: #3d4a17;
    --warn: #e0aa52; --warn-bg: #2b2113; --warn-line: #e0aa52; --warn-border: #4a3a1e; --active-bg: #d7ff54; --active-fg: #1b1b1d;
    --underline: #8fae1f; --mark-bg: #d7ff54; --mark-fg: #161618; --code-bg: #1b1b1d; --code-head: #222225; --code-line: #33333a;
    --focus-ring: 0 0 0 3px #d7ff54, 0 0 0 4px #fafafa; --sh-md: 0 8px 24px rgb(0 0 0 / 0.5); --sh-lg: 0 20px 56px rgb(0 0 0 / 0.6);
    --overlay: rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161618; --surface: #1e1e21; --surface-2: #26262a; --ink: #f3f3f4; --ink-2: #a9a9ad; --ink-3: #939396;
  --line: #2a2a30; --line-2: #33333a; --line-3: #45454b; --chip: #26262a; --accent-text: #c9f23f; --pos-bg: #2c3313; --pos-border: #3d4a17;
  --warn: #e0aa52; --warn-bg: #2b2113; --warn-line: #e0aa52; --warn-border: #4a3a1e; --active-bg: #d7ff54; --active-fg: #1b1b1d;
  --underline: #8fae1f; --mark-bg: #d7ff54; --mark-fg: #161618; --code-bg: #1b1b1d; --code-head: #222225; --code-line: #33333a;
  --focus-ring: 0 0 0 3px #d7ff54, 0 0 0 4px #fafafa; --sh-md: 0 8px 24px rgb(0 0 0 / 0.5); --sh-lg: 0 20px 56px rgb(0 0 0 / 0.6);
  --overlay: rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + var(--strip-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 16px/1.6 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
::selection { background: var(--lime); color: #313135; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
code, kbd, pre { font-family: var(--mono); }
button { font: inherit; color: inherit; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--lime); color: #313135; border-radius: var(--r-md); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; flex: none; margin-right: 8px; }
.mark { width: 28px; height: 28px; }
.mark-bg { fill: var(--mark-bg); }
.mark-fg { fill: var(--mark-fg); }
.brand-api { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); }
.top-links { display: flex; gap: 2px; margin-left: 8px; }
.top-links a { text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 14px; height: var(--h-sm); display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--r-md); transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.top-links a:hover { color: var(--ink); background: var(--chip); }
.search-btn {
  margin-left: auto; display: flex; align-items: center; gap: 8px; height: var(--h-md); min-width: 220px; padding: 0 8px 0 12px;
  background: var(--surface); border: 1px solid var(--line-3); border-radius: var(--r-md); color: var(--ink-3); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: border-color var(--dur-1) var(--ease);
}
.search-btn:hover { border-color: #98989a; }
.search-btn svg, .icon-btn svg, .search-field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-btn kbd { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-3); }
.icon-btn { display: inline-grid; place-items: center; width: var(--h-md); height: var(--h-md); border: 0; border-radius: var(--r-md); background: transparent; cursor: pointer; color: var(--ink-2); flex: none; transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.icon-btn:hover { background: var(--chip); color: var(--ink); }
.menu-btn { display: none; margin-left: -8px; }
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center; height: var(--h-md); min-width: var(--h-md); padding: 0 10px; flex: none;
  border-radius: var(--r-md); text-decoration: none; font: 700 13px/1 var(--sans); letter-spacing: 0.02em; color: var(--ink-2);
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.lang-switch:hover { background: var(--chip); color: var(--ink); }
.theme-btn svg:last-child { display: none; }
:root[data-theme="dark"] .theme-btn svg:first-child { display: none; }
:root[data-theme="dark"] .theme-btn svg:last-child { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn svg:first-child { display: none; }
  :root:not([data-theme="light"]) .theme-btn svg:last-child { display: block; }
}

.early {
  position: sticky; top: var(--top-h); z-index: 25; min-height: var(--strip-h);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.early::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--lime); box-shadow: 0 0 0 1px rgb(49 49 53 / 0.25); flex: none; }
.early strong { color: var(--ink); font-weight: 700; }
.early a { color: var(--ink); text-decoration-color: var(--underline); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }

/* ---------- раскладка ---------- */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 232px; max-width: 1600px; margin: 0 auto; }
.kind-reference .layout, .kind-home .layout { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: calc(var(--top-h) + var(--strip-h)); align-self: start;
  height: calc(100vh - var(--top-h) - var(--strip-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 16px 48px 20px; border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-label { margin: 0 0 6px; padding: 0 12px; font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.02em; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li + li { margin-top: 2px; }
.sidebar a {
  display: flex; align-items: center; min-height: var(--h-sm); padding: 5px 12px; border-radius: var(--r-md); text-decoration: none;
  color: var(--ink-2); font-size: 14px; line-height: 1.4; font-weight: 600;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.sidebar a:hover { color: var(--ink); background: var(--chip); }
.sidebar a[aria-current="page"] { color: var(--active-fg); background: var(--active-bg); font-weight: 700; }

.content { min-width: 0; padding: 48px 56px 72px; outline: none; }
.content:focus-visible { box-shadow: none; }
.content-ref { padding-top: 8px; }
.toc { position: sticky; top: calc(var(--top-h) + var(--strip-h)); align-self: start; padding: 48px 24px 24px 0; max-height: calc(100vh - var(--top-h) - var(--strip-h)); overflow-y: auto; }
.toc-label { margin: 0 0 8px; font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.02em; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13px; line-height: 1.4; color: var(--ink-3); text-decoration: none; font-weight: 600; }
.toc .toc-l3 a { padding-left: 26px; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--ink); font-weight: 700; }

/* ---------- текст ---------- */
.prose { max-width: 724px; }
.prose h1, .ref-text h1, .hero h1 { margin: 0 0 12px; font-size: 42px; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.lede { margin: 0 0 32px; font-size: 20px; line-height: 1.5; color: var(--ink-2); font-weight: 500; max-width: 660px; text-wrap: pretty; letter-spacing: -0.01em; }
.prose h2, .ref-text h2 { position: relative; margin: 48px 0 12px; font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.prose h3 { position: relative; margin: 32px 0 8px; font-size: 20px; line-height: 1.35; font-weight: 800; letter-spacing: -0.015em; }
.prose h4 { margin: 24px 0 6px; font-size: 16px; font-weight: 800; }
.prose p, .prose li { text-wrap: pretty; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 800; }
.prose a, .ref-text a, .muted a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--underline); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: background-color var(--dur-1) var(--ease); border-radius: 2px; }
.prose a:hover, .ref-text a:hover, .muted a:hover { background: var(--lime); color: #313135; text-decoration-color: transparent; }
.anchor { position: absolute; left: -22px; top: 0; width: 22px; text-decoration: none !important; color: var(--ink-3) !important; opacity: 0; font-weight: 500; background: none !important; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
:not(pre) > code { font-size: 0.86em; padding: 0.12em 0.38em; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); white-space: break-spaces; overflow-wrap: anywhere; }
h1 code, h2 code, h3 code { font-size: 0.82em; }
blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: 14px; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 700; font-size: 13px; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td:last-child code { white-space: break-spaces; }
.errors-table tr:target td { background: var(--pos-bg); }
.code-link { text-decoration: none !important; }

.callout { margin: 0 0 20px; padding: 14px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--ink); font-size: 15px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-warning { background: var(--warn-bg); border-color: var(--warn-border); border-left-color: var(--warn-line); }
.callout-tip { background: var(--pos-bg); border-color: var(--pos-border); border-left-color: var(--accent-text); }

/* шаги быстрого старта: настоящая последовательность */
.steps { counter-reset: step; margin: 8px 0 24px; }
.steps > h3 { counter-increment: step; display: flex; align-items: center; gap: 12px; margin-top: 36px; }
.steps > h3::before {
  content: counter(step); flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--active-bg); color: var(--active-fg); font: 700 14px/1 var(--mono);
}
.steps > h3 .anchor { left: -22px; }

/* ---------- кнопки как в кабинете ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h-md); padding: 0 14px;
  border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  font: 700 14px/1 var(--sans); letter-spacing: -0.01em; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn:hover { background: var(--lime); border-color: var(--lime); color: #313135; }
.btn:active { background: var(--lime-strong); border-color: var(--lime-strong); color: #313135; }
.btn-primary { background: var(--active-bg); border-color: var(--active-bg); color: var(--active-fg); }
.btn-lg { height: var(--h-lg); padding: 0 20px; font-size: 16px; border-radius: var(--r-lg); }
.btn svg { width: 16px; height: 16px; }

/* ---------- код ---------- */
.code { margin: 0 0 20px; border-radius: var(--r-lg); background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-line); overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 8px 0 14px; background: var(--code-head); border-bottom: 1px solid var(--code-line); }
.code-title { font: 700 13px/1 var(--sans); color: var(--code-dim); white-space: nowrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.code-title + .tabs { margin-left: 8px; }
.tabs button { border: 0; background: transparent; color: var(--code-dim); font: 700 13px/1 var(--sans); height: var(--h-xs); padding: 0 10px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: #fff; background: rgb(255 255 255 / 0.06); }
.tabs button[aria-selected="true"] { color: #313135; background: var(--lime); }
.copy { margin-left: auto; border: 1px solid #45454b; background: transparent; color: var(--code-dim); font: 700 13px/1 var(--sans); height: var(--h-xs); padding: 0 10px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; }
.copy:hover { color: #313135; background: var(--lime); border-color: var(--lime); }
.copy.done { color: #313135; background: var(--lime); border-color: var(--lime); }
.code pre { margin: 0; padding: 16px 18px; overflow: auto; font-size: 13px; line-height: 1.6; tab-size: 2; }
.code pre:focus-visible { box-shadow: inset 0 0 0 2px var(--lime); border-radius: 0; }
.code code { font-family: var(--mono); font-variant-ligatures: none; }
.t-str { color: #d7ff54; }
.t-str-key { color: #f3f3f4; }
.t-num { color: #e0aa52; }
.t-kw { color: #f0817a; }
.t-com { color: #939396; font-style: italic; }
.t-var { color: #e0aa52; }
.t-flag { color: #b7b7b9; }
.t-fn { color: #9fd3ff; }
.lang-http .t-str-key { color: #b7b7b9; }

/* ---------- главная ---------- */
.content-home { padding-top: 56px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 48px; align-items: start; max-width: 1180px; margin-bottom: 56px; }
.hero h1 { font-size: 68px; line-height: 1.05; letter-spacing: -0.03em; }
.hero-text { padding-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.hero-code { min-width: 0; }
.hero-code .code { margin-bottom: 14px; box-shadow: var(--sh-md); }
.prose-home { max-width: 760px; }

/* ---------- справочник ---------- */
.ref-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding: 48px 0; border-top: 1px solid var(--line); max-width: 1320px; }
.ref-intro { border-top: 0; padding-top: 40px; }
.ref-text { min-width: 0; max-width: 640px; }
.ref-text h2 { margin-top: 0; }
.ref-text > p { margin: 0 0 16px; }
.ref-text ul:not(.attrs):not(.plain-list) { padding-left: 22px; }
.ref-code { min-width: 0; }
.ref-code .sticky { position: sticky; top: calc(var(--top-h) + var(--strip-h) + 24px); }
.ref-code .code pre { max-height: min(62vh, 640px); }
.ref-code .code-request pre { max-height: none; }
.ref-sub { margin: 28px 0 8px; font-size: 16px; font-weight: 800; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.endpoint code { font-size: 14px; font-weight: 700; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.method {
  display: inline-flex; align-items: center; font: 700 11px/1 var(--mono); padding: 4px 9px; border-radius: 999px;
  background: var(--pos-bg); border: 1px solid var(--pos-border); color: var(--accent-text); letter-spacing: 0.02em;
}
.ref-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 8px; font-size: 14px; }
.ref-meta div { display: flex; gap: 8px; }
.ref-meta dt { color: var(--ink-3); }
.ref-meta dd { margin: 0; font-weight: 700; }
.routes-box { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.routes-box .code-head { background: transparent; border-bottom: 1px solid var(--line); }
.routes-box .code-title { color: var(--ink-3); }
.routes-box ul { list-style: none; margin: 0; padding: 8px; }
.routes-box li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); text-decoration: none; transition: background-color var(--dur-1) var(--ease); }
.routes-box li a:hover { background: var(--chip); }
.routes-box li code { font-size: 13px; overflow-wrap: anywhere; border: 0; background: none; padding: 0; font-weight: 700; }
.base-url { margin: 0; padding: 14px 18px; }
.base-url code { font-size: 14px; background: none; border: 0; padding: 0; }

.attrs { list-style: none; margin: 0 0 8px; padding: 0; }
.attr { padding: 14px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + var(--strip-h) + 16px); }
.attr:last-child { border-bottom: 0; }
.attr:target { background: linear-gradient(90deg, var(--pos-bg), transparent 70%); border-radius: var(--r-sm); }
.attr-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.attr-name { text-decoration: none !important; background: none !important; }
.attr-name code { font-size: 14px; font-weight: 700; background: none; border: 0; padding: 0; color: var(--ink); }
.attr-name:hover code { text-decoration: underline; text-decoration-color: var(--underline); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.attr-type { font-size: 13px; color: var(--ink-3); font-family: var(--mono); }
.attr-opt, .req { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.req { color: var(--accent-text); font-weight: 700; }
.attr-desc { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.attr-desc code { font-size: 0.86em; }
.enum { display: block; margin-top: 6px; line-height: 2; }
.enum-label { color: var(--ink-3); margin-right: 2px; }
.enum code { margin-right: 2px; }
.attr-children { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.attr-children > summary { cursor: pointer; min-height: var(--h-sm); padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; border-radius: var(--r-lg); }
.attr-children > summary::-webkit-details-marker { display: none; }
.attr-children > summary::before { content: "+"; font-family: var(--mono); width: 14px; color: var(--ink-3); }
.attr-children[open] > summary::before { content: "\2212"; }
.attr-children[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.attr-children > .attrs { padding: 0 14px; }
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.plain-list li { margin: 6px 0; font-size: 14px; color: var(--ink-2); }

/* ---------- листание и подвал ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 724px; margin-top: 56px; }
.kind-reference .pager { max-width: 1320px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-xl); background: var(--surface); text-decoration: none; font-weight: 700; transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.pager a:hover { border-color: var(--ink); box-shadow: var(--sh-sm); }
.pager span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.pager-next { text-align: right; grid-column: 2; }
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { max-width: 1600px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 14px; color: var(--ink-3); }
.foot-inner a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.foot-inner a:hover { color: var(--ink); text-decoration: underline; }
.foot-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
.foot-brand .mark { width: 22px; height: 22px; }

/* ---------- поиск ---------- */
.search { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: var(--overlay); }
.search[hidden] { display: none; }
.search-panel { width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.search-field input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 600 16px var(--sans); }
.search-field input:focus-visible { box-shadow: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 10px 12px; border-radius: var(--r-md); text-decoration: none; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--chip); }
.search-results a[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--lime); }
.sr-title { display: block; font-weight: 700; font-size: 14px; }
.sr-sec { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.sr-text { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: var(--pos-bg); color: inherit; border-radius: 2px; box-shadow: 0 0 0 1px var(--pos-border); }
.search-empty { padding: 18px 12px; color: var(--ink-3); font-size: 14px; }
.search-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--ink-3); }

.prose-404 { padding-top: 24px; }

/* ---------- ИИ-агенты: кнопка в шапке, блок промпта, меню страницы, тост ---------- */
.agent-btn svg, .nav-agent svg, .agent-card svg, .page-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-spark path { fill: currentColor; stroke: none; }
.agent-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: var(--h-md); padding: 0 14px;
  border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.agent-btn .i-spark { color: var(--accent-text); }
.agent-btn:hover { background: var(--lime); border-color: var(--lime); color: #313135; }
.agent-btn:hover .i-spark { color: #313135; }
.agent-btn + .search-btn { margin-left: 0; }
.nav-agent { display: none; }

.agent-card { display: flex; gap: 18px; margin: 0 0 40px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.agent-card-icon { flex: none; display: grid; place-items: center; width: var(--h-lg); height: var(--h-lg); border-radius: var(--r-lg); background: var(--lime); color: #313135; }
.agent-card-icon svg { width: 22px; height: 22px; }
.agent-card-body { min-width: 0; flex: 1; }
.prose .agent-card-title, .agent-card-title { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.prose .agent-card-text, .agent-card-text { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.agent-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px !important; }
.prose .agent-card-actions a.btn { text-decoration: none; }
.prose .agent-card-actions a.btn:hover { background: var(--lime); color: #313135; }
.agent-card-preview > summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); width: fit-content; border-radius: var(--r-sm); }
.agent-card-preview > summary:hover { color: var(--ink); }
.agent-card-preview pre {
  margin: 12px 0 0; max-height: 360px; overflow: auto; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--code-line);
  background: var(--code-bg); color: var(--code-text); font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head h1 { min-width: 0; }
.page-menu { position: relative; flex: none; display: inline-flex; margin-top: 8px; }
.pm-main, .pm-toggle {
  display: inline-flex; align-items: center; gap: 7px; height: var(--h-sm); border: 1px solid var(--line-3); background: var(--surface); color: var(--ink);
  font: 700 13px/1 var(--sans); cursor: pointer; transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.pm-main { padding: 0 12px; border-radius: var(--r-md) 0 0 var(--r-md); }
.pm-toggle { padding: 0 8px; border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; }
.pm-main:hover, .pm-toggle:hover { background: var(--lime); border-color: var(--lime); color: #313135; }
.pm-toggle[aria-expanded="true"] { background: var(--chip); }
.pm-main svg, .pm-toggle svg { width: 16px; height: 16px; }
.pm-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.pm-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 290px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-md);
}
.pm-list[hidden] { display: none; }
.pm-list [role="menuitem"] {
  display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--r-md); background: none;
  text-align: left; text-decoration: none !important; color: var(--ink) !important; font: 700 14px/1.35 var(--sans); cursor: pointer;
}
.pm-list [role="menuitem"] small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.pm-list [role="menuitem"]:hover { background: var(--chip) !important; }
.pm-list [role="menuitem"]:focus-visible { background: var(--chip) !important; box-shadow: var(--focus-ring); }
.pm-list a[target="_blank"] span::after { content: " \2197"; color: var(--ink-3); font-weight: 500; }
.ref-intro .page-head h1, .hero .page-head h1 { margin-bottom: 12px; }

.toast {
  position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-lg); background: #313135; color: #fff;
  font-weight: 700; font-size: 14px; box-shadow: var(--sh-lg); transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--lime); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error::before { background: #f0817a; }
:root[data-theme="dark"] .toast { background: #f3f3f4; color: #161618; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #f3f3f4; color: #161618; } }

/* ---------- адаптив ---------- */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 248px minmax(0, 1fr); }
  .toc { display: none; }
  .content { padding: 40px 40px 64px; }
}
@media (max-width: 1100px) {
  .ref-section { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ref-text { max-width: 724px; }
  .ref-code .sticky { position: static; }
  .ref-code { max-width: 724px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-text { padding-top: 0; }
  .top-links { display: none; }
  .agent-btn span { display: none; }
  .agent-btn { width: var(--h-md); padding: 0; justify-content: center; }
}
@media (max-width: 900px) {
  .layout, .kind-reference .layout, .kind-home .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 40; top: var(--top-h); left: 0; bottom: 0; height: auto; width: min(320px, 86vw);
    background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--sh-lg);
    transform: translateX(-102%); visibility: hidden; transition: transform 200ms var(--ease), visibility 0s linear 200ms;
  }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform 200ms var(--ease); }
  body.nav-open::after { content: ""; position: fixed; inset: var(--top-h) 0 0 0; z-index: 35; background: var(--overlay); }
  .search-btn { min-width: 0; margin-left: auto; }
  .search-btn kbd { display: none; }
  .nav-agent {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--h-lg); margin: 0 0 20px; padding: 8px 14px; border: 0; border-radius: var(--r-lg);
    background: var(--lime); color: #313135; font-weight: 700; font-size: 14px; text-align: left; cursor: pointer;
  }
}
@media (max-width: 640px) {
  .top { gap: 6px; padding: 0 16px; }
  .brand { font-size: 18px; margin-right: 0; }
  .early { position: static; padding: 6px 16px; }
  :root { --strip-h: 0px; }
  .content, .content-home { padding: 28px 16px 56px; }
  .search-btn-text { display: none; }
  .search-btn { width: var(--h-md); height: var(--h-md); padding: 0; justify-content: center; }
  .agent-btn { display: none; }
  .agent-btn + .search-btn { margin-left: auto; }
  .lang-switch { padding: 0 6px; min-width: 32px; }
  .prose h1, .ref-text h1, .hero h1 { font-size: 32px; }
  .hero h1 { font-size: 42px; }
  .lede { font-size: 17px; }
  .prose h2, .ref-text h2 { font-size: 22px; }
  .prose h3 { font-size: 18px; }
  .anchor { display: none; }
  .code pre { font-size: 12.5px; padding: 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .ref-section { padding: 36px 0; }
  th, td { padding: 8px 10px; }
  .page-head { flex-direction: column-reverse; gap: 12px; }
  .page-menu { align-self: flex-end; margin-top: 0; }
  .agent-card { flex-direction: column; gap: 12px; padding: 18px; }
  .pm-list { width: min(290px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .early, .sidebar, .toc, .pager, .foot, .copy, .page-menu, .agent-card { display: none !important; }
  .layout { display: block; }
}
.hero .page-head { flex-direction: column-reverse; gap: 20px; }
.hero .page-menu { align-self: flex-start; margin-top: 0; }
