/*
  API documentation (/developers). Scoped to body.tp-site .dv; uses the public
  site tokens from public-next.css. Layout: sidebar | content | on-this-page.
*/

body.tp-site .dv {
  --dv-sticky-top: 104px;
  --dv-code-bg: #172033;
  --dv-code-fg: #E9EDF3;
  --dv-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Same container as the site header (.tp-wrap) so the edges line up. */
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 72px;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 196px;
  grid-template-areas: 'side main toc';
  gap: 40px;
  color: var(--text);
}

/* ---------- sidebar ---------- */
body.tp-site .dv-sidebar {
  grid-area: side;
  position: sticky;
  top: var(--dv-sticky-top);
  align-self: start;
  max-height: calc(100vh - var(--dv-sticky-top) - 16px);
  overflow-y: auto;
  padding: 4px 8px 16px 0;
  font-size: 13px;
}
body.tp-site .dv-side-label,
body.tp-site .dv-side-group {
  margin: 18px 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
body.tp-site .dv-side-label:first-child { margin-top: 0; }
body.tp-site .dv-side-group { margin-top: 14px; color: var(--text-4); }
body.tp-site .dv-side-label-link { color: var(--text-3); text-decoration: none; }
body.tp-site .dv-side-label-link:hover,
body.tp-site .dv-side-label-link.is-active { color: var(--text); }
body.tp-site .dv-side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
body.tp-site .dv-side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  line-height: 18px;
}
body.tp-site .dv-side-link:hover { background: var(--surface); color: var(--text); }
body.tp-site .dv-side-link.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-card); }
body.tp-site .dv-side-op { padding: 5px 10px; }
body.tp-site .dv-side-op-name { min-width: 0; overflow-wrap: anywhere; }
body.tp-site .dv-side-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
body.tp-site .dv-side-foot a { color: var(--text-2); font-size: 12px; }
body.tp-site .dv-menu-toggle { display: none; }

/* ---------- method badges ---------- */
body.tp-site .dv-m {
  flex: 0 0 auto;
  display: inline-block;
  min-width: 42px;
  text-align: center;
  font-family: var(--dv-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 6px;
  padding: 2px 5px;
}
body.tp-site .dv-m-lg { font-size: 12px; padding: 4px 10px; min-width: 0; border-radius: 8px; }
body.tp-site .dv-m-get { background: #E5EEF7; color: #3F6E9B; }
body.tp-site .dv-m-post { background: #E3F2EA; color: #2F7A55; }
body.tp-site .dv-m-patch { background: #F5EFE0; color: #8A7040; }
body.tp-site .dv-m-delete { background: #FBE3DE; color: #C84A31; }

/* ---------- on this page ---------- */
body.tp-site .dv-toc {
  grid-area: toc;
  position: sticky;
  top: var(--dv-sticky-top);
  align-self: start;
  font-size: 12.5px;
}
body.tp-site .dv-toc-label {
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
body.tp-site .dv-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
body.tp-site .dv-toc-link {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  text-decoration: none;
  line-height: 17px;
}
body.tp-site .dv-toc-link:hover { color: var(--text); }
body.tp-site .dv-toc-link.is-active { color: var(--text); border-left-color: var(--accent); }

/* ---------- main column ---------- */
body.tp-site .dv-main { grid-area: main; min-width: 0; }
body.tp-site .dv-main-wide { grid-column: main / toc; }
body.tp-site .dv-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-3); }
body.tp-site .dv-crumbs a { color: var(--text-2); text-decoration: none; }
body.tp-site .dv-crumbs a:hover { color: var(--text); text-decoration: underline; }
body.tp-site .dv-crumb-sep { color: var(--text-4); }

body.tp-site .dv-head { margin-bottom: 8px; }
body.tp-site .dv-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
body.tp-site .dv-h1 { margin: 0 0 14px; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; }
body.tp-site .dv-lede { margin: 0 0 16px; max-width: 720px; font-size: 15.5px; line-height: 26px; color: var(--text-2); }
body.tp-site .dv-notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #F5EFE0; color: #6E5A2E; font-size: 13.5px; }
body.tp-site .dv-head-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
body.tp-site .dv-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
body.tp-site .dv-btn-primary { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }

body.tp-site .dv-endpoint-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-soft); scroll-margin-top: var(--dv-sticky-top); }
body.tp-site .dv-endpoint-path { font-family: var(--dv-mono); font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }

body.tp-site .dv-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
body.tp-site .dv-facts > div { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-soft); }
body.tp-site .dv-facts dt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
body.tp-site .dv-facts dd { margin: 4px 0 0; font-size: 13.5px; line-height: 20px; }

body.tp-site .dv-section { margin-top: 40px; scroll-margin-top: var(--dv-sticky-top); }
body.tp-site .dv-section h2 { margin: 0 0 12px; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
body.tp-site .dv-section h3 { margin: 22px 0 8px; font-size: 15px; font-weight: 600; }
body.tp-site .dv-section p,
body.tp-site .dv-section li { font-size: 14.5px; line-height: 24px; color: var(--text-2); }
body.tp-site .dv-section p { margin: 0 0 12px; max-width: 760px; }
body.tp-site .dv-section a,
body.tp-site .dv-card a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
body.tp-site .dv-section a:hover { text-decoration-color: var(--accent); }
body.tp-site .dv-section ol,
body.tp-site .dv-plain { margin: 0 0 12px; padding-left: 20px; max-width: 760px; }
body.tp-site .dv-section strong { color: var(--text); }

body.tp-site .dv-inline,
body.tp-site .dv-field {
  font-family: var(--dv-mono);
  font-size: 0.88em;
  background: var(--surface-3);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
  overflow-wrap: anywhere;
}
body.tp-site .dv-req { margin-left: 4px; font-size: 10.5px; font-weight: 600; color: var(--accent); }

/* ---------- tables ---------- */
body.tp-site .dv-table-wrap { margin: 0 0 14px; overflow-x: auto; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface); }
body.tp-site .dv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
body.tp-site .dv-table th,
body.tp-site .dv-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); line-height: 20px; }
body.tp-site .dv-table tr:last-child > * { border-bottom: 0; }
body.tp-site .dv-table thead th { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); }
body.tp-site .dv-table tbody th { width: 180px; font-weight: 600; color: var(--text); }
body.tp-site .dv-table td { color: var(--text-2); overflow-wrap: anywhere; }
body.tp-site .dv-type { font-family: var(--dv-mono); font-size: 12px; color: var(--text-2); }

/* ---------- code ---------- */
body.tp-site .dv-tabs,
body.tp-site .dv-json { margin: 0 0 16px; border-radius: 14px; overflow: hidden; background: var(--dv-code-bg); }
body.tp-site .dv-tabs-bar,
body.tp-site .dv-json-bar { display: flex; align-items: center; gap: 2px; padding: 6px 6px 0 8px; background: #121A2B; }
body.tp-site .dv-json-bar { padding: 8px 6px 8px 14px; }
body.tp-site .dv-tab {
  border: 0;
  background: transparent;
  color: #9AA3B2;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 9px 12px 10px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
body.tp-site .dv-tab:hover { color: #FFFFFF; }
body.tp-site .dv-tab.is-active { background: var(--dv-code-bg); color: #FFFFFF; }
body.tp-site .dv-tab:focus-visible,
body.tp-site .dv-copy:focus-visible { outline: 2px solid var(--panel-dark-accent); outline-offset: 1px; }
body.tp-site .dv-copy {
  margin-left: auto;
  align-self: center;
  border: 1px solid #2A3550;
  background: transparent;
  color: #C9D0DB;
  font-family: inherit;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}
body.tp-site .dv-copy:hover { color: #FFFFFF; border-color: #3A4767; }
body.tp-site .dv-code {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--dv-code-fg);
  font-family: var(--dv-mono);
  font-size: 12.5px;
  line-height: 20px;
  white-space: pre;
  tab-size: 2;
}
body.tp-site .dv-code-json { max-height: 560px; overflow-y: auto; }
body.tp-site .dv-json-label { color: #9AA3B2; font-size: 11.5px; font-weight: 500; }
body.tp-site .dv-status { font-family: var(--dv-mono); font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
body.tp-site .dv-status-2xx { background: rgba(47, 122, 85, 0.25); color: #8FD3AE; }
body.tp-site .dv-j-key { color: #9CC4F0; }
body.tp-site .dv-j-str { color: #B7E0A2; }
body.tp-site .dv-j-num { color: #F2C38A; }
body.tp-site .dv-j-lit { color: #E9917B; }

body.tp-site .dv-details { margin: 0 0 10px; }
body.tp-site .dv-details > summary { cursor: pointer; padding: 6px 0; font-size: 14px; }
body.tp-site .dv-details[open] > summary { margin-bottom: 6px; }

/* ---------- cards & lists ---------- */
body.tp-site .dv-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
body.tp-site .dv-card { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-soft); box-shadow: var(--shadow-card); }
body.tp-site .dv-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text); }
body.tp-site .dv-card p { margin: 0 0 10px; font-size: 13.5px; line-height: 21px; color: var(--text-2); }
body.tp-site .dv-card ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 22px; }
body.tp-site .dv-card-link { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s; }
body.tp-site .dv-card-link:hover { border-color: var(--accent-soft); }
body.tp-site .dv-card-link p { margin: 0; }
body.tp-site .dv-cards-compact .dv-card { padding: 16px 18px; }

body.tp-site .dv-steps { padding-left: 22px; }
body.tp-site .dv-steps > li { margin-bottom: 22px; }
body.tp-site .dv-steps > li::marker { font-weight: 700; color: var(--accent); }
body.tp-site .dv-steps h3 { margin: 0 0 6px; }

body.tp-site .dv-ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
body.tp-site .dv-section .dv-ref-list { padding-left: 0; }
body.tp-site .dv-ref-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  text-decoration: none !important;
  color: var(--text) !important;
}
body.tp-site .dv-ref-item:hover { border-color: var(--accent-soft); box-shadow: var(--shadow-card); }
body.tp-site .dv-ref-text { display: flex; flex-direction: column; min-width: 0; }
body.tp-site .dv-ref-name { font-size: 14px; font-weight: 600; line-height: 20px; }
body.tp-site .dv-ref-path { font-family: var(--dv-mono); font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }

body.tp-site .dv-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
body.tp-site .dv-pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
body.tp-site .dv-pager-link:hover { border-color: var(--accent-soft); }
body.tp-site .dv-pager-next { text-align: right; grid-column: 2; }
body.tp-site .dv-pager-dir { font-size: 11px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  body.tp-site .dv { grid-template-columns: 224px minmax(0, 1fr); grid-template-areas: 'side main'; gap: 32px; }
  body.tp-site .dv-toc { display: none; }
  body.tp-site .dv-main-wide { grid-column: auto; }
}
@media (max-width: 860px) {
  body.tp-site .dv { display: block; padding: 16px 32px 56px; }
  body.tp-site .dv-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    height: 38px;
    padding: 0 14px;
    border-radius: 19px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
  }
  body.tp-site .dv-sidebar {
    display: none;
    position: static;
    max-height: none;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
  }
  body.tp-site .dv-sidebar.is-open { display: block; }
  body.tp-site .dv-h1 { font-size: 28px; line-height: 34px; }
  body.tp-site .dv-facts { grid-template-columns: minmax(0, 1fr); }
  body.tp-site .dv-cards { grid-template-columns: minmax(0, 1fr); }
  body.tp-site .dv-table tbody th { width: auto; }
  body.tp-site .dv-pager { grid-template-columns: minmax(0, 1fr); }
  body.tp-site .dv-pager-next { grid-column: auto; }
}
@media (max-width: 640px) {
  /* Matches .tp-wrap's phone padding. */
  body.tp-site .dv { padding-left: 20px; padding-right: 20px; }
}
