/* Документация API: поверх ui.css и landing.css (шапка, подвал, кнопки и фон — оттуда) */
html[lang="ru"] [data-lang="en"], html[lang="en"] [data-lang="ru"] { display: none !important; }
.nav-links a.on { color: #fde047; }

/* Шапка страницы */
.d-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 72px 0 56px; }
.d-hero h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 18px 0 16px; }
.d-hero .lead { color: #d1d5db; font-size: clamp(15px, 1.5vw, 18px); max-width: 620px; }
.d-base { margin-top: 26px; max-width: 560px; }
.d-base .label { display: block; margin-bottom: 8px; }
.d-base .code-box { background: #030712; border-color: rgba(250,204,21,.35); padding: 8px 8px 8px 16px; border-radius: 12px; }
.d-base .code-box span { color: #fde047; font-size: 14.5px; }
.d-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.d-cta .btn svg { width: 18px; height: 18px; flex: none; }
.d-facts { border-radius: 24px; background: radial-gradient(420px 220px at 100% 0%, rgba(250,204,21,.09), transparent 70%), #030712; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 25px 50px -12px rgba(0,0,0,.6); padding: 8px 22px; }
.d-fact { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.d-fact:first-child { border-top: 0; }
.d-fact > span { color: #9ca3af; }
.d-fact > b { font-weight: 600; color: #fff; text-align: right; }
.d-fact code { font-family: var(--mono); font-size: 12.5px; color: #fde047; }

/* Раскладка: оглавление слева, текст справа */
.d-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 72px; }
.toc { position: sticky; top: 86px; max-height: calc(100vh - 106px); overflow: auto; padding: 4px 6px 16px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.toc-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: transparent; border: 0; padding: 4px 10px 10px; color: #6b7280; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: default; text-align: left; }
.toc-toggle .cur, .toc-toggle svg { display: none; }
.toc-list a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: #9ca3af; font-size: 13.5px; line-height: 1.35; border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s; }
.toc-list a:hover { color: #fff; background: rgba(255,255,255,.03); }
.toc-list a.l1 { color: #e5e7eb; font-weight: 600; margin-top: 10px; }
.toc-list a.l1:first-child { margin-top: 0; }
.toc-list a.l2 { padding-left: 18px; font-size: 13px; }
.toc-list a.active { color: #fde047; background: rgba(250,204,21,.07); border-left-color: #facc15; border-radius: 0 8px 8px 0; }
.toc-list .tm { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .03em; min-width: 30px; flex: none; }
.toc-list .tm.get { color: #4ade80; } .toc-list .tm.post { color: #facc15; } .toc-list .tm.delete { color: #f87171; }
.toc-foot { margin: 16px 10px 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 13px; }
.toc-foot a { color: #9ca3af; display: inline-flex; align-items: center; gap: 6px; } .toc-foot a:hover { color: #fde047; }

/* Текст */
.doc { min-width: 0; }
.dsec { padding: 8px 0 44px; }
.dsec + .dsec, .dgroup { border-top: 1px solid rgba(255,255,255,.06); padding-top: 44px; }
.dgroup-title { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #6b7280; margin: 0 0 6px; }
.doc h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; scroll-margin-top: 90px; }
.doc h3 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; scroll-margin-top: 90px; }
.doc h4 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9ca3af; margin: 24px 0 10px; }
.doc p { color: #d1d5db; line-height: 1.7; margin: 0 0 14px; max-width: 780px; }
.doc p b, .doc li b { color: #fff; font-weight: 600; }
.doc a:not(.btn) { color: #fde047; border-bottom: 1px solid rgba(250,204,21,.3); }
.doc a:not(.btn):hover { border-bottom-color: #fde047; }
.doc :not(pre) > code, .doc td code, .toc code { font-family: var(--mono); font-size: .86em; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; color: #fef08a; white-space: nowrap; }
.dl { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 9px; max-width: 780px; }
.dl li { position: relative; padding-left: 20px; color: #d1d5db; line-height: 1.65; }
.dl li::before { content: ''; position: absolute; left: 3px; top: .68em; width: 6px; height: 6px; border-radius: 2px; background: #facc15; transform: rotate(45deg); }
ol.steps-ol { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
ol.steps-ol li { counter-increment: st; position: relative; padding-left: 40px; color: #d1d5db; line-height: 1.65; min-height: 28px; }
ol.steps-ol li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(250,204,21,.1); color: #fde047; font-weight: 700; font-size: 13px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; margin: 16px 0; border-radius: 12px; background: rgba(250,204,21,.05); border: 1px solid rgba(250,204,21,.22); color: #d1d5db; font-size: 14px; line-height: 1.65; max-width: 820px; }
.callout > i { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(250,204,21,.15); color: #fde047; font-style: normal; font-weight: 800; font-size: 13px; margin-top: 1px; }
.callout.warn { background: rgba(239,68,68,.05); border-color: rgba(239,68,68,.25); } .callout.warn > i { background: rgba(239,68,68,.15); color: #f87171; }
.callout.ok { background: rgba(34,197,94,.05); border-color: rgba(34,197,94,.25); } .callout.ok > i { background: rgba(34,197,94,.15); color: #4ade80; }
.callout p { margin: 0; }

/* Таблицы */
.tbl-wrap { overflow-x: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; margin: 14px 0 20px; background: rgba(255,255,255,.015); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; font-weight: 600; padding: 11px 14px; background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; color: #d1d5db; line-height: 1.55; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { white-space: nowrap; }
.tbl td.wrap-ok { white-space: normal; }
.tbl .http { font-family: var(--mono); font-weight: 700; color: #fff; }
.tbl .x { color: #9ca3af; font-size: 13px; }

/* Параметры */
.params { border: 1px solid rgba(255,255,255,.08); border-radius: 14px; overflow: hidden; margin: 10px 0 18px; background: rgba(255,255,255,.015); }
.pr { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.05); }
.pr:first-child { border-top: 0; }
.pn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.doc .pn code { color: #fff; background: none; border: 0; padding: 0; font-size: 13.5px; font-weight: 600; }
.ty { font-family: var(--mono); font-size: 11.5px; color: #9ca3af; }
.rq { font-size: 10px; color: #fca5a5; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.pd { color: #d1d5db; font-size: 14px; line-height: 1.6; }

/* Эндпоинты */
.ep { padding: 36px 0 8px; border-top: 1px solid rgba(255,255,255,.06); }
.dgroup > .ep:first-of-type { border-top: 0; padding-top: 12px; }
.ep-line { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 4px 0 16px; border-radius: 12px; background: #030712; border: 1px solid rgba(255,255,255,.08); font-family: var(--mono); font-size: 14px; overflow-x: auto; white-space: nowrap; }
.ep-line .pth { color: #fff; }
.ep-line .pth i { font-style: normal; color: #fde047; }
.ep-line .auth { margin-left: auto; font-family: var(--sans); font-size: 11.5px; color: #6b7280; }
.m { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; border: 1px solid transparent; flex: none; }
.m.get { color: #4ade80; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); }
.m.post { color: #fde047; background: rgba(250,204,21,.12); border-color: rgba(250,204,21,.32); }
.m.delete { color: #f87171; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); }
.errs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 20px; }
.ec { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; font-family: var(--mono); font-size: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: #d1d5db; }
.ec b { color: #f87171; font-weight: 700; } .ec.w b { color: #fbbf24; }

/* Статусы */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.y { color: #fde047; background: rgba(250,204,21,.1); border-color: rgba(250,204,21,.3); }
.st.b { color: #93c5fd; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.3); }
.st.o { color: #fdba74; background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.3); }
.st.g { color: #4ade80; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); }
.st.p { color: #fbbf24; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); }
.st.r { color: #f87171; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); }
.st.n { color: #9ca3af; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }
.flow-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 14px; color: #6b7280; font-size: 13px; }
.flow-line > b { color: #9ca3af; font-weight: 600; min-width: 64px; }
.yes { color: #4ade80; font-weight: 600; } .no { color: #6b7280; }

/* Блоки кода */
.code { margin: 12px 0 18px; border-radius: 14px; background: #0b1120; border: 1px solid rgba(255,255,255,.08); overflow: hidden; max-width: 100%; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 6px 8px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02); }
.code-title { font-family: var(--mono); font-size: 12px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-tabs { display: flex; gap: 2px; margin-left: -8px; overflow-x: auto; scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tabs button { background: transparent; border: 0; color: #9ca3af; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.code-tabs button:hover { color: #fff; }
.code-tabs button.on { color: #fde047; background: rgba(250,204,21,.1); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: #e5e7eb; white-space: pre; tab-size: 2; }
.code pre[hidden] { display: none; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); color: #d1d5db; border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 500; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { border-color: rgba(250,204,21,.45); color: #fde047; }
.copy-btn.done { color: #4ade80; border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.08); }
.tk-k { color: #fde047; } .tk-s { color: #86efac; } .tk-n { color: #93c5fd; } .tk-b { color: #f9a8d4; }
.tk-c { color: #6b7280; font-style: italic; } .tk-kw { color: #c4b5fd; } .tk-v { color: #fdba74; } .tk-f { color: #fde047; } .tk-h { color: #9ca3af; }
.tk-m { color: #000; background: #facc15; border-radius: 4px; padding: 0 5px; font-weight: 700; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.pair .code { margin: 12px 0 18px; }

/* Мобильные */
@media (max-width: 1000px) {
  .d-hero { grid-template-columns: minmax(0, 1fr); padding: 48px 0 36px; gap: 28px; }
  .d-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: sticky; top: 66px; z-index: 30; max-height: none; overflow: visible; margin: 0 -20px 8px; padding: 0; background: rgba(3,7,18,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); border-top: 1px solid rgba(255,255,255,.06); }
  .toc-toggle { cursor: pointer; padding: 13px 20px; color: #e5e7eb; font-size: 13px; letter-spacing: 0; text-transform: none; }
  .toc-toggle .tt { color: #6b7280; font-weight: 600; flex: none; }
  .toc-toggle .cur { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fde047; font-weight: 600; text-align: left; }
  .toc-toggle svg { display: block; width: 16px; height: 16px; flex: none; color: #9ca3af; transition: transform .2s; }
  .toc.open .toc-toggle svg { transform: rotate(180deg); }
  .toc-body { display: none; max-height: 62vh; overflow: auto; padding: 4px 14px 16px; border-top: 1px solid rgba(255,255,255,.06); }
  .toc.open .toc-body { display: block; }
  .doc h2, .doc h3 { scroll-margin-top: 132px; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 760px) {
  .toc { margin: 0 -16px 8px; }
  .toc-toggle { padding: 13px 16px; }
  .pr { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .code pre { font-size: 12.5px; padding: 14px; }
  .d-facts { padding: 4px 18px; }
  .dsec + .dsec, .dgroup { padding-top: 36px; }
  .d-cta .btn { flex: 1 1 auto; }
  .d-base .code-box span { font-size: 13px; }
  .tbl td.wrap-ok { min-width: 220px; }
  .tbl td, .tbl th { padding: 10px 12px; }
}
