/*
 * Omono API reference — the look of the Scalar page (/docs).
 *
 * Scalar's default theme, restyled towards a calm, Stripe-like reference:
 * system fonts, 15px text, Omono blue, a quiet sidebar, dark code panels and
 * attribute lists instead of heavy tables. Mostly Scalar's own CSS variables;
 * the few targeted rules are prefixed with #app so they outrank Scalar's
 * component styles, which load after this file.
 *
 * The page follows Scalar's colour mode: Scalar puts .light-mode or
 * .dark-mode on <body> (from the system setting, or the toggle).
 */

/* ---- Tokens ---- */

:root:root {
  --scalar-font:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --scalar-font-code:
    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono',
    monospace;

  --scalar-heading-1: 28px;
  --scalar-page-description: 17px;
  --scalar-heading-2: 20px;
  --scalar-heading-3: 17px;
  --scalar-heading-4: 15px;
  --scalar-heading-5: 15px;
  --scalar-heading-6: 15px;
  --scalar-paragraph: 15px;
  --scalar-small: 14px;
  --scalar-mini: 13px;
  --scalar-micro: 12px;
  --scalar-font-size-1: 20px;
  --scalar-font-size-2: 15px;
  --scalar-font-size-3: 14px;
  --scalar-font-size-4: 13px;
  --scalar-font-size-5: 12px;

  --scalar-bold: 600;
  --scalar-semibold: 500;

  --scalar-radius: 4px;
  --scalar-border-width: 1px;

  --scalar-content-max-width: 1120px;
  --scalar-sidebar-width: 264px;
  --scalar-custom-header-height: 52px;

  --scalar-text-decoration: none;
  --scalar-text-decoration-hover: underline;
}

body.light-mode,
#app .light-mode {
  --scalar-background-1: #ffffff;
  --scalar-background-2: #f6f8fa;
  --scalar-background-3: #eaeef2;
  --scalar-background-accent: rgba(7, 108, 166, 0.08);
  --scalar-color-1: #1a2330;
  --scalar-color-2: #4c5866;
  --scalar-color-3: #6b7785;
  --scalar-color-accent: #076ca6;
  --scalar-border-color: #e3e8ee;
  --scalar-link-color: #076ca6;
  --scalar-link-color-hover: #054f7a;

  --scalar-color-blue: #076ca6;
  --scalar-color-green: #1a7f4b;
  --scalar-color-orange: #b45309;
  --scalar-color-yellow: #a16207;
  --scalar-color-red: #c0262d;
  --scalar-color-purple: #6941c6;

  --scalar-button-1: #076ca6;
  --scalar-button-1-hover: #065b8c;
  --scalar-button-1-color: #ffffff;

  --scalar-sidebar-background-1: #ffffff;
  --scalar-sidebar-color-1: #1a2330;
  --scalar-sidebar-color-2: #4c5866;
  --scalar-sidebar-border-color: #e3e8ee;
  --scalar-sidebar-item-hover-background: #f3f5f8;
  --scalar-sidebar-item-hover-color: #1a2330;
  --scalar-sidebar-item-active-background: rgba(7, 108, 166, 0.08);
  --scalar-sidebar-color-active: #076ca6;
  --scalar-sidebar-search-background: #ffffff;
  --scalar-sidebar-search-border-color: #dde3ea;
  --scalar-sidebar-search-color: #6b7785;

  --omono-code-background: #1c2733;
  --omono-topbar-background: rgba(255, 255, 255, 0.92);
}

body.dark-mode,
#app .dark-mode {
  --scalar-background-1: #0f1720;
  --scalar-background-2: #16212c;
  --scalar-background-3: #1f2c38;
  --scalar-background-accent: rgba(96, 179, 232, 0.12);
  --scalar-color-1: #e6edf3;
  --scalar-color-2: #aab5c0;
  --scalar-color-3: #808d99;
  --scalar-color-accent: #60b3e8;
  --scalar-border-color: #26333f;
  --scalar-link-color: #60b3e8;
  --scalar-link-color-hover: #8ccaf0;

  --scalar-color-blue: #60b3e8;
  --scalar-color-green: #4cc38a;
  --scalar-color-orange: #f0a35e;
  --scalar-color-yellow: #e5c15a;
  --scalar-color-red: #f07178;
  --scalar-color-purple: #b69cf6;

  --scalar-button-1: #60b3e8;
  --scalar-button-1-hover: #8ccaf0;
  --scalar-button-1-color: #0b1219;

  --scalar-sidebar-background-1: #0f1720;
  --scalar-sidebar-color-1: #e6edf3;
  --scalar-sidebar-color-2: #aab5c0;
  --scalar-sidebar-border-color: #26333f;
  --scalar-sidebar-item-hover-background: #16212c;
  --scalar-sidebar-item-hover-color: #e6edf3;
  --scalar-sidebar-item-active-background: rgba(96, 179, 232, 0.12);
  --scalar-sidebar-color-active: #60b3e8;
  --scalar-sidebar-search-background: #16212c;
  --scalar-sidebar-search-border-color: #26333f;
  --scalar-sidebar-search-color: #808d99;

  --omono-code-background: #0b1219;
  --omono-topbar-background: rgba(15, 23, 32, 0.92);
}

/* ---- Top bar (the same bar as the guide pages, see docs.css) ---- */

body {
  margin: 0;
  background: var(--scalar-background-1, #ffffff);
}

.omono-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-sizing: border-box;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--omono-topbar-background, #ffffff);
  -webkit-backdrop-filter: saturate(1.8) blur(8px);
  backdrop-filter: saturate(1.8) blur(8px);
  border-bottom: 1px solid var(--scalar-border-color, #e3e8ee);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.omono-topbar a {
  color: var(--scalar-color-3, #6b7785);
  text-decoration: none;
}
.omono-topbar a:hover {
  color: var(--scalar-color-1, #1a2330);
}
.omono-topbar .omono-brand {
  color: var(--scalar-color-1, #1a2330);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.omono-topbar .omono-brand span {
  color: var(--scalar-color-accent, #076ca6);
}
.omono-topbar nav {
  display: flex;
  gap: 22px;
}
.omono-topbar nav a {
  white-space: nowrap;
}
.omono-topbar nav a[aria-current='page'] {
  color: var(--scalar-color-accent, #076ca6);
}
@media (max-width: 860px) {
  .omono-topbar {
    padding: 0 16px;
  }
  .omono-topbar nav {
    gap: 16px;
    font-size: 13.5px;
  }
}
@media (max-width: 440px) {
  .omono-topbar nav {
    gap: 14px;
  }
  .omono-topbar .omono-hide-narrow {
    display: none;
  }
}

/* ---- Base ---- */

#app .scalar-app {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Calmer vertical rhythm between sections. */
#app .section {
  padding-top: 64px;
  padding-bottom: 64px;
}

/* The introduction's "Client Libraries" card only picks the language of the
   code samples, but its title reads as a list of SDKs, and Omono has none
   yet. Each operation's sample keeps its own language menu. */
#app .scalar-reference-intro-clients {
  display: none;
}

/* Copy for LLM / View as Markdown at the top of the introduction and of each
   resource section: the spec writes them as links to the section's Markdown
   (/docs/docs.js copies on a `?copy` link). Small outlined buttons, as on
   the guide pages. */
#app .markdown a[href$='.md?copy'],
#app .markdown a[href^='/docs/reference/'][href$='.md'] {
  display: inline-flex;
  align-items: center;
  margin: 0 4px 4px 0;
  padding: 2px 10px;
  border: 1px solid var(--scalar-border-color);
  border-radius: 6px;
  color: var(--scalar-color-2);
  font-size: 13px;
  text-decoration: none;
}
#app .markdown a[href$='.md?copy']:hover,
#app .markdown a[href^='/docs/reference/'][href$='.md']:hover {
  border-color: var(--scalar-color-accent);
  color: var(--scalar-color-accent);
}

/* A section scrolled to from the sidebar takes focus: no outline around it. */
#app .section:focus,
#app .section:focus-visible,
#app .section-container:focus,
#app section:focus {
  outline: none;
}

/* ---- Prose (introduction, resource and operation descriptions) ---- */

#app .markdown {
  --markdown-line-height: 1.65;
  --markdown-spacing-sm: 10px;
  --markdown-spacing-md: 16px;
  --scalar-refs-heading-spacing: 36px;
  font-size: 15px;
  color: var(--scalar-color-1);
}
#app .markdown p,
#app .markdown li {
  font-size: 15px;
}
#app .markdown h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
}
#app .markdown h3 {
  font-size: 17px;
}
#app .markdown h4 {
  font-size: 15px;
}
#app .markdown a {
  color: var(--scalar-link-color);
  text-decoration: none;
  font-weight: 500;
}
#app .markdown a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
#app .markdown code {
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: none;
  border: 1px solid
    color-mix(in srgb, var(--scalar-border-color), transparent 30%);
  background: var(--scalar-background-2);
  color: var(--scalar-color-1);
}
/* Code blocks in descriptions: a dark panel, with the syntax colours of
   Scalar's dark palette (its highlighter reads these variables). */
#app .markdown pre {
  --scalar-color-1: #e6edf3;
  --scalar-color-2: #b7c2cc;
  --scalar-color-3: #8593a0;
  --scalar-color-blue: #8ccaf0;
  --scalar-color-green: #6fd3a0;
  --scalar-color-orange: #f0a35e;
  --scalar-color-purple: #c4a7ff;
  --scalar-color-red: #f38b8f;
  margin: 18px 0 22px;
  border-radius: 8px;
  background: var(--omono-code-background);
}
#app .markdown pre code {
  display: block;
  margin: 0;
  background: none;
  color: #e6edf3;
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
}
#app .markdown blockquote {
  margin-left: 0;
  padding: 12px 16px;
  border: 1px solid
    color-mix(in srgb, var(--scalar-color-accent), transparent 75%);
  border-left: 3px solid var(--scalar-color-accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--scalar-color-accent), transparent 94%);
}
#app .markdown blockquote > :last-child {
  margin-bottom: 0;
}

/* Tables: light, no heavy header. */
#app .markdown table {
  border: 0;
  border-radius: 0;
  width: 100%;
  table-layout: auto;
  margin: 20px 0;
}
#app .markdown th {
  white-space: nowrap;
  word-break: normal;
  background: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--scalar-color-3);
  padding: 8px 12px 8px 0;
  border: 0;
  border-bottom: 1px solid var(--scalar-border-color);
}
#app .markdown td {
  word-break: normal;
  overflow-wrap: break-word;
  font-size: 14px;
  padding: 10px 12px 10px 0;
  border: 0;
  border-bottom: 1px solid var(--scalar-border-color);
  color: var(--scalar-color-1);
}
#app .markdown tr:last-of-type td {
  border-bottom: 0;
}
/* Short keys (a status, an error code) stay on one line. */
#app .markdown td:not(:last-child) code {
  white-space: nowrap;
}
/*
 * On a phone, a three-column table (the Errors table of an operation) becomes
 * a list: the first two cells on one line, the last one underneath, and the
 * header row the same way. Any other table that is too wide scrolls inside
 * its own box.
 */
@media (max-width: 600px) {
  #app .markdown td:last-child {
    overflow-wrap: anywhere;
  }
  #app .markdown table:not(:has(td:first-child > code + br)) {
    display: block;
    overflow-x: auto;
  }
  #app .markdown table:has(th:nth-child(3):last-child) {
    overflow: visible;
  }
  #app .markdown table:has(th:nth-child(3):last-child) > thead,
  #app .markdown table:has(th:nth-child(3):last-child) > tbody {
    display: block;
  }
  #app .markdown table:has(th:nth-child(3):last-child) tr {
    display: flex;
    flex-wrap: wrap;
    column-gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--scalar-border-color);
  }
  #app .markdown table:has(th:nth-child(3):last-child) > thead tr {
    padding: 0 0 8px;
  }
  #app .markdown table:has(th:nth-child(3):last-child) tr:last-of-type {
    border-bottom: 0;
  }
  #app .markdown table:has(th:nth-child(3):last-child) :is(th, td) {
    display: block;
    padding: 0;
    border: 0;
  }
  #app .markdown table:has(th:nth-child(3):last-child) :is(th, td):last-child {
    flex-basis: 100%;
    margin-top: 4px;
  }
}

/*
 * "The <name> object": the generated attribute tables, shown as a Stripe-style
 * attribute list — the name in monospace, the type small and muted beside it,
 * the description underneath, light rules between rows. They are the tables
 * whose first cell is `name`<br>type.
 */
#app .markdown table:has(td:first-child > code + br) {
  display: block;
  margin: 12px 0 0;
}
#app .markdown table:has(td:first-child > code + br) > thead {
  display: none;
}
#app .markdown table:has(td:first-child > code + br) > tbody {
  display: block;
}
#app .markdown table:has(td:first-child > code + br) tr {
  display: block;
  padding: 14px 0 15px;
  border-top: 1px solid var(--scalar-border-color);
}
#app .markdown table:has(td:first-child > code + br) td {
  display: block;
  padding: 0;
  border: 0;
}
#app .markdown table:has(td:first-child > code + br) td:first-child {
  font-size: 12.5px;
  color: var(--scalar-color-3);
  line-height: 1.5;
}
#app .markdown table:has(td:first-child > code + br) td:first-child br {
  display: none;
}
#app
  .markdown
  table:has(td:first-child > code + br)
  td:first-child
  > code:first-child {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--scalar-color-1);
  background: none;
  border: 0;
  padding: 0;
  margin-right: 8px;
}
#app .markdown table:has(td:first-child > code + br) td + td {
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--scalar-color-2);
}
#app .markdown table:has(td:first-child > code + br) td + td:empty {
  display: none;
}

/* "More attributes": a quiet disclosure, like Stripe's "Show child attributes". */
#app .markdown details {
  margin-top: 20px;
  border: 1px solid var(--scalar-border-color);
  border-radius: 8px;
  padding: 0;
}
#app .markdown details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--scalar-color-1);
  border-radius: 8px;
  list-style: none;
}
#app .markdown details > summary::-webkit-details-marker {
  display: none;
}
#app .markdown details > summary::before {
  margin-top: 0;
  width: 14px;
  height: 14px;
}
#app .markdown details > summary:hover {
  background: var(--scalar-background-2);
}
#app .markdown details[open] > summary {
  border-bottom: 1px solid var(--scalar-border-color);
  border-radius: 8px 8px 0 0;
}
#app .markdown details[open] {
  padding-bottom: 0;
}
#app .markdown details > :not(summary) {
  margin: 0 16px;
}
#app .markdown details > table,
#app .markdown details > table:has(td:first-child > code + br) {
  width: auto;
  margin: 0 16px 2px;
}
#app .markdown details > table:has(td:first-child > code + br) tr:first-child {
  border-top: 0;
}

/* ---- Sidebar ---- */

#app .references-sidebar,
#app .t-doc__sidebar {
  font-size: 14px;
}
/* Group headings ("Core resources", "Reference data") in the same small
   capitals as the guide navigation. */
#app .references-sidebar .group\/sidebar-section > .group\/button {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--scalar-color-3);
  margin-top: 10px;
}
#app .sidebar-heading-type {
  font-size: 9.5px;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

/* ---- Operations ---- */

#app .endpoint-method,
#app .request-method {
  font-family: var(--scalar-font-code);
}
#app .scalar-card {
  border-radius: 8px;
}
#app .request-card {
  background: var(--omono-code-background);
}
