/*
 * The customer API docs (M4-030): the guide pages' layout, and one rule for the reference page.
 * Plain CSS, no web fonts and no external URLs - the pages load nothing from another origin.
 */
:root {
  color-scheme: light dark;
  --docs-background: #ffffff;
  --docs-foreground: #1a1a1a;
  --docs-muted: #595959;
  --docs-border: #d9d9d9;
  --docs-surface: #f5f5f5;
  --docs-link: #0b4f8a;
  --docs-accent: #0b1f33;
  --docs-focus: #0b4f8a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --docs-background: #0f1115;
    --docs-foreground: #e8e8e8;
    --docs-muted: #b3b3b3;
    --docs-border: #3a3d44;
    --docs-surface: #1b1e24;
    --docs-link: #8cc4ff;
    --docs-accent: #e8e8e8;
    --docs-focus: #8cc4ff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--docs-background);
  color: var(--docs-foreground);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: var(--docs-link);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--docs-focus);
  outline-offset: 2px;
}

.docs-skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--docs-background);
  border: 1px solid var(--docs-border);
}

.docs-skip:focus {
  top: 0.5rem;
}

.docs-header {
  border-bottom: 1px solid var(--docs-border);
  padding: 0.75rem 1rem;
}

.docs-brand {
  margin: 0;
  font-weight: 600;
}

.docs-brand a {
  color: var(--docs-accent);
  text-decoration: none;
}

.docs-version {
  margin-left: 0.5rem;
  color: var(--docs-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.docs-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.docs-nav {
  flex: 0 0 12rem;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav li {
  margin: 0 0 0.5rem;
}

.docs-nav a[aria-current='page'] {
  color: var(--docs-accent);
  font-weight: 600;
  text-decoration: none;
}

.docs-content {
  flex: 1 1 32rem;
  min-width: 0;
}

.docs-content h1 {
  margin-top: 0;
  font-size: 2rem;
  line-height: 1.25;
}

.docs-content h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--docs-border);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.1em 0.3em;
  background: var(--docs-surface);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* In a table a scope or a path stays on one line; the table scrolls in its region instead. */
th code,
td code {
  white-space: nowrap;
  overflow-wrap: normal;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  line-height: 1.45;
}

.docs-table {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}

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

th {
  background: var(--docs-surface);
}

.docs-footer {
  border-top: 1px solid var(--docs-border);
  padding: 1rem;
  color: var(--docs-muted);
  font-size: 0.875rem;
  text-align: center;
}

.docs-failure {
  padding: 1rem;
}

/* The reference: Redoc draws a light theme of its own, so the page around it stays light too, and
   Redoc lays out its own columns across the full width. */
.docs-reference {
  color-scheme: light;
  --docs-background: #ffffff;
  --docs-foreground: #1a1a1a;
  --docs-muted: #595959;
  --docs-border: #d9d9d9;
  --docs-surface: #f5f5f5;
  --docs-link: #0b4f8a;
  --docs-accent: #0b1f33;
  --docs-focus: #0b4f8a;
}

.docs-reference .docs-layout {
  display: block;
  max-width: none;
  padding: 0;
}

.docs-reference .docs-nav {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--docs-border);
}

.docs-reference .docs-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.docs-reference .docs-nav li {
  margin: 0;
}

/* Redoc's "API docs by Redocly" badge links off-site; its image is patched to an empty inline
   SVG at build time, and the link itself is not shown. */
a[href='https://redocly.com/redoc/'] {
  display: none !important;
}

@media (max-width: 40rem) {
  .docs-nav {
    flex-basis: 100%;
  }
}
