.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 780px);
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 100px;
}

.docs-toc {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 56px);
  overflow-y: auto;
}

.toc-group { display: flex; flex-direction: column; gap: 2px; }

.toc-label {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.docs-toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
}

.docs-toc a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.docs-toc a .method { min-width: 40px; height: 18px; font-size: 10px; }

@media (max-width: 1020px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-toc { display: none; }
}

.docs-content { min-width: 0; }

.docs-section {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.docs-section:first-child { padding-top: 0; border-top: 0; }
.docs-section h1 { margin-top: 14px; font-size: clamp(32px, 4.4vw, 46px); letter-spacing: -0.04em; }
.docs-section h2 { font-size: 24px; letter-spacing: -0.03em; }
.docs-section > p { margin: 14px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--text-2); max-width: 62ch; }

.docs-lead { font-size: 18px !important; color: var(--text-2); max-width: 56ch; }

.docs-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.docs-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
}

.docs-chip code { padding: 0; background: none; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .nav .btn-ghost { display: none; }
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 14px;
  text-align: left;
}

.alert svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.alert-bad { background: var(--bad-soft); color: #ffb3b3; }
.alert-warn { background: var(--warn-soft); color: #f8d59f; }
.alert-gold { background: var(--accent-soft); color: #c6d6ff; }
.alert-ok { background: var(--ok-soft); color: #9ce8c4; }

.docs-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13.5px !important;
  color: var(--text-2) !important;
  max-width: none !important;
}

.docs-section .code-window { margin-top: 18px; }
.docs-section .code-window pre { font-size: 12.5px; }

.ref-list {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
}

.ref-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  color: inherit;
  text-decoration: none;
  transition: background 0.18s;
}

.ref-row:hover { background: rgba(255, 255, 255, 0.035); }
.ref-row:hover code { color: var(--accent-2); }
.ref-row + .ref-row { border-top: 1px solid var(--line); }
.ref-row code { font-size: 14px; color: var(--text); transition: color 0.18s; }
.ref-row > span:last-child { font-size: 13.5px; color: var(--text-2); }

@media (max-width: 640px) {
  .ref-row { grid-template-columns: 56px minmax(0, 1fr); gap: 6px 12px; padding: 12px 16px; }
  .ref-row > span:last-child { grid-column: 1 / -1; font-size: 13px; }
}

.ep-head { display: flex; align-items: center; gap: 12px; }
.ep-head .method { height: 26px; min-width: 60px; font-size: 12.5px; }

.pipeline-full { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.pipeline-full svg { width: 15px; height: 15px; color: var(--muted); }
.pipeline-full .badge { font-family: var(--mono); font-weight: 500; }

.table {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--panel);
}

.trow {
  display: grid;
  grid-template-columns: 200px 120px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 16px;
  font-size: 13.5px;
}

#errors .trow, #statuses .trow { grid-template-columns: 110px minmax(0, 1fr); }

.trow + .trow { border-top: 1px solid var(--line); }
.trow.thead { color: var(--muted); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255, 255, 255, 0.015); }
.trow span:first-child { font-family: var(--mono); color: var(--text); }
.trow.thead span { font-family: var(--mono); }
.trow span:not(:first-child) { color: var(--text-2); }
.trow code { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); font-size: 0.92em; color: var(--text); }
.mono-or { color: var(--muted); font-style: normal; }

@media (max-width: 640px) {
  .trow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .trow span:first-child { font-weight: 600; }
  #errors .trow, #statuses .trow { grid-template-columns: minmax(0, 1fr); }
}

.code-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 18px; }
.code-pair .code-window { margin-top: 0; min-width: 0; }
@media (max-width: 780px) { .code-pair { grid-template-columns: minmax(0, 1fr); } }

.delivery-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 700px) { .delivery-grid { grid-template-columns: minmax(0, 1fr); } }

.delivery-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }

.delivery-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.delivery-head svg { width: 18px; height: 18px; color: var(--accent); }
.delivery-head h3 { font-size: 16px; }
.delivery-card > p { margin: 0 0 14px; font-size: 14px; color: var(--text-2); }

.delivery-card .mini {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #0a0b0d;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-2);
}
