:root {
  color-scheme: dark;
  /* Docs roles, mapped onto the brand tokens in brand.css. */
  --bg: var(--rh-bg);
  --panel: var(--rh-surface);
  --fg: var(--rh-heading);
  --text: var(--rh-text);
  --muted: var(--rh-text-muted);
  --faint: var(--rh-text-dim);
  --line: var(--rh-line);
  --line-soft: color-mix(in srgb, var(--rh-line) 60%, transparent);
  --accent: var(--rh-accent);
  --accent-soft: color-mix(in srgb, var(--rh-accent) 10%, transparent);
  --accent-line: color-mix(in srgb, var(--rh-accent) 30%, transparent);
  --code-bg: var(--rh-bg-deep);
  --code-inline: color-mix(in srgb, var(--rh-text) 8%, transparent);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
svg { flex: none; }

/* Header: the home page's brand and nav, made sticky. */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--rh-bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar { max-width: 90rem; height: var(--header); margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bar-left { display: flex; align-items: center; gap: .75rem; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--rh-text); font-size: 20px; font-weight: 700; letter-spacing: -.8px; }
.brand .mark { width: 28px; height: 28px; }
.chip { font: 600 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; padding: 3px 9px 2px; }
.site-nav { display: flex; gap: 24px; font: 12px var(--mono); color: var(--rh-text-2); }
.site-nav a:hover, .site-nav a.is-active { color: var(--accent); }
.menu-btn { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--fg); cursor: pointer; }
.menu-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; }

/* Three columns: sections, article, on this page. */
.docs-grid { display: grid; grid-template-columns: 16rem minmax(0, 1fr) 15rem; gap: 2.5rem; max-width: 90rem; margin: 0 auto; padding: 0 1.5rem; align-items: start; }

.docs-sidebar { position: sticky; top: var(--header); max-height: calc(100vh - var(--header)); overflow-y: auto; padding: 1.25rem 0 3rem; scrollbar-width: thin; }
.docs-sidebar .nav-section { margin: 1.6rem 0 .55rem .8rem; font: 600 .62rem var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.docs-sidebar ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-sidebar a { display: block; margin-left: -1px; padding: .38rem .8rem; border-left: 1px solid transparent; font-size: .875rem; line-height: 1.35; color: var(--muted); transition: color .15s, border-color .15s; }
.docs-sidebar a:hover { color: var(--fg); border-left-color: var(--rh-line-strong); }
.docs-sidebar a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.docs-main { min-width: 0; padding: 2rem 0 5rem; }
.docs-topline, .prose, .pager, .colophon { max-width: 46rem; }
.docs-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.crumb { font: .66rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.md-link { display: inline-flex; align-items: center; gap: .45rem; font: .72rem var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .32rem .8rem; transition: color .15s, border-color .15s; }
.md-link svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.md-link:hover { color: var(--accent); border-color: var(--accent-line); }

/* Prose. */
.prose { font-size: 1rem; line-height: 1.72; color: var(--text); overflow-wrap: break-word; }
.prose h1 { margin: 0 0 1.2rem; color: var(--fg); font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.5rem); line-height: 1.12; font-weight: 700; letter-spacing: -.03em; }
.prose h2 { margin: 2.7rem 0 .9rem; padding-top: .7rem; border-top: 1px solid var(--line-soft); color: var(--fg); font-size: 1.4rem; line-height: 1.3; font-weight: 650; letter-spacing: -.015em; }
.prose h3 { margin: 2rem 0 .6rem; color: var(--fg); font-size: 1.12rem; font-weight: 650; }
.prose h4 { margin: 1.6rem 0 .5rem; color: var(--rh-heading); font-size: 1rem; font-weight: 650; }
.prose .heading-link:hover::after { content: " #"; color: var(--accent); opacity: .6; font-weight: 400; }
.prose .heading-mark { color: var(--accent); opacity: 0; font-weight: 400; text-decoration: none; }
.prose .heading-mark::after { content: "#"; }
.prose :is(h2, h3, h4):hover .heading-mark, .prose .heading-mark:focus-visible { opacity: .6; }
.prose p, .prose ul, .prose ol, .prose dl { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .3rem 0; }
.prose li > p { margin: 0 0 .5rem; }
.prose ol li::marker { color: var(--faint); font-variant-numeric: tabular-nums; }
.prose ul li::marker { color: var(--accent); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose h1 a, .prose h2 a, .prose h3 a, .prose h4 a { color: inherit; text-decoration: none; }
.prose strong { color: var(--fg); font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose blockquote { margin: 0 0 1.3rem; padding: .4rem 0 .4rem 1.1rem; border-left: 3px solid var(--accent-line); color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { max-width: 100%; border: 1px solid var(--line); border-radius: .6rem; }

.prose :not(pre) > code { font: .86em var(--mono); color: var(--rh-text); background: var(--code-inline); border: 1px solid var(--line-soft); border-radius: .35rem; padding: .08em .36em; }
.prose h1 code, .prose h2 code, .prose h3 code { font-size: .86em; font-weight: 500; color: var(--accent); background: none; border: 0; padding: 0; }
.prose a code { color: inherit; }
.prose div.highlighter-rouge { position: relative; margin: 0 0 1.4rem; }
.prose pre { margin: 0 0 1.4rem; padding: 1rem 1.15rem; background: var(--code-bg); border: 1px solid var(--line); border-radius: .75rem; font: .84rem/1.6 var(--mono); color: var(--rh-text); overflow-x: auto; }
.prose div.highlighter-rouge pre { margin: 0; }
.prose pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.prose pre:focus-visible, .prose .table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-btn { position: absolute; top: .55rem; right: .55rem; font: .66rem var(--mono); letter-spacing: .06em; color: var(--muted); background: var(--rh-surface); border: 1px solid var(--line); border-radius: .4rem; padding: .25rem .5rem; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; }
.highlighter-rouge:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); }
@media (hover: none) { .copy-btn { opacity: 1; } }

.table-wrap { margin: 0 0 1.5rem; overflow-x: auto; border: 1px solid var(--line); border-radius: .6rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.prose th { text-align: left; font: 600 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--rh-surface); border-bottom: 1px solid var(--line); padding: .65rem .9rem; white-space: nowrap; }
.prose td { padding: .6rem .9rem; border-top: 1px solid var(--line-soft); vertical-align: top; }
.prose tr:first-child td { border-top: 0; }

/* Previous / next, colophon. */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; }
.pager a { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--fg); font-weight: 600; transition: border-color .15s; }
.pager a span { font: 500 .64rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pager a:hover { border-color: var(--accent-line); }
.pager .next { text-align: right; grid-column: 2; }
.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--faint); }
.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--accent); }

/* On this page. */
.docs-toc { position: sticky; top: var(--header); max-height: calc(100vh - var(--header)); overflow-y: auto; padding: 2.2rem 0 2rem; scrollbar-width: thin; }
.toc-title { margin: 0 0 .75rem; font: 600 .62rem var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-toc a { display: block; margin-left: -1px; padding: .28rem .85rem; border-left: 1px solid transparent; font-size: .8rem; line-height: 1.35; color: var(--muted); transition: color .15s, border-color .15s; }
.docs-toc li[data-depth="3"] a { padding-left: 1.6rem; font-size: .76rem; }
.docs-toc a:hover { color: var(--fg); }
.docs-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

.scrim { display: none; }

@media (max-width: 1200px) {
  .docs-grid { grid-template-columns: 15rem minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-grid { grid-template-columns: minmax(0, 1fr); padding: 0 1.25rem; }
  .menu-btn { display: inline-flex; }
  .site-nav .optional { display: none; }
  .docs-sidebar { position: fixed; top: 0; left: 0; z-index: 60; width: 18rem; max-width: 85vw; height: 100vh; max-height: none; padding: 4.5rem 1.25rem 2rem; background: color-mix(in srgb, var(--rh-bg) 97%, transparent); border-right: 1px solid var(--line); transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  body.nav-open .docs-sidebar { transform: none; visibility: visible; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  .docs-main { padding-top: 1.5rem; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
/* Without scripts the drawer can't open, so the sections list follows the page instead. */
@media (max-width: 860px) and (scripting: none) {
  .menu-btn { display: none; }
  .docs-sidebar { position: static; order: 1; width: auto; max-width: none; height: auto; padding: 1rem 0 2.5rem; background: none; border-right: 0; border-top: 1px solid var(--line); transform: none; visibility: visible; transition: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Skip link, and the sidebar's way to Progress. */
.skip { position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: .5rem .9rem; background: var(--rh-action); color: var(--rh-action-ink); border-radius: .4rem; font-weight: 600; }
.skip:focus { top: .75rem; }
.sidebar-progress { display: block; margin: .4rem 0 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .6rem; font-size: .84rem; line-height: 1.35; color: var(--fg); transition: border-color .15s; }
.sidebar-progress span { color: var(--accent); }
.sidebar-progress:hover { border-color: var(--accent-line); }
@media (max-width: 360px) { .chip { display: none; } }
