/* Документация: три колонки — разделы, статья, «на этой странице». */

.docs-shell {
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px;
  max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter);
}
.docs-side { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 32px 4px 48px 0; }
.docs-side .search { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); padding: 0 12px; font: inherit; font-size: .9rem; margin-bottom: 22px; }
.docs-side .search:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }
.docs-group { margin-bottom: 22px; }
.docs-group h5 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 8px 10px; }
.docs-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.docs-group a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: .93rem; opacity: .85; }
.docs-group a:hover { text-decoration: none; background: var(--bg-soft); opacity: 1; }
.docs-group a[aria-current="page"] { background: var(--brand-wash); color: var(--brand); font-weight: 650; opacity: 1; }
.docs-group li[hidden] { display: none; }
.docs-toggle { display: none; }

.docs-main { padding: 40px 0 96px; min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2rem, 3.6vw, 2.6rem); margin-bottom: 14px; }
.prose > .lead { margin-bottom: 32px; }
.prose h2 { font-size: 1.5rem; margin: 2.4em 0 .6em; padding-top: 8px; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3 { font-size: 1.15rem; margin: 1.8em 0 .5em; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h2 .anchor, .prose h3 .anchor { opacity: 0; margin-left: 8px; color: var(--muted); font-weight: 500; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; text-decoration: none; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1.2em; }
.prose li { margin-bottom: 6px; }
.prose li > ul { margin: 6px 0 0; }
.prose :not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .86em; word-break: break-word; }
.prose table code { white-space: nowrap; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose .grid { margin: 0 0 1.6em; }
.prose .card { padding: 22px; }
.prose .card h3 { margin-top: 0; }

.method { display: inline-block; font: 700 .72rem var(--mono); padding: 3px 8px; border-radius: 6px; margin-right: 8px; vertical-align: middle; letter-spacing: .02em; }
.method.get { background: var(--mint-wash); color: var(--mint); }
.method.post { background: var(--brand-wash); color: var(--brand); }
.endpoint { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-family: var(--mono); font-size: .92rem; margin: 0 0 1.2em; }

.checklist { list-style: none; padding: 0 !important; }
.checklist li { position: relative; padding-left: 34px; margin-bottom: 10px; }
.checklist input { position: absolute; left: 0; top: 3px; width: 20px; height: 20px; accent-color: var(--mint); cursor: pointer; }
.checklist label { cursor: pointer; }
.progress { height: 8px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); overflow: hidden; margin: 0 0 22px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--mint)); transition: width .3s ease; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; max-width: 760px; }
.pager a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; color: inherit; transition: border-color .2s, transform .2s; }
.pager a:hover { text-decoration: none; border-color: var(--brand-2); transform: translateY(-2px); }
.pager small { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.pager b { color: var(--brand); }
.pager .next { text-align: right; grid-column: 2; }

.toc { position: sticky; top: var(--header-h); align-self: start; padding: 40px 0; font-size: .86rem; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.toc h5 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); }
.toc a.lvl3 { padding-left: 26px; font-size: .82rem; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--brand); border-left-color: var(--brand); }

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 16px;
    padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft);
    color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  }
  .docs-side { position: static; max-height: none; padding: 0; display: none; }
  .docs-side.is-open { display: block; padding-top: 16px; }
  .docs-main { padding-top: 24px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
