.docs-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 200px;
  gap: 48px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  border-top: 1px solid var(--rule);
}

.docs-side {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 8px;
}

.docs-side-title {
  margin: 0 0 14px;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.docs-nav-group {
  margin-bottom: 26px;
}

.docs-nav-label {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.docs-nav-group a {
  display: block;
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}

.docs-nav-group a:hover {
  color: var(--white);
  background: var(--surface);
}

.docs-nav-group a.is-active {
  color: var(--black);
  background: var(--accent);
  font-weight: 600;
}

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

.docs-eyebrow {
  margin: 0 0 10px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.docs-title {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.375rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.docs-deck {
  margin: 14px 0 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 64ch;
}

.docs-body {
  margin-top: 40px;
  max-width: 72ch;
}

.docs-body h2 {
  margin: 56px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
  font-weight: 600;
  scroll-margin-top: 24px;
}

.docs-body h3 {
  margin: 32px 0 10px;
  font-size: 1rem;
  font-weight: 600;
  scroll-margin-top: 24px;
}

.docs-body h4 {
  margin: 24px 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.docs-body p {
  margin: 0 0 16px;
  line-height: 1.7;
  color: var(--muted);
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--muted);
}

.docs-body li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.docs-body a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.32);
}

.docs-body a:hover {
  text-decoration-color: var(--accent);
}

.docs-body strong {
  color: var(--white);
  font-weight: 600;
}

.docs-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  white-space: nowrap;
}

.docs-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-size: 0.8125rem;
}

.docs-toc-title {
  margin: 0 0 12px;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.docs-toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
}

.docs-toc a:hover {
  color: var(--white);
  border-left-color: var(--accent);
}

.callout {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface);
}

.callout p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.callout p + p {
  margin-top: 10px;
}

.callout-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.callout-note {
  border-left-color: var(--accent);
}

.callout-note .callout-label {
  color: var(--accent);
}

.callout-tip {
  border-left-color: var(--green);
}

.callout-tip .callout-label {
  color: var(--green);
}

.callout-warn {
  border-left-color: #f87171;
}

.callout-warn .callout-label {
  color: #f87171;
}

.steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 28px 44px;
  margin: 0;
  border-left: 1px solid var(--rule);
}

.steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -14px;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--black);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.step-title {
  margin: 3px 0 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.doc-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
}

.doc-card:hover {
  border-color: rgba(234, 179, 8, 0.5);
}

.doc-card h3 {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.doc-card p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.code {
  margin: 0 0 20px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.code pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.86);
}

.code pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

.table-wrap {
  margin: 0 0 22px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.doc-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  white-space: nowrap;
}

.doc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  line-height: 1.55;
  vertical-align: top;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table code {
  white-space: nowrap;
}

.endpoint {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  margin: 0 0 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  overflow-x: auto;
}

.method {
  flex: none;
  min-width: 52px;
  padding: 2px 7px;
  border-radius: 4px;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--black);
  background: rgba(255, 255, 255, 0.6);
}

.method-get {
  background: var(--green);
}

.method-post {
  background: var(--accent);
}

.method-put,
.method-patch {
  background: #60a5fa;
}

.method-delete {
  background: #f87171;
}

.endpoint-path {
  color: var(--white);
  white-space: nowrap;
}

.endpoint-note {
  margin-left: auto;
  padding-left: 16px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.media {
  margin: 0 0 22px;
}

.media-frame {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.media-kind {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.media-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
}

.media-cap {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

.steps .media,
.steps .code,
.steps .callout {
  margin-top: 14px;
}

.page-nav {
  display: flex;
  gap: 16px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.page-nav a {
  flex: 1;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-decoration: none;
}

.page-nav a:hover {
  border-color: rgba(234, 179, 8, 0.5);
}

.page-nav-dir {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 5px;
}

.page-nav-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.page-nav .next {
  text-align: right;
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 216px minmax(0, 1fr);
    gap: 40px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 24px 20px 72px;
  }

  .docs-side {
    position: static;
    max-height: none;
    padding: 16px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--surface);
  }

  .docs-nav-group {
    margin-bottom: 18px;
  }

  .docs-nav-group:last-child {
    margin-bottom: 0;
  }

  .doc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-nav {
    flex-direction: column;
  }

  .endpoint {
    flex-wrap: wrap;
  }

  .endpoint-note {
    margin-left: 0;
    padding-left: 0;
    width: 100%;
    white-space: normal;
  }
}
