/*
 * UrbaHive guide: the look of the site.
 *
 * The values are the app's "1a" design (webapp/src/styles/tokens.css,
 * docs/design/design-system.md): a grey-blue page, white cards held by a
 * hairline shadow, one action blue, the navy sidebar in both themes, Manrope
 * only. The fonts come from fonts.css (generated by tools/build.mjs).
 *
 * Contents: tokens · base · shell (sidebar, top bar) · search · article ·
 * components (steps, callouts, labels, tables, figures, diagrams, video) ·
 * table of contents · pager and footer · home · lightbox · responsive · print.
 */

/* ------------------------------------------------------------------ tokens */

:root {
    --page: #f2f5f9;
    --card: #ffffff;
    --fg: #0f1b2d;
    --muted-fg: #5d6c80;
    --muted: #f7f9fc;
    --border: #e1e7ef;
    --border-strong: #cbd5e1;
    --primary: #2474a6;
    --primary-hover: #1f6896;
    --primary-fg: #ffffff;
    --primary-ink: #2370a0;
    --primary-soft: #e4eff7;
    --success: #1b8f62;
    --success-ink: #177953;
    --success-soft: #e1f4ea;
    --warning: #c27a12;
    --warning-ink: #98600e;
    --warning-soft: #fbf0da;
    --destructive: #cc3f3f;
    --destructive-ink: #c33434;
    --destructive-soft: #fbe8e8;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --ring: #2474a6;
    --ring-soft: rgba(36, 116, 166, 0.18);
    --mark: #fbe9b7;

    /* The navy anchor: the sidebar keeps it in both themes, as the app does */
    --navy: #152538;
    --sb-bg: #152538;
    --sb-fg: #b9c7d8;
    --sb-strong: #ffffff;
    --sb-muted: #7d8ea4;
    --sb-icon: #7fbde8;
    --sb-active: #223951;
    --sb-hover: rgba(255, 255, 255, 0.06);
    --sb-border: #283648;
    --bright: #5faee3;
    --dots: rgba(255, 255, 255, 0.1);

    /* Logo (light background) */
    --logo-a: #2a7396;
    --logo-b: #1c3249;

    --shadow-card: 0 1px 2px rgba(15, 27, 45, 0.05), 0 0 0 1px rgba(15, 27, 45, 0.03);
    --shadow-hover: 0 14px 28px -14px rgba(15, 27, 45, 0.22), 0 0 0 1px rgba(36, 116, 166, 0.25);
    --shadow-float: 0 12px 32px -8px rgba(15, 27, 45, 0.22), 0 0 0 1px rgba(15, 27, 45, 0.06);
    --shadow-shot: 0 0 0 1px rgba(15, 27, 45, 0.08), 0 10px 28px -16px rgba(15, 27, 45, 0.35);

    /* Diagrams (assets/diagrams/*.svg read these, with light fallbacks) */
    --dg-bg: #f2f5f9;
    --dg-card: #ffffff;
    --dg-ink: #0f1b2d;
    --dg-muted: #5d6c80;
    --dg-line: #b4c0cf;
    --dg-primary: #2474a6;
    --dg-primary-ink: #2370a0;
    --dg-primary-soft: #e4eff7;
    --dg-navy: #152538;
    --dg-on-navy: #ffffff;
    --dg-success: #1b8f62;
    --dg-success-ink: #177953;
    --dg-success-soft: #e1f4ea;
    --dg-warning: #c27a12;
    --dg-warning-ink: #98600e;
    --dg-warning-soft: #fbf0da;
    --dg-destructive: #cc3f3f;
    --dg-destructive-ink: #c33434;
    --dg-destructive-soft: #fbe8e8;

    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    --sb-w: 272px;
    --header-h: 64px;
    --doc-w: 840px;
    --toc-w: 228px;
    --radius-card: 12px;
    --radius-control: 10px;

    color-scheme: light;
}

/* Dark: the app's .dark tokens. Written twice: chosen with the button, or
   followed from the system until the reader chooses. */
:root[data-theme='dark'] {
    --page: #0b1421;
    --card: #121d2d;
    --fg: #e7eef6;
    --muted-fg: #8b9bb1;
    --muted: #0f1a29;
    --border: #1e2c3f;
    --border-strong: #2c3d54;
    --primary: #5faee3;
    --primary-hover: #7bbde9;
    --primary-fg: #06111c;
    --primary-ink: #5faee3;
    --primary-soft: rgba(95, 174, 227, 0.14);
    --success: #3bbf85;
    --success-ink: #3bbf85;
    --success-soft: rgba(59, 191, 133, 0.14);
    --warning: #e6a23c;
    --warning-ink: #e6a23c;
    --warning-soft: rgba(230, 162, 60, 0.14);
    --destructive: #f26b6b;
    --destructive-ink: #f26b6b;
    --destructive-soft: rgba(242, 107, 107, 0.14);
    --header-bg: #0e1826;
    --input-bg: #0e1826;
    --ring: #5faee3;
    --ring-soft: rgba(95, 174, 227, 0.25);
    --mark: rgba(230, 162, 60, 0.3);
    --sb-bg: #08101a;
    --sb-fg: #9daec3;
    --sb-muted: #697f9a;
    --sb-active: #142636;
    --sb-hover: rgba(255, 255, 255, 0.05);
    --sb-border: #19212a;
    --dots: rgba(255, 255, 255, 0.07);
    --logo-a: #089ce8;
    --logo-b: #bde1f1;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-hover: 0 14px 28px -14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(95, 174, 227, 0.35);
    --shadow-float: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-shot: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
    --dg-bg: #0b1421;
    --dg-card: #121d2d;
    --dg-ink: #e7eef6;
    --dg-muted: #8b9bb1;
    --dg-line: #3a4d66;
    --dg-primary: #5faee3;
    --dg-primary-ink: #5faee3;
    --dg-primary-soft: #1d3146;
    --dg-navy: #24405d;
    --dg-on-navy: #ffffff;
    --dg-success: #3bbf85;
    --dg-success-ink: #3bbf85;
    --dg-success-soft: #183439;
    --dg-warning: #e6a23c;
    --dg-warning-ink: #e6a23c;
    --dg-warning-soft: #36332e;
    --dg-destructive: #f26b6b;
    --dg-destructive-ink: #f26b6b;
    --dg-destructive-soft: #312836;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --page: #0b1421;
        --card: #121d2d;
        --fg: #e7eef6;
        --muted-fg: #8b9bb1;
        --muted: #0f1a29;
        --border: #1e2c3f;
        --border-strong: #2c3d54;
        --primary: #5faee3;
        --primary-hover: #7bbde9;
        --primary-fg: #06111c;
        --primary-ink: #5faee3;
        --primary-soft: rgba(95, 174, 227, 0.14);
        --success: #3bbf85;
        --success-ink: #3bbf85;
        --success-soft: rgba(59, 191, 133, 0.14);
        --warning: #e6a23c;
        --warning-ink: #e6a23c;
        --warning-soft: rgba(230, 162, 60, 0.14);
        --destructive: #f26b6b;
        --destructive-ink: #f26b6b;
        --destructive-soft: rgba(242, 107, 107, 0.14);
        --header-bg: #0e1826;
        --input-bg: #0e1826;
        --ring: #5faee3;
        --ring-soft: rgba(95, 174, 227, 0.25);
        --mark: rgba(230, 162, 60, 0.3);
        --sb-bg: #08101a;
        --sb-fg: #9daec3;
        --sb-muted: #697f9a;
        --sb-active: #142636;
        --sb-hover: rgba(255, 255, 255, 0.05);
        --sb-border: #19212a;
        --dots: rgba(255, 255, 255, 0.07);
        --logo-a: #089ce8;
        --logo-b: #bde1f1;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
        --shadow-hover: 0 14px 28px -14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(95, 174, 227, 0.35);
        --shadow-float: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
        --shadow-shot: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
        --dg-bg: #0b1421;
        --dg-card: #121d2d;
        --dg-ink: #e7eef6;
        --dg-muted: #8b9bb1;
        --dg-line: #3a4d66;
        --dg-primary: #5faee3;
        --dg-primary-ink: #5faee3;
        --dg-primary-soft: #1d3146;
        --dg-navy: #24405d;
        --dg-on-navy: #ffffff;
        --dg-success: #3bbf85;
        --dg-success-ink: #3bbf85;
        --dg-success-soft: #183439;
        --dg-warning: #e6a23c;
        --dg-warning-ink: #e6a23c;
        --dg-warning-soft: #36332e;
        --dg-destructive: #f26b6b;
        --dg-destructive-ink: #f26b6b;
        --dg-destructive-soft: #312836;
        color-scheme: dark;
    }
}

/* -------------------------------------------------------------------- base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--page);
    color: var(--fg);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a {
    color: var(--primary-ink);
}

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.icon {
    width: 16px;
    height: 16px;
    flex: none;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius-control);
    background: var(--primary);
    color: var(--primary-fg);
    font-weight: 700;
    text-decoration: none;
    transition: top 0.15s;
}

.skip-link:focus {
    top: 12px;
}

kbd {
    display: inline-block;
    min-width: 1.7em;
    padding: 0.05em 0.45em;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--card);
    color: var(--fg);
    font: 600 0.8em/1.5 var(--font);
    text-align: center;
    white-space: nowrap;
    vertical-align: 0.08em;
}

/* --------------------------------------------------------------- the shell */

.shell {
    display: grid;
    grid-template-columns: var(--sb-w) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--sb-bg);
    color: var(--sb-fg);
    z-index: 40;
}

.sb-head {
    flex: none;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px 0 18px;
    border-bottom: 1px solid var(--sb-border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--fg);
    text-decoration: none;
    border-radius: 8px;
}

.brand-mark {
    width: 30px;
    height: 30px;
    flex: none;
}

.brand-mark .mk-a {
    fill: var(--logo-a);
}

.brand-mark .mk-b {
    fill: var(--logo-b);
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand-guide {
    color: var(--primary-ink);
    font-weight: 600;
}

.sidebar .brand {
    color: var(--sb-strong);
}

.sidebar .brand-guide {
    color: var(--sb-icon);
}

.sidebar .brand-mark .mk-a {
    fill: #089ce8;
}

.sidebar .brand-mark .mk-b {
    fill: #bde1f1;
}

.sidebar :focus-visible {
    outline-color: var(--sb-icon);
    outline-offset: -2px;
}

.sb-close {
    display: none;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sb-fg);
    cursor: pointer;
}

.sb-close:hover {
    background: var(--sb-hover);
    color: var(--sb-strong);
}

.sb-nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.nav-group {
    margin: 18px 10px 6px;
    color: var(--sb-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--sb-fg);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.nav-item::-webkit-details-marker {
    display: none;
}

.nav-item:hover {
    background: var(--sb-hover);
    color: var(--sb-strong);
}

.nav-home[aria-current='page'] {
    background: var(--sb-active);
    color: var(--sb-strong);
    font-weight: 600;
}

.nav-home[aria-current='page'] .nav-icon,
.nav-section.is-current > details > summary .nav-icon {
    color: var(--sb-icon);
}

.nav-section.is-current > details > summary {
    color: var(--sb-strong);
    font-weight: 600;
}

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

.nav-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

details[open] > summary .nav-chevron {
    transform: rotate(90deg);
}

.nav-pages {
    margin: 2px 0 8px 18px;
    padding-left: 9px;
    border-left: 1px solid var(--sb-border);
}

.nav-pages a {
    position: relative;
    display: block;
    padding: 6px 10px;
    border-radius: 7px;
    color: var(--sb-fg);
    font-size: 13.5px;
    line-height: 1.38;
    text-decoration: none;
}

.nav-pages a:hover {
    background: var(--sb-hover);
    color: var(--sb-strong);
}

.nav-pages a[aria-current='page'] {
    background: var(--sb-active);
    color: var(--sb-strong);
    font-weight: 600;
}

.nav-pages a[aria-current='page']::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 7px;
    bottom: 7px;
    width: 2px;
    border-radius: 2px;
    background: var(--sb-icon);
}

.sb-foot {
    flex: none;
    padding: 12px 22px 16px;
    border-top: 1px solid var(--sb-border);
    color: var(--sb-muted);
    font-size: 12px;
    line-height: 1.5;
}

.sb-foot p {
    margin: 0;
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(8, 16, 26, 0.55);
}

.main-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top bar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 0 28px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.brand--topbar {
    display: none;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    background: var(--card);
    color: var(--fg);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.icon-btn:hover {
    background: var(--muted);
    border-color: var(--muted-fg);
}

/* The language switch, next to the theme button: the code of the other language. */
.lang-btn {
    width: auto;
    min-width: 38px;
    padding: 0 9px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-decoration: none;
}

.lang-btn:hover {
    color: var(--fg);
}

.menu-btn,
.search-btn {
    display: none;
}

.theme-btn .i-sun {
    display: none;
}

:root[data-theme='dark'] .theme-btn .i-sun {
    display: block;
}

:root[data-theme='dark'] .theme-btn .i-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .theme-btn .i-sun {
        display: block;
    }

    :root:not([data-theme='light']) .theme-btn .i-moon {
        display: none;
    }
}

.crumbs {
    min-width: 0;
    flex: 1;
}

.crumbs ol {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted-fg);
    font-size: 13.5px;
    white-space: nowrap;
}

.crumbs li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.crumbs li:last-child {
    overflow: hidden;
}

.crumbs li + li::before {
    content: '/';
    color: var(--border-strong);
}

.crumbs a {
    color: var(--muted-fg);
    text-decoration: none;
    border-radius: 4px;
}

.crumbs a:hover {
    color: var(--fg);
    text-decoration: underline;
}

.crumbs [aria-current='page'] {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fg);
    font-weight: 700;
}

.crumbs-tile,
.tile {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ------------------------------------------------------------------ search */

.search {
    position: relative;
}

.search--top {
    width: clamp(220px, 28vw, 340px);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    color: var(--muted-fg);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 38px 0 36px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    background: var(--input-bg);
    color: var(--fg);
    font: 500 14px/1 var(--font);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder {
    color: var(--muted-fg);
    opacity: 1;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring-soft);
}

.search-key {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-fg);
    pointer-events: none;
}

.search-input:focus ~ .search-key,
.search.has-value .search-key {
    display: none;
}

.search-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: min(540px, calc(100vw - 32px));
    padding: 6px;
    border-radius: var(--radius-card);
    background: var(--card);
    box-shadow: var(--shadow-float);
}

.search-results {
    max-height: min(62vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.search-result {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--fg);
    text-decoration: none;
    scroll-margin: 6px;
}

.search-result:hover,
.search-result[aria-selected='true'] {
    background: var(--primary-soft);
}

.sr-title {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
}

.sr-context {
    display: block;
    margin-top: 1px;
    color: var(--primary-ink);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
}

.sr-snippet {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted-fg);
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.search mark {
    padding: 0 1px;
    border-radius: 3px;
    background: var(--mark);
    color: inherit;
}

.search-empty {
    margin: 0;
    padding: 14px 12px;
    color: var(--muted-fg);
    font-size: 14px;
}

.search-foot {
    display: flex;
    gap: 16px;
    margin: 4px 0 0;
    padding: 8px 10px 4px;
    border-top: 1px solid var(--border);
    color: var(--muted-fg);
    font-size: 12px;
}

.search-foot span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------------------------------------------------------------- the page */

main {
    flex: 1;
    outline: none;
}

.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--doc-w)) var(--toc-w);
    justify-content: center;
    gap: 40px;
    padding: 32px 32px 8px;
}

.is-doc:not(.has-toc) .doc-layout {
    grid-template-columns: minmax(0, var(--doc-w));
}

.doc-col {
    min-width: 0;
}

.doc {
    padding: 44px 56px 52px;
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow-card);
}

.doc-eyebrow {
    margin: 0 0 6px;
    color: var(--primary-ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.doc h1 {
    margin: 0 0 22px;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.doc-body > :first-child {
    margin-top: 0;
}

.doc-body > p:first-child {
    color: var(--muted-fg);
    font-size: 18px;
    line-height: 1.6;
}

.doc-body h2 {
    margin: 52px 0 14px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.doc-body h3 {
    margin: 34px 0 10px;
    font-size: 18.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.doc-body h4 {
    margin: 26px 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.doc-body h2,
.doc-body h3,
.doc-body h4 {
    position: relative;
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.h-anchor {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-left: 6px;
    border-radius: 6px;
    color: var(--muted-fg);
    vertical-align: -0.12em;
    opacity: 0;
    transition: opacity 0.15s, background-color 0.15s;
}

.h-anchor .icon {
    width: 15px;
    height: 15px;
}

.doc-body h2:hover .h-anchor,
.doc-body h3:hover .h-anchor,
.doc-body h4:hover .h-anchor,
.h-anchor:focus-visible {
    opacity: 1;
}

.h-anchor:hover {
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.doc-body p {
    margin: 0 0 16px;
}

.doc-body ul,
.doc-body ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.doc-body li {
    margin: 6px 0;
    padding-left: 2px;
}

.doc-body li::marker {
    color: var(--muted-fg);
}

.doc-body li > ul,
.doc-body li > ol {
    margin: 6px 0 4px;
}

.doc-body strong {
    font-weight: 700;
}

.doc-body a,
.home a.inline-link {
    color: var(--primary-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}

.doc-body a:hover {
    text-decoration-color: currentColor;
}

.doc-body a.h-anchor,
.doc-body a.shot-zoom {
    text-decoration: none;
}

.doc-body a.ext::after,
.home a.ext::after {
    content: '';
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-left: 0.22em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E") center / contain no-repeat;
    vertical-align: 0;
}

.broken-link {
    color: var(--destructive-ink) !important;
    text-decoration-style: wavy !important;
}

.doc-body hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.doc-body code {
    padding: 0.1em 0.38em;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--muted);
    font-family: var(--mono);
    font-size: 0.86em;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.doc-body pre {
    margin: 0 0 18px;
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: var(--radius-control);
    background: var(--muted);
    box-shadow: inset 0 0 0 1px var(--border);
    font-size: 14px;
    line-height: 1.55;
}

.doc-body pre code {
    padding: 0;
    border: 0;
    background: none;
    overflow-wrap: normal;
}

/* -------------------------------------------------------------- components */

/* UI labels, roles */

.ui {
    padding: 0.06em 0.42em;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--muted);
    color: var(--fg);
    font-size: 0.92em;
    font-weight: 600;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.role {
    display: inline-block;
    padding: 0.02em 0.6em;
    border-radius: 999px;
    background: var(--warning-soft);
    color: var(--warning-ink);
    font-size: 0.86em;
    font-weight: 700;
    line-height: 1.55;
    white-space: nowrap;
}

/* Steps */

.doc-body ol.steps {
    margin: 10px 0 22px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.doc-body ol.steps > li {
    position: relative;
    margin: 0;
    padding: 2px 0 16px 46px;
    counter-increment: step;
}

.doc-body ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-ink);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.doc-body ol.steps > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 14.5px;
    top: 36px;
    bottom: 4px;
    width: 1px;
    background: var(--border-strong);
}

.doc-body ol.steps > li:last-child {
    padding-bottom: 0;
}

.doc-body ol.steps > li > :last-child {
    margin-bottom: 0;
}

.doc-body ol.steps > li > figure {
    margin: 16px 0 6px;
}

/* Callouts */

.callout {
    --c: var(--primary);
    --c-ink: var(--primary-ink);
    --c-soft: var(--primary-soft);
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    margin: 22px 0;
    padding: 14px 18px 14px 16px;
    border-radius: var(--radius-card);
    background: var(--c-soft);
}

.callout.tip {
    --c: var(--success);
    --c-ink: var(--success-ink);
    --c-soft: var(--success-soft);
}

.callout.warning {
    --c: var(--warning);
    --c-ink: var(--warning-ink);
    --c-soft: var(--warning-soft);
}

.callout-icon {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    color: var(--c);
}

.callout-body {
    min-width: 0;
}

.callout-title {
    margin: 0 0 2px !important;
    color: var(--c-ink);
    font-size: 14.5px;
    font-weight: 700;
}

.callout-body p {
    margin: 0 0 8px;
}

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

.callout .ui {
    background: var(--card);
}

/* Tables */

.table-wrap {
    margin: 20px 0 24px;
    overflow-x: auto;
    border-radius: var(--radius-control);
    box-shadow: inset 0 0 0 1px var(--border);
}

.table-wrap:focus-visible {
    outline-offset: 2px;
}

.doc-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    line-height: 1.5;
}

.doc-body th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--muted);
    color: var(--muted-fg);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    vertical-align: bottom;
}

.doc-body td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

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

.doc-body th:first-child,
.doc-body td:first-child {
    padding-left: 16px;
}

.doc-body td:first-child {
    font-weight: 600;
}

.doc-body caption {
    padding: 10px 16px;
    caption-side: top;
    color: var(--muted-fg);
    font-size: 13px;
    text-align: left;
}

/* Figures */

.doc-body figure,
.home figure {
    margin: 28px 0 30px;
}

.figure-caption {
    margin: 12px 0 0 !important;
    color: var(--muted-fg);
    font-size: 14px;
    line-height: 1.55;
}

.shot-stage {
    border-radius: var(--radius-card);
}

.shot--element .shot-stage {
    display: flex;
    justify-content: center;
    padding: 28px 24px;
    background-color: var(--page);
    background-image: radial-gradient(color-mix(in srgb, var(--muted-fg) 22%, transparent) 1px, transparent 1px);
    background-size: 18px 18px;
    box-shadow: inset 0 0 0 1px var(--border);
}

.shot-frame {
    position: relative;
    border-radius: 10px;
    background: var(--muted);
    box-shadow: var(--shadow-shot);
}

.shot--element .shot-frame {
    width: min(100%, var(--shot-w, 100%));
}

/* <picture> wraps the AVIF and WebP of a picture: it adds no box of its own. */
.shot-zoom picture,
.video-facade picture {
    display: contents;
}

.shot-zoom {
    display: block;
    border-radius: inherit;
    cursor: zoom-in;
}

.shot-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
}

.shot-zoom-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(15, 27, 45, 0.78);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.shot-zoom:hover .shot-zoom-hint,
.shot-zoom:focus-visible .shot-zoom-hint {
    opacity: 1;
}

.shot-zoom:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 3px;
}

/* Hotspots: a numbered badge on the top-left corner of each box. The box
   outline shows while the reader points at its badge or legend line. */

.hs-box {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--w);
    height: var(--h);
    border-radius: 6px;
    box-shadow: 0 0 0 2px rgba(36, 116, 166, 0.95), 0 0 0 5px rgba(95, 174, 227, 0.3);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.hs-box.is-hot {
    opacity: 1;
}

.hs-num {
    position: absolute;
    left: clamp(20px, var(--x), calc(100% - 6px));
    top: clamp(13px, var(--y), calc(100% - 13px));
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2474a6;
    color: #ffffff;
    box-shadow: 0 0 0 2px #ffffff, 0 3px 8px rgba(8, 16, 26, 0.45);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transform: translate(-80%, -62%);
    transition: transform 0.15s, background-color 0.15s;
    pointer-events: none;
}

.hs-num.is-hot {
    background: #152538;
    transform: translate(-80%, -62%) scale(1.15);
}

.shot-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 6px 20px;
    margin: 12px 0 0 !important;
    padding: 0 !important;
    list-style: none;
    font-size: 14px;
    line-height: 1.45;
}

.shot-legend li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 !important;
    padding: 2px 0 !important;
    border-radius: 6px;
}

.shot-legend-num {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 0;
    flex: none;
    border-radius: 50%;
    background: #2474a6;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.shot-legend li.is-hot .shot-legend-label {
    color: var(--primary-ink);
}

/* Missing picture or diagram: visible in the page until it exists */

.figure-missing-box {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 30px 20px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-card);
    background: var(--muted);
    color: var(--muted-fg);
    font-size: 14px;
    text-align: center;
}

.figure-missing-box .icon {
    width: 26px;
    height: 26px;
}

.figure-missing-reason {
    font-size: 13px;
}

/* Diagrams */

.dg-frame {
    position: relative;
    padding: 20px;
    border-radius: var(--radius-card);
    background: var(--dg-bg);
    box-shadow: inset 0 0 0 1px var(--border);
}

.dg-svg {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    font-family: var(--font);
}

.dg-zoom {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    cursor: zoom-in;
    opacity: 0;
    transition: opacity 0.15s;
}

.dg-frame:hover .dg-zoom,
.dg-zoom:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .dg-zoom {
        opacity: 1;
    }
}

/* Video: a local poster until the reader clicks */

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-card);
    background: #08101a;
    box-shadow: var(--shadow-shot);
}

/* The YouTube player loads on a click, in the page (youtube-nocookie). */
.video-facade {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.video-facade img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}

.video-facade:hover img {
    filter: brightness(1.08);
}

.video-facade:focus-visible {
    outline: 3px solid var(--bright);
    outline-offset: -3px;
}

/* Off-centre so the button does not hide the poster's title */
.video-play {
    position: absolute;
    left: 71%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: #152538;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.16), 0 14px 30px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, background-color 0.2s;
}

.video-play .icon {
    width: 30px;
    height: 30px;
    margin-left: 4px;
}

.video-facade:hover .video-play {
    background: #ffffff;
    transform: translate(-50%, -50%) scale(1.06);
}

.video-note {
    position: absolute;
    pointer-events: none;
    right: 12px;
    bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(8, 16, 26, 0.78);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

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

/* From file://, where YouTube refuses to embed, the local MP4 plays instead. */
.video-player {
    display: block;
    width: 100%;
    height: 100%;
    background: #08101a;
}

.video-player::cue {
    font-family: inherit;
    font-size: 0.95em;
}

.video figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 20px;
}

.video .figure-caption {
    flex: 1 1 300px;
}

.icon-inline {
    width: 14px;
    height: 14px;
}

/* -------------------------------------------------------- on this page */

.toc {
    position: sticky;
    top: calc(var(--header-h) + 28px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 56px);
    overflow-y: auto;
    padding: 4px 4px 8px 0;
    scrollbar-width: thin;
}

.toc-title {
    margin: 0 0 10px;
    color: var(--muted-fg);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

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

.toc > .toc-list {
    border-left: 2px solid var(--border);
}

.toc-list a {
    display: block;
    margin-left: -2px;
    padding: 5px 0 5px 14px;
    border-left: 2px solid transparent;
    color: var(--muted-fg);
    font-size: 13.5px;
    line-height: 1.4;
    text-decoration: none;
}

.toc-list .toc-h3 a {
    padding-left: 26px;
    font-size: 13px;
}

.toc-list a:hover {
    color: var(--fg);
}

.toc-list a.is-active {
    border-left-color: var(--primary);
    color: var(--primary-ink);
    font-weight: 600;
}

.toc-top {
    display: inline-block;
    margin-top: 14px;
    color: var(--muted-fg);
    font-size: 13px;
    text-decoration: none;
}

.toc-top::before {
    content: '↑ ';
}

.toc-top:hover {
    color: var(--fg);
}

.toc-inline {
    display: none;
    margin: -6px 0 26px;
    border-radius: var(--radius-control);
    background: var(--muted);
    box-shadow: inset 0 0 0 1px var(--border);
}

.toc-inline summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    list-style: none;
}

.toc-inline summary::-webkit-details-marker {
    display: none;
}

.toc-inline summary::before {
    content: '';
    width: 7px;
    height: 7px;
    margin: 0 3px 0 2px;
    border-right: 2px solid var(--muted-fg);
    border-bottom: 2px solid var(--muted-fg);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.toc-inline[open] summary::before {
    transform: rotate(45deg);
}

.toc-inline nav {
    padding: 0 14px 12px;
}

.toc-inline .toc-list a {
    margin-left: 0;
    padding: 4px 0 4px 10px;
    border-left: 0;
}

/* --------------------------------------------------------- pager, footer */

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.pager a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 16px 20px;
    border-radius: var(--radius-card);
    background: var(--card);
    box-shadow: var(--shadow-card);
    color: var(--fg);
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

.pager a:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.pager-next {
    grid-column: 2;
    align-items: flex-end;
    text-align: right;
}

.pager-dir {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-fg);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.pager-arrow {
    width: 14px;
    height: 14px;
}

.pager-title {
    color: var(--primary-ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.site-footer {
    padding: 28px 32px 36px;
    color: var(--muted-fg);
    font-size: 13px;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.site-footer span[aria-hidden] {
    margin: 0 6px;
}

.site-footer a {
    color: var(--muted-fg);
    font-weight: 600;
}

.site-footer a:hover {
    color: var(--fg);
}

/* -------------------------------------------------------------------- home */

.is-home .doc-layout {
    display: block;
    max-width: 1180px;
    margin: 0 auto;
}

.home {
    display: grid;
    gap: 22px;
}

.home h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.home p {
    margin: 0 0 14px;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
    gap: 44px;
    padding: 48px 48px 44px;
    overflow: visible;
    border-radius: 16px;
    background-color: var(--navy);
    background-image: radial-gradient(var(--dots) 1px, transparent 1px);
    background-size: 22px 22px;
    color: #ffffff;
}

:root[data-theme='dark'] .home-hero {
    background-color: #08101a;
    box-shadow: inset 0 0 0 1px #1e2c3f;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .home-hero {
        background-color: #08101a;
        box-shadow: inset 0 0 0 1px #1e2c3f;
    }
}

.home-eyebrow {
    margin: 0 0 12px !important;
    color: var(--sb-icon);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.home-hero h1 {
    margin: 0 0 14px;
    font-size: 46px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.home-lead {
    max-width: 34em;
    margin: 0 0 26px !important;
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
    line-height: 1.6;
}

.search--hero .search-icon {
    left: 16px;
    width: 18px;
    height: 18px;
}

.search--hero .search-input {
    height: 52px;
    padding-left: 46px;
    border-color: transparent;
    border-radius: 12px;
    background: #ffffff;
    color: #0f1b2d;
    font-size: 16px;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6);
}

.search--hero .search-input::placeholder {
    color: #5d6c80;
}

.search--hero .search-input:focus {
    border-color: var(--bright);
    box-shadow: 0 0 0 3px rgba(95, 174, 227, 0.45);
}

.search--hero .search-key {
    right: 14px;
    border-color: #cbd5e1;
    background: #ffffff;
    color: #5d6c80;
}

.search--hero .search-panel {
    left: 0;
    right: auto;
    width: 100%;
    min-width: min(480px, calc(100vw - 32px));
    color: var(--fg);
}

.home-hero-links {
    margin: 16px 0 0 !important;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14.5px;
}

.home-hero-links a {
    color: #9fd0f2;
    font-weight: 700;
    text-decoration: none;
}

.home-hero-links a:hover {
    text-decoration: underline;
}

.home-video-title {
    margin: 0 0 12px !important;
    color: #ffffff;
    font-size: 15px !important;
    font-weight: 700;
    letter-spacing: 0 !important;
}

.home-hero .video {
    margin: 0;
}

.home-hero .video-frame {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
}

.home-hero .figure-caption {
    color: rgba(255, 255, 255, 0.72);
}

.home-hero .video-link {
    color: #9fd0f2;
}

.home-hero :focus-visible {
    outline-color: var(--bright);
}

.home-section {
    padding: 30px 32px 32px;
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow-card);
}

.home-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 20px;
    margin-bottom: 18px;
}

.home-section-head p {
    margin: 0;
    color: var(--muted-fg);
}

.home-more {
    color: var(--primary-ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.home-more:hover {
    text-decoration: underline;
}

.home-plain {
    padding: 8px 4px 0;
}

/* Start path */

.start-path {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.start-path a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 18px 18px 16px;
    border-radius: var(--radius-card);
    background: var(--muted);
    box-shadow: inset 0 0 0 1px var(--border);
    color: var(--fg);
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s, background-color 0.15s;
}

.start-path a:hover {
    background: var(--card);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.start-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-fg);
    font-size: 14px;
    font-weight: 800;
}

.start-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.start-text {
    flex: 1;
    color: var(--muted-fg);
    font-size: 14px;
    line-height: 1.5;
}

.start-go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: var(--primary-ink);
    font-size: 13.5px;
    font-weight: 700;
}

.start-go .icon {
    width: 14px;
    height: 14px;
}

/* Concept diagrams on the home page: text beside a diagram */

.home-concept {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 660px);
    align-items: center;
    gap: 40px;
}

.home-concept-text h2 {
    margin-bottom: 12px;
}

.home-concept-text p {
    color: var(--muted-fg);
}

.home-concept-text .home-more {
    display: inline-block;
    margin-top: 4px;
}

.home-concept figure {
    margin: 0 !important;
}

/* Section cards */

.section-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 14px;
}

.section-card {
    display: flex;
    flex-direction: column;
    padding: 20px 22px 18px;
    border-radius: var(--radius-card);
    background: var(--card);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s;
}

.section-card:hover {
    box-shadow: var(--shadow-hover);
}

.section-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.section-card-head .tile {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.section-card-head .tile .icon {
    width: 18px;
    height: 18px;
}

.section-card h3 {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.section-card h3 a {
    color: var(--fg);
    text-decoration: none;
}

.section-card h3 a:hover {
    color: var(--primary-ink);
}

.section-card-count {
    color: var(--muted-fg);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.section-card-summary {
    margin: 0 0 12px !important;
    color: var(--muted-fg);
    font-size: 14.5px;
    line-height: 1.55;
}

.section-card-pages {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border);
}

.section-card-pages li {
    border-bottom: 1px solid var(--border);
}

.section-card-pages li:last-child {
    border-bottom: 0;
}

.section-card-pages a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 2px;
    color: var(--fg);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.section-card-pages a::after {
    content: '→';
    color: var(--muted-fg);
    font-weight: 500;
    transition: transform 0.15s, color 0.15s;
}

.section-card-pages a:hover {
    color: var(--primary-ink);
}

.section-card-pages a:hover::after {
    color: var(--primary-ink);
    transform: translateX(2px);
}

.section-card-more {
    border-top: 1px solid var(--border);
}

.section-card-more > summary {
    padding: 9px 2px 2px;
    color: var(--primary-ink);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    list-style: none;
}

.section-card-more > summary::-webkit-details-marker {
    display: none;
}

.section-card-more > summary::after {
    content: ' ↓';
}

.section-card-more[open] > summary {
    display: none;
}

.section-card-more .section-card-pages {
    border-top: 0;
}

/* Popular tasks */

.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 0 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.task-list li {
    border-bottom: 1px solid var(--border);
}

.task-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    color: var(--fg);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.task-list a::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.55;
}

.task-list a:hover {
    color: var(--primary-ink);
}

.task-list a:hover::before {
    opacity: 1;
}

.help-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 20px 26px;
    border-radius: 14px;
    background: var(--primary-soft);
}

.help-strip p {
    margin: 0;
}

.help-strip-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.help-strip a {
    color: var(--primary-ink);
    font-weight: 700;
}

/* ---------------------------------------------------------------- lightbox */

.lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
}

.lightbox::backdrop {
    background: rgba(8, 16, 26, 0.92);
}

.lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 100%;
    padding: 56px 24px 24px;
}

.lightbox-close {
    position: fixed;
    top: 14px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-control);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.lightbox-close .icon {
    width: 20px;
    height: 20px;
}

.lightbox-media {
    position: relative;
    max-width: 100%;
}

.lightbox-media .shot-frame {
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.lightbox-media .dg-frame {
    width: min(94vw, 1400px);
    max-height: calc(100vh - 160px);
    overflow: auto;
    background: var(--dg-bg);
}

.lightbox-media .dg-svg {
    max-height: calc(100vh - 200px);
}

.lightbox-text {
    max-width: min(900px, 94vw);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14.5px;
    line-height: 1.5;
    text-align: center;
}

.lightbox-text .figure-caption {
    color: rgba(255, 255, 255, 0.85);
}

.lightbox-text .shot-legend {
    justify-items: start;
    text-align: left;
}

.lightbox :focus-visible {
    outline-color: var(--bright);
}

body.lightbox-open {
    overflow: hidden;
}

/* Toast */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 90;
    padding: 10px 16px;
    border-radius: var(--radius-control);
    background: var(--navy);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, 16px);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1279px) {
    .doc-layout,
    .is-doc .doc-layout {
        grid-template-columns: minmax(0, var(--doc-w));
    }

    .toc {
        display: none;
    }

    .toc-inline {
        display: block;
    }
}

@media (max-width: 1100px) {
    .home-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
        padding: 40px 36px;
    }

    .home-concept {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

@media (max-width: 1023px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(320px, 86vw);
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform 0.22s ease, visibility 0s linear 0.22s;
        box-shadow: 20px 0 40px -20px rgba(0, 0, 0, 0.5);
    }

    .nav-open .sidebar {
        transform: none;
        visibility: visible;
        transition: transform 0.22s ease;
    }

    .nav-open {
        overflow: hidden;
    }

    .sb-close {
        display: inline-grid;
    }

    .menu-btn {
        display: inline-grid;
    }

    .brand--topbar {
        display: inline-flex;
    }

    .crumbs {
        display: none;
    }

    .topbar {
        padding: 0 16px;
    }
}

@media (max-width: 720px) {
    :root {
        --header-h: 58px;
    }

    .topbar {
        gap: 10px;
    }

    .brand--topbar .brand-name {
        font-size: 16px;
    }

    .brand--topbar .brand-mark {
        width: 26px;
        height: 26px;
    }

    .search--top {
        display: none;
    }

    .search-btn {
        display: inline-grid;
    }

    .topbar.is-searching .search--top {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        width: auto;
        padding: 10px 16px 12px;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 14px 24px -18px rgba(15, 27, 45, 0.4);
    }

    .topbar.is-searching .search--top .search-icon {
        left: 28px;
    }

    .topbar.is-searching .search-panel {
        left: 16px;
        right: 16px;
        width: auto;
    }

    .doc-layout,
    .is-doc .doc-layout {
        padding: 0;
    }

    .doc {
        padding: 26px 16px 32px;
        border-radius: 0;
        box-shadow: none;
    }

    .doc h1 {
        font-size: 29px;
    }

    .doc-body > p:first-child {
        font-size: 17px;
    }

    .doc-body h2 {
        margin-top: 42px;
        font-size: 22px;
    }

    .doc-body h3 {
        font-size: 18px;
    }

    .doc-body ol.steps > li {
        padding-left: 40px;
    }

    .doc-body ol.steps > li::before {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .doc-body ol.steps > li:not(:last-child)::after {
        left: 13.5px;
        top: 34px;
    }

    .callout {
        padding: 12px 14px;
        gap: 10px;
    }

    .shot--element .shot-stage {
        padding: 16px 12px;
    }

    .hs-num {
        width: 20px;
        height: 20px;
        font-size: 11px;
        left: clamp(17px, var(--x), calc(100% - 5px));
        top: clamp(11px, var(--y), calc(100% - 11px));
    }

    .dg-frame {
        padding: 10px;
    }

    .video-play {
        width: 60px;
        height: 60px;
    }

    .video-play .icon {
        width: 24px;
        height: 24px;
    }

    .pager {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin: 0;
        padding: 16px;
    }

    .pager-next {
        grid-column: 1;
    }

    .pager a {
        box-shadow: var(--shadow-card);
    }

    .site-footer {
        padding: 20px 16px 28px;
    }

    .is-home .doc-layout {
        padding: 16px;
    }

    .home {
        gap: 16px;
    }

    .home-hero {
        padding: 30px 20px 24px;
        border-radius: 14px;
    }

    .home-hero h1 {
        font-size: 36px;
    }

    .home-lead {
        font-size: 16px;
    }

    .home-section {
        padding: 22px 18px 22px;
        border-radius: 12px;
    }

    .start-path {
        grid-template-columns: minmax(0, 1fr);
    }

    .search-foot {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------------------------- print */

@media print {
    :root {
        --page: #ffffff;
    }

    body {
        background: #ffffff;
        color: #000000;
        font-size: 11pt;
    }

    .sidebar,
    .nav-backdrop,
    .topbar,
    .toc,
    .toc-inline,
    .pager,
    .h-anchor,
    .shot-zoom-hint,
    .dg-zoom,
    .skip-link,
    .search,
    .video-play,
    .video-note {
        display: none !important;
    }

    .shell {
        display: block;
    }

    .doc-layout,
    .is-doc .doc-layout {
        display: block;
        padding: 0;
    }

    .doc {
        padding: 0;
        box-shadow: none;
    }

    .doc-body a.ext::after {
        content: ' (' attr(href) ')';
        width: auto;
        height: auto;
        background: none;
        -webkit-mask: none;
        mask: none;
        font-size: 0.85em;
        font-weight: 500;
    }

    figure,
    .callout,
    .table-wrap,
    ol.steps > li {
        break-inside: avoid;
    }

    h2,
    h3 {
        break-after: avoid;
    }

    .shot-frame,
    .video-frame {
        box-shadow: 0 0 0 1px #cbd5e1;
    }

    .hs-box {
        display: none;
    }

    .shot--element .shot-stage,
    .dg-frame {
        background: none;
        box-shadow: none;
    }

    .site-footer {
        padding: 12pt 0 0;
        text-align: left;
    }

    .home-hero {
        background: #ffffff;
        color: #000000;
    }
}
