.api-docs {
  --docs-ink: #12352c;
  --docs-muted: #5a6f66;
  --docs-line: #d5ddd7;
  --docs-panel: #ffffff;
  --docs-green: #1f5a44;
  --docs-green-deep: #0f3a2d;
  --docs-accent: #c67d38;
  --docs-code-bg: #152821;
  --docs-code-ink: #d7ebe1;
  --docs-shine: rgba(31, 90, 68, 0.08);
  --docs-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

.api-docs header a[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Reset marketing-site section padding that would break docs cards. */
.api-docs section.integrate,
.api-docs section.docs-section {
  max-width: none;
  margin: 0;
  padding: 0;
}

.docs-hero-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 40px 12px;
}

.docs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 40px 80px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  color: var(--docs-ink);
}

.docs-side {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 4px;
  padding-top: 8px;
}

.docs-side a {
  color: var(--docs-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
}

.docs-side a:hover,
.docs-side a.active {
  background: var(--docs-shine);
  color: var(--docs-green-deep);
  text-decoration: none;
}

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

.integrate {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.18fr);
  align-items: stretch;
  border: 1px solid var(--docs-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--docs-panel);
  box-shadow: 0 18px 40px rgba(18, 53, 44, 0.05);
  animation: docs-rise 0.65s ease both;
}

.integrate-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 36px 34px;
  border-right: 1px solid var(--docs-line);
  background: linear-gradient(160deg, #f7faf6 0%, #ffffff 55%);
}

.integrate-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--docs-green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.integrate-copy .eyebrow i {
  width: auto;
  height: auto;
  margin: 0;
  background: none;
  border-radius: 0;
  color: var(--docs-accent);
  font-style: normal;
}

.integrate-copy h1 {
  margin: 0 0 14px;
  color: var(--docs-ink);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -1.2px;
  font-weight: 650;
}

.integrate-copy h1 em {
  font-style: italic;
  color: var(--docs-green);
}

.integrate-copy .lede {
  max-width: 34ch;
  margin: 0 0 26px;
  color: var(--docs-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.api-docs .docs-actions a.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--docs-green);
  border-radius: 10px;
  background: var(--docs-green);
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: none;
}

.api-docs .docs-actions a.button:hover {
  background: var(--docs-green-deep);
  border-color: var(--docs-green-deep);
  color: #ffffff;
  text-decoration: none;
}

.api-docs .docs-actions a.button.ghost {
  background: transparent;
  border-color: var(--docs-line);
  color: var(--docs-green-deep);
}

.api-docs .docs-actions a.button.ghost:hover {
  background: var(--docs-shine);
  border-color: #c5d0c8;
  color: var(--docs-green-deep);
}

.integrate-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--docs-code-bg);
}

.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(215, 235, 225, 0.12);
  background: #1a3229;
}

.lang-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(215, 235, 225, 0.62);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.lang-tabs button:hover {
  background: rgba(215, 235, 225, 0.08);
  color: #ffffff;
}

.lang-tabs button[aria-selected='true'] {
  background: rgba(215, 235, 225, 0.14);
  color: #ffffff;
}

.code-stage {
  flex: 1;
  background: var(--docs-code-bg);
}

.code-stage .code-block {
  margin: 0;
  padding: 22px 24px;
  border-radius: 0;
  min-height: 300px;
  height: 100%;
  background: transparent;
  color: var(--docs-code-ink);
  overflow-x: auto;
  font: 13px/1.55 var(--docs-mono);
  white-space: pre;
}

.docs-section {
  background: var(--docs-panel);
  border: 1px solid var(--docs-line);
  border-radius: 18px;
  padding: 28px 30px !important;
  margin: 0 0 18px !important;
  max-width: none !important;
  box-shadow: 0 14px 36px rgba(18, 53, 44, 0.04);
  animation: docs-rise 0.7s ease both;
}

.docs-main .docs-section:nth-child(1) {
  animation-delay: 0.04s;
}
.docs-main .docs-section:nth-child(2) {
  animation-delay: 0.08s;
}
.docs-main .docs-section:nth-child(3) {
  animation-delay: 0.12s;
}

.docs-section h2 {
  margin: 0 0 10px;
  color: var(--docs-ink);
  font-size: 1.4rem;
  letter-spacing: -0.45px;
  font-weight: 650;
}

.docs-section > p {
  color: var(--docs-muted);
  margin: 0 0 18px;
}

.docs-section a {
  color: var(--docs-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--docs-mono);
  font-size: 13px;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.method.post {
  background: #1f5a44;
}
.method.get {
  background: #2a6f9b;
}

.path {
  color: var(--docs-ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.docs-section pre,
.docs-section .code-block {
  margin: 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--docs-code-bg);
  color: var(--docs-code-ink);
  overflow-x: auto;
  font: 13px/1.55 var(--docs-mono);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}

table.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.docs-table th,
table.docs-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--docs-line);
  vertical-align: top;
}

table.docs-table th {
  color: var(--docs-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

code.inline {
  font-family: var(--docs-mono);
  font-size: 0.9em;
  background: rgba(31, 90, 68, 0.08);
  color: var(--docs-ink);
  padding: 2px 6px;
  border-radius: 5px;
}

.note {
  border-left: 3px solid var(--docs-accent);
  padding: 12px 14px;
  background: rgba(198, 125, 56, 0.1);
  border-radius: 0 10px 10px 0;
  color: var(--docs-ink);
  margin: 16px 0 0;
}

@keyframes docs-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .integrate {
    grid-template-columns: 1fr;
  }
  .integrate-copy {
    border-right: 0;
    border-bottom: 1px solid var(--docs-line);
    padding: 28px 22px;
  }
  .integrate-copy .lede {
    max-width: none;
  }
}

@media (max-width: 860px) {
  .docs-hero-wrap {
    padding: 20px 16px 4px;
  }
  .docs-shell {
    grid-template-columns: 1fr;
    padding: 12px 16px 64px;
    gap: 18px;
  }
  .docs-side {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 0;
  }
  .docs-section {
    padding: 22px 20px !important;
  }
  .code-stage .code-block {
    min-height: 0;
  }
}
