:root {
  --docs-side-left: clamp(260px, 18vw, 330px);
  --docs-side-right: clamp(220px, 16vw, 300px);
}

body,
.docs-shell,
.docs-content,
.docs-sidebar,
.docs-toc {
  font-family: var(--font-sans);
  font-kerning: normal;
}

.docs-hero h1,
.docs-card h2,
.docs-card h3,
.docs-page-link .title,
.docs-chapter-meta .title {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.page-shell {
  max-width: none;
  width: 100%;
  padding: 12px 10px 0;
}

.docs-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px 8px 44px;
  display: grid;
  grid-template-columns: var(--docs-side-left) minmax(0, 1fr) var(--docs-side-right);
  gap: 12px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  border: 1px solid rgba(97, 151, 255, 0.24);
  border-radius: 14px;
  background: rgba(8, 20, 38, 0.9);
  padding: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.docs-sidebar h2 {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ebde7;
}

.docs-sidebar .docs-search {
  width: 100%;
  border: 1px solid rgba(110, 166, 255, 0.28);
  border-radius: 9px;
  background: rgba(11, 28, 52, 0.86);
  color: #e8f3ff;
  padding: 8px 9px;
  font-size: 13px;
  outline: none;
  margin-bottom: 8px;
}

.docs-sidebar .docs-search:focus {
  border-color: rgba(150, 205, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(46, 139, 255, 0.18);
}

.docs-group-title {
  width: 100%;
  border: 0;
  background: transparent;
  color: #9fbee9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  padding: 8px 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-group-title:hover {
  background: rgba(36, 88, 168, 0.24);
  color: #d8ebff;
}

.docs-group-title::after {
  content: "▾";
  font-size: 10px;
  color: #8bb0df;
  transition: transform 0.2s ease;
}

.docs-group-title.collapsed::after {
  transform: rotate(-90deg);
}

.docs-group-items {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}

.docs-group-title.collapsed + .docs-group-items {
  display: none;
}

.docs-sidebar a[data-doc-link] {
  display: block;
  text-decoration: none;
  color: #bfd3ee;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 8px;
  padding: 8px 9px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-item-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(119, 184, 255, 0.32);
  background: rgba(18, 52, 92, 0.68);
  color: #cfe6ff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.docs-sidebar a[data-doc-link]:hover {
  background: rgba(36, 88, 168, 0.34);
  color: #ffffff;
}

.docs-sidebar a[data-doc-link].active {
  background: rgba(36, 105, 210, 0.42);
  border-color: rgba(125, 194, 255, 0.28);
  color: #ffffff;
}

.docs-content {
  min-height: calc(100vh - 150px);
  border: 1px solid rgba(97, 151, 255, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% -10%, rgba(48, 128, 255, 0.16), transparent 40%),
    radial-gradient(circle at 95% 10%, rgba(20, 84, 200, 0.16), transparent 35%),
    rgba(8, 19, 37, 0.9);
  box-shadow: 0 28px 72px rgba(1, 8, 20, 0.5);
  padding: 22px 28px 26px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.docs-toc {
  position: sticky;
  top: 86px;
  align-self: start;
  border: 1px solid rgba(97, 151, 255, 0.22);
  border-radius: 14px;
  background: rgba(8, 20, 38, 0.9);
  padding: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.docs-toc h3 {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ebde7;
}

.docs-toc a {
  display: block;
  text-decoration: none;
  color: #bcd2ef;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
}

.docs-toc a.level-h3 {
  padding-left: 16px;
  font-size: 12px;
}

.docs-toc a:hover {
  background: rgba(36, 88, 168, 0.34);
  color: #ffffff;
}

.docs-toc a.active {
  background: rgba(36, 105, 210, 0.42);
  border-color: rgba(125, 194, 255, 0.28);
  color: #ffffff;
}

.docs-chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(108, 165, 255, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: rgba(9, 24, 46, 0.9);
}

.docs-top-tabs {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.docs-top-tabs a {
  text-decoration: none;
  border: 1px solid rgba(112, 168, 255, 0.24);
  border-radius: 999px;
  color: #bcd2ef;
  background: rgba(10, 26, 49, 0.76);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  white-space: nowrap;
}

.docs-top-tabs a:hover {
  color: #ffffff;
  background: rgba(24, 61, 108, 0.9);
}

.docs-top-tabs a.active {
  color: #ffffff;
  border-color: rgba(125, 194, 255, 0.36);
  background: rgba(36, 105, 210, 0.42);
}

.docs-global-search {
  margin: 0 0 12px;
}

.docs-global-search input {
  width: 100%;
  border: 1px solid rgba(112, 168, 255, 0.3);
  border-radius: 10px;
  background: rgba(10, 26, 49, 0.88);
  color: #e8f3ff;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.docs-global-search input:focus {
  border-color: rgba(148, 205, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(44, 138, 255, 0.2);
}

.docs-chapter-meta {
  display: grid;
  gap: 2px;
}

.docs-chapter-meta .hint {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #98b7e1;
}

.docs-chapter-meta .title {
  font-size: 16px;
  font-weight: 700;
  color: #e8f3ff;
}

.docs-switch-btn {
  border: 1px solid rgba(119, 184, 255, 0.38);
  border-radius: 9px;
  background: rgba(13, 37, 68, 0.86);
  color: #deefff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 10px;
}

.docs-switch-btn:hover {
  background: rgba(25, 63, 110, 0.95);
}

.docs-switch-btn.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.docs-card,
.docs-hero {
  border: 0;
  border-top: 1px solid rgba(112, 165, 255, 0.14);
  border-radius: 0;
  background: transparent;
  padding: 18px 0;
}

.docs-content > .docs-card:first-of-type,
.docs-content > .docs-hero:first-of-type {
  border-top: 0;
  padding-top: 6px;
}

.docs-hero h1 {
  font-size: clamp(36px, 4.2vw, 64px);
  line-height: 1.04;
  margin-bottom: 12px;
}

.docs-hero p {
  color: #bfd3ed;
  line-height: 1.78;
  max-width: 72ch;
}

.docs-card h2 {
  font-size: clamp(30px, 3.2vw, 50px);
  line-height: 1.04;
  margin-bottom: 10px;
}

.docs-card h3 {
  font-size: clamp(20px, 1.7vw, 28px);
  line-height: 1.12;
  margin-top: 16px;
  margin-bottom: 10px;
  color: #dcecff;
}

.docs-card p,
.docs-card li,
.docs-card td,
.docs-card th,
.docs-card ol,
.docs-card ul {
  color: #bad0ec;
  line-height: 1.74;
}

.docs-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 8px 0 4px;
  border: 1px solid rgba(112, 165, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(9, 24, 45, 0.48);
}

.docs-card thead th {
  background: rgba(18, 46, 82, 0.82);
  color: #e8f3ff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.45;
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(118, 178, 255, 0.24);
}

.docs-card tbody td {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.58;
  vertical-align: top;
  border-top: 1px solid rgba(112, 165, 255, 0.14);
}

.docs-card tbody tr:first-child td {
  border-top: 0;
}

.docs-card th + th,
.docs-card td + td {
  border-left: 1px solid rgba(112, 165, 255, 0.14);
}

.docs-card td code,
.docs-card th code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.docs-card table:has(thead th:nth-child(2)):not(:has(thead th:nth-child(3))) thead th:nth-child(1),
.docs-card table:has(thead th:nth-child(2)):not(:has(thead th:nth-child(3))) tbody td:nth-child(1) {
  width: 44%;
}

.docs-card table:has(thead th:nth-child(2)):not(:has(thead th:nth-child(3))) thead th:nth-child(2),
.docs-card table:has(thead th:nth-child(2)):not(:has(thead th:nth-child(3))) tbody td:nth-child(2) {
  width: 56%;
}

.docs-card table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) thead th:nth-child(1),
.docs-card table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) tbody td:nth-child(1) {
  width: 26%;
}

.docs-card table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) thead th:nth-child(2),
.docs-card table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) tbody td:nth-child(2) {
  width: 16%;
}

.docs-card table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) thead th:nth-child(3),
.docs-card table:has(thead th:nth-child(3)):not(:has(thead th:nth-child(4))) tbody td:nth-child(3) {
  width: 58%;
}

.docs-card table:has(thead th:nth-child(4)) thead th:nth-child(1),
.docs-card table:has(thead th:nth-child(4)) tbody td:nth-child(1) {
  width: 10%;
}

.docs-card table:has(thead th:nth-child(4)) thead th:nth-child(2),
.docs-card table:has(thead th:nth-child(4)) tbody td:nth-child(2) {
  width: 30%;
}

.docs-card table:has(thead th:nth-child(4)) thead th:nth-child(3),
.docs-card table:has(thead th:nth-child(4)) tbody td:nth-child(3) {
  width: 29%;
}

.docs-card table:has(thead th:nth-child(4)) thead th:nth-child(4),
.docs-card table:has(thead th:nth-child(4)) tbody td:nth-child(4) {
  width: 31%;
}

.docs-card ul,
.docs-card ol {
  padding-left: 22px;
}

.docs-kpi-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.docs-kpi {
  border: 1px solid rgba(110, 166, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 23, 44, 0.7);
}

.docs-kpi strong {
  display: block;
  margin-bottom: 4px;
  color: #e8f3ff;
}

.docs-kpi span {
  color: #b8cfea;
  font-size: 13px;
  line-height: 1.6;
}

pre {
  position: relative;
  border-radius: 12px;
  background: #071628;
  border: 1px solid rgba(110, 166, 255, 0.18);
  padding: 14px;
  overflow: auto;
  max-width: 100%;
}

pre code {
  color: #d9edff;
  font-size: 13px;
  line-height: 1.6;
}

.docs-code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(119, 184, 255, 0.36);
  border-radius: 8px;
  background: rgba(16, 43, 78, 0.9);
  color: #deefff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
}

.docs-code-copy.copied {
  border-color: rgba(119, 255, 192, 0.44);
  background: rgba(19, 79, 66, 0.92);
}

.docs-pager {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(112, 165, 255, 0.14);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.docs-page-link {
  border: 1px solid rgba(109, 166, 255, 0.24);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  background: rgba(9, 24, 45, 0.76);
  display: grid;
  gap: 4px;
}

.docs-page-link .hint {
  color: #93b4de;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-page-link .title {
  color: #e6f2ff;
  font-size: 14px;
  font-weight: 700;
}

.docs-page-link:hover {
  background: rgba(24, 59, 104, 0.9);
}

.docs-page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.docs-next {
  display: inline-flex;
  margin-top: 12px;
  border: 1px solid rgba(118, 183, 255, 0.38);
  border-radius: 10px;
  padding: 8px 12px;
  color: #e8f3ff;
  text-decoration: none;
  background: rgba(16, 43, 78, 0.86);
}

.docs-next:hover {
  background: rgba(24, 61, 108, 0.96);
}

@media (max-width: 1320px) {
  .docs-shell {
    grid-template-columns: 280px minmax(0, 1fr) 220px;
  }
}

@media (max-width: 1120px) {
  .docs-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 980px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }

  .docs-toc {
    position: static;
  }

  .docs-content {
    padding: 16px;
  }

  .docs-kpi-grid,
  .docs-pager {
    grid-template-columns: 1fr;
  }

  .docs-chapter-nav {
    flex-wrap: wrap;
  }

  .docs-card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .docs-card table thead th,
  .docs-card table tbody td {
    white-space: nowrap;
  }
}
