:root {
  color-scheme: dark;
  --bg: #14161a; --surface: #1b1e23; --raised: #23272e; --fg: #e8ebef; --muted: #9aa4b0;
  --accent: #a6d2ff; --accent-strong: #2462a1; --line: #2f343c; --code: #23272e;
  --header: #1d2a38; --kbd: #2b2f36; --kbd-edge: #0d0f12;
  --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / 30%);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f7f9; --surface: #ffffff; --raised: #eef1f5; --fg: #1b1f24; --muted: #5b6573;
    --accent: #1f5c99; --accent-strong: #2462a1; --line: #dde2e8; --code: #eef1f5;
    --header: #2f4a63; --kbd: #ffffff; --kbd-edge: #c3cad3;
    --shadow: 0 1px 2px rgb(16 24 40 / 8%);
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 10; background: var(--surface); padding: 6px 10px; }

header.top {
  position: sticky; top: 0; z-index: 5; background: var(--header); color: #fff;
  box-shadow: 0 1px 0 rgb(0 0 0 / 25%);
}
header.top .bar {
  max-width: 1160px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
}
header.top .brand {
  display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
  font-weight: 600; font-size: 18px; letter-spacing: 0.01em;
}
header.top .brand img { width: 32px; height: 32px; border-radius: 7px; }
header.top .brand span { opacity: 0.75; font-weight: 400; }
header.top .open {
  margin-left: auto; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; background: var(--accent-strong);
  border: 1px solid rgb(255 255 255 / 25%);
}
header.top .open:hover { filter: brightness(1.12); }

.wrap {
  max-width: 1160px; margin: 0 auto; padding: 28px 20px 48px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px;
}
nav.side { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px);
  overflow-y: auto; font-size: 15px; padding-right: 4px; }
nav.side p { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); }
nav.side p:first-child { margin-top: 0; }
nav.side p strong { font-weight: 600; }
nav.side ul { list-style: none; padding: 0; margin: 0; }
nav.side li a {
  display: block; padding: 5px 10px; border-radius: 8px; color: var(--fg);
  text-decoration: none;
}
nav.side li a:hover { background: var(--raised); }
nav.side li a[aria-current] {
  background: var(--raised); color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

main {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 40px 36px; min-width: 0;
}
main > :first-child { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; font-weight: 650; }
h1 { font-size: 2rem; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin: 1.8em 0 0.6em;
  border-top: 1px solid var(--line); padding-top: 1.1em; }
h1 + h2, h1 + p + h2 { border-top: 0; padding-top: 0; }
h3 { font-size: 1.1rem; margin: 1.5em 0 0.5em; }
h2 .anchor, h3 .anchor { margin-left: 8px; color: var(--muted); text-decoration: none;
  opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
p, ul, ol { margin: 0 0 1em; }
li { margin: 0.25em 0; }
li > ul, li > ol { margin: 0.25em 0 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
img { max-width: 100%; height: auto; }

code {
  font: 0.9em/1.4 ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  background: var(--code); padding: 2px 6px; border-radius: 6px;
}
pre { background: var(--code); padding: 14px 16px; overflow-x: auto; border-radius: 8px;
  border: 1px solid var(--line); }
pre code { padding: 0; background: none; }

table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 0 0 1.2em;
  display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { background: var(--raised); font-weight: 600; font-size: 0.92em; white-space: nowrap; }
tbody tr:hover td { background: color-mix(in srgb, var(--raised) 50%, transparent); }

td code { white-space: pre; }  /* the indents in a pseudocode | Python table */
/* A pseudocode | Python table fits the page: 55:45, long lines (mostly comments) wrap. */
table.code-pair { display: table; table-layout: fixed; }
table.code-pair th:first-child { width: 55%; }
table.code-pair th { white-space: normal; }
table.code-pair td code { white-space: pre-wrap; overflow-wrap: anywhere; }

blockquote {
  margin: 0 0 1.2em; padding: 10px 16px; border-left: 4px solid var(--accent);
  background: var(--raised); border-radius: 0 8px 8px 0; color: var(--fg);
}
blockquote > :last-child { margin-bottom: 0; }

.pager { display: flex; gap: 12px; margin-top: 36px; padding-top: 20px;
  border-top: 1px solid var(--line); }
.pager a { flex: 1; display: block; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--fg); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: 12px; }
.pager .next { text-align: right; }
.pager span { flex: 1; }

footer.bottom { max-width: 1160px; margin: 0 auto; padding: 0 20px 32px;
  color: var(--muted); font-size: 13px; }

@media (max-width: 820px) {
  .wrap { grid-template-columns: 1fr; gap: 16px; padding: 16px 12px 32px; }
  nav.side { position: static; max-height: none; overflow: visible; order: 2; }
  nav.side::before { content: "All help pages"; display: block; font-weight: 600;
    margin: 4px 0 4px; }
  nav.side li a[aria-current] { box-shadow: none; border-color: var(--accent); }
  nav.side ul { display: flex; flex-wrap: wrap; gap: 4px; }
  nav.side li { margin: 0; }
  nav.side li a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 14px; }
  nav.side p { margin: 12px 0 6px; }
  main { padding: 22px 18px; }
  h1 { font-size: 1.65rem; }
  header.top .brand span { display: none; }
}
