:root {
    --paper: #ffffff;
    --surface: #f7f7f8;
    --ink: #171719;
    --muted: #64646d;
    --rule: #e5e5e8;
    --accent: #e4002b;
    --header: 76px;
    color-scheme: light;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-size: 16px;
}
a {
    color: inherit;
    text-underline-offset: 4px;
}
button,
input {
    font: inherit;
}
button {
    cursor: pointer;
}
button,
input {
    border-radius: 0;
}
button {
    color: inherit;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}
::selection {
    background: #e4002b20;
}
html {
    scroll-padding-top: calc(var(--header) + 28px);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
}
.topbar-inner {
    height: var(--header);
    max-width: 1512px;
    padding: 0 34px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 20px;
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -1.4px;
}
.brand span {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 26px;
}
.version-picker {
    position: relative;
    flex-shrink: 0;
}
.version-picker summary {
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}
.version-options {
    position: absolute;
    top: calc(100% + 20px);
    right: 0;
    width: 258px;
    padding: 8px;
    background: var(--paper);
    border: 1px solid var(--ink);
}
.version-options a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;
    padding: 12px;
    text-decoration: none;
    font-size: 13px;
}
.version-options a:hover,
.version-options a[aria-current] {
    background: var(--surface);
    color: var(--accent);
}
.version-options small {
    font-size: 11px;
    color: var(--muted);
}
.version-options .all-versions {
    border-top: 1px solid var(--rule);
    margin-top: 6px;
}
.archive-banner {
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    background: var(--surface);
    margin-bottom: 32px;
    font-size: 13px;
    line-height: 1.6;
}
.archive-banner p {
    margin: 0;
}
.archive-banner strong,
.archive-banner span {
    display: block;
}
.archive-banner span {
    color: var(--muted);
    margin-top: 4px;
}
.search-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    width: 218px;
    border: 1px solid var(--rule);
    background: var(--surface);
    font-size: 13px;
    color: var(--muted);
}
.search-button kbd {
    margin-left: auto;
    border-left: 1px solid var(--rule);
    padding-left: 14px;
    font: inherit;
}
.github-link {
    font-size: 13px;
    text-decoration: none;
}
.github-link:hover,
.brand:hover,
.sidebar-bottom a:hover {
    color: var(--accent);
}
.site-shell {
    max-width: 1512px;
    margin: auto;
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr) 208px;
}
.sidebar {
    position: sticky;
    top: var(--header);
    height: calc(100dvh - var(--header));
    border-right: 1px solid var(--rule);
    padding: 24px 18px 24px 26px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.nav-group {
    margin: 22px 10px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--muted);
}
.nav-group:first-child {
    margin-top: 8px;
}
.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 10px;
    font-size: 13px;
    text-decoration: none;
    border-left: 2px solid transparent;
}
.nav-link:hover {
    background: var(--surface);
}
.nav-link.active {
    background: var(--surface);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.nav-number {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.nav-link.active .nav-number {
    color: var(--accent);
}
.sidebar-bottom {
    margin-top: 34px;
    padding: 20px 12px 0;
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
    gap: 10px;
}
.sidebar-bottom a {
    text-decoration: none;
}
main {
    min-width: 0;
    padding: 54px 54px 32px;
}
.article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.breadcrumb {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}
h1 {
    margin: 0;
    font-size: clamp(35px, 3.6vw, 52px);
    font-weight: 500;
    letter-spacing: -2px;
    line-height: 1.08;
}
.chapter-number {
    color: var(--accent);
    font-size: 79px;
    font-weight: 300;
    letter-spacing: -5px;
    line-height: 0.94;
    font-variant-numeric: tabular-nums;
}
.page-description {
    font-size: 19px;
    line-height: 1.65;
    color: var(--muted);
    margin: 25px 0 34px;
    max-width: 620px;
}
.article {
    border-top: 1px solid var(--rule);
    padding-top: 12px;
    font-size: 15px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}
.article p {
    margin: 20px 0;
}
.article h2 {
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.7px;
    line-height: 1.25;
    margin: 42px 0 18px;
    scroll-margin-top: 15px;
}
.article h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.25px;
    line-height: 1.4;
    margin: 30px 0 12px;
}
.article h2:first-child {
    margin-top: 22px;
}
.article ul,
.article ol {
    padding-left: 23px;
}
.article li {
    margin: 8px 0;
    padding-left: 4px;
}
.article a {
    text-decoration-color: var(--accent);
}
.article a:hover {
    color: var(--accent);
}
.article strong {
    font-weight: 600;
}
.article blockquote {
    border-left: 3px solid var(--accent);
    margin: 26px 0;
    padding: 2px 23px;
    background: var(--surface);
}
.article blockquote p {
    margin: 15px 0;
}
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
    background: var(--surface);
    padding: 3px 5px;
}
.code-block {
    margin: 23px 0;
    background: var(--surface);
    border: 1px solid var(--rule);
    overflow: hidden;
}
.code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 39px;
    padding: 5px 14px;
    border-bottom: 1px solid var(--rule);
    font-size: 11px;
    color: var(--muted);
}
.copy-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0 5px 10px;
    border: 0;
    background: none;
    font-size: 11px;
}
.copy-button svg {
    width: 13px;
    height: 13px;
}
.copy-button:hover {
    color: var(--accent);
}
pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    line-height: 1.75;
    font-size: 13px;
    overflow-wrap: normal;
}
pre code {
    padding: 0;
    font-size: inherit;
    background: none;
}
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--rule);
    margin: 24px 0;
}
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    line-height: 1.7;
}
th {
    text-align: left;
    font-weight: 600;
    background: var(--surface);
}
th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
    min-width: 125px;
}
tr:last-child td {
    border-bottom: 0;
}
td code {
    white-space: nowrap;
    overflow-wrap: normal;
}
.page-toc {
    position: sticky;
    top: var(--header);
    align-self: start;
    max-height: calc(100dvh - var(--header));
    overflow-y: auto;
    padding: 60px 28px 28px 20px;
    font-size: 11px;
}
.page-toc > p {
    margin: 0 0 17px;
    font-weight: 600;
}
.page-toc nav a,
.mobile-toc nav a {
    display: block;
    padding: 7px 0;
    text-decoration: none;
    color: var(--muted);
    line-height: 1.55;
}
.page-toc nav a:hover,
.page-toc nav a[aria-current] {
    color: var(--accent);
}
.toc-top {
    display: inline-block;
    text-decoration: none;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    color: var(--muted);
}
.page-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin-top: 48px;
}
.page-navigation a {
    display: block;
    padding: 22px 14px 22px 0;
    text-decoration: none;
}
.page-navigation span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 9px;
}
.page-navigation strong {
    font-size: 14px;
    font-weight: 500;
}
.page-navigation a:hover strong {
    color: var(--accent);
}
.page-navigation .next-page {
    position: relative;
    text-align: right;
    padding-right: 28px;
    border-left: 1px solid var(--rule);
}
.next-page svg {
    position: absolute;
    right: 0;
    top: 46px;
    width: 15px;
}
.article-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 22px;
    font-size: 10px;
    color: var(--muted);
}
.article-footer a {
    text-decoration: none;
}
.article-footer a:hover {
    color: var(--accent);
}
.mobile-toc,
.menu-button {
    display: none;
}
.icon-button {
    border: 0;
    padding: 8px;
    background: none;
    line-height: 0;
}
.skip-link {
    position: fixed;
    top: -70px;
    left: 18px;
    padding: 12px;
    background: var(--paper);
    color: var(--accent);
    z-index: 100;
    border: 1px solid var(--accent);
}
.skip-link:focus {
    top: 12px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.search-dialog {
    padding: 0;
    width: min(650px, calc(100vw - 32px));
    max-height: min(720px, calc(100dvh - 64px));
    margin-top: min(15vh, 110px);
    border: 1px solid var(--ink);
    background: var(--paper);
}
.search-dialog::backdrop {
    background: #17171950;
}
.search-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--rule);
}
.search-dialog h2 {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--rule);
}
.search-input-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 17px;
    min-width: 0;
    background: var(--paper);
    color: var(--ink);
}
.search-input-wrap:focus-within {
    border-bottom-color: var(--accent);
}
.search-status {
    padding: 0 20px;
    font-size: 12px;
    color: var(--muted);
}
.search-results {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 380px;
    overflow-y: auto;
}
.search-results a {
    display: block;
    text-decoration: none;
    padding: 15px 20px;
    border-top: 1px solid var(--rule);
}
.search-results a:hover,
.search-results a:focus {
    background: var(--surface);
}
.search-results strong {
    font-size: 14px;
    font-weight: 600;
}
.search-results small {
    display: block;
    color: var(--accent);
    font-size: 11px;
    margin-bottom: 5px;
}
.search-results p {
    font-size: 12px;
    line-height: 1.65;
    color: var(--muted);
    margin: 8px 0 0;
}
.search-hint {
    padding: 13px 20px;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 10px;
}
.not-found {
    max-width: 750px;
    padding: 70px 30px;
    margin: auto;
    line-height: 1.8;
}
@media (min-width: 1550px) {
    .site-shell {
        border-left: 1px solid var(--rule);
        border-right: 1px solid var(--rule);
    }
}
@media (max-width: 1250px) {
    .site-shell {
        grid-template-columns: 230px minmax(0, 1fr);
    }
    .page-toc {
        display: none;
    }
    main {
        max-width: 850px;
        padding: 46px;
    }
    .mobile-toc {
        display: block;
        border-top: 1px solid var(--rule);
        border-bottom: 1px solid var(--rule);
        padding: 14px 0;
        margin-bottom: 22px;
        font-size: 12px;
    }
    .mobile-toc summary {
        cursor: pointer;
    }
    .mobile-toc nav {
        margin-top: 10px;
    }
    .mobile-toc + .article {
        border-top: 0;
        padding-top: 0;
    }
}
@media (max-width: 800px) {
    :root {
        --header: 64px;
    }
    .topbar-inner {
        padding: 0 18px;
        gap: 12px;
    }
    .menu-button {
        display: block;
    }
    .brand {
        font-size: 23px;
        gap: 0;
    }
    .brand span,
    .github-link {
        display: none;
    }
    .header-actions {
        margin-left: auto;
        gap: 16px;
    }
    .version-options {
        position: fixed;
        top: var(--header);
        right: 18px;
        width: min(280px, calc(100vw - 36px));
    }
    .search-button {
        width: auto;
        padding: 8px;
        background: var(--paper);
    }
    .search-button span,
    .search-button kbd {
        display: none;
    }
    .site-shell {
        display: block;
    }
    .sidebar {
        display: none;
        position: fixed;
        left: 0;
        bottom: 0;
        top: var(--header);
        width: min(300px, 88vw);
        z-index: 15;
        background: var(--paper);
        border-right-color: var(--ink);
    }
    .sidebar.open {
        display: flex;
    }
    body.nav-open::after {
        content: '';
        position: fixed;
        inset: var(--header) 0 0 0;
        background: #17171950;
        z-index: 10;
    }
    main {
        padding: 35px 24px 25px;
    }
    h1 {
        font-size: 37px;
        letter-spacing: -1.4px;
    }
    .chapter-number {
        font-size: 64px;
        letter-spacing: -4px;
    }
    .article-header {
        gap: 14px;
    }
    .page-description {
        font-size: 17px;
        margin-top: 21px;
    }
    .article {
        font-size: 14px;
    }
    .article h2 {
        font-size: 23px;
    }
    .breadcrumb {
        margin-bottom: 20px;
        font-size: 10px;
    }
    pre {
        padding: 15px;
        font-size: 12px;
    }
    .page-navigation strong {
        font-size: 12px;
    }
    .article-footer {
        flex-wrap: wrap;
    }
}
@media (max-width: 390px) {
    main {
        padding-left: 18px;
        padding-right: 18px;
    }
    .chapter-number {
        font-size: 52px;
    }
    h1 {
        font-size: 32px;
    }
    .header-actions {
        gap: 10px;
    }
}
@media print {
    .topbar,
    .sidebar,
    .page-toc,
    .page-navigation,
    .article-footer,
    .mobile-toc,
    .copy-button {
        display: none;
    }
    .site-shell {
        display: block;
    }
    main {
        padding: 0;
    }
    .chapter-number {
        font-size: 40px;
    }
    pre {
        white-space: pre-wrap;
    }
    a {
        text-decoration: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}

.no-js .search-button,
.no-js .menu-button,
.no-js .copy-button {
    display: none;
}
@media (max-width: 800px) {
    .no-js .sidebar {
        display: flex;
        position: static;
        width: auto;
        height: auto;
        border-bottom: 1px solid var(--rule);
    }
}
