:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #14202b;
  --muted: #5b6875;
  --border: #dbe3ea;
  --border-strong: #c3d0dc;
  --brand: #116149;
  --brand-strong: #0b4737;
  --brand-soft: #dff4ec;
  --blue: #2357c6;
  --blue-soft: #e6eefc;
  --amber: #b7791f;
  --amber-soft: #fff4d8;
  --red: #b83232;
  --red-soft: #fde7e7;
  --code-bg: #121923;
  --code-text: #e8eef6;
  --shadow: 0 18px 50px rgb(20 32 43 / 10%);
  --radius: 8px;
  --topbar-height: 64px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  padding: 0.1rem 0.28rem;
  border-radius: 5px;
  background: #eef2f6;
  color: #17212d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.88rem;
  line-height: 1.58;
  white-space: pre;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
}

.brand span {
  display: grid;
  gap: 0;
  line-height: 1.2;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-link {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.topbar-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle {
  display: none;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  height: calc(100vh - var(--topbar-height));
  border-right: 1px solid var(--border);
  background: #fbfcfd;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 18px;
  padding: 24px 20px;
  overflow-y: auto;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input,
.capabilities-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.search-box input {
  padding: 0.65rem 0.75rem;
}

.search-box input:focus,
.capabilities-form input:focus {
  border-color: var(--brand);
  outline: 3px solid rgb(17 97 73 / 16%);
}

.search-results {
  display: none;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.search-results.is-open {
  display: grid;
  gap: 6px;
}

.search-results a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.search-results a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.search-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-nav {
  display: grid;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: #334354;
  font-size: 0.94rem;
  font-weight: 750;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav-link.is-active {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.sidebar-note {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.sidebar-note span {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.sidebar-note strong {
  font-size: 0.92rem;
  line-height: 1.35;
}

.content {
  min-width: 0;
  background: var(--surface);
}

.doc-section {
  scroll-margin-top: calc(var(--topbar-height) + 24px);
  padding: 56px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid var(--border);
}

.doc-section > * {
  max-width: 1040px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 460px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - var(--topbar-height) - 40px);
  background:
    linear-gradient(135deg, rgb(223 244 236 / 62%), transparent 44%),
    linear-gradient(180deg, #fff, #f8fbfc);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: #111b26;
  line-height: 1.15;
}

h1 {
  max-width: 760px;
  margin: 0 0 20px;
  font-size: clamp(2.45rem, 6vw, 4.8rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
}

h3 {
  margin: 28px 0 12px;
  font-size: 1.08rem;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: #3d4b58;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.62rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
}

.button.primary {
  background: var(--brand);
  color: #fff;
}

.button.primary:hover {
  background: var(--brand-strong);
}

.button.secondary {
  border-color: var(--border-strong);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover {
  background: var(--surface-2);
}

.hero-panel,
.code-block {
  min-width: 0;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
  box-shadow: var(--shadow);
}

.hero-panel {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 8%);
}

.hero-panel pre,
.code-block pre {
  margin: 0;
  overflow-x: auto;
}

.hero-panel pre {
  padding: 24px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  background: #0c121a;
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef6262;
}

.terminal-bar span:nth-child(2) {
  background: #f1b44c;
}

.terminal-bar span:nth-child(3) {
  background: #57c785;
}

.terminal-bar strong {
  margin-left: 8px;
  color: #a9b8c8;
  font-size: 0.8rem;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading p:last-child {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.steps,
.metric-grid,
.code-grid {
  display: grid;
  gap: 16px;
}

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

.step-card,
.metric-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.step-card span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
}

.step-card h3 {
  margin: 18px 0 8px;
}

.step-card p,
.metric-card p {
  margin: 0;
  color: var(--muted);
}

.callout {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.callout.warning {
  border-color: #efd388;
  background: var(--amber-soft);
}

.callout strong {
  display: block;
  color: #4a310a;
}

.callout p {
  margin: 6px 0 0;
  color: #5d4619;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 28px;
  align-items: start;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.93rem;
}

th,
td {
  padding: 0.75rem 0.82rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3f6f9;
  color: #3b4856;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
}

.metric-card span {
  color: var(--blue);
  font-size: 1.45rem;
  font-weight: 900;
}

.metric-card strong {
  color: #273442;
}

.code-block {
  position: relative;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid #263344;
}

.code-title {
  min-height: 42px;
  padding: 0.72rem 1rem;
  border-bottom: 1px solid #263344;
  background: #0c121a;
  color: #a9b8c8;
  font-size: 0.82rem;
  font-weight: 850;
}

.code-block pre {
  padding: 18px;
}

.copy-button {
  position: absolute;
  top: 7px;
  right: 8px;
  min-height: 30px;
  padding: 0.3rem 0.55rem;
  border: 1px solid #344357;
  border-radius: 6px;
  background: #1b2634;
  color: #dbe6f2;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.copy-button:hover {
  background: #263448;
}

.endpoint-table table {
  min-width: 1080px;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0.18rem 0.42rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
}

.method.get {
  background: var(--blue-soft);
  color: #17459d;
}

.method.post {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.method.patch {
  background: #efe8ff;
  color: #5f32a7;
}

.method.delete {
  background: var(--red-soft);
  color: var(--red);
}

.capabilities-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  max-width: 920px;
}

.capabilities-form label {
  display: grid;
  gap: 6px;
}

.capabilities-form label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.capabilities-form input {
  padding: 0.62rem 0.75rem;
}

.form-note {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.capabilities-output.is-loading code {
  color: #f9d978;
}

.capabilities-output.is-error code {
  color: #ffb4b4;
}

.example {
  border-top: 1px solid var(--border);
}

.example:last-child {
  border-bottom: 1px solid var(--border);
}

.example summary {
  min-height: 56px;
  padding: 1rem 0;
  color: #1c2a37;
  font-weight: 850;
  cursor: pointer;
}

.example summary:hover {
  color: var(--brand);
}

.example .code-grid {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 12px;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .hero-panel {
    max-width: 640px;
  }

  .steps,
  .metric-grid,
  .split,
  .capabilities-form {
    grid-template-columns: 1fr;
  }

  .capabilities-form .button {
    justify-self: start;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 58px;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-link {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: var(--topbar-height) auto 0 0;
    z-index: 35;
    width: min(86vw, 326px);
    height: auto;
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .content {
    min-height: 100vh;
  }

  .doc-section {
    padding: 42px 20px;
  }

  .hero {
    padding-top: 34px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .brand small {
    display: none;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .hero-panel pre,
  .code-block pre {
    padding: 14px;
  }

  .terminal-bar strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .step-card,
  .metric-card {
    padding: 16px;
  }

  th,
  td {
    padding: 0.65rem 0.7rem;
  }
}
