/* Developer documentation. Uses the dashboard's graphite palette. */
:root {
  color-scheme: dark;
  --bg: #181818;
  --panel: #202020;
  --panel-raised: #272727;
  --line: #333;
  --line-bright: #4a4a4a;
  --text: #e7e7e7;
  --body: #c2c2c2;
  --muted: #a3a3a3;
  --link: #90b4ef;
  --code-bg: #141414;
  --focus: #9fb9e8;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
  scrollbar-color: #3f3f3f transparent;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: #44536b;
  color: #fff;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Top bar */
.docs-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #1c1c1c;
}
.docs-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-size: 14px;
}
.docs-brand:hover {
  text-decoration: none;
}
.docs-brand img {
  width: 22px;
  height: 22px;
  filter: invert(1);
  opacity: 0.85;
}
.docs-brand strong {
  font-weight: 650;
  letter-spacing: -0.015em;
}
.docs-brand span {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--line-bright);
  color: var(--muted);
}
.back-link {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}
.docs-sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 28px 14px;
  border-right: 1px solid var(--line);
}
.nav-label {
  margin: 0 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.docs-sidebar nav {
  display: grid;
  gap: 2px;
}
.docs-sidebar nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  color: #c7c7c7;
  font-size: 13px;
}
.docs-sidebar nav a:hover {
  background: var(--panel-raised);
  color: var(--text);
  text-decoration: none;
}
.docs-sidebar nav a.is-active {
  background: #303030;
  color: var(--text);
  font-weight: 600;
}
.docs-sidebar nav a span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.docs-on-page {
  margin-top: 28px;
}
.docs-on-page nav a {
  color: var(--muted);
}
.docs-sidebar-note {
  margin: 28px 10px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--body);
  font-size: 12px;
}
.docs-sidebar-note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.docs-main {
  min-width: 0;
  padding: 40px 48px 64px;
}
#integration-guide {
  max-width: 800px;
}

/* Type */
h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 650;
}
h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
}
h3 {
  margin: 24px 0 10px;
  font-size: 14px;
  font-weight: 600;
}
p {
  margin: 0 0 14px;
  color: var(--body);
  line-height: 1.65;
}
strong {
  color: var(--text);
  font-weight: 600;
}
.page-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.page-head > p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}
.guide-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--muted);
  font-size: 13px;
}
.guide-steps li {
  counter-increment: step;
}
.guide-steps li::before {
  content: counter(step) '.';
  margin-right: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.guide-section {
  padding: 32px 0 18px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 72px;
}
.guide-section:last-of-type {
  border-bottom: 0;
}

/* Code */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}
#integration-guide p code,
#integration-guide td code,
.guide-note code,
.state-cards code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-raised);
  color: #dedede;
}
.code-example {
  position: relative;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  overflow: hidden;
}
.code-example pre {
  margin: 0;
  padding: 44px 16px 16px;
  overflow-x: auto;
  color: #e3e3e3;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
}
.code-example::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 32px;
  border-bottom: 1px solid var(--line);
  background: #1a1a1a;
}
.code-example code {
  font-size: inherit;
  overflow-wrap: normal;
}
.copy-example {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 1;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.copy-example:hover {
  border-color: var(--line-bright);
  color: var(--text);
}

/* Notes */
.guide-note {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-bright);
  border-radius: 6px;
  background: var(--panel);
  color: var(--body);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Tables */
.guide-table-wrap {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.guide-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.55;
}
.guide-table-wrap th {
  padding: 9px 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.guide-table-wrap td {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--body);
  vertical-align: top;
}
.guide-table-wrap td:first-child {
  min-width: 170px;
  color: var(--text);
}

/* Lifecycle states */
.state-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.state-cards article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.state-cards h3 {
  margin: 0 0 6px;
}
.state-cards p {
  font-size: 13px;
}
.state-cards p:first-of-type {
  color: var(--muted);
}
.state-cards article > code {
  display: inline-block;
  margin-bottom: 12px;
}
.guide-footer {
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* API reference */
.reference-intro {
  margin-bottom: 20px;
}
.reference-intro .guide-note {
  margin-bottom: 0;
}
.docs-loading,
.docs-error {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}
.docs-error {
  border-color: #704848;
  background: #2a2020;
}
.docs-error p {
  margin-top: 0;
  color: #ecc0c0;
}
.docs-error button {
  margin-right: 14px;
  padding: 6px 12px;
  border: 1px solid #855858;
  border-radius: 6px;
  background: #3a2a2a;
  color: #edcccc;
  cursor: pointer;
}

/* Swagger UI, restyled onto the same surfaces. */
.swagger-ui,
.swagger-ui .info .title,
.swagger-ui .opblock-tag,
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui .response-col_status,
.swagger-ui table thead tr td,
.swagger-ui table thead tr th,
.swagger-ui .parameter__name,
.swagger-ui .parameter__type,
.swagger-ui .model,
.swagger-ui section.models h4,
.swagger-ui .model-title,
.swagger-ui label,
.swagger-ui .tab li,
.swagger-ui .parameter__in,
.swagger-ui .parameter__extension,
.swagger-ui .parameter__deprecated,
.swagger-ui .response-control-media-type__title,
.swagger-ui .dialog-ux .modal-ux-header h3,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-content p {
  color: #d6d6d6;
}
.swagger-ui {
  font-family: inherit;
}
.swagger-ui .topbar,
.swagger-ui .information-container,
.swagger-ui .download-url-wrapper {
  display: none;
}
.swagger-ui .wrapper {
  max-width: none;
  padding: 0;
}
.swagger-ui .scheme-container {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}
.swagger-ui .filter-container {
  padding: 0 0 16px;
  border: 0;
}
.swagger-ui .filter-container .filter {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.swagger-ui .filter .operation-filter-input {
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #555;
}
.swagger-ui .opblock-tag {
  padding: 12px 0;
  border-color: var(--line);
  font:
    600 15px -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
.swagger-ui .opblock-tag:hover {
  background: transparent;
}
.swagger-ui .opblock {
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: none;
}
.swagger-ui .opblock.opblock-get,
.swagger-ui .opblock.opblock-post,
.swagger-ui .opblock.opblock-put,
.swagger-ui .opblock.opblock-patch,
.swagger-ui .opblock.opblock-delete {
  border-color: var(--line);
  background: var(--panel);
}
.swagger-ui .opblock .opblock-summary {
  align-items: center;
  padding: 6px 8px;
}
.swagger-ui .opblock .opblock-summary-method {
  min-width: 62px;
  padding: 5px 0;
  border-radius: 4px;
  font-size: 11px;
  text-shadow: none;
}
.swagger-ui .opblock.opblock-get .opblock-summary-method {
  background: #3d5f8f;
}
.swagger-ui .opblock.opblock-post .opblock-summary-method {
  background: #3b6b53;
}
.swagger-ui .opblock.opblock-put .opblock-summary-method,
.swagger-ui .opblock.opblock-patch .opblock-summary-method {
  background: #80612e;
}
.swagger-ui .opblock.opblock-delete .opblock-summary-method {
  background: #8a4a4e;
}
.swagger-ui .opblock .opblock-summary-path {
  font-size: 13px;
  font-weight: 600;
}
.swagger-ui .opblock .opblock-summary-description,
.swagger-ui .response-col_links,
.swagger-ui .prop-format {
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
}
.swagger-ui .opblock .opblock-section-header {
  border-block: 1px solid var(--line);
  background: var(--panel-raised);
  box-shadow: none;
}
.swagger-ui .opblock-summary-control:focus:not(:focus-visible) {
  outline: none;
}
.swagger-ui .opblock-body,
.swagger-ui .responses-wrapper {
  overflow-x: auto;
}
.swagger-ui table tbody tr td {
  font-size: 13px;
}
.swagger-ui input,
.swagger-ui select,
.swagger-ui textarea,
.swagger-ui input[type='text'],
.swagger-ui input[type='password'],
.swagger-ui input[type='email'],
.swagger-ui input[type='search'] {
  border: 1px solid #555;
  border-radius: 6px;
  background: #1d1d1d;
  color: #e1e1e1;
  box-shadow: none;
  font-size: 13px;
}
.swagger-ui input::placeholder,
.swagger-ui textarea::placeholder {
  color: var(--muted);
}
.swagger-ui .btn,
.swagger-ui .btn.authorize {
  border-color: #666;
  border-radius: 6px;
  color: #ddd;
  box-shadow: none;
  font-size: 12px;
}
.swagger-ui svg,
.swagger-ui svg path {
  fill: #bbb;
}
.swagger-ui .model-box,
.swagger-ui section.models .model-container {
  background: var(--panel-raised);
}
.swagger-ui .model-toggle:after {
  filter: invert(1);
}
.swagger-ui .renderedMarkdown code,
.swagger-ui .markdown code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #303030;
  color: #dedede;
}
.swagger-ui .prop-type {
  color: #b7a4ec;
}
.swagger-ui .parameter__name.required:after {
  color: #eeaaaa;
}
.swagger-ui .response-control-media-type__accept-message {
  color: #a1d2b2;
}
.swagger-ui .loading-container .loading:after {
  color: var(--muted);
}
.swagger-ui .highlight-code,
.swagger-ui .highlight-code pre {
  border-radius: 6px;
  background: var(--code-bg) !important;
}
.swagger-ui .highlight-code pre {
  font-size: 12.5px;
  line-height: 1.6;
}
.swagger-ui .highlight-code code {
  padding: 0;
  background: transparent;
  color: inherit;
}
.swagger-ui .auth-container {
  border-color: var(--line-bright);
}
.swagger-ui .auth-container:last-of-type {
  padding-bottom: 0;
}
.swagger-ui .auth-container input {
  width: 100%;
}
.swagger-ui .auth-btn-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.swagger-ui .auth-btn-wrapper .btn {
  min-height: 36px;
  margin: 0;
}
.swagger-ui .dialog-ux .backdrop-ux {
  background: rgb(0 0 0 / 65%);
}
.swagger-ui .dialog-ux .modal-ux {
  width: min(660px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 20px 70px rgb(0 0 0 / 30%);
}
.swagger-ui .dialog-ux .modal-ux-header {
  padding: 18px 22px;
  border-bottom-color: var(--line);
}
.swagger-ui .dialog-ux .modal-ux-content {
  padding: 20px 22px;
}

@media (max-width: 1000px) {
  .docs-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .docs-main {
    padding: 32px 28px 56px;
  }
  .state-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .docs-bar {
    padding: 0 16px;
  }
  .docs-brand span {
    display: none;
  }
  .docs-layout {
    display: block;
  }
  .docs-sidebar {
    position: static;
    height: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .docs-sidebar > .nav-label,
  .docs-on-page,
  .docs-sidebar-note {
    display: none;
  }
  .docs-sidebar > nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }
  .docs-sidebar nav a span {
    display: none;
  }
  .docs-main {
    padding: 24px 16px 48px;
  }
  .guide-section {
    padding-top: 26px;
  }
  .code-example pre {
    font-size: 12px;
  }
  .guide-table-wrap td:first-child {
    min-width: 130px;
  }
  .swagger-ui .opblock .opblock-summary {
    flex-wrap: wrap;
    gap: 6px;
  }
  .swagger-ui .opblock .opblock-summary-description {
    flex-basis: 100%;
  }
  .swagger-ui .opblock .opblock-summary-path {
    max-width: calc(100% - 100px);
    font-size: 12px;
  }
}
