/* Light is the house palette of the Fealthy sites; dark is derived from the same hues. Scalar puts
   `light-mode` or `dark-mode` on <body> from a script that runs before first paint, so the
   `prefers-color-scheme` block below only paints the markup right when that script has not run
   (JavaScript off). Scalar's own rules sit in cascade layers, these do not, so they win. */
body,
.light-mode {
  color-scheme: light;
  --docs-focus: #00473d;
  --docs-input-border: #818897;
  --scalar-background-1: #ffffff;
  --scalar-background-2: #f4f8f4;
  --scalar-background-3: #efefef;
  --scalar-background-accent: #effef9;
  --scalar-color-1: #151c16;
  --scalar-color-2: #636a71;
  --scalar-color-3: #636a71;
  --scalar-color-accent: #00473d;
  --scalar-border-color: #e6e6e6;
  --scalar-link-color: #00473d;
  --scalar-link-color-hover: #0a6554;
  --scalar-button-1: #00473d;
  --scalar-button-1-hover: #0a6554;
  --scalar-button-1-color: #ffffff;
  --scalar-color-green: #0a6532;
  --scalar-color-red: #c71a0e;
  --scalar-color-blue: #2446d9;
  --scalar-color-orange: #b45309;
  --scalar-color-yellow: #b45309;
  --scalar-color-purple: #5203d1;
}

.dark-mode {
  color-scheme: dark;
  --docs-focus: #2fcfb4;
  --docs-input-border: #818897;
  --scalar-background-1: #121212;
  --scalar-background-2: #161d18;
  --scalar-background-3: #202822;
  --scalar-background-accent: #112220;
  --scalar-color-1: #f4f8f4;
  --scalar-color-2: #b4bcc6;
  --scalar-color-3: #9aa3ad;
  --scalar-color-accent: #2fcfb4;
  --scalar-border-color: #2a332c;
  --scalar-link-color: #2fcfb4;
  --scalar-link-color-hover: #7fe6d1;
  --scalar-button-1: #2fcfb4;
  --scalar-button-1-hover: #7fe6d1;
  --scalar-button-1-color: #06231d;
  --scalar-color-green: #3fd07a;
  --scalar-color-red: #ff7b72;
  --scalar-color-blue: #8aa4ff;
  --scalar-color-orange: #ff9d57;
  --scalar-color-yellow: #ff9d57;
  --scalar-color-purple: #c2a5ff;
}

@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    color-scheme: dark;
    --docs-focus: #2fcfb4;
    --docs-input-border: #818897;
    --scalar-background-1: #121212;
    --scalar-background-2: #161d18;
    --scalar-background-3: #202822;
    --scalar-background-accent: #112220;
    --scalar-color-1: #f4f8f4;
    --scalar-color-2: #b4bcc6;
    --scalar-color-3: #9aa3ad;
    --scalar-color-accent: #2fcfb4;
    --scalar-border-color: #2a332c;
    --scalar-link-color: #2fcfb4;
    --scalar-link-color-hover: #7fe6d1;
    --scalar-button-1: #2fcfb4;
    --scalar-button-1-hover: #7fe6d1;
    --scalar-button-1-color: #06231d;
    --scalar-color-green: #3fd07a;
    --scalar-color-red: #ff7b72;
    --scalar-color-blue: #8aa4ff;
    --scalar-color-orange: #ff9d57;
    --scalar-color-yellow: #ff9d57;
    --scalar-color-purple: #c2a5ff;
  }
}

body {
  --scalar-sidebar-item-active-background: var(--scalar-background-accent);
  --scalar-custom-header-height: 56px;
  --scalar-font:
    'e-Ukraine', 'e-Ukraine Fallback', 'e-Ukraine Fallback Roboto', Arial, Helvetica, system-ui,
    sans-serif;
  --scalar-font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --scalar-radius: 0.375rem;
  --scalar-radius-lg: 0.5rem;
  --scalar-radius-xl: 0.75rem;
  margin: 0;
  background: var(--scalar-background-1);
  color: var(--scalar-color-1);
  font-family: var(--scalar-font);
  line-height: 1.5;
}

.scalar-app {
  font-family: inherit;
}

/* The page header: Scalar's modern layout has none of its own. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 56px;
  padding: 0 0.75rem;
  background: var(--scalar-background-1);
  border-bottom: 1px solid var(--scalar-border-color);
  font-size: 0.875rem;
}

.site-header a {
  color: var(--scalar-link-color);
}

.site-header a:hover {
  color: var(--scalar-link-color-hover);
}

.site-header a:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--docs-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--scalar-color-1);
  text-decoration: none;
}

.site-header .brand:hover {
  color: var(--scalar-color-1);
}

.brand-mark {
  display: block;
  width: 32px;
  height: 32px;
  flex: none;
}

.brand-wordmark {
  display: block;
  flex: none;
  width: 72px;
  height: auto;
  color: var(--scalar-color-accent);
}

.brand-wordmark svg {
  display: block;
  width: 100%;
  height: auto;
}

.back-short {
  display: none;
}

.brand-label {
  display: none;
  padding-left: 0.5rem;
  border-left: 1px solid var(--scalar-border-color);
  color: var(--scalar-color-2);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--scalar-color-2);
  font-weight: 500;
}

.lang-switch [aria-current='true'] {
  color: var(--scalar-color-1);
  font-weight: 700;
}

.lang-switch a,
.lang-switch [aria-current='true'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2rem;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  border-radius: var(--scalar-radius);
  background: var(--scalar-background-1);
  color: var(--scalar-link-color);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

@media (min-width: 480px) {
  .brand-label {
    display: block;
  }

  .brand-wordmark {
    width: 80px;
  }

  .site-header {
    padding: 0 1rem;
  }
}

@media (max-width: 359px) {
  .back-long {
    display: none;
  }

  .back-short {
    display: inline;
  }
}

@media (max-width: 399px) {
  .site-header {
    gap: 0.5rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .brand-wordmark {
    width: 64px;
  }
}

@media (pointer: coarse) {
  .site-header .back-link,
  .lang-switch a,
  .lang-switch [aria-current='true'] {
    min-height: 44px;
  }

  .site-header .back-link {
    display: inline-flex;
    align-items: center;
  }

  .lang-switch a {
    min-width: 44px;
  }
}

/* A control's only boundary in Scalar's request form is its border, which must reach 3:1. */
.scalar-app input:not([type='checkbox'], [type='radio']),
.scalar-app textarea,
.scalar-app select {
  border-color: var(--docs-input-border);
}

/* Scalar lays an introduction table out with fixed columns and breaks every word anywhere, so a short header
   («Статус») or a status code («400») was split letter by letter in a narrow column. The columns follow their
   content instead: a word stays whole, a header stays on one line, and only a code span longer than 26 characters
   (a JSON body) wraps, inside its own box. A table wider than its box scrolls inside it. */
.scalar-app .markdown.markdown {
  container-type: inline-size;
}

.scalar-app .markdown.markdown table {
  display: block;
  width: 100%;
  overflow-x: auto;
  table-layout: auto;
}

.scalar-app .markdown.markdown th,
.scalar-app .markdown.markdown td {
  word-break: normal;
  overflow-wrap: break-word;
}

.scalar-app .markdown.markdown th {
  white-space: nowrap;
}

.scalar-app .markdown.markdown td code {
  display: inline-block;
  width: max-content;
  max-width: 26ch;
  overflow-wrap: anywhere;
}

/* A box under 700px (a laptop's introduction column): tighter cells, and a code span wraps only at its spaces, so
   a body without spaces widens its column and the table scrolls instead of splitting it. */
@container (width < 700px) {
  .scalar-app .markdown.markdown th,
  .scalar-app .markdown.markdown td {
    padding-inline: 9px;
    font-size: 14px;
  }

  .scalar-app .markdown.markdown td code {
    display: inline;
    width: auto;
    max-width: none;
    overflow-wrap: break-word;
  }
}

/* On a laptop the introduction's left column (the text and its tables) takes more of the row than the server and
   authentication column beside it. */
@container references-container (900px <= width < 1300px) {
  .scalar-app .introduction-section .section-columns > .section-column:first-child {
    flex: 1.7;
  }
}

/* A code sample is wrapped instead of scrolling sideways, so nothing is cut off at rest. */
.scalar-app code.hljs.custom-scroll,
.scalar-app code.hljs.custom-scroll *,
.scalar-app .scalar-code-block-pre,
.scalar-app .scalar-code-block-pre * {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.scalar-app .scalar-code-block-pre {
  width: 100%;
}

.scalar-app .request-card {
  max-height: none;
}

/* The authentication row (the reference's card and the request client's own) keeps the chip beside
   its title («optional», «required») on one line, in full, and never lets the type selector run
   under it. The selector yields instead: it drops under the title when the row is too narrow and
   wraps its own label, so nothing overlaps, nothing is clipped and the page never scrolls sideways. */
.scalar-app [data-testid='auth-indicator'] {
  white-space: nowrap;
}

.scalar-app div:has(> [id^='headlessui-disclosure-button'] [data-testid='auth-indicator']) {
  flex-wrap: wrap;
}

.scalar-app [id^='headlessui-disclosure-button']:has([data-testid='auth-indicator']) {
  flex: none;
  max-width: 100%;
  overflow: visible;
}

.scalar-app [id^='headlessui-disclosure-button']:has([data-testid='auth-indicator']) + div {
  min-width: 0;
  max-width: 100%;
  padding-left: 0.5rem;
}

.scalar-app div:has(> [id^='headlessui-disclosure-button'] [data-testid='auth-indicator']) [id^='headlessui-popover-button'] {
  white-space: normal;
  text-align: start;
}

/* The not-found page. */
.not-found {
  box-sizing: border-box;
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.not-found h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.not-found p {
  margin: 0 0 1rem;
  color: var(--scalar-color-2);
}

.not-found section + section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--scalar-border-color);
}

.not-found a {
  color: var(--scalar-link-color);
  text-decoration: underline;
}

.not-found a:hover {
  color: var(--scalar-link-color-hover);
}

.not-found a:focus-visible {
  outline: 2px solid var(--docs-focus);
  outline-offset: 2px;
}

.noscript-note {
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--scalar-background-2);
  color: var(--scalar-color-2);
  font-size: 0.875rem;
}

/* The phone's section bar shows the name of the operation being read, which is a whole sentence in
   Ukrainian: it is cut with an ellipsis instead of widening the page (and with it the request client). */
.scalar-app .t-doc__header header > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The request client on a phone: it fits the screen, and its address bar wraps instead of scrolling.
   The page was widened to the length of the operation name in the bar above (rule before), and the
   toast area, the close button and the send button each reached past the right edge. Desktop is not touched. */
@media (max-width: 599px) {
  ol.scalar-toaster {
    width: auto !important;
  }

  .scalar-client .app-exit-button,
  .scalar-client .scalar-sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  /* It floats over the page header behind the dimmed backdrop: a solid disc keeps it apart from the header's links. */
  .scalar-client .app-exit-button {
    background: var(--scalar-background-1) !important;
    color: var(--scalar-color-1) !important;
    box-shadow: 0 0 0 1px var(--scalar-border-color);
  }

  .scalar-client .t-app__top-container > div > button[class*='3xl:hidden'] {
    height: auto;
    min-height: 44px;
  }

  .scalar-client .address-bar-bg-states {
    height: auto !important;
    min-height: var(--scalar-address-bar-height);
  }

  .scalar-client .address-bar-bg-states > .scroll-timeline-x {
    flex-wrap: wrap;
    overflow: visible;
    min-width: 0;
  }

  .scalar-client .address-bar-bg-states > .scroll-timeline-x button,
  .scalar-client .address-bar-bg-states > .scroll-timeline-x span {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: start;
  }

  .scalar-client .address-bar-bg-states > button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* The navigation between the reference and the playground. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0 auto 0 1rem;
  color: var(--scalar-color-2);
  font-weight: 500;
}

.site-header .site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.25rem;
  border-bottom: 2px solid transparent;
  color: var(--scalar-link-color);
  text-decoration: none;
}

.site-header .site-nav a[aria-current='page'] {
  border-bottom-color: var(--scalar-color-accent);
  color: var(--scalar-color-1);
  font-weight: 700;
}

@media (pointer: coarse) {
  .site-header .site-nav a {
    min-height: 44px;
  }
}

/* On a phone the navigation takes a second row, and the page's header offset grows with it. */
@media (max-width: 599px) {
  body {
    --docs-header-two-rows: 96px;
    --scalar-custom-header-height: var(--docs-header-two-rows);
  }

  .site-header {
    flex-wrap: wrap;
    align-content: center;
    row-gap: 0;
    height: var(--docs-header-two-rows);
  }

  .site-header .brand,
  .header-actions {
    height: 48px;
  }

  .site-nav {
    order: 3;
    flex: 0 0 100%;
    height: 40px;
    margin: 0;
  }
}
