@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("https://static-2v.gitbook.com/_next/static/media/e4af272ccee01ff0-s.woff2?dpl=p-7595706b92d6c939e2e81c1a110b3e") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("https://static-2v.gitbook.com/_next/static/media/e4af272ccee01ff0-s.woff2?dpl=p-7595706b92d6c939e2e81c1a110b3e") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("https://static-2v.gitbook.com/_next/static/media/e4af272ccee01ff0-s.woff2?dpl=p-7595706b92d6c939e2e81c1a110b3e") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("https://static-2v.gitbook.com/_next/static/media/e4af272ccee01ff0-s.woff2?dpl=p-7595706b92d6c939e2e81c1a110b3e") format("woff2");
}

:root {
    color-scheme: dark;
    --bg: #1d1d1d;
    --bg-sidebar: #161616;
    --bg-elevated: #222222;
    --bg-soft: #262626;
    --bg-muted: #2b2b2b;
    --bg-code: #151515;
    --tint-hover: rgba(255, 255, 255, 0.04);
    --tint-subtle: rgba(255, 255, 255, 0.06);
    --text: #fefffe;
    --text-strong: #fefffe;
    --text-body: #ededed;
    --text-muted: #bfbfbf;
    --text-subtle: #8a8a8a;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.12);
    --primary: #00ff9d;
    --primary-strong: #00e68d;
    --primary-soft: rgba(0, 255, 157, 0.12);
    --primary-subtle: rgba(0, 255, 157, 0.18);
    --warning: #fe9a00;
    --warning-soft: rgba(254, 154, 0, 0.1);
    --success: #00c950;
    --success-soft: rgba(0, 201, 80, 0.1);
    --danger: #fb2c36;
    --danger-soft: rgba(251, 44, 54, 0.1);
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --sidebar-width: 288px;
    --toc-width: 256px;
    --content-width: 48rem;
    --topbar-height: 4rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.625;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

::selection {
    background: var(--primary-subtle);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-strong);
}

img,
iframe {
    max-width: 100%;
}

code,
pre {
    font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;
}

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--topbar-height);
    padding: 0.75rem 1.5rem;
    background: rgba(29, 29, 29, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.topbar-start,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: var(--text);
}

.brand img {
    display: block;
    width: auto;
    height: 2rem;
    max-width: min(14rem, 42vw);
    object-fit: contain;
    object-position: left center;
    flex: none;
}

.brand-label {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ---------- Search (header, right-aligned) ---------- */

.search {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: min(22rem, 45vw);
}

.search-input {
    width: 100%;
    min-height: 2.25rem;
    padding: 0.5rem 2.5rem 0.5rem 0.875rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1;
    transition: border-color 120ms ease, background 120ms ease;
}

.search-input::placeholder {
    color: var(--text-subtle);
}

.search-input:hover {
    background: var(--bg-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-subtle);
    background: var(--bg-muted);
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.1);
}

.search-kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-subtle);
    font: inherit;
    font-size: 0.72rem;
}

.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd {
    display: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    max-height: min(60vh, 28rem);
    overflow: auto;
    display: none;
    gap: 0.25rem;
    padding: 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 60;
}

.search-results[data-open="true"] {
    display: grid;
}

.search-results[data-empty="true"] {
    color: var(--text-subtle);
    font-size: 0.85rem;
    padding: 0.75rem;
}

.search-results a {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
}

.search-results a:hover {
    background: var(--bg-muted);
}

.search-results strong {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--text);
    font-size: 0.875rem;
}

.search-results span {
    display: block;
    color: var(--text-subtle);
    font-size: 0.8rem;
    line-height: 1.4;
}

.nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: var(--text);
    border-radius: 999px;
}

/* ---------- Layout ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(260px, var(--sidebar-width)) minmax(0, 1fr) minmax(220px, var(--toc-width));
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.sidebar,
.toc {
    position: sticky;
    top: var(--topbar-height);
    align-self: start;
    height: calc(100vh - var(--topbar-height));
    max-height: calc(100vh - var(--topbar-height));
}

.sidebar {
    background: var(--bg-sidebar);
}

.sidebar-panel,
.toc-panel {
    height: 100%;
    overflow: auto;
    padding: 1.5rem 0.75rem 2rem;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.sidebar-panel::-webkit-scrollbar,
.toc-panel::-webkit-scrollbar {
    width: 8px;
}

.sidebar-panel::-webkit-scrollbar-thumb,
.toc-panel::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
}

/* ---------- Sidebar: home link ---------- */

.home-link {
    display: block;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 120ms ease, color 120ms ease;
}

.home-link:hover {
    background: var(--tint-hover);
    color: var(--text);
}

.home-link.is-active {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* ---------- Sidebar: nav tree ---------- */

.nav-tree {
    margin-top: 0.5rem;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link,
.nav-group-label {
    display: block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 400;
    transition: background 120ms ease, color 120ms ease;
    text-align: left;
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nav-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-group-label-text {
    flex: 1;
    min-width: 0;
}

.nav-row .nav-link,
.nav-row .nav-group-label {
    flex: 1;
    min-width: 0;
}

.nav-link:hover,
.nav-group-label:hover {
    background: var(--tint-hover);
    color: var(--text);
}

.nav-item.is-current > .nav-link,
.nav-item.is-current > .nav-row > .nav-link {
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 600;
}

.nav-link.is-label {
    color: var(--text);
    font-weight: 600;
    cursor: default;
}

.nav-link.is-label:hover {
    background: transparent;
    color: var(--text);
}

/* Group: uppercase top-level section header */
.nav-item.is-group > .nav-group-label {
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    padding: 0.375rem 0.75rem;
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-item.is-group > .nav-group-label:hover {
    background: var(--tint-hover);
}

.nav-item.is-group:first-child > .nav-group-label {
    margin-top: 0;
}

/* Chevron toggle */
.nav-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
    opacity: 0.55;
    flex-shrink: 0;
}

.nav-item:hover > .nav-row > .nav-toggle-btn,
.nav-toggle-btn:focus-visible {
    opacity: 1;
}

.nav-toggle-btn:hover {
    background: var(--tint-hover);
    color: var(--text);
}

.chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 160ms ease;
    display: inline-block;
    color: var(--text-subtle);
    flex-shrink: 0;
}

.nav-group-label .chevron {
    margin-left: auto;
    opacity: 0.55;
    transition: opacity 120ms ease, transform 160ms ease;
}

.nav-item:hover > .nav-group-label .chevron,
.nav-group-label:focus-visible .chevron {
    opacity: 1;
}

.nav-toggle-btn[aria-expanded="true"] .chevron,
.nav-group-label[aria-expanded="true"] .chevron {
    transform: rotate(45deg);
}

/* Collapse animation using grid-rows trick */
.nav-children {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 180ms ease, opacity 180ms ease;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.nav-children[data-expanded="true"] {
    grid-template-rows: 1fr;
    opacity: 1;
}

/* Nested indent */
.nav-sublist .nav-link,
.nav-sublist .nav-group-label,
.nav-sublist .nav-row > .nav-link,
.nav-sublist .nav-row > .nav-group-label {
    padding-left: 1.25rem;
}

.nav-sublist .nav-sublist .nav-link,
.nav-sublist .nav-sublist .nav-group-label,
.nav-sublist .nav-sublist .nav-row > .nav-link,
.nav-sublist .nav-sublist .nav-row > .nav-group-label {
    padding-left: 1.75rem;
}

.nav-sublist .nav-sublist .nav-sublist .nav-link,
.nav-sublist .nav-sublist .nav-sublist .nav-group-label,
.nav-sublist .nav-sublist .nav-sublist .nav-row > .nav-link,
.nav-sublist .nav-sublist .nav-sublist .nav-row > .nav-group-label {
    padding-left: 2.25rem;
}

/* ---------- Content ---------- */

.content {
    min-width: 0;
    padding: 2rem clamp(1rem, 3vw, 3rem) 3rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    max-width: var(--content-width);
    margin: 0 auto 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.breadcrumbs a {
    color: var(--primary);
    transition: color 120ms ease;
}

.breadcrumbs a:hover {
    color: var(--primary-strong);
}

.breadcrumbs span {
    color: var(--text-subtle);
    opacity: 0.6;
}

.doc-card {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ---------- Typography ---------- */

.doc-card h1,
.doc-card h2,
.doc-card h3,
.doc-card h4,
.doc-card h5,
.doc-card h6 {
    position: relative;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: 700;
    scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.doc-card h1 {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    line-height: 1.15;
}

.doc-card h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    font-size: 1.375rem;
}

.doc-card h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
    font-size: 1.125rem;
}

.doc-card h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.doc-card h5,
.doc-card h6 {
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (min-width: 640px) {
    .doc-card h1 { font-size: 1.875rem; }
    .doc-card h2 { font-size: 1.5rem; }
    .doc-card h3 { font-size: 1.25rem; }
}

@media (min-width: 1024px) {
    .doc-card h1 { font-size: 2.25rem; }
}

.heading-anchor {
    position: absolute;
    top: 50%;
    left: -1.35rem;
    transform: translateY(-50%);
    opacity: 0;
    color: var(--text-subtle);
    font-size: 0.9em;
    transition: opacity 120ms ease, color 120ms ease;
}

.doc-card h2:hover .heading-anchor,
.doc-card h3:hover .heading-anchor,
.doc-card h4:hover .heading-anchor,
.doc-card h5:hover .heading-anchor,
.doc-card h6:hover .heading-anchor,
.heading-anchor:focus {
    opacity: 1;
}

.heading-anchor:hover {
    color: var(--primary);
}

.doc-card hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.doc-card p,
.doc-card li,
.doc-card td,
.doc-card summary {
    color: var(--text-body);
    font-size: 1rem;
}

.doc-card th {
    color: var(--text);
    font-size: 1rem;
}

.doc-card p {
    margin: 0 0 1rem;
}

.doc-card strong {
    color: var(--text);
    font-weight: 600;
}

/* Inline elements inside a link must not override the link's color. */
.doc-card a strong,
.doc-card a em,
.doc-card a code {
    color: inherit;
}

.doc-card ul,
.doc-card ol {
    padding-left: 1.5rem;
    margin: 0 0 1rem;
}

.doc-card li {
    margin: 0.25rem 0;
}

.doc-card li > ul,
.doc-card li > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* ---------- Tables ---------- */

.doc-card table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-elevated);
    font-size: 0.9rem;
}

.doc-card th,
.doc-card td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.doc-card tr:last-child td {
    border-bottom: 0;
}

.doc-card th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
}

/* ---------- Code ---------- */

.doc-card pre {
    overflow: auto;
    margin: 1.25rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-code);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.55;
}

.doc-card pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}

.doc-card :not(pre) > code {
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 0.875em;
}

/* ---------- Blockquote / details / figures ---------- */

.doc-card blockquote {
    margin: 1.25rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 2px solid var(--primary);
    color: var(--text-muted);
}

.doc-card details {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.doc-card summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
}

.doc-card figure {
    margin: 1.5rem 0;
}

.doc-card img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-elevated);
}

/* Only stretch to full column width when the source didn't specify a
   width — GitBook emits width="89" etc. on small screenshots and we
   should honor it. */
.doc-card figure img:not([width]) {
    width: 100%;
}

/* GitBook wraps small images in <div align="left"> to keep them
   left-aligned with natural size — don't let figure's default
   block layout center them. */
.doc-card div[align="left"] figure,
.doc-card div[align="right"] figure,
.doc-card div[align="center"] figure {
    display: inline-block;
    margin: 1.5rem 0;
}

.doc-card div[align="center"] {
    text-align: center;
}

.doc-card figcaption {
    margin-top: 0.5rem;
    color: var(--text-subtle);
    font-size: 0.85rem;
}

.doc-card a.is-external::after {
    content: "↗";
    display: inline-block;
    margin-left: 0.2em;
    color: var(--text-subtle);
    font-size: 0.85em;
}

/* Inline content links: underline with a tinted accent, matching
   production. Nav, breadcrumbs, pager, TOC, heading anchors, and
   meta links stay clean because they live outside .doc-card or
   are explicitly excluded below. */
.doc-card a {
    text-decoration: underline;
    text-decoration-color: rgba(0, 255, 157, 0.35);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color 120ms ease, color 120ms ease;
}

.doc-card a:hover {
    text-decoration-color: var(--primary);
}

.doc-card a.heading-anchor,
.doc-card a.card-link,
.doc-card h1 > a,
.doc-card h2 > a,
.doc-card h3 > a,
.doc-card h4 > a,
.doc-card h5 > a,
.doc-card h6 > a {
    text-decoration: none;
}

/* ---------- Callouts ---------- */

.callout {
    margin: 1.5rem 0;
    padding: 0.875rem 1rem;
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.callout-info {
    border-left-color: var(--primary);
    background: var(--primary-soft);
}

.callout-warning {
    border-left-color: var(--warning);
    background: var(--warning-soft);
}

.callout-success {
    border-left-color: var(--success);
    background: var(--success-soft);
}

.callout-danger {
    border-left-color: var(--danger);
    background: var(--danger-soft);
}

/* ---------- Embeds ---------- */

.embed-block {
    position: relative;
    margin: 1.5rem 0;
    padding-top: 56.25%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #111;
}

.embed-block iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.embed-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--text);
}

/* ---------- Page meta / feedback / pager ---------- */

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: var(--content-width);
    margin: 2rem auto 0;
    color: var(--text-subtle);
    font-size: 0.85rem;
}

.page-meta a {
    color: var(--text-subtle);
}

.page-meta a:hover {
    color: var(--text);
}

/* Pager: two cards at the bottom of the page. Previous has a
   left-arrow + right-aligned text; Next has left-aligned text + a
   right-arrow. Matches production's /tutorials/video-tutorials
   layout. */

.pager {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    max-width: var(--content-width);
    margin: 2.5rem auto 0;
}

@media (min-width: 640px) {
    .pager { flex-direction: row; }
}

.pager-link {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-body);
    transition: border-color 120ms ease, color 120ms ease;
    min-width: 0;
}

@media (min-width: 768px) {
    .pager-link { padding: 1rem 1.25rem; }
}

.pager-link:hover {
    border-color: var(--primary);
    color: var(--text);
}

.pager-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1 1 0;
    min-width: 0;
}

.pager-prev .pager-body {
    align-items: flex-end;
    text-align: right;
}

.pager-eyebrow {
    color: var(--text-subtle);
    font-size: 0.75rem;
    font-weight: 400;
}

.pager-title {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1rem;
    line-height: 1.35;
    min-width: 0;
}

.pager-title strong {
    font-weight: 600;
    color: var(--text);
    transition: color 120ms ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}

.pager-link:hover .pager-title strong {
    color: var(--primary);
}

/* CSS-only chevron arrows — no extra SVG asset needed. */
.pager-arrow {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border: 2px solid var(--text-subtle);
    border-top: 0;
    border-left: 0;
    flex-shrink: 0;
    transition: border-color 120ms ease;
}

.pager-link:hover .pager-arrow {
    border-color: var(--primary);
}

.pager-arrow-right {
    transform: rotate(-45deg);
}

.pager-arrow-left {
    transform: rotate(135deg);
}

/* ---------- Icons (emoji + SVG) ----------
   Emoji variants use the system color-emoji font. SVG variants use
   CSS mask so the icon's fill is driven by currentColor, picking up
   hover/active link states correctly. */

.page-title-icon,
.nav-icon,
.card-link-icon,
.pager-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.page-title-icon-emoji,
.nav-icon-emoji,
.card-link-icon-emoji,
.pager-icon-emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.page-title-icon-svg,
.nav-icon-svg,
.card-link-icon-svg,
.pager-icon-svg {
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask-image: var(--icon-src);
    mask-image: var(--icon-src);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.page-title-icon {
    font-size: 0.9em;
    margin-right: 0.4em;
    vertical-align: -0.05em;
}

.nav-icon {
    font-size: 1em;
    width: 1.1em;
}

/* Sidebar SVG icons render in the muted text color unless the link is
   active — keeps the tree visually calmer than emojis. */
.nav-icon-svg {
    color: var(--text-subtle);
}

.nav-item.is-current > .nav-link .nav-icon-svg,
.nav-link:hover .nav-icon-svg {
    color: inherit;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Card list (bare link lists → card rows) ---------- */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card-link:hover {
    border-color: var(--primary);
    color: var(--text);
}

.card-link-body {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

.card-link-icon {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1em;
    flex-shrink: 0;
}

.card-link-title {
    font-weight: 600;
    color: var(--text);
    transition: color 120ms ease;
}

.card-link:hover .card-link-title {
    color: var(--primary);
}

.card-link-subtitle {
    color: var(--text-subtle);
    font-size: 0.9rem;
    font-weight: 400;
}

.card-link-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--text-subtle);
    border-bottom: 2px solid var(--text-subtle);
    transform: rotate(-45deg);
    flex-shrink: 0;
    transition: border-color 120ms ease;
}

.card-link:hover .card-link-chevron {
    border-right-color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ---------- TOC ---------- */

.toc-panel p {
    margin: 0 0 0.625rem;
    color: var(--text-subtle);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-item + .toc-item {
    margin-top: 0.1rem;
}

.toc-item a {
    display: block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-subtle);
    font-size: 0.85rem;
    line-height: 1.45;
    border-left: 2px solid transparent;
}

.toc-item a:hover {
    color: var(--text);
    border-left-color: var(--line-strong);
}

.toc-level-3 { padding-left: 0.75rem; }
.toc-level-4 { padding-left: 1.5rem; }

/* ---------- Backdrop (mobile) ---------- */

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
    z-index: 30;
}

body.nav-open .backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: minmax(260px, var(--sidebar-width)) minmax(0, 1fr);
    }

    .toc {
        display: none;
    }
}

@media (max-width: 920px) {
    .nav-toggle {
        display: inline-block;
    }

    .topbar {
        padding: 0.8rem 1rem;
    }

    .search {
        min-width: 0;
        flex: 1;
        max-width: min(14rem, 60vw);
    }

    .search-kbd {
        display: none;
    }

    .layout {
        display: block;
        padding: 0 1rem 1.5rem;
    }

    .sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        height: auto;
        max-height: none;
        transform: translateX(-105%);
        transition: transform 160ms ease;
        z-index: 40;
        background: rgba(29, 29, 29, 0.98);
        border-right: 1px solid var(--line);
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-panel {
        padding: 1rem 0.75rem;
    }

    .content {
        padding: 1.25rem 0 2rem;
    }

    .heading-anchor {
        display: none;
    }

    .pager {
        flex-direction: column;
    }
}
