/* The docs, laid out the way docs sites usually are: a bar along the top,
   the list of pages down the left, the page in the middle and its headings
   down the right. Light or dark with the reader's device; Terminus's ember
   is the one accent. */
:root {
  color-scheme: light dark;
  --bg: #ffffff; --raised: #f7f7f8; --text: #1a1a1e; --soft: #5e5e68; --faint: #8a8a94;
  --line: #e7e7ea; --accent: #d9481f; --accent-soft: rgb(232 86 42 / 0.1); --code: #f3f3f5;
  --pre: #16161a; --pre-text: #ececf0;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bar: 60px;
}
/* Dark: the device's setting, unless the switch in the bar chose (docs.js
   sets data-theme on <html>). The two blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f10; --raised: #17171a; --text: #ececf0; --soft: #a3a3ad; --faint: #74747e;
    --line: #26262b; --accent: #ff7a4d; --accent-soft: rgb(255 122 77 / 0.14); --code: #1e1e22;
    --pre: #17171a; --pre-text: #ececf0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f10; --raised: #17171a; --text: #ececf0; --soft: #a3a3ad; --faint: #74747e;
  --line: #26262b; --accent: #ff7a4d; --accent-soft: rgb(255 122 77 / 0.14); --code: #1e1e22;
  --pre: #17171a; --pre-text: #ececf0;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans);
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 6px; font-weight: 600; z-index: 3; }
.skip:focus { left: 8px; }

/* The bar */
.bar { position: sticky; top: 0; z-index: 2; height: var(--bar); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.bar .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.bar nav { margin-left: auto; }
.brand { flex: none; display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.logo { flex: none; width: 22px; height: 22px; fill: var(--accent); }
.brand em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.bar nav { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.bar nav a { white-space: nowrap; text-decoration: none; color: var(--soft); padding: 6px 10px; border-radius: 6px; }
.bar nav a:hover { color: var(--text); }
.bar nav .get { margin-left: 8px; color: #fff; background: #d9481f; font-weight: 600; padding: 6px 14px; }
.bar nav .get:hover { color: #fff; background: #c23d17; }

/* Search, and the light/dark switch: both shown by docs.js, so a browser
   without scripts doesn't get controls that do nothing. */
.search { position: relative; flex: 0 1 300px; min-width: 0; margin-left: 16px; }
.search[hidden], .theme[hidden] { display: none; }
.search > svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 34px 0 32px; font: 14px var(--sans); color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg); }
.search kbd { position: absolute; right: 8px; top: 50%; translate: 0 -50%; font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; pointer-events: none; }
.search input:focus ~ kbd { display: none; }
.search ol { position: absolute; top: 44px; left: 0; width: min(480px, calc(100vw - 32px)); max-height: min(70svh, 520px); overflow-y: auto; list-style: none; margin: 0; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / 0.18); }
.search li a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; }
.search li[aria-selected="true"] a, .search li a:hover { background: var(--raised); }
.search li strong { font-size: 14px; font-weight: 600; }
.search li small { margin-left: 8px; font-size: 12px; color: var(--faint); }
.search li span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--soft); }
.search mark { background: none; color: var(--accent); font-weight: 600; }
.search .none { padding: 12px; font-size: 14px; color: var(--soft); }
.theme, .fold { flex: none; width: 36px; height: 36px; display: grid; place-items: center; color: var(--soft); background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.theme:hover, .fold:hover { color: var(--text); background: var(--raised); }
/* Folds the list of pages away, for a wider page. Only where the list sits
   beside the page: on a phone it's already folded into Menu. */
.fold { margin-right: -4px; border-color: transparent; }
.fold[hidden] { display: none; }
:root[data-pages="closed"] .side { display: none; }
:root[data-pages="closed"] .layout { grid-template-columns: minmax(0, 1fr) 220px; }
.theme svg, .fold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* The picture is where a press goes: the sun while it's dark, the moon while it's light. */
.theme .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: block; }
  :root:not([data-theme="light"]) .theme .moon { display: none; }
}
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }

/* Three columns */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; column-gap: 48px; align-items: start; }
.side, .toc { position: sticky; top: var(--bar); max-height: calc(100svh - var(--bar)); overflow-y: auto; padding: 32px 0 40px; }

/* The list of pages */
.side { font-size: 14px; line-height: 1.4; }
.side section + section, .menu section + section { margin-top: 26px; }
.side h2, .menu h2 { margin: 0 0 8px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.side ul, .menu ul { list-style: none; margin: 0; padding: 0; }
.side a, .menu a { display: block; padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--soft); }
.side a:hover, .menu a:hover { color: var(--text); background: var(--raised); }
.side a[aria-current], .menu a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
/* On a phone the list folds away above the page. */
.menu { display: none; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.menu summary { padding: 10px 14px; font-weight: 600; cursor: pointer; }
.menu nav { padding: 4px 2px 12px; border-top: 1px solid var(--line); padding-top: 14px; }

/* On this page */
.toc { font-size: 13px; line-height: 1.4; }
.toc h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--soft); }
.toc a:hover { color: var(--text); border-left-color: var(--faint); }

/* The page */
main { min-width: 0; max-width: 760px; width: 100%; margin: 0 auto; padding: 40px 0 0; }
.title { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
h1 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
.lede { margin: 12px 0 0; font-size: 18px; line-height: 1.5; color: var(--soft); text-wrap: pretty; }

.body > :first-child { margin-top: 0; }
.body p, .body ul, .body ol, .body dl { margin: 0 0 16px; text-wrap: pretty; }
.body ul, .body ol { padding-left: 1.4em; }
.body li { margin-bottom: 6px; }
.body li::marker { color: var(--faint); }
.body h2 { margin: 44px 0 14px; font-size: 24px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; text-wrap: balance; }
.body h2 a { text-decoration: none; }
.body h2 a:hover::after { content: " #"; color: var(--faint); font-weight: 400; }
.body h3 { margin: 30px 0 8px; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
.body p a, .body li a, .body td a, .body dd a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.body p a:hover, .body li a:hover, .body td a:hover, .body dd a:hover { text-decoration-color: var(--accent); }
.body strong { font-weight: 650; }
.body code { font: 0.86em/1.5 var(--mono); overflow-wrap: anywhere; background: var(--code); border: 1px solid var(--line); padding: 0.1em 0.38em; border-radius: 5px; }
.body pre { margin: 0 0 20px; padding: 16px 18px; background: var(--pre); color: var(--pre-text); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font: 13.5px/1.6 var(--mono); tab-size: 2; }
.body pre code { font: inherit; background: none; border: 0; padding: 0; overflow-wrap: normal; }
/* Something on screen: a button, a row in Settings. */
.body b { font-weight: 650; }
.body dt { font-weight: 650; margin-top: 16px; }
.body dd { margin: 4px 0 0; color: var(--soft); }
/* A warning or a summary. */
.panel { margin: 0 0 20px; padding: 14px 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 10px; }
.panel > :last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; margin: 4px 0 20px; font-size: 14.5px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 600; color: var(--soft); }
td:first-child { font-weight: 550; }
/* A field's or key's name stays in one piece; the column grows to hold it. */
td:first-child code { overflow-wrap: normal; white-space: nowrap; }
/* The start page's list of pages. */
.body .cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; }
.body .cards li { margin: 0; position: relative; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 10px; transition: border-color 0.15s, background-color 0.15s; }
.body .cards li:hover { border-color: var(--accent); background: var(--raised); }
.body .cards a { display: block; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.cards a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.cards span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--soft); }

/* Previous and next */
.turn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.turn a { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; transition: border-color 0.15s; }
.turn a:hover { border-color: var(--accent); }
.turn small { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 500; color: var(--soft); }
.turn .next { text-align: right; }

footer { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 56px; padding: 24px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--soft); }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }
footer span { margin-right: auto; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); column-gap: 40px; }
  :root[data-pages="closed"] .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
/* The plain links leave the bar before they'd crowd it. */
@media (max-width: 1040px) {
  .bar nav a:not(.get) { display: none; }
}
@media (max-width: 820px) {
  .layout, :root[data-pages="closed"] .layout { display: block; }
  .side, .fold { display: none; }
  .menu { display: block; }
  main { padding-top: 28px; }
  .search { flex: 1 1 0; margin-left: 4px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .bar .wrap { gap: 10px; }
  .bar nav, .brand em, .search kbd { display: none; }
  /* 16px, or iOS zooms the page in when the box is tapped. */
  .search input { font-size: 16px; }
  .search ol { position: fixed; top: calc(var(--bar) + 4px); left: 16px; }
  h1 { font-size: 28px; }
  .lede { font-size: 17px; }
  .body h2 { font-size: 21px; margin-top: 36px; }
  .body pre { font-size: 12.5px; padding: 14px; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 2px 0; }
  td:first-child { font-weight: 650; }
  footer span { width: 100%; }
}
