/* ApeMind API reference. Builds on docs.css tokens: neutrals carry the page, brand orange
   marks the primary action and current item, red is kept for destructive methods and errors.
   The code panel stays dark in both themes, like a terminal. */

:root {
  --api-console-w: 460px;
  --code-panel: #0d1117;
  --code-panel-line: #30363d;
  --code-panel-text: #e6edf3;
  --code-panel-muted: #8b949e;
}

.api-shell {
  --side-w: 300px;
}

.api-main,
.api-view {
  min-width: 0;
}

.api-content {
  padding: 24px 40px 120px;
  max-width: 1440px;
  margin: 0 auto;
}

.mono {
  font-family: var(--font-mono);
}

/* ── Sidebar ── */

.api-side-top {
  margin-bottom: 12px;
}

.api-side-top .dx-side-head {
  margin-bottom: 10px;
}

.api-spec-dl {
  width: calc(100% - 8px);
  margin: 0 4px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font: 500 12px/1 var(--font-mono);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.api-spec-dl:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--hover);
}

.api-side-search {
  position: relative;
  margin: 0 4px 16px;
}

.api-side-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.api-side-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--text);
  font: 13px var(--font-sans);
}

.api-side-search input:focus {
  outline: none;
  border-color: var(--brand-emphasis);
  background: var(--bg);
}

.api-side-group {
  margin: 0 0 18px;
}

.api-side-group > p {
  margin: 0 8px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.api-side-tag > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.api-side-tag > button:hover {
  background: var(--hover);
}

.api-side-tag > button span {
  flex: 1;
  min-width: 0;
}

.api-side-tag > button small {
  font: 11px var(--font-mono);
  color: var(--faint);
}

.api-side-tag > button svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--faint);
  transition: transform 0.2s;
}

.api-side-tag.is-collapsed > button svg {
  transform: rotate(-90deg);
}

.api-side-tag.is-collapsed > ol {
  display: none;
}

.dx-side .api-side-tag li > a {
  padding: 4px 8px 4px 24px;
  font-size: 13px;
  gap: 8px;
}

.dx-side .api-side-tag li > a > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dx-side .api-side-tag li > a[aria-current="page"]::before {
  left: 10px;
}

.is-deprecated {
  text-decoration: line-through;
  color: var(--faint);
}

/* ── Method badges ── */

.api-method {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--bg);
}

.api-method.m-post {
  color: var(--brand);
  border-color: var(--brand-muted);
  background: var(--brand-soft);
}

.api-method.m-put,
.api-method.m-patch {
  color: var(--ink);
  border-color: var(--ink);
}

.api-method.m-delete {
  color: var(--danger);
  border-color: var(--danger-muted);
}

/* ── Public parameters ── */

.api-auth {
  margin: 0 0 28px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}

.api-auth.is-collapsed {
  padding: 10px 16px;
  margin-bottom: 20px;
}

.api-auth-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.api-auth-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.api-auth-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
}

.api-auth-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11.5px;
}

.api-auth-toggle {
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.api-auth-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.api-auth-body[hidden] {
  display: none;
}

.api-auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-end;
}

.api-field-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}

.api-field-inline.grow {
  flex: 1 1 460px;
}

.api-inputs {
  display: flex;
  gap: 6px;
}

.api-inputs .api-input {
  flex: 1;
  min-width: 0;
}

.api-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.api-auth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 12.5px;
}

.api-hint {
  color: var(--muted);
}

.api-hint a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
}

.api-hint a svg {
  width: 12px;
  height: 12px;
}

.api-verdict {
  color: var(--muted);
}

.api-verdict.is-ok {
  color: var(--ink);
  font-weight: 500;
}

.api-verdict.is-ok::before {
  content: "●";
  margin-right: 6px;
  color: var(--brand-emphasis);
}

.api-verdict.is-bad {
  color: var(--danger);
}

.api-memory {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.api-memory[hidden] {
  display: none;
}

.api-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 26px;
  padding: 0 4px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
}

.api-chip code {
  font: 600 11.5px var(--font-mono);
  color: var(--ink);
}

.api-chip .mono {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.api-chip button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  cursor: pointer;
  line-height: 1;
}

.api-chip button:hover {
  background: var(--hover);
  color: var(--ink);
}

/* ── Controls ── */

.api-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.api-input:focus {
  outline: none;
  border-color: var(--brand-emphasis);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea.api-input {
  height: auto;
  padding: 10px;
  line-height: 1.55;
  resize: vertical;
}

.api-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.api-btn:hover {
  background: var(--hover);
}

.api-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.api-btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--muted);
}

.api-btn.ghost:hover {
  background: var(--hover);
  color: var(--ink);
}

.api-btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.api-btn.primary:hover {
  background: var(--brand-emphasis);
}

.api-btn.primary.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.api-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12.5px;
  cursor: pointer;
}

.api-link:hover {
  text-decoration: underline;
}

.api-copy {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.api-copy:hover {
  color: var(--ink);
}

.api-copy.on-dark {
  border-color: var(--code-panel-line);
  background: transparent;
  color: var(--code-panel-muted);
}

.api-copy.on-dark:hover {
  color: var(--code-panel-text);
}

/* ── Pages ── */

.api-page {
  max-width: 980px;
}

.api-home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.api-op-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.api-auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.api-page h1,
.api-doc h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.api-page .lede {
  margin: 12px 0 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
}

.api-steps {
  counter-reset: step;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 28px 0 8px;
  padding: 0;
}

.api-steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 16px 52px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.api-steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font: 600 12px/1 var(--font-mono);
}

.api-steps strong {
  color: var(--ink);
  font-size: 15px;
}

.api-home-group h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 40px 0 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.api-home-group .count {
  font-size: 13px;
  font-weight: 400;
  color: var(--faint);
}

.api-op-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.api-op-list li + li {
  border-top: 1px solid var(--line-soft);
}

.api-op-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
}

.api-op-list a:hover {
  background: var(--hover);
}

.api-op-name {
  font-weight: 500;
  color: var(--ink);
}

.api-op-list code {
  font: 12.5px var(--font-mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 460px;
}

/* ── Operation page: documentation left, console right ── */

.api-op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--api-console-w));
  gap: 48px;
  align-items: start;
}

.api-doc {
  min-width: 0;
}

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 20px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
}

.api-endpoint .api-method {
  min-width: 52px;
  height: 22px;
  font-size: 11px;
}

.api-endpoint code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font: 14px var(--font-mono);
  color: var(--ink);
  white-space: nowrap;
}

.api-endpoint-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.api-md {
  font-size: 15px;
  line-height: 1.75;
}

.api-md p {
  margin: 0 0 10px;
}

.api-md ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.api-md code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--faint) 16%, transparent);
  color: var(--ink);
  font: 0.88em var(--font-mono);
}

.api-md a {
  color: var(--brand);
}

.api-md.small {
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.api-md.small p {
  margin: 0 0 4px;
}

.api-empty {
  color: var(--faint);
  font-size: 14px;
}

.api-section {
  margin-top: 36px;
}

.api-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.api-ctype {
  margin-left: auto;
  font: 12px var(--font-mono);
  color: var(--muted);
}

.api-fields {
  list-style: none;
  margin: 0;
  padding: 0;
}

.api-fields > li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.api-fields.is-nested {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid var(--line-soft);
}

.api-fields.is-nested > li:last-child {
  border-bottom: 0;
}

.api-field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.api-field-name {
  font: 600 13.5px var(--font-mono);
  color: var(--ink);
}

.api-type {
  font: 12.5px var(--font-mono);
  color: var(--muted);
}

.api-req {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
}

.api-meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.api-meta code {
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--canvas);
  border: 1px solid var(--line-soft);
  font: 12px var(--font-mono);
  color: var(--ink);
}

.api-children {
  margin-top: 6px;
}

.api-variants {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  overflow: hidden;
}

.api-variants-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.api-variant-kind {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.api-variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.api-variant-tab {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font: 500 12px/1 var(--font-mono);
  cursor: pointer;
}

.api-variant-tab:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.api-variant-tab[aria-selected="true"] {
  border-color: var(--brand-muted);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.api-variant-panel {
  padding: 10px 14px;
  background: var(--bg);
}

.api-variant-panel > .api-fields.is-nested {
  margin-top: 0;
  padding-left: 0;
  border-left: 0;
}

.api-scalar-schema {
  padding: 8px 0;
}

.api-fields .api-link {
  margin-top: 6px;
}

.api-sse-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-muted);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}

.api-media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}

.api-media-tab {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--muted);
  font: 500 12px/1 var(--font-mono);
  cursor: pointer;
}

.api-media-tab:hover {
  color: var(--ink);
}

.api-media-tab[aria-selected="true"] {
  border-color: var(--brand-muted);
  background: var(--brand-soft);
  color: var(--brand);
}

.api-sse-note {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--brand-muted);
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.api-pager {
  margin-top: 48px;
}

.api-pager a strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.api-pager a.next strong {
  justify-content: flex-end;
}

.api-response {
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.api-response > summary {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}

.api-response > summary > span:not(.api-status):not(.api-sse-badge) {
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.api-response-body,
.api-media-pane {
  min-width: 0;
}

.api-response > summary::-webkit-details-marker {
  display: none;
}

.api-response > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

.api-response[open] > summary::before {
  transform: rotate(45deg);
}

.api-response > :not(summary) {
  margin-left: 19px;
}

.api-response > .api-fields {
  margin-bottom: 8px;
}

.api-status {
  font: 600 12.5px var(--font-mono);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink);
}

.api-status.bad {
  color: var(--danger);
  border-color: var(--danger-muted);
}

.api-example {
  margin: 8px 0 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.api-example-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--canvas);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
}

.api-example pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 12px 14px;
  font: 12.5px/1.6 var(--font-mono);
  color: var(--text);
}

/* ── Console ── */

.api-console {
  position: sticky;
  top: calc(var(--top-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - var(--top-h) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.api-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  min-width: 0;
}

.api-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink);
}

.api-code {
  background: var(--code-panel);
  border-color: var(--code-panel-line);
}

.api-code .api-card-head {
  padding-left: 8px;
  border-color: var(--code-panel-line);
}

.api-tabs {
  display: flex;
  gap: 2px;
}

.api-tabs button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--code-panel-muted);
  font-size: 12.5px;
  cursor: pointer;
}

.api-tabs button:hover {
  color: var(--code-panel-text);
}

.api-tabs button[aria-selected="true"] {
  background: #21262d;
  color: var(--code-panel-text);
  font-weight: 500;
}

.api-code pre {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  padding: 14px 16px;
  color: var(--code-panel-text);
  font: 12.5px/1.65 var(--font-mono);
  scrollbar-width: thin;
}

.api-code-foot {
  margin: 0;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--code-panel-line);
  font-size: 11.5px;
  color: var(--code-panel-muted);
}

.api-code-foot code {
  font: 11.5px var(--font-mono);
  color: var(--code-panel-text);
}

.api-write {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--danger);
}

.api-params {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.api-param {
  display: grid;
  gap: 4px;
}

.api-param > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.api-param code {
  font: 600 12.5px var(--font-mono);
  color: var(--ink);
}

.api-param small {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
}

select.api-input {
  padding-right: 28px;
}

.api-more > summary {
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.api-more > summary:hover {
  color: var(--ink);
}

.api-params-inner {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.api-file {
  font-size: 12.5px;
}

.api-body-wrap {
  padding: 0 14px 14px;
}

.api-params + .api-body-wrap {
  padding-top: 0;
}

.api-card-head + .api-body-wrap {
  padding-top: 14px;
}

.api-body-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.api-body-head code {
  font: 400 11.5px var(--font-mono);
  color: var(--faint);
}

.api-body {
  width: 100%;
  font-size: 12.5px;
}

.api-send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
}

.api-send-note {
  font-size: 12px;
  color: var(--muted);
}

.api-send-note.is-warn {
  color: var(--ink);
}

.api-result:empty {
  display: none;
}

.api-result {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-soft);
}

.api-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-result-head .api-copy {
  margin-left: auto;
}

.api-result-url {
  overflow-wrap: anywhere;
}

.api-result-body {
  margin: 10px 0 0;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: var(--code-bg);
  border: 1px solid var(--line-soft);
  font: 12.5px/1.6 var(--font-mono);
  white-space: pre;
}

.api-result-headers {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.api-result-headers summary {
  cursor: pointer;
}

.api-result-headers pre {
  margin: 6px 0 0;
  max-height: 200px;
  overflow: auto;
  font: 11.5px/1.6 var(--font-mono);
}

.api-error,
.api-warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.api-error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.api-warn {
  color: var(--ink);
  background: var(--brand-soft);
  border: 1px solid var(--brand-muted);
}

.api-doc > .api-warn {
  margin-bottom: 16px;
}

.api-loading {
  padding: 40px 0;
}

/* ── Responsive ── */

@media (max-width: 1280px) {
  :root {
    --api-console-w: 400px;
  }

  .api-content {
    padding: 24px 28px 96px;
  }

  .api-op {
    gap: 32px;
  }
}

@media (max-width: 1080px) {
  .api-op {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-console {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 960px) {
  .api-content {
    padding: 20px 16px 80px;
  }

  .api-op-list a {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .api-op-list code {
    grid-column: 1 / -1;
    max-width: none;
  }

  .api-field-inline {
    min-width: 0;
    flex: 1 1 100%;
  }

  .api-inputs {
    flex-wrap: wrap;
  }

  .api-inputs .api-input {
    flex: 1 1 180px;
  }

  .api-endpoint {
    flex-wrap: wrap;
  }

  .api-endpoint-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .api-response > summary {
    flex-wrap: wrap;
  }
}
