/* Surge Manual. The palette, header, and article typography follow nssurge.com (Surge-Website:
   src/index.css, src/Header/index.css, src/Blog/blog.css); when the site's look changes, change
   the same values here. */

:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --soft: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #e5e5ea;
  --line-strong: #c7c7cc;
  --paper: #ffffff;
  --card: #ffffff;
  --paper-raise: #f5f5f7;
  --paper-raise-hover: #e8e8ed;
  --header-bg: rgba(255, 255, 255, 0.8);
  --scrim: rgba(0, 0, 0, 0.3);
  --accent: #0a6cff;
  --accent-hover: #0057d6;
  --accent-soft: #eef5ff;
  --focus-ring: rgba(10, 108, 255, 0.2);
  --ok-bg: #e8f8ee;
  --ok-fg: #1a7f37;
  --warn-bg: #fff4d6;
  --warn-fg: #8a5a00;
  --bad-bg: #fdecec;
  --bad-fg: #c42b1c;
  /* Code colors: the GitHub palettes the site's blog uses. */
  --code-comment: #6a737d;
  --code-keyword: #d73a49;
  --code-string: #032f62;
  --code-value: #005cc5;
  --code-title: #6f42c1;
  --code-variable: #e36209;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, monospace;
  --header-height: 56px;
  --gutter: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --soft: #d2d2d7;
  --muted: #a1a1a6;
  --faint: #86868b;
  --line: #2c2c2e;
  --line-strong: #48484a;
  --paper: #000000;
  --card: #161617;
  --paper-raise: #1c1c1e;
  --paper-raise-hover: #2c2c2e;
  --header-bg: rgba(22, 22, 23, 0.8);
  --scrim: rgba(0, 0, 0, 0.6);
  --accent: #2b8cff;
  --accent-hover: #4d9fff;
  --accent-soft: rgba(43, 140, 255, 0.16);
  --focus-ring: rgba(43, 140, 255, 0.35);
  --ok-bg: rgba(48, 209, 88, 0.16);
  --ok-fg: #30d158;
  --warn-bg: rgba(255, 214, 10, 0.14);
  --warn-fg: #ffd60a;
  --bad-bg: rgba(255, 69, 58, 0.16);
  --bad-fg: #ff6961;
  --code-comment: #8b949e;
  --code-keyword: #ff7b72;
  --code-string: #a5d6ff;
  --code-value: #79c0ff;
  --code-title: #d2a8ff;
  --code-variable: #ffa657;
}

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Header: the site's bar, with search in place of the page links. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.site-header-row {
  display: flex;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  align-items: center;
  gap: 12px;
}

.site-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.022em;
}

.site-brand img {
  width: 22px;
  height: 22px;
}

.site-brand-section {
  margin-left: 2px;
  border-left: 1px solid var(--line-strong);
  padding-left: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.011em;
}

.icon-button {
  display: inline-flex;
  margin-left: -8px;
  border-radius: 6px;
  padding: 8px;
  color: var(--soft);
}

.icon-button:hover {
  color: var(--ink);
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

.search-trigger {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--paper-raise);
  padding: 6px 8px 6px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  transition: background-color 0.15s, color 0.15s;
}

.search-trigger:hover {
  background: var(--paper-raise-hover);
  color: var(--ink);
}

.search-trigger svg {
  width: 15px;
  height: 15px;
}

.search-trigger span {
  min-width: 120px;
  text-align: left;
}

kbd {
  display: inline-block;
  min-width: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  padding: 2px 5px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 14px;
  text-align: center;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav-link {
  color: var(--soft);
  font-size: 13px;
  line-height: 1;
}

.site-nav-link:hover {
  color: var(--ink);
}

.site-theme-switch {
  display: inline-flex;
  gap: 2px;
  border-radius: 999px;
  padding: 2px;
  background: var(--paper-raise);
}

.site-theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}

.site-theme-switch button:hover {
  color: var(--ink);
}

:root:not([data-theme="dark"]) .site-theme-switch [data-theme-option="light"] {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .site-theme-switch [data-theme-option="dark"] {
  color: var(--ink);
  background: var(--paper-raise-hover);
}

.site-theme-switch svg {
  width: 15px;
  height: 15px;
}

/* Page frame: contents, article, and the page's own outline. */

.doc-layout {
  display: grid;
  max-width: 1440px;
  margin: 0 auto;
  grid-template-columns: 280px minmax(0, 1fr) 248px;
}

.doc-nav,
.doc-toc {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.doc-nav {
  border-right: 1px solid var(--line);
  padding: 24px 16px 48px calc(var(--gutter) - 12px);
}

.doc-nav h2 {
  margin: 28px 0 6px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

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

.doc-nav a {
  display: block;
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.4;
}

.doc-nav a:hover {
  background: var(--paper-raise);
  color: var(--ink);
}

.doc-nav a.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.doc-scrim {
  display: none;
}

.doc-main {
  width: 100%;
  max-width: calc(760px + var(--gutter) * 2 + 32px);
  min-width: 0;
  margin: 0 auto;
  padding: 48px calc(var(--gutter) + 16px) 48px;
}

.doc-eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.doc-toc {
  padding: 48px var(--gutter) 48px 8px;
}

.doc-toc h2 {
  margin: 0 0 10px;
  padding-left: 13px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.doc-toc ul {
  margin: 0;
  border-left: 1px solid var(--line);
  padding: 0;
  list-style: none;
}

.doc-toc a {
  display: block;
  margin-left: -1px;
  border-left: 1px solid transparent;
  padding: 4px 0 4px 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-toc a[data-depth="1"] {
  padding-left: 24px;
}

.doc-toc a[data-depth="2"] {
  padding-left: 36px;
}

.doc-toc a:hover {
  color: var(--ink);
}

.doc-toc a.is-current {
  border-left-color: var(--accent);
  color: var(--ink);
}

/* Article: the blog's article styles, a step smaller for reference reading. */

.doc-content {
  color: var(--soft);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4,
.doc-content h5,
.doc-content h6 {
  color: var(--ink);
}

.doc-content h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.doc-content h2 {
  margin: 56px 0 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.doc-content h3 {
  margin: 40px 0 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.doc-content h4,
.doc-content h5,
.doc-content h6 {
  margin: 32px 0 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .doc-content h1 {
    font-size: 40px;
  }
}

/* A link to the heading itself, shown while the heading is hovered. */
.heading-anchor {
  margin-left: 0.4em;
  color: var(--faint);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s;
}

:is(h2, h3, h4, h5, h6):hover > .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.doc-content .heading-anchor:hover {
  color: var(--accent);
  text-decoration: none;
}

.doc-content p,
.doc-content ul,
.doc-content ol,
.doc-content blockquote,
.doc-content pre,
.doc-content table,
.doc-content .alert,
.doc-content .code-block {
  margin: 16px 0 0;
}

.doc-content h1 + p {
  margin-top: 20px;
}

.doc-content ul,
.doc-content ol {
  padding-left: 1.4em;
}

.doc-content li > ul {
  list-style: circle;
}

.doc-content li + li,
.doc-content li > ul,
.doc-content li > ol,
.doc-content li > p + p {
  margin-top: 6px;
}

.doc-content li > p {
  margin: 0;
}

.doc-content strong {
  color: var(--ink);
  font-weight: 600;
}

.doc-content a {
  color: var(--accent);
}

.doc-content a:hover {
  text-decoration: underline;
}

.doc-content code {
  border-radius: 6px;
  background: var(--paper-raise);
  padding: 0.12em 0.32em;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: 0;
}

/* The first column of a table is usually a parameter name; keep it on one line. */
.doc-content td:first-child code {
  white-space: nowrap;
}

.doc-content a code {
  color: inherit;
}

.doc-content :is(h1, h2, h3, h4, h5, h6) code {
  font-size: 0.92em;
}

.doc-content pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-raise);
  padding: 16px 20px;
  font-size: 13.5px;
  line-height: 1.65;
  -moz-tab-size: 4;
  tab-size: 4;
}

.doc-content pre code {
  border-radius: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font-size: inherit;
}

.code-block {
  position: relative;
}

.code-block pre {
  margin: 0;
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 4px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  color: var(--ink);
}

/* highlight.js classes, written at build time, plus the two manual.js adds to profile snippets. */
.hljs-comment,
.hljs-quote {
  color: var(--code-comment);
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-doctag {
  color: var(--code-keyword);
}

.hljs-string,
.hljs-regexp {
  color: var(--code-string);
}

.hljs-number,
.hljs-literal,
.hljs-attr,
.hljs-attribute,
.hljs-property,
.hljs-built_in,
.hljs-meta {
  color: var(--code-value);
}

.hljs-title,
.hljs-section {
  color: var(--code-title);
}

.hljs-variable,
.hljs-params,
.hljs-bullet,
.hljs-symbol {
  color: var(--code-variable);
}

.hljs-section {
  font-weight: 600;
}

.doc-content blockquote {
  border-left: 3px solid var(--line);
  padding-left: 16px;
  color: var(--muted);
}

.doc-content blockquote > :first-child {
  margin-top: 0;
}

.doc-content hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

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

.doc-content p > img:only-child {
  display: block;
  margin: 24px auto 0;
  border-radius: 14px;
}

.doc-content table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.55;
}

.doc-content th,
.doc-content td {
  border-bottom: 1px solid var(--line);
  padding: 8px 20px 8px 0;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

/* Version badges: {{ book.VER }} in the sources. */
.badge {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 3px 9px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}

:is(h1, h2, h3) > .badge {
  position: relative;
  top: -0.12em;
}

/* Hint boxes: {% hint style='info|tip|danger|working' %} in the sources. The plugin's icon markup
   needs its own icon font, so the icon is drawn here instead. */
.alert {
  display: flex;
  gap: 12px;
  border-radius: 14px;
  background: var(--hint-bg);
  padding: 14px 16px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.alert::before {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  background: var(--hint-fg);
  content: "";
  -webkit-mask: var(--hint-icon) center / contain no-repeat;
  mask: var(--hint-icon) center / contain no-repeat;
}

.alert .hints-icon {
  display: none;
}

.alert .hints-container {
  min-width: 0;
  flex: 1;
}

.alert .hints-container > :first-child {
  margin-top: 0;
}

.alert code {
  background: rgba(127, 127, 127, 0.14);
}

.alert-info {
  --hint-bg: var(--accent-soft);
  --hint-fg: var(--accent);
  --hint-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.25v3.25a.75.75 0 0 0 1.5 0v-4A.75.75 0 0 0 10 9H9Z'/%3E%3C/svg%3E");
}

.alert-success {
  --hint-bg: var(--ok-bg);
  --hint-fg: var(--ok-fg);
  --hint-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.5a6 6 0 0 0-3.6 10.8c.5.4.85.95.85 1.45v.25h5.5v-.25c0-.5.35-1.05.85-1.45A6 6 0 0 0 10 1.5ZM7.5 15.5v.75c0 1.25 1.1 2.25 2.5 2.25s2.5-1 2.5-2.25v-.75h-5Z'/%3E%3C/svg%3E");
}

.alert-danger {
  --hint-bg: var(--bad-bg);
  --hint-fg: var(--bad-fg);
  --hint-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M8.5 2.9c.67-1.15 2.33-1.15 3 0l6.25 10.85c.67 1.16-.17 2.6-1.5 2.6H3.75c-1.33 0-2.17-1.44-1.5-2.6L8.5 2.9ZM10 6.5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 6.5Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z'/%3E%3C/svg%3E");
}

.alert-warning {
  --hint-bg: var(--warn-bg);
  --hint-fg: var(--warn-fg);
  --hint-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M11.1 1.6a1.75 1.75 0 0 0-2.2 0l-.9.75-1.15.1a1.75 1.75 0 0 0-1.6 1.6l-.1 1.15-.75.9a1.75 1.75 0 0 0 0 2.2l.75.9.1 1.15a1.75 1.75 0 0 0 1.6 1.6l1.15.1.9.75c.64.53 1.56.53 2.2 0l.9-.75 1.15-.1a1.75 1.75 0 0 0 1.6-1.6l.1-1.15.75-.9a1.75 1.75 0 0 0 0-2.2l-.75-.9-.1-1.15a1.75 1.75 0 0 0-1.6-1.6l-1.15-.1-.9-.75ZM10 4.5a.75.75 0 0 1 .75.75V7.5a.75.75 0 0 1-1.5 0V5.25A.75.75 0 0 1 10 4.5Zm0 6.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.5 15.2V18a.5.5 0 0 0 .78.42L10 16.6l2.72 1.82a.5.5 0 0 0 .78-.42v-2.8l-2.02.17-.38.32a1.75 1.75 0 0 1-2.2 0l-.38-.32-2.02-.17Z'/%3E%3C/svg%3E");
}

/* Previous and next pages, as the site's cards. */

.doc-pager {
  display: grid;
  margin-top: 72px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.doc-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 16px 20px;
  transition: border-color 0.15s;
}

.doc-pager a:hover {
  border-color: var(--line-strong);
}

.doc-pager a.is-next {
  grid-column: 2;
  align-items: flex-end;
  text-align: right;
}

.doc-pager span {
  color: var(--muted);
  font-size: 13px;
}

.doc-pager strong {
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
}

.doc-footer {
  display: flex;
  margin-top: 48px;
  flex-wrap: wrap;
  gap: 8px 20px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  color: var(--faint);
  font-size: 12px;
}

.doc-footer p {
  margin: 0;
}

.doc-footer a:hover {
  color: var(--ink);
}

/* Search: a dialog in the site's sheet style. */

.search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: none;
  margin: 12vh auto 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  padding: 0;
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--line);
}

.search-dialog::backdrop {
  background: var(--scrim);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 20px;
  color: var(--muted);
}

.search-field svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: none;
  padding: 18px 0;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  letter-spacing: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-close {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
}

.search-results {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  padding: 8px;
}

.search-results:empty {
  display: none;
}

.search-result {
  display: block;
  border-radius: 12px;
  padding: 10px 12px;
}

.search-result[aria-selected="true"] {
  background: var(--paper-raise);
}

.search-result-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.search-result-title span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-page {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.search-result-text {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.search-result mark {
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
}

.search-note {
  margin: 0;
  padding: 20px 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Narrower windows: the outline goes first, then the contents become a drawer. */

.nav-toggle {
  display: none;
}

@media (max-width: 1199px) {
  .doc-layout {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .doc-toc {
    display: none;
  }
}

@media (max-width: 859px) {
  .nav-toggle {
    display: inline-flex;
  }

  .doc-layout {
    display: block;
  }

  .doc-nav {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(300px, 86vw);
    height: auto;
    background: var(--paper);
    padding-left: 8px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }

  .nav-open .doc-nav {
    transform: none;
    visibility: visible;
  }

  .nav-open .doc-scrim {
    display: block;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    z-index: 20;
    background: var(--scrim);
  }

  .doc-main {
    padding: 32px var(--gutter) 40px;
  }

  .search-trigger span {
    min-width: 0;
  }

  .search-trigger kbd,
  .site-home-link {
    display: none;
  }

  .search-trigger {
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  .site-header,
  .doc-nav,
  .doc-toc,
  .doc-pager,
  .code-copy,
  .search-dialog {
    display: none !important;
  }

  .doc-layout {
    display: block;
  }
}

/* Phones: the search button keeps only its icon, so the bar fits. */
@media (max-width: 479px) {
  .search-trigger span {
    display: none;
  }

  .search-trigger {
    padding: 8px;
  }

  .site-header-row {
    gap: 8px;
  }
}
