/* Страница для разработчиков (/api, /ru/api): те же цвета и шрифты, что у приложения; светлая и тёмная тема
   (по умолчанию — как в системе, выбор из приложения — через localStorage, см. api.js). Шрифты — свои файлы. */
@font-face { font-family: "Chivo"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/chivo-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chivo"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/chivo-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chivo"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/chivo-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chivo Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/chivo-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chivo Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/chivo-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* у Chivo нет кириллицы — для неё IBM Plex Sans (как в приложении) */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --stage: #f4f4f4; --panel: #fff; --field: #f3f3f3; --field-2: #ececec; --line: #e6e6e6; --hl: rgba(0,0,0,.06); --hl-2: rgba(0,0,0,.1);
  --text: #1c1c1c; --text-2: #3d3d3d; --muted: #6f6f6f; --faint: #a8a8a8; --strong: #111;
  --accent: #e0600a; --accent-2: #f26b0f; --accent-soft: rgba(242,107,15,.1); --accent-ring: rgba(242,107,15,.5);
  --primary: #151515; --primary-fg: #fff; --primary-hover: #000;
  --code-bg: #f7f7f7; --tok-str: #1d7a46; --tok-com: #8a8a8a; --tok-key: #b4480a; --tok-num: #7a4bd1;
  --ok: #1f9d5c; --err: #c0391d; --sh: rgba(0,0,0,.06);
  --sans: "Chivo", "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Chivo Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --top: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stage: #0e0e0e; --panel: #151515; --field: #1c1c1c; --field-2: #242424; --line: #242424; --hl: rgba(255,255,255,.06); --hl-2: rgba(255,255,255,.12);
    --text: #ededed; --text-2: #b9b9b9; --muted: #8a8a8a; --faint: #555; --strong: #fff;
    --accent: #ff8a33; --accent-2: #ff7a1a; --accent-soft: rgba(255,122,26,.12); --accent-ring: rgba(255,122,26,.6);
    --primary: #f3f3f3; --primary-fg: #0e0e0e; --primary-hover: #fff;
    --code-bg: #111; --tok-str: #8fd6a4; --tok-com: #6e6e6e; --tok-key: #ffab70; --tok-num: #c3a6ff;
    --ok: #7ee2a8; --err: #ff8a70; --sh: rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --stage: #0e0e0e; --panel: #151515; --field: #1c1c1c; --field-2: #242424; --line: #242424; --hl: rgba(255,255,255,.06); --hl-2: rgba(255,255,255,.12);
  --text: #ededed; --text-2: #b9b9b9; --muted: #8a8a8a; --faint: #555; --strong: #fff;
  --accent: #ff8a33; --accent-2: #ff7a1a; --accent-soft: rgba(255,122,26,.12); --accent-ring: rgba(255,122,26,.6);
  --primary: #f3f3f3; --primary-fg: #0e0e0e; --primary-hover: #fff;
  --code-bg: #111; --tok-str: #8fd6a4; --tok-com: #6e6e6e; --tok-key: #ffab70; --tok-num: #c3a6ff;
  --ok: #7ee2a8; --err: #ff8a70; --sh: rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--stage); color: var(--text); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }
code, pre, kbd { font-family: var(--mono); font-feature-settings: "zero" 0; }
:not(pre) > code { font-size: .86em; background: var(--field); box-shadow: inset 0 0 0 1px var(--hl); border-radius: 5px; padding: .1em .38em; color: var(--strong); overflow-wrap: anywhere; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* верхняя панель */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); background: color-mix(in srgb, var(--stage) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1280px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; color: var(--strong); font-size: 18px; font-weight: 600; letter-spacing: -.02em; text-decoration: none !important; white-space: nowrap; }
.brand small { font: 500 11px/1 var(--mono); letter-spacing: 0; color: var(--muted); background: var(--field); box-shadow: inset 0 0 0 1px var(--hl); border-radius: 6px; padding: 4px 6px; position: relative; top: -2px; }
.top nav { display: flex; gap: 22px; margin-left: 12px; }
.top nav a { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.top nav a:hover { color: var(--text); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { height: 32px; min-width: 32px; padding: 0 10px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 12.5px/1 var(--sans); color: var(--text-2); background: transparent; border: 0; cursor: pointer; text-decoration: none !important; }
.pill:hover { background: var(--field); color: var(--text); }
.pill svg { width: 16px; height: 16px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
.btn { height: 40px; padding: 0 16px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px/1 var(--sans); white-space: nowrap; text-decoration: none !important; border: 0; cursor: pointer; transition: background .15s, transform .15s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primary-fg); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: var(--field); color: var(--text); box-shadow: inset 0 0 0 1px var(--hl); }
.btn.ghost:hover { background: var(--field-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { cursor: default; background: var(--field); color: var(--muted); box-shadow: inset 0 0 0 1px var(--hl); }

/* первый экран */
.hero { max-width: 1280px; margin: 0 auto; padding: 64px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 6px 10px; margin: 0 0 20px; }
.hero h1 { margin: 0; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; color: var(--strong); text-wrap: balance; }
.hero .lead { margin: 18px 0 0; font-size: 17px; line-height: 1.55; color: var(--text-2); max-width: 540px; text-wrap: pretty; }
.hero ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.hero li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.hero li b { color: var(--strong); font-weight: 500; }
.tick { flex: 0 0 20px; height: 20px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.tick svg { width: 12px; height: 12px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.cta-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.hero-code { min-width: 0; }
.hero-code .code { box-shadow: inset 0 0 0 1px var(--hl), 0 24px 60px var(--sh); }

/* раскладка документации */
.docs { max-width: 1280px; margin: 0 auto; padding: 0 24px 96px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
.toc { position: sticky; top: calc(var(--top) + 24px); align-self: start; max-height: calc(100vh - var(--top) - 48px); overflow: auto; padding: 4px 4px 16px 0; scrollbar-width: thin; }
.toc summary { display: none; }
.toc-title { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 7px; font-size: 13.5px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); background: var(--field); }
.toc a.on { color: var(--strong); background: var(--field); box-shadow: inset 2px 0 0 var(--accent-2); }
.toc ol ol a { padding-left: 22px; font-size: 13px; }
.toc .toc-sep { height: 1px; background: var(--line); margin: 12px 0; }
.content { min-width: 0; max-width: 820px; }
.content > section { padding-top: 40px; margin-top: 16px; border-top: 1px solid var(--line); }
.content > section:first-child { border-top: 0; margin-top: 0; padding-top: 8px; }
.content h2 { margin: 0 0 12px; font-size: 26px; line-height: 1.2; letter-spacing: -.025em; font-weight: 600; color: var(--strong); }
.content h3 { margin: 32px 0 10px; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; color: var(--strong); }
.content h2 a.anchor, .content h3 a.anchor { color: var(--faint); margin-left: 8px; font-weight: 400; opacity: 0; transition: opacity .15s; text-decoration: none; }
.content h2:hover a.anchor, .content h3:hover a.anchor, a.anchor:focus-visible { opacity: 1; }
.content p, .content li { color: var(--text-2); }
.content p { margin: 0 0 14px; }
.content ul, .content ol { padding-left: 20px; margin: 0 0 14px; }
.content li { margin: 5px 0; }
.content strong { color: var(--strong); font-weight: 500; }
.sub { color: var(--muted) !important; font-size: 14px; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: s; position: relative; padding-left: 40px; margin: 0 0 22px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font: 600 12.5px/26px var(--sans); text-align: center; }
.steps > li > strong:first-child { display: block; color: var(--strong); margin-bottom: 4px; }

/* эндпоинт */
.ep { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--hl); font-family: var(--mono); font-size: 14px; color: var(--strong); overflow-wrap: anywhere; }
.m { font: 600 11px/1 var(--mono); letter-spacing: .04em; padding: 5px 7px; border-radius: 6px; color: #fff; }
.m.post { background: #2f7de1; }
.m.get { background: #1f9d5c; }
.m.put { background: #b7791f; }
.ep .ep-note { margin-left: auto; font: 12.5px/1.3 var(--sans); color: var(--muted); }

/* таблицы */
.tbl { overflow-x: auto; margin: 0 0 18px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hl); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td code { white-space: nowrap; }
td.wrap code { white-space: normal; }
td .req { font: 500 11px/1 var(--sans); color: var(--muted); margin-left: 6px; }
td.nw { white-space: nowrap; }

/* заметки */
.note { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }
.note p { margin: 0; color: var(--text); }
.note svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
.note.plain { background: var(--panel); box-shadow: inset 0 0 0 1px var(--hl); }
.note.plain svg { color: var(--muted); }

/* блоки кода */
.code { position: relative; margin: 0 0 18px; border-radius: 14px; background: var(--code-bg); box-shadow: inset 0 0 0 1px var(--hl); overflow: hidden; min-width: 0; }
.code-head { display: flex; align-items: center; gap: 4px; min-height: 42px; padding: 0 6px 0 8px; border-bottom: 1px solid var(--line); }
.code-label { font: 12px/1 var(--mono); color: var(--muted); padding-left: 6px; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-right: auto; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 500 12.5px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--strong); background: var(--field-2); }
.copy { flex: 0 0 auto; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 500 12px/1 var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.copy:hover { color: var(--text); background: var(--field-2); }
.copy svg { width: 14px; height: 14px; }
.copy .i-ok { display: none; }
.copy.done { color: var(--ok); }
.copy.done .i-ok { display: block; }
.copy.done .i-copy { display: none; }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font-size: 12.75px; line-height: 1.7; color: var(--text); tab-size: 4; scrollbar-width: thin; }
.code pre code { font: inherit; }
.panel-lang { display: none; }
.no-js .panel-lang { display: block; }
.no-js .panel-lang + .panel-lang { border-top: 1px dashed var(--line); }
.panel-lang.on { display: block; }
.no-js .tabs, .no-js .copy { display: none; }
.t-s { color: var(--tok-str); }
.t-c { color: var(--tok-com); font-style: italic; }
.t-k { color: var(--tok-key); }
.t-n { color: var(--tok-num); }

/* MCP */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.tool { padding: 16px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--hl); }
.tool > code { font-size: 13px !important; background: none !important; box-shadow: none !important; padding: 0 !important; color: var(--accent) !important; }
.tool p { margin: 6px 0 0 !important; font-size: 13.5px; line-height: 1.5; }
.soon { display: inline-flex; align-items: center; font: 500 11px/1 var(--sans); color: var(--muted); background: var(--field); box-shadow: inset 0 0 0 1px var(--hl); border-radius: 99px; padding: 4px 8px; margin-left: 8px; vertical-align: 2px; }

/* цены */
.packs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 8px 0 18px; }
.pack { position: relative; display: flex; flex-direction: column; padding: 22px 14px 14px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--hl); text-align: center; }
.pack.popular { box-shadow: inset 0 0 0 1.5px var(--accent-ring), 0 14px 36px var(--sh); }
.pack-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font: 500 11px/1 var(--sans); color: #fff; background: var(--accent-2); border-radius: 99px; padding: 4px 9px; white-space: nowrap; }
.pack-n { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--strong); }
.pack-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pack-p { font-size: 17px; font-weight: 500; color: var(--strong); margin: 14px 0 2px; }
.pack-u { font: 12px/1.3 var(--mono); color: var(--muted); margin-bottom: 14px; }
.pack .btn { margin-top: auto; width: 100%; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0 !important; margin: 0 0 16px !important; }
.facts li { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }

/* подвал */
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: 1280px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; font-size: 13px; color: var(--muted); }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-right: auto; }
.foot-in a { color: var(--muted); }
.foot-in a:hover { color: var(--text); }

/* планшет и телефон */
@media (max-width: 1100px) {
  .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 20px; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 40px; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: sticky; top: var(--top); z-index: 10; max-height: none; overflow: visible; margin: 0 -24px 8px; padding: 0; background: color-mix(in srgb, var(--stage) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .toc summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; padding: 12px 24px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
  .toc[open] summary svg { transform: rotate(180deg); }
  .toc .toc-body { padding: 0 24px 14px; max-height: min(60vh, 480px); overflow: auto; }
  .toc-title { display: none; }
  .toc a { margin-left: 0; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  html { scroll-padding-top: calc(var(--top) + 64px); }
  .top nav { display: none; }
}
@media (max-width: 560px) {
  .top-in, .hero, .docs, .foot-in { padding-left: 16px; padding-right: 16px; }
  .toc { margin: 0 -16px 8px; }
  .toc summary { padding: 12px 16px; }
  .toc .toc-body { padding: 0 16px 14px; }
  .hero { padding-top: 32px; }
  .hero .lead { font-size: 16px; }
  .brand small { display: none; }
  .top-cta { display: none; }
  .content h2 { font-size: 23px; }
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pack:last-child { grid-column: 1 / -1; }
  .ep .ep-note { margin-left: 0; width: 100%; }
  .cta .btn { flex: 1 1 auto; }
  .code pre { font-size: 12px; padding: 12px 14px 14px; }
  th, td { padding: 9px 12px; }
  /* таблица ошибок: 4 колонки — прокручивается внутри, а не сжимается в столбик */
  .tbl.errs table { min-width: 640px; }
}
.content h2.gap { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
