:root {
  --text: #1c1b18;
  --text-2: #46443e;
  --muted: #78756c;
  --line: #e6e4de;
  --line-soft: #efede8;
  --bg: #ffffff;
  --bg-soft: #f8f7f4;
  --link: #2563d8;
  --code-bg: #16171b;
  --code-head: #1e1f24;
  --code-line: #2b2c33;
  --code-text: #e4e4e7;
  --code-muted: #9a9aa3;
  --sans: 'Work Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --top-h: 56px;
  /* The bar, the page and the footer share one width, so the logo, the
     content and the footer line up down the left edge. */
  --page-w: 1112px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15.5px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: #ffe39a; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  padding: 8px 12px; border-radius: 6px; background: var(--text); color: #fff;
  font-size: 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  height: var(--top-h);
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: var(--page-w); height: 100%; margin: 0 auto; padding: 0 32px;
}
.top-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; border-radius: 6px; }
.top-brand img { display: block; }
.top-word {
  font: 800 17px/1 'Bricolage Grotesque', var(--sans);
  letter-spacing: -.03em;
}
.top-slash { color: #cfccc4; font-size: 18px; font-weight: 300; }
.top-docs { font-weight: 500; font-size: 15px; text-decoration: none; color: var(--text); border-radius: 6px; }
.top-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-nav a {
  padding: 6px 10px; border-radius: 6px;
  color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none;
}
.top-nav a:hover { color: var(--text); background: var(--bg-soft); }
.top-site { margin-left: 6px; color: var(--muted) !important; }
.top a:focus-visible,
.doc a:focus-visible,
.outline a:focus-visible,
.foot a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Page: content plus an outline of it on wide screens. */
.page {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 88px;
  max-width: var(--page-w); margin: 0 auto; padding: 0 32px;
}
.doc { width: 100%; min-width: 0; max-width: 760px; padding: 48px 0 96px; }

/* Type */
.doc h1, .doc h2, .doc h3, .doc h4 { color: var(--text); scroll-margin-top: calc(var(--top-h) + 24px); }
.doc h1 {
  margin: 0 0 12px;
  font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em;
}
.lede { margin: 0 0 28px; font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 62ch; }
.doc h2 {
  margin: 64px 0 12px; padding-top: 40px; border-top: 1px solid var(--line);
  font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em;
}
.doc h3 {
  margin: 40px 0 8px;
  font-size: 18.5px; line-height: 1.4; font-weight: 600; letter-spacing: -.01em;
}
.doc h2 + h3 { margin-top: 24px; }
.doc p { margin: 0 0 16px; color: var(--text-2); }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--link); text-decoration: none; }
.doc a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* A # appears beside a heading on hover so a section can be linked to. */
.anchor {
  margin-left: 8px; color: #bdb9b0 !important; font-weight: 400;
  text-decoration: none !important; opacity: 0;
}
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }

/* Inline code */
.doc code {
  font-family: var(--mono); font-size: .86em;
  padding: .12em .38em; border-radius: 5px;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  color: var(--text); overflow-wrap: anywhere;
}
.doc pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }

/* Overview facts */
.facts {
  margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.facts div { display: grid; grid-template-columns: 168px minmax(0, 1fr); }
.facts div + div { border-top: 1px solid var(--line); }
.facts dt {
  padding: 10px 16px; background: var(--bg-soft);
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.facts dd { margin: 0; padding: 10px 16px; font-size: 14.5px; color: var(--text); min-width: 0; }
.facts dd code { background: none; border: 0; padding: 0; font-size: 13.5px; }

/* Endpoint line */
.endpoint {
  display: flex; align-items: center; gap: 10px;
  width: fit-content; max-width: 100%;
  margin: 4px 0 16px !important; padding: 6px 12px 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft);
}
.endpoint code { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; }
.method {
  padding: 3px 6px; border-radius: 4px;
  background: #e3f4ea; color: #106b3f;
  font: 600 11.5px/1.2 var(--mono); letter-spacing: .02em;
}

/* Parameter and attribute lists */
.label {
  margin: 24px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.params { margin: 0 0 20px; padding: 0; list-style: none; }
.label + .params li:first-child { border-top: 0; }
.params li { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.params li:first-child { border-top: 1px solid var(--line); }
.params li:last-child { border-bottom: 1px solid var(--line-soft); }
.param-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.doc .param-name {
  padding: 0; border: 0; background: none;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.param-type { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.param-opt { font-size: 12.5px; color: var(--muted); }
.param-req { color: #b3471d; font-weight: 500; }
.params p { margin: 0; font-size: 15px; line-height: 1.6; }

.tool-name { margin: 32px 0 6px; font-size: 16px; font-weight: 600; }
.doc .tool-name code { font-size: 15px; font-weight: 600; }

/* Code blocks */
.code {
  margin: 0 0 16px; border-radius: 10px; overflow: hidden;
  background: var(--code-bg); border: 1px solid #0c0c0e;
}
.code + .code { margin-top: -4px; }
.code-head {
  display: flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 8px 0 14px;
  background: var(--code-head); border-bottom: 1px solid var(--code-line);
  color: var(--code-muted); font-size: 12.5px; font-weight: 500;
}
.code-head span { margin-right: auto; }
.copy, .doc .code-try {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 9px; border: 0; border-radius: 5px;
  background: transparent; color: var(--code-muted); cursor: pointer;
  font: 500 12.5px/1 var(--sans); text-decoration: none !important;
}
.copy:hover, .doc .code-try:hover { color: #fff; background: rgba(255,255,255,.08); }
.copy:focus-visible, .code-try:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 1px; }
.code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  color: var(--code-text);
  font: 400 13px/1.65 var(--mono);
  tab-size: 2;
}
.tok-key { color: #7ee2a8; }
.tok-str { color: #a5d6ff; }
.tok-num { color: #f2b872; }
.tok-lit { color: #d2a8ff; }
.tok-kw { color: #ff8f86; }
.tok-cmd { color: #ffb366; }
.tok-flag { color: #d2a8ff; }
.tok-com { color: #8b8d96; }

/* Tables */
.table-wrap { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  padding: 9px 14px; text-align: left; white-space: nowrap;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.table td { padding: 10px 14px; vertical-align: top; color: var(--text-2); border-top: 1px solid var(--line-soft); }
.table tr:first-child td { border-top: 0; }
.table td:first-child { white-space: nowrap; }
.table td code { font-size: 12.5px; }

/* Notes */
.note {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 3px solid #d7d3c9; background: var(--bg-soft); border-radius: 0 8px 8px 0;
}
.note p { margin: 0; font-size: 15px; }

/* Outline */
.outline {
  position: sticky; top: var(--top-h); align-self: start;
  max-height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 48px 0 32px; font-size: 13.5px; line-height: 1.4;
  scrollbar-width: thin;
}
.outline-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.outline ol { margin: 0; padding: 0; list-style: none; }
.outline > ol { border-left: 1px solid var(--line); }
.outline ol ol { margin: 2px 0 6px; }
.outline a {
  display: block; margin-left: -1px; padding: 4px 0 4px 14px;
  border-left: 1px solid transparent;
  color: var(--muted); text-decoration: none;
}
.outline ol ol a { padding-left: 26px; font-size: 13px; }
.outline a:hover { color: var(--text); }
.outline a.is-active { color: var(--text); font-weight: 500; border-left-color: var(--text); }

/* Footer */
.foot { border-top: 1px solid var(--line); }
.foot-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  max-width: var(--page-w); margin: 0 auto; padding: 22px 32px 28px;
  color: var(--muted); font-size: 13.5px;
}
.foot a { color: var(--text-2); }
.foot-brand {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font: 800 14px/1 'Bricolage Grotesque', var(--sans); letter-spacing: -.02em; color: var(--text) !important;
}

@media (max-width: 1060px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .outline { display: none; }
}

@media (max-width: 640px) {
  :root { --top-h: 52px; }
  body { font-size: 15.5px; }
  .top-inner, .page, .foot-inner { padding-left: 18px; padding-right: 18px; }
  .top-site { display: none; }
  .top-nav a { padding: 8px 10px; }
  .doc { padding: 32px 0 72px; }
  .doc h1 { font-size: 29px; }
  .lede { font-size: 16.5px; }
  .doc h2 { margin-top: 48px; padding-top: 32px; font-size: 22px; }
  .facts div { grid-template-columns: 1fr; }
  .facts dt { padding: 8px 14px 2px; background: none; font-size: 13px; }
  .facts dd { padding: 0 14px 10px; }
  .code { margin-left: -18px; margin-right: -18px; border-radius: 0; border-left: 0; border-right: 0; }
  .code pre { font-size: 12.5px; }
  .copy, .doc .code-try { height: 36px; padding: 0 12px; }
  /* Three columns do not fit a phone. Each row becomes the status beside its
     meaning, with the example message underneath. */
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px;
    padding: 12px 14px; border-top: 1px solid var(--line-soft);
  }
  .table tr:first-child { border-top: 0; }
  .table td { padding: 0; border: 0; }
  .table td:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  .top-word, .top-slash { display: none; }
}
