/*
  Squirrel API reference: the whole look, as plain CSS (nothing to compile).
  A dark top bar, a light menu, a white text column and a dark code panel.
  Squirrel orange (#ff6a00 to #ff9a00, from the logo) is used for accents only.
  Every text colour meets WCAG AA (4.5:1) on the background it sits on.
*/

:root {
  /* brand */
  --brand: #ff6a00;
  --brand-2: #ff9a00;
  --brand-gradient: linear-gradient(90deg, #ff6a00 0%, #ff9a00 100%);
  --brand-text: #b54708;       /* orange readable as text on white (5.0:1) */
  --brand-tint: #fff4ec;       /* active menu item */

  /* surfaces */
  --topbar-bg: #14171a;
  --nav-bg: #f7f8fa;
  --nav-border: #e4e7eb;
  --main-bg: #ffffff;
  --examples-bg: #1b1f24;      /* the dark code panel */
  --code-bg: #111418;
  --code-annotation-bg: #0b0d10;
  --lang-select-bg: #0f1215;
  --table-head-bg: #f6f8fa;
  --table-border: #e4e7eb;
  --inline-code-bg: #f3f4f6;

  /* text */
  --main-text: #1f2328;
  --muted-text: #57606a;
  --heading-text: #0d1117;
  --nav-text: #24292f;
  --nav-active-text: #9a3412;
  --topbar-text: #ffffff;
  --topbar-muted-text: #c9d1d9;
  --code-text: #e6edf3;

  /* HTTP method badges (white text, all above 4.5:1) */
  --method-get: #047857;
  --method-post: #1d4ed8;
  --method-put: #a15c07;
  --method-delete: #b91c1c;

  /* sizes; under 1000px the menu hides behind the Menu button, under 740px the code moves under the text */
  --topbar-height: 56px;
  --nav-width: 260px;
  --examples-width: 46%;
  --main-padding: 40px;
  --nav-padding: 20px;
  --radius: 8px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
}

/* ---------------------------------------------------------------- general */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  color: var(--main-text);
  background-color: var(--main-bg);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: none;
}

html {
  scroll-padding-top: calc(var(--topbar-height) + 16px);
}

body {
  padding-top: var(--topbar-height);
  box-sizing: border-box;
}

a {
  color: var(--brand-text);
}

/* a dark orange focus ring on the light surfaces, the bright one on the dark top bar and code panel */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 2px;
}

.topbar a:focus-visible, .topbar button:focus-visible, .topbar input:focus-visible,
.dark-box button:focus-visible, .toc-wrapper .lang-selector button:focus-visible, .content pre button:focus-visible {
  outline-color: var(--brand-2);
}

.label-short {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--nav-padding);
  box-sizing: border-box;
  background-color: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 3px solid transparent;
  border-image: var(--brand-gradient) 1;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--topbar-text);
  text-decoration: none;
}

.topbar-brand .logo {
  display: block;
  height: 30px;
  width: auto;
}

.topbar-brand .topbar-title {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.version-badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--brand-2);
  border-radius: 999px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.topbar .search {
  position: relative;
  flex: 1 1 auto;
  max-width: 420px;
}

.topbar .search input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #3a4048;
  border-radius: var(--radius);
  background-color: #23272d;
  color: var(--topbar-text);
  font: inherit;
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
}

.topbar .search input::placeholder {
  color: #a3abb5;
}

.topbar .search input:focus {
  border-color: var(--brand-2);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  max-height: 0;
  overflow-y: auto;
  background: var(--main-bg);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  visibility: hidden;
}

.search-results.visible {
  max-height: 60vh;
  visibility: visible;
  padding: 6px 0;
}

/* docs.js writes links, or one "No results" line */
.search-results li {
  margin: 0;
  padding: 8px 14px;
  line-height: 1.4;
  color: var(--muted-text);
  font-size: 14px;
}

.search-results a {
  display: block;
  margin: -8px -14px;
  padding: 8px 14px;
  color: var(--main-text);
  text-decoration: none;
}

.search-results a:hover, .search-results a:focus {
  background-color: var(--brand-tint);
  color: var(--nav-active-text);
}

.search-results .result-section {
  display: block;
  color: var(--muted-text);
  font-size: 12px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-links a {
  color: var(--topbar-muted-text);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.topbar-links a:hover {
  color: var(--topbar-text);
}

.topbar-links a.topbar-cta {
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--brand-gradient);
  color: #111;
  font-weight: 650;
}

.topbar-links a.topbar-cta:hover {
  color: #000;
  filter: brightness(1.05);
}

/* the button that shows the menu on small screens */
#nav-button {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 10px;
  margin-left: -10px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--topbar-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#nav-button:hover, #nav-button[aria-expanded="true"] {
  background-color: #23272d;
}

.nav-button-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background-color: currentColor;
}

.nav-button-bars::before, .nav-button-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background-color: currentColor;
}

.nav-button-bars::before { top: -6px; }
.nav-button-bars::after { top: 6px; }

/* ---------------------------------------------------------------- menu */

.toc-wrapper {
  position: fixed;
  z-index: 30;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--nav-width);
  padding: 16px 0 24px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  font-size: 14px;
  transition: left 0.3s ease-in-out;
}

/* language tabs for phones (the code panel's own tabs are hidden there) */
.toc-wrapper .lang-selector {
  display: none;
  margin: 0 var(--nav-padding) 16px;
  padding: 4px 8px 0;
  width: auto;
  border-radius: var(--radius);
}

.toc-wrapper ul, .toc-wrapper li {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.toc-wrapper li {
  color: var(--nav-text);
}

/* a group of sections ("Getting started", "Reporting"...) */
.toc-wrapper .toc-group-label {
  padding: 18px var(--nav-padding) 6px;
  color: var(--muted-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* a section that is a group of its own, spaced like a group */
.toc-wrapper .toc-standalone {
  margin-top: 12px;
}

.toc-link, .toc-footer li {
  display: block;
  overflow-x: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--nav-text);
  transition: background-color 120ms linear;
}

.toc-link {
  padding: 6px var(--nav-padding);
  border-left: 3px solid transparent;
}

.toc-h1 {
  font-weight: 600;
}

.toc-link:hover {
  background-color: #eef0f3;
}

/* the section being read */
.toc-link.active {
  background-color: var(--brand-tint);
  border-left-color: var(--brand);
  color: var(--nav-active-text);
  font-weight: 650;
}

/* the parent of the section being read */
.toc-link.active-parent {
  color: var(--heading-text);
}

.toc-list-h2 {
  display: none;
  font-weight: 400;
}

.toc-list-h2.open {
  display: block;
}

.toc-h2 {
  padding-left: calc(var(--nav-padding) + 12px);
  font-size: 13.5px;
}

.toc-wrapper .toc-footer {
  padding: 16px 0 0;
  margin: 20px var(--nav-padding) 0;
  border-top: 1px solid var(--nav-border);
}

.toc-footer li, .toc-footer a {
  color: var(--muted-text);
}

.toc-wrapper .toc-footer li {
  padding: 0;
  font-size: 13px;
  line-height: 1.8;
}

/* ---------------------------------------------------------------- page and code panel */

.page-wrapper {
  margin-left: var(--nav-width);
  position: relative;
  z-index: 10;
  background-color: var(--main-bg);
  min-height: 100%;
  padding-bottom: 1px;
}

/* the dark box gives the code column its background; the content sits on top of it */
.page-wrapper .dark-box {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--examples-width);
  background-color: var(--examples-bg);
}

/* the code panel's language tabs stay under the top bar while scrolling */
.page-wrapper .lang-selector {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  width: calc((100% - var(--nav-width)) * 0.46);
  z-index: 50;
}

.lang-selector {
  display: flex;
  gap: 4px;
  padding: 8px var(--main-padding) 0;
  box-sizing: border-box;
  background-color: var(--lang-select-bg);
  width: 100%;
  overflow-x: auto;
}

.lang-selector button {
  display: inline-block;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #c9d1d9;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 36px;
  cursor: pointer;
  outline-offset: -2px;
}

.lang-selector button:hover {
  color: #fff;
}

.lang-selector button.active {
  color: #fff;
  border-bottom-color: var(--brand-2);
}

/* ---------------------------------------------------------------- text column */

.content {
  position: relative;
  z-index: 30;
  display: block;
  padding-top: 8px;
  line-height: 1.65;
}

.content::after {
  content: '';
  display: block;
  clear: both;
}

.content > h1, .content > h2, .content > h3, .content > h4, .content > p, .content > ul, .content > ol {
  display: block;
  box-sizing: border-box;
  margin-right: var(--examples-width);
  padding: 0 var(--main-padding);
}

.content > ul, .content > ol {
  padding-left: calc(var(--main-padding) + 20px);
}

.content > h1, .content > h2, .content > div {
  clear: both;
}

.content h1, .content h2, .content h3 {
  color: var(--heading-text);
  font-weight: 650;
}

.content h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  padding-top: 48px;
  margin-top: 48px;
  margin-bottom: 20px;
  border-top: 1px solid var(--table-border);
}

.content h1:first-child {
  border-top-width: 0;
  margin-top: 0;
  padding-top: 32px;
}

.content h2 {
  font-size: 21px;
  line-height: 1.3;
  margin-top: 56px;
  margin-bottom: 12px;
}

/* an h2 right after its h1 sits closer to it */
.content h1 + h2 {
  margin-top: 28px;
}

.content h3 {
  font-size: 16px;
  margin-top: 32px;
  margin-bottom: 10px;
}

/* tables: a light header row and thin row lines; a table too wide for the text column scrolls sideways */
.content > table {
  display: block;
  box-sizing: border-box;
  overflow-x: auto;
  margin: 0 calc(var(--examples-width) + var(--main-padding)) 24px var(--main-padding);
  border-collapse: collapse;
  font-size: 14px;
}

.content th, .content td {
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
  border-bottom: 1px solid var(--table-border);
}

.content th {
  padding: 8px 12px;
  background-color: var(--table-head-bg);
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.content td {
  padding: 10px 12px;
}

/* the first column holds the parameter or field name */
.content td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--heading-text);
  white-space: nowrap;
}

.content td:first-child code {
  background: none;
  padding: 0;
}

.content p, .content li {
  line-height: 1.65;
  margin-top: 0;
}

.content p {
  margin-bottom: 14px;
}

.content img {
  max-width: 100%;
}

.content code {
  padding: 2px 5px;
  border-radius: 4px;
  background-color: var(--inline-code-bg);
  font-family: var(--mono);
  font-size: 0.87em;
  word-break: break-all;
}

.content pre > code {
  padding: 0;
  background-color: transparent;
  font-size: 13px;
  word-break: normal;
}

/* notes and warnings: a tinted box with a coloured left edge and a small badge */
.content aside {
  display: block;
  box-sizing: border-box;
  margin: 20px calc(var(--examples-width) + var(--main-padding)) 20px var(--main-padding);
  padding: 14px 18px;
  background-color: #eef4ff;
  border-left: 4px solid #2f5bd3;
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.6;
  color: var(--main-text);
}

.content aside::before {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: 1px;
}

.content aside.notice::before {
  content: 'i' / '';
  background-color: #2f5bd3;
}

.content aside.warning {
  background-color: #fff6ed;
  border-left-color: var(--brand);
}

.content aside.warning::before {
  content: '!' / '';
  background-color: var(--brand-text);
}

.content aside.success {
  background-color: #ecfdf3;
  border-left-color: #047857;
}

.content aside.success::before {
  content: '\2713' / '';
  background-color: #047857;
}

/* ---------------------------------------------------------------- endpoint cards and badges */

/* <div class="endpoint"><span class="method post">POST</span><code class="path">/products/search</code></div> */
.content > .endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 calc(var(--examples-width) + var(--main-padding)) 20px var(--main-padding);
  padding: 10px 14px;
  border: 1px solid var(--table-border);
  border-radius: var(--radius);
  background-color: var(--table-head-bg);
  clear: none;
}

.endpoint .path {
  padding: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading-text);
  word-break: break-all;
}

.method {
  display: inline-block;
  min-width: 52px;
  padding: 3px 8px;
  box-sizing: border-box;
  border-radius: 4px;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 18px;
  text-align: center;
}

.method.get { background-color: var(--method-get); }
.method.post { background-color: var(--method-post); }
.method.put { background-color: var(--method-put); }
.method.delete { background-color: var(--method-delete); }

.badge-on-request {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid #ffd8a8;
  border-radius: 999px;
  background-color: #fff4e5;
  color: #8a4600;
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
}

.endpoint .badge-on-request {
  margin-left: auto;
}

.required {
  display: inline-block;
  white-space: nowrap;
  padding: 0 7px;
  border-radius: 999px;
  background-color: #fef3f2;
  color: #b42318;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-transform: lowercase;
}

.optional {
  color: var(--muted-text);
  font-size: 13px;
}

/* the Quickstart's numbered steps */
.content > ol.steps {
  counter-reset: step;
  list-style: none;
  padding-left: var(--main-padding);
}

.content > ol.steps > li {
  position: relative;
  counter-increment: step;
  padding-left: 40px;
  margin-bottom: 14px;
}

.content > ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #111;
  font-weight: 700;
  font-size: 13px;
  line-height: 26px;
  text-align: center;
}

/* ---------------------------------------------------------------- code samples (the right column) */

.content > div.highlight {
  clear: none;
}

.content pre, .content blockquote {
  float: right;
  clear: right;
  width: var(--examples-width);
  margin: 0;
  box-sizing: border-box;
  background-color: var(--code-bg);
  color: var(--code-text);
}

.content blockquote > p {
  margin: 0;
}

.content pre {
  position: relative;
  padding: 20px var(--main-padding);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

/* "The above command returns JSON structured like this:" */
.content blockquote > p {
  padding: 12px var(--main-padding);
  background-color: var(--code-annotation-bg);
  color: #c9d1d9;
  font-size: 13px;
}

.content blockquote a {
  color: var(--code-text);
}

/* a tabbed sample shows only for the chosen language (docs.js sets it) */
.js .content pre[class*="tab-"] {
  display: none;
}

.js .content pre.tab-active {
  display: block;
}

/* code colouring (docs.js) */
.tok-comment { color: #8b949e; }
.tok-string { color: #a5d6ff; }
.tok-number { color: #ffa657; }
.tok-keyword { color: #ff7b72; }
.tok-key { color: #79c0ff; }
.tok-variable { color: #d2a8ff; }
.tok-flag { color: #7ee787; }

.copy-clipboard {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background-color: #1f242b;
  color: #c9d1d9;
  fill: currentColor;
  font: 600 12px/16px var(--font);
  cursor: pointer;
  opacity: 0.85;
}

.copy-clipboard svg {
  width: 13px;
  height: 13px;
}

.copy-clipboard:hover, .copy-clipboard:focus-visible {
  opacity: 1;
  color: #fff;
  border-color: #8b949e;
}

.copy-clipboard.copied {
  color: #7ee2a8;
  border-color: #2f7a4f;
}

.copy-clipboard.copy-failed {
  color: #ffb4a8;
  border-color: #a8382c;
}

.search-highlight {
  padding: 1px 2px;
  margin: -1px -2px;
  border-radius: 3px;
  background: #ffe2c2;
  color: var(--heading-text);
}

/* ---------------------------------------------------------------- smaller screens */

/* under 1240px the text column would be too narrow beside the code: one column, the samples follow the text
   (the menu stays until 1000px, and the language tabs move into it) */
@media (max-width: 1240px) {
  .topbar-links a.topbar-home {
    display: none;
  }

  /* one column: the code samples follow the text */
  .dark-box {
    display: none;
  }

  .content > h1, .content > h2, .content > h3, .content > h4, .content > p, .content > ul, .content > ol {
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
  }

  .content > ul, .content > ol, .content > ol.steps {
    padding-left: 40px;
  }

  .content aside, .content > .endpoint, .content > table {
    margin-left: 20px;
    margin-right: 20px;
  }

  .content pre, .content blockquote {
    float: none;
    width: auto;
  }

  .content pre {
    margin: 0 20px;
    padding: 16px 20px;
    border-radius: var(--radius);
  }

  .content blockquote {
    margin: 16px 20px 0;
  }

  .content blockquote > p {
    padding: 8px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .content div.highlight + p, .content div.highlight + h3, .content div.highlight + table {
    margin-top: 20px;
  }

  .toc-wrapper .lang-selector {
    display: flex;
  }

  .page-wrapper .lang-selector {
    display: none;
  }
}

@media (max-width: 1000px) {
  .toc-wrapper {
    left: calc(-1 * var(--nav-width));
    visibility: hidden;
    transition: left 0.3s ease-in-out, visibility 0s linear 0.3s;
  }

  .toc-wrapper.open {
    left: 0;
    visibility: visible;
    transition: left 0.3s ease-in-out, visibility 0s linear 0s;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
  }

  .page-wrapper {
    margin-left: 0;
  }

  #nav-button {
    display: inline-flex;
  }

  .topbar-brand .topbar-title {
    display: none;
  }
}

@media (max-width: 740px) {
  .topbar {
    gap: 12px;
    padding: 0 12px;
  }

  .nav-button-text, .version-badge, .topbar-links a:not(.topbar-cta) {
    display: none;
  }

  .topbar-brand .logo {
    height: 24px;
  }

  .topbar-links a.topbar-cta {
    padding: 6px 10px;
    font-size: 13px;
  }

  .topbar-links a.topbar-cta .label-full { display: none; }
  .topbar-links a.topbar-cta .label-short { display: inline; }

  /* the search box is narrow here: its results span the screen under the top bar */
  .topbar .search {
    position: static;
    min-width: 0;
  }

  .search-results {
    position: fixed;
    top: var(--topbar-height);
    left: 8px;
    right: 8px;
  }
}

/* ---------------------------------------------------------------- print */

@media print {
  body {
    padding-top: 0;
  }

  .topbar, .toc-wrapper, .dark-box, .lang-selector, .copy-clipboard {
    display: none !important;
  }

  .page-wrapper {
    margin-left: 0;
  }

  .content > h1, .content > h2, .content > h3, .content > p, .content > ul, .content > ol,
  .content aside, .content > .endpoint {
    margin-right: 0;
  }

  .content > table {
    width: 100%;
    margin-left: 0;
  }

  .content pre, .content blockquote {
    float: none;
    width: auto;
    border: 1px solid #999;
    border-radius: 5px;
    background: none;
    color: #000;
    white-space: pre-wrap;
  }

  .js .content pre[class*="tab-"] {
    display: block;
  }

  .content blockquote > p {
    background: none;
    color: #333;
  }

  [class^="tok-"] {
    color: inherit;
  }

  .method, .badge-on-request, .required {
    border: 1px solid #999;
    background: none;
    color: #000;
  }

  .content h1 {
    border-top: 2px solid #ccc;
  }
}
