.apiDocsShell {
  display: grid;
  min-height: calc(100vh - 120px);
  grid-template-columns: 280px minmax(420px, 1fr) 360px;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.docsSidebar,
.docsArticle,
.docsRunner {
  min-height: 0;
  overflow: auto;
}

.docsSidebar {
  padding: 18px;
  border-right: 1px solid var(--border);
}

.docsBrand,
.docsSearch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docsBrand {
  margin-bottom: 18px;
  font-size: 1.0625rem;
}

.docsSearch {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
}

.docsSearch input {
  width: 100%;
  border: 0;
  outline: 0;
}

.docsSurface {
  display: grid;
  gap: 0;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.docsSurfaceHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.docsSurfaceHeader strong {
  color: var(--text-strong);
  font-size: 0.875rem;
}

.docsSurfaceHeader span {
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.docsSurface .docsGroup {
  margin-top: 14px;
}

.docsSearchEmpty,
.docsCatalogEmpty {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docsGroup {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.docsGroup h3 {
  margin-bottom: 4px;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.docsGroup button {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-normal);
  text-align: left;
}

.docsGroup button[data-active="true"] {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.docsArticle {
  padding: 28px 34px 60px;
  background: #fff;
}

.docsArticle h1 {
  margin-bottom: 20px;
}

.endpointBar,
.runnerEndpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.docsKeyNotice {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.docsKeyNotice .shButton {
  justify-self: start;
}

.docsLead {
  margin: 18px 0 24px;
  color: var(--text-soft);
  line-height: 1.7;
}

.docsCatalogSummary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(100px, 0.45fr);
  gap: 12px;
  margin-bottom: 18px;
}

.docsCatalogSummary article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.docsCatalogSummary span {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.docsCatalogSummary code {
  overflow-wrap: anywhere;
  color: var(--text-normal);
  font-size: 0.75rem;
  line-height: 1.5;
}

.docsCatalogSummary strong {
  color: var(--text-strong);
  font-size: 1.5rem;
}

.docsCatalogNotice {
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.docsCatalogNotice[data-surface='compatibility'] {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.docsCatalogNotice p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.65;
}

.docsCatalogSearchResult {
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 0.8125rem;
}

.docsCatalogGroup > header {
  align-items: flex-start;
}

.docsCatalogGroup > header > div:first-child {
  display: grid;
  gap: 6px;
}

.docsCatalogGroup header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
}

.docsCatalogEndpoints {
  display: grid;
}

.docsCatalogEndpoint {
  display: grid;
  grid-template-columns: 68px minmax(250px, 1.3fr) minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
}

.docsCatalogEndpoint:last-child {
  border-bottom: 0;
}

.docsCatalogEndpoint .shBadge {
  justify-self: start;
}

.docsCatalogEndpoint code {
  overflow-wrap: anywhere;
  color: var(--text-normal);
  font-size: 0.75rem;
}

.docsCatalogEndpoint span {
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.agentResourceCard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 70%);
}

.agentResourceIcon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: #dbeafe;
  color: #1d4ed8;
}

.agentResourceContent {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.agentResourceContent p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.agentResourceTitle,
.agentResourceActions,
.agentResourceModules {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agentResourceTitle {
  justify-content: space-between;
}

.agentResourceTitle h2 {
  margin: 2px 0 0;
  font-size: 1.0625rem;
}

.agentResourceTitle .eyebrow {
  color: #2563eb;
}

.agentResourceModules {
  color: var(--text-soft);
  font-size: 0.8125rem;
}

.agentResourceModules strong {
  color: var(--text-strong);
}

.agentResourceActions {
  flex-wrap: wrap;
}

.agentResourceMetadataLink {
  color: #2563eb;
  font-size: 0.8125rem;
  text-decoration: none;
}

.agentResourceMetadataLink:hover {
  text-decoration: underline;
}

.paramCard {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.paramCard header,
.docsRunner header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.paramRow {
  display: grid;
  grid-template-columns: 150px 110px minmax(0, 1fr) 50px;
  align-items: start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #f0f2f5;
  color: var(--text-soft);
  font-size: 0.8125rem;
}

.paramRow[data-nested='true'] {
  background: #fbfcfe;
}

.paramName {
  position: relative;
  min-width: 0;
}

.paramName code {
  overflow-wrap: anywhere;
}

.paramTreeMarker {
  position: absolute;
  top: -13px;
  width: 12px;
  height: 23px;
  border-bottom: 1px solid #cfd7e3;
  border-left: 1px solid #cfd7e3;
  border-radius: 0 0 0 4px;
}

.paramRow em {
  color: #a16207;
  font-style: normal;
}

.docsDetailContent {
  display: grid;
  gap: 12px;
  padding: 16px;
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.7;
}

.docsDetailContent p {
  margin: 0;
}

.docsDetailContent pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #f7f8fa;
  color: var(--text-normal);
  font-size: 0.75rem;
  line-height: 1.6;
}

.docsSteps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.docsGuideActions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.docsStatusGrid {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
  gap: 0;
}

.docsStatusGrid > * {
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #f0f2f5;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docsStatusGrid > code {
  color: var(--text-normal);
}

.docsRunner {
  border-left: 1px solid var(--border);
  background: #fff;
}

.docsRunner form {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.runnerModeField {
  display: grid;
  gap: 8px;
}

.runnerModeLabel {
  color: var(--text-normal);
  font-size: 0.8125rem;
  font-weight: 600;
}

.runnerModeToggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
}

.runnerModeToggle button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
}

.runnerModeToggle button:hover {
  color: var(--text-normal);
}

.runnerModeToggle button[data-active='true'] {
  border-color: #d8dee8;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: var(--text-strong);
}

.runnerModeToggle button:last-child[data-active='true'] {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.runnerModeHint {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

.runnerModeHint[data-mode='production'] {
  color: #92400e;
}

.runnerBodyError {
  color: #b42318;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.runnerBodyField {
  display: grid;
  gap: 6px;
}

.docsRunner .shTextarea[aria-invalid='true'] {
  border-color: #f04438;
  box-shadow: 0 0 0 2px rgba(240, 68, 56, 0.1);
}

.docsRunnerUnavailable {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docsGuideAside header {
  display: flex;
  align-items: center;
  min-height: 58px;
}

.docsGuideAside > div {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docsGuideAside span,
.docsGuideAside p {
  margin: 0;
}

.docsGuideAside strong {
  color: var(--text-normal);
}

.runnerResult {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.runnerResult pre {
  overflow: auto;
  max-height: 300px;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f7f8fa;
  font-size: 0.75rem;
}

@media (max-width: 1180px) {
  .apiDocsShell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .docsRunner {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 860px) {
  .apiDocsShell {
    grid-template-columns: 1fr;
  }

  .paramRow {
    grid-template-columns: 1fr;
  }

  .docsStatusGrid {
    grid-template-columns: 1fr;
  }

  .docsCatalogSummary,
  .docsCatalogEndpoint {
    grid-template-columns: 1fr;
  }

  .agentResourceCard {
    grid-template-columns: 1fr;
  }

  .agentResourceTitle {
    align-items: flex-start;
  }
}
