/* Developer docs and API reference. Loaded after api-landing.css. */
.dx {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --code-bg: #10102a;
  --code-head: #191938;
  --code-line: #2a2a52;
  --code-text: #e9e9f6;
  --code-muted: #9a9ac0;
  --get: #0d7a52;
  --get-bg: #e3f5ec;
  --post: #3533b5;
  --post-bg: #ebebfb;
  --put: #9a5b00;
  --put-bg: #fbf0dc;
  --header-h: 64px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
}
.dx h1, .dx h2, .dx h3, .dx h4 { color: var(--ink); text-wrap: balance; }
.dx h1 { margin: 0 0 14px; font-size: clamp(2.1rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -0.035em; }
.dx h2 { margin: 0 0 12px; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.025em; }
.dx h3 { margin: 30px 0 10px; font-size: 1.08rem; line-height: 1.35; letter-spacing: -0.01em; }
.dx h4 { margin: 24px 0 6px; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.dx p { margin: 0 0 14px; }
.dx ul, .dx ol { margin: 0 0 16px; padding-left: 20px; }
.dx li { margin: 4px 0; }
.dx a:not([class]) { color: var(--post); text-decoration: none; }
.dx a:not([class]):hover { text-decoration: underline; }
.dx :not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.84em;
  overflow-wrap: anywhere;
}

/* ---------- Header ---------- */
.dx .site-header { min-height: var(--header-h); padding: 0 24px; gap: 18px; }
.dx-tabs { display: flex; align-self: stretch; gap: 4px; margin-left: 18px; }
.dx-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.dx-tabs a:hover { color: var(--ink); }
.dx-tabs a[aria-current="page"] { color: var(--ink); }
.dx-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.dx .site-header nav { gap: 20px; }
.dx .site-header nav a { font-weight: 600; }

/* ---------- Shell ---------- */
.dx-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
}
.dx-nav {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 26px 18px 40px 24px;
  border-right: 1px solid var(--line);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.dx-filter {
  position: relative;
  margin-bottom: 20px;
}
.dx-filter input {
  width: 100%;
  min-height: 36px;
  padding: 7px 30px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.dx-filter input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.16); }
.dx-filter kbd {
  position: absolute;
  top: 8px;
  right: 9px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 18px;
}
.dx-group { margin-bottom: 22px; }
.dx-group > p {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.dx-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  margin-left: -10px;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
  text-decoration: none;
}
.dx-nav a:hover { background: var(--surface); color: var(--ink); }
.dx-nav a[aria-current="true"] { background: var(--post-bg); color: var(--post); font-weight: 600; }
.dx-nav a[hidden], .dx-group[hidden] { display: none; }
.dx-nav .verb { flex: 0 0 auto; }

.dx-main { min-width: 0; padding: 44px 56px 120px; }
.dx-article { max-width: 820px; }

/* ---------- Docs blocks ---------- */
.dx-lead { max-width: 680px; color: var(--muted); font-size: 17px; }
.dx-section { padding: 46px 0 6px; scroll-margin-top: calc(var(--header-h) + 12px); }
.dx-section + .dx-section { border-top: 1px solid var(--line); margin-top: 34px; }
.dx-section > p, .dx-section > ul, .dx-section > ol { max-width: 700px; }
.dx-sub { scroll-margin-top: calc(var(--header-h) + 12px); }
.dx-kicker { margin: 0 0 8px; color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.dx-base {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.dx-base span { color: var(--muted); font-size: 12px; font-weight: 700; }
.dx-base code { border: 0 !important; background: none !important; padding: 0 !important; font-size: 13px !important; }

.dx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 22px 0 8px; }
.dx-card {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.dx-card:hover { border-color: #c7c9d6; box-shadow: 0 10px 26px rgba(2, 1, 90, 0.07); transform: translateY(-2px); }
.dx-card:active { transform: scale(0.98); }
.dx-card strong { color: var(--ink); font-size: 14.5px; }
.dx-card span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.dx-steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 0; }
.dx-step { position: relative; padding: 0 0 30px 46px; scroll-margin-top: calc(var(--header-h) + 12px); }
.dx-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.dx-step::after { content: ""; position: absolute; top: 32px; bottom: 4px; left: 14px; width: 1px; background: var(--line); }
.dx-step:last-child::after { display: none; }
.dx-step h3 { margin-top: 2px; }

.dx-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 22px 0 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dx-flow div { display: grid; gap: 3px; padding: 14px 16px; border-right: 1px solid var(--line); background: var(--canvas); }
.dx-flow div:last-child { border-right: 0; }
.dx-flow b { color: var(--muted); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; }
.dx-flow code { justify-self: start; }
.dx-flow span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.callout {
  display: grid;
  gap: 2px;
  margin: 18px 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--post);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
}
.callout strong { color: var(--ink); }
.callout span { color: var(--muted); }
.callout-warn { border-left-color: #c77800; }

.dx-table { width: 100%; margin: 16px 0 20px; border-collapse: collapse; font-size: 13.5px; }
.dx-table th { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; }
.dx-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.dx-table td:first-child { white-space: nowrap; }
.dx-table-wrap { overflow-x: auto; }

/* ---------- Method badges ---------- */
.verb {
  display: inline-block;
  min-width: 38px;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 17px;
  text-align: center;
}
.verb-get { background: var(--get-bg); color: var(--get); }
.verb-post { background: var(--post-bg); color: var(--post); }
.verb-put { background: var(--put-bg); color: var(--put); }
.dx-endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 4px 0 16px; font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
.dx-endpoint .path { overflow-wrap: anywhere; }

/* ---------- Code panels ---------- */
.code-panel {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--code-line);
  border-radius: 10px;
  background: var(--code-bg);
  box-shadow: 0 10px 30px rgba(2, 1, 90, 0.1);
}
.code-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-head);
}
.code-title { min-width: 0; overflow: hidden; color: var(--code-muted); font-family: var(--mono); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.code-title .verb { margin-right: 6px; background: rgba(255, 255, 255, 0.08); color: #c9c9ff; }
.code-title .verb-get { color: #7fe0b5; }
.code-title .verb-put { color: #ffc36b; }
.code-tabs { display: flex; gap: 2px; margin-left: auto; }
.code-tabs button, .copy-button {
  min-height: 28px;
  padding: 3px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--code-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.code-tabs button:hover, .copy-button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.code-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: #fff; }
.code-tabs + .copy-button { margin-left: 2px; }
.code-title + .copy-button { margin-left: auto; }
.copy-button { display: inline-flex; align-items: center; gap: 6px; }
.copy-button svg { width: 13px; height: 13px; }
.copy-button[data-copied] { color: #7fe0b5; }
.code-panel pre {
  margin: 0;
  padding: 16px 18px 18px;
  border-radius: 0;
  background: transparent;
  color: var(--code-text);
  font-size: 12.5px;
  line-height: 1.7;
  tab-size: 2;
}
.code-panel pre[data-lang] { display: none; }
html[data-lang="curl"] .code-panel pre[data-lang="curl"],
html[data-lang="python"] .code-panel pre[data-lang="python"],
html[data-lang="node"] .code-panel pre[data-lang="node"],
html[data-lang="ruby"] .code-panel pre[data-lang="ruby"] { display: block; }
.code-panel-tall pre { max-height: 560px; overflow: auto; }
.code-panel + .code-panel { margin-top: 14px; }
.code-panel-light { border-color: var(--line); background: var(--surface); box-shadow: none; }
.code-panel-light .code-head { border-color: var(--line); background: var(--surface-strong); }
.code-panel-light .code-title { color: var(--muted); }
.code-panel-light pre { color: var(--text); }
.code-panel-light .copy-button { color: var(--muted); }
.code-panel-light .copy-button:hover { background: rgba(2, 1, 90, 0.06); color: var(--ink); }

.tok-str { color: #a8e6a1; }
.tok-com { color: #8484ad; font-style: italic; }
.tok-key { color: #c6a7ff; }
.tok-lit { color: #ffb27a; }
.tok-num { color: #ffb27a; }
.tok-fn { color: #82c8ff; }
.tok-var { color: #ffd479; }
.tok-flag { color: #82c8ff; }
.tok-sym { color: #82c8ff; }
.tok-prop { color: #9ecbff; }
.code-panel-light .tok-str { color: #0d7a52; }
.code-panel-light .tok-prop { color: #3533b5; }
.code-panel-light .tok-lit, .code-panel-light .tok-num { color: #a14c00; }

/* ---------- Parameters ---------- */
.params { margin: 6px 0 22px; border-top: 1px solid var(--line); }
.param { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.param-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.param-name { color: var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 700; }
.param-type { color: var(--muted); font-size: 12.5px; }
.param-req { color: #b04a00; font-size: 11.5px; font-weight: 700; }
.param-opt { color: var(--muted); font-size: 11.5px; }
.param p { margin: 4px 0 0; color: var(--text); font-size: 13.5px; }
.param .params { margin: 10px 0 0 2px; padding: 0 0 0 14px; border-top: 0; border-left: 1px solid var(--line); }
.param .param:last-child { border-bottom: 0; }
.param details { margin-top: 8px; }
.param summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.param summary::-webkit-details-marker { display: none; }
.param summary::before { content: "+"; font-family: var(--mono); }
.param details[open] > summary::before { content: "\2212"; }
.param summary:hover { color: var(--ink); border-color: #c7c9d6; }

/* ---------- Reference two-column ---------- */
.ref-intro { max-width: 760px; padding-bottom: 10px; }
.ref-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--header-h);
}
.ref-block > div { min-width: 0; }
.ref-code { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.ref-code .code-panel:first-child { margin-top: 0; }
.ref-resource { padding-top: 64px; border-top: 1px solid var(--line); scroll-margin-top: var(--header-h); }
.ref-resource > .ref-block:first-of-type { border-top: 0; padding-top: 18px; }
.ref-resource-head { max-width: 760px; }
.ref-resource-head h2 { font-size: 1.9rem; }
.ref-endpoints { margin: 18px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ref-endpoints p { margin: 0 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ref-endpoints a { display: flex; align-items: center; gap: 9px; min-height: 28px; color: var(--ink); font-family: var(--mono); font-size: 12.5px; text-decoration: none; }
.ref-endpoints a:hover .path { text-decoration: underline; }
.ref-scope { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; color: var(--muted); font-size: 12.5px; }
.ref-scope code { font-size: 11.5px !important; }
.ref-returns { margin-top: 18px; }
.ref-returns p { color: var(--text); font-size: 14px; }

.dx-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 56px;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
}
.dx-foot div { display: grid; gap: 2px; }
.dx-foot span { color: #c8c9e0; font-size: 13px; }
.dx-foot nav { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-foot a { min-height: 38px; display: inline-flex; align-items: center; padding: 7px 13px; border: 1px solid #47477d; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.dx-foot a:hover { background: #151475; }

.dx-mobile-nav { display: none; }

@media (max-width: 1180px) {
  .ref-block { grid-template-columns: 1fr; gap: 6px; }
  .ref-code { position: static; }
  .ref-code .code-panel:first-child { margin-top: 18px; }
}

@media (max-width: 920px) {
  .dx-shell { grid-template-columns: 1fr; }
  .dx-nav { display: none; }
  .dx-main { padding: 28px 20px 90px; }
  .dx-tabs { margin-left: 4px; }
  .dx .site-header nav { display: none; }
  .dx-mobile-nav {
    position: sticky;
    z-index: 15;
    top: var(--header-h);
    display: flex;
    gap: 6px;
    margin: 0 -20px 8px;
    padding: 10px 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    scrollbar-width: none;
  }
  .dx-mobile-nav::-webkit-scrollbar { display: none; }
  .dx-mobile-nav a { flex: 0 0 auto; min-height: 34px; display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
  .dx-flow { grid-template-columns: 1fr 1fr; }
  .dx-flow div:nth-child(2) { border-right: 0; }
  .dx-flow div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .dx { --header-h: 58px; }
  .dx .site-header { padding: 0 14px; gap: 8px; }
  .dx .brand-label { display: none; }
  .dx-tabs a { padding: 0 8px; font-size: 13px; }
  .dx-tabs a[aria-current="page"]::after { right: 8px; left: 8px; }
  .dx .header-action { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .dx-main { padding: 22px 16px 80px; }
  .dx-mobile-nav { margin: 0 -16px 8px; padding: 10px 16px; }
  .code-head { flex-wrap: wrap; padding: 6px 6px 6px 12px; }
  .code-tabs { order: 3; width: 100%; margin-left: -6px; overflow-x: auto; }
  .code-panel pre { padding: 14px; font-size: 11.5px; }
  .dx-flow { grid-template-columns: 1fr; }
  .dx-flow div { border-right: 0; border-bottom: 1px solid var(--line); }
  .dx-flow div:last-child { border-bottom: 0; }
  .dx-step { padding-left: 40px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ref-block-head { border-top: 0; padding-top: 0; }
.ref-title { margin-top: 0; font-size: 1.3rem; }
.dx-top { padding-top: 8px; }
.dx-note { color: var(--muted); font-size: 13.5px; }
.dx-base-block { display: flex; margin: 0 0 14px; }
.dx-limits { margin: 20px 0 8px; border-top: 1px solid var(--line); }
.dx-limits div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dx-limits dt { color: var(--ink); font-size: 13.5px; font-weight: 700; }
.dx-limits dd { margin: 0; font-size: 14px; }
.dx-checklist { list-style: none; padding: 0; }
.dx-checklist li { position: relative; padding: 9px 0 9px 30px; border-bottom: 1px solid var(--line); }
.dx-checklist li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 2px;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
}
@media (max-width: 560px) {
  .dx-limits div { grid-template-columns: 1fr; gap: 2px; }
}
.dx-filter { display: block; }
.code-select { position: relative; margin-left: auto; }
.code-select select {
  min-height: 28px;
  padding: 3px 24px 3px 9px;
  border: 1px solid var(--code-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.code-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 9px;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1.5px solid var(--code-muted);
  border-bottom: 1.5px solid var(--code-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.code-select select:hover { background-color: rgba(255, 255, 255, 0.1); }
.code-select select option { color: #111; }
.code-select + .copy-button { margin-left: 2px; }
.dx-filter input:not(:placeholder-shown) + kbd { display: none; }
