/* ============================
   MULTITAP PRODUCT GUIDE — Shared Theme
   Motorsport · Asphalt + Hi-Vis + Brand Blue
   Matches the main site tokens.
   ============================ */

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

:root {
    --asphalt:  #0B0B0E;
    --asphalt-2:#101015;
    --surface:  #15151A;
    --surface-2:#1C1C22;
    --line:     #2A2A30;
    --line-2:   #3A3A42;
    --bone:     #F2EFE6;
    --mute:     #7A7A82;
    --mute-2:   #4F4F55;
    --hi-vis:   #EFFF00;
    --hi-vis-d: #C8D700;
    --brand:    #0F92D0;
    --brand-d:  #0C7AAE;
    --race-red: #E10600;
    --amber:    #F5A524;
    --green:    #2ECC71;

    --f-display: 'Big Shoulders Display', sans-serif;
    --f-mono:    'JetBrains Mono', ui-monospace, monospace;
    --f-body:    'Archivo', system-ui, sans-serif;

    --rail-w: 250px;
    --toc-w: 220px;
    --article-w: 800px;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    font-family: var(--f-body);
    background: var(--asphalt);
    color: var(--bone);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand); color: var(--asphalt); }
img { display: block; max-width: 100%; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--hi-vis); outline-offset: 3px; }

h1, h2, h3 {
    font-family: var(--f-display);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.02;
    text-transform: uppercase;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px);
}

.skip-link {
    position: absolute; left: -9999px; top: auto;
    width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: static; width: auto; height: auto; }

/* ============================
   NAV (matches main site)
   ============================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 14px clamp(20px, 4vw, 32px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--asphalt);
    border-bottom: 1px solid var(--line);
}
.nav__logo { height: 32px; display: block; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__link {
    font-family: var(--f-mono);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bone);
    text-decoration: none;
    position: relative;
    padding: 6px 0;
    transition: color 0.2s;
}
.nav__link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s;
}
.nav__link:hover { color: var(--brand); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--brand); }
.nav__link.is-active::after { transform: scaleX(1); }
.nav__cta {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 18px;
    background: var(--hi-vis);
    color: var(--asphalt);
    border: 2px solid var(--hi-vis);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
}
.nav__cta:hover { background: transparent; color: var(--hi-vis); }
.btn__arrow { font-family: var(--f-mono); font-weight: 700; transition: transform 0.2s; }
.nav__cta:hover .btn__arrow { transform: translateX(4px); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--bone);
    transition: transform 0.25s, opacity 0.25s;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--asphalt);
    z-index: 150;
    padding: 100px 28px 28px;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
}
.mobile-menu.is-active { display: flex; }
.mobile-menu a {
    color: var(--bone);
    text-decoration: none;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.mobile-menu .nav__cta {
    font-size: 0.95rem;
    padding: 16px 22px;
    margin-top: 14px;
    border-bottom: none;
    justify-content: center;
}

/* ============================
   CHAPTER HEADER
   ============================ */
.chead {
    padding: clamp(120px, 15vw, 160px) 0 clamp(36px, 5vw, 56px);
    background: var(--asphalt);
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.chead__grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(15, 146, 208, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 146, 208, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 20% 50%, rgba(0,0,0,0.7), transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 20% 50%, rgba(0,0,0,0.7), transparent 70%);
    pointer-events: none;
}
.chead__inner { position: relative; z-index: 1; }
.chead__crumbs {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.chead__crumbs a { text-decoration: none; color: var(--mute); transition: color 0.2s; }
.chead__crumbs a:hover { color: var(--brand); }
.chead__crumbs .sep { color: var(--line-2); }
.chead__crumbs .active { color: var(--brand); }

.chead__row {
    display: flex;
    align-items: flex-end;
    gap: clamp(16px, 3vw, 32px);
}
.chead__num {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 8rem);
    line-height: 0.82;
    color: var(--brand);
    letter-spacing: -0.04em;
    flex-shrink: 0;
}
.chead__meta { min-width: 0; }
.chead__kicker {
    font-family: var(--f-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.chead__kicker::before {
    content: '';
    display: inline-block;
    width: 36px;
    height: 1px;
    background: var(--brand);
}
.chead__title {
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    color: var(--bone);
    line-height: 0.92;
    max-width: 16ch;
}
.chead__title .hi { color: var(--brand); }
.chead__sub {
    color: var(--bone);
    opacity: 0.85;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.6;
    max-width: 640px;
    margin-top: 22px;
}
.chead__where {
    margin-top: 26px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mute);
}

/* ============================
   DOC LAYOUT — rail / article / toc
   ============================ */
.doc {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--toc-w);
    gap: clamp(28px, 4vw, 60px);
    padding: clamp(36px, 5vw, 60px) 0 clamp(60px, 8vw, 100px);
    align-items: start;
}

/* Chapter rail */
.rail {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}
.rail__label {
    font-family: var(--f-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 12px;
    padding-left: 14px;
}
.rail ol {
    list-style: none;
    border-left: 1px solid var(--line);
}
.rail li a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 14px;
    color: var(--mute);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.35;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.rail li a .n {
    font-family: var(--f-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--mute-2);
    min-width: 20px;
}
.rail li a:hover { color: var(--bone); background: var(--asphalt-2); }
.rail li a.is-active {
    color: var(--bone);
    border-left-color: var(--brand);
    background: var(--asphalt-2);
}
.rail li a.is-active .n { color: var(--brand); }
.rail__group {
    font-family: var(--f-mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mute-2);
    padding: 16px 14px 6px;
}

/* On-this-page */
.toc {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}
.toc__label {
    font-family: var(--f-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 12px;
}
.toc ul { list-style: none; border-left: 1px solid var(--line); }
.toc li a {
    display: block;
    padding: 6px 14px;
    color: var(--mute);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.35;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color 0.2s, border-color 0.2s;
}
.toc li a:hover { color: var(--bone); }
.toc li a.is-active { color: var(--bone); border-left-color: var(--hi-vis); }
.toc li.sub a { padding-left: 26px; font-size: 0.78rem; }

/* Article */
.article {
    max-width: var(--article-w);
    min-width: 0;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--bone);
}
.article p { margin-bottom: 20px; opacity: 0.92; }
.article .lede {
    font-size: 1.14rem;
    line-height: 1.6;
    opacity: 1;
    color: var(--bone);
    margin-bottom: 30px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}
.article h2 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    color: var(--bone);
    letter-spacing: -0.01em;
    margin: 64px 0 20px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 90px;
    position: relative;
}
.article h2::before {
    content: '';
    position: absolute;
    top: -1px; left: 0;
    width: 56px; height: 4px;
    background: var(--brand);
}
.article > section:first-of-type > h2,
.article > h2:first-child { margin-top: 0; }
.article h3 {
    font-size: 1.25rem;
    color: var(--bone);
    letter-spacing: 0.02em;
    margin: 40px 0 14px;
    scroll-margin-top: 90px;
}
.article h4 {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand);
    margin: 30px 0 12px;
    scroll-margin-top: 90px;
}
.article a {
    color: var(--brand);
    text-decoration: none;
    border-bottom: 1px solid var(--brand);
    transition: color 0.2s, border-color 0.2s;
}
.article a:hover { color: var(--hi-vis); border-color: var(--hi-vis); }
.article ul, .article ol { margin: 16px 0 24px; padding-left: 24px; }
.article li { margin-bottom: 10px; line-height: 1.6; opacity: 0.92; }
.article li::marker { color: var(--brand); }
.article strong { color: var(--bone); font-weight: 600; }
.article em { font-style: italic; }
.article code {
    font-family: var(--f-mono);
    font-size: 0.86em;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 1px 6px;
    color: var(--bone);
}
.article pre {
    font-family: var(--f-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    padding: 18px 20px;
    margin: 18px 0 26px;
    overflow-x: auto;
    color: var(--bone);
}
.article pre code { background: none; border: none; padding: 0; font-size: inherit; }
.article blockquote {
    border-left: 4px solid var(--hi-vis);
    background: var(--asphalt-2);
    padding: 22px 24px;
    margin: 28px 0;
    color: var(--bone);
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

/* ============================
   UI DEVICES — chips, paths, keys, pills
   ============================ */
.ui {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 1px 8px 2px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--bone);
    border-radius: 3px;
    white-space: nowrap;
    vertical-align: baseline;
    line-height: 1.5;
}
.ui--primary { border-color: var(--brand); color: var(--brand); }
.ui--danger  { border-color: var(--race-red); color: #ff6b66; }
.ui--warn    { border-color: var(--amber); color: var(--amber); }
.ui--ok      { border-color: var(--green); color: var(--green); }
.ui--vis     { border-color: var(--hi-vis); color: var(--hi-vis); }

.path {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--f-mono);
    font-size: 0.74em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mute);
    vertical-align: baseline;
}
.path b { color: var(--bone); font-weight: 600; }
.path i { font-style: normal; color: var(--brand); }

kbd {
    font-family: var(--f-mono);
    font-size: 0.78em;
    font-weight: 700;
    padding: 1px 7px 2px;
    border: 1px solid var(--line-2);
    border-bottom-width: 3px;
    background: var(--surface-2);
    color: var(--bone);
    border-radius: 4px;
    white-space: nowrap;
}

.status {
    font-family: var(--f-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--line-2);
    color: var(--mute);
    white-space: nowrap;
    vertical-align: middle;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--mute); }
.status--live  { color: var(--green); border-color: var(--green); }
.status--live::before  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status--idle  { color: var(--bone); border-color: var(--line-2); }
.status--idle::before  { background: var(--bone); }
.status--off   { color: var(--mute); border-color: var(--mute-2); }
.status--warn  { color: var(--amber); border-color: var(--amber); }
.status--warn::before  { background: var(--amber); }
.status--vis   { color: var(--hi-vis); border-color: var(--hi-vis); }
.status--vis::before   { background: var(--hi-vis); box-shadow: 0 0 8px var(--hi-vis); }
.status--red   { color: #ff6b66; border-color: var(--race-red); }
.status--red::before   { background: var(--race-red); }
.status--brand { color: var(--brand); border-color: var(--brand); }
.status--brand::before { background: var(--brand); }

/* ============================
   CALLOUTS
   ============================ */
.note {
    margin: 26px 0;
    padding: 18px 22px 18px 24px;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    font-size: 0.96rem;
    line-height: 1.6;
}
.note > :last-child { margin-bottom: 0; }
.note__label {
    display: block;
    font-family: var(--f-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 8px;
}
.note--tip  { border-left-color: var(--hi-vis); }
.note--tip .note__label  { color: var(--hi-vis); }
.note--warn { border-left-color: var(--race-red); }
.note--warn .note__label { color: #ff6b66; }
.note--soon { border-left-color: var(--mute-2); }
.note--soon .note__label { color: var(--mute); }
.note p { margin-bottom: 10px; opacity: 0.9; }

/* ============================
   CONTROL TABLES
   ============================ */
.article table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 30px;
    font-size: 0.9rem;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
    line-height: 1.55;
}
.article th, .article td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    color: var(--bone);
}
.article th {
    background: var(--asphalt);
    font-family: var(--f-mono);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand);
    white-space: nowrap;
}
.article tr:last-child td { border-bottom: none; }
.article td:first-child { white-space: nowrap; }
.article td:first-child .ui { white-space: normal; }
.article td p { margin: 0 0 8px; }
.article td p:last-child { margin: 0; }
.article table.wide td:first-child { white-space: normal; min-width: 150px; }
.article .tscroll { overflow-x: auto; margin: 18px 0 30px; }
.article .tscroll table { margin: 0; }

/* ============================
   STEPS
   ============================ */
.steps {
    list-style: none;
    padding: 0;
    margin: 24px 0 32px;
    counter-reset: step;
}
.steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 22px 60px;
    margin: 0;
    opacity: 1;
    border-left: 1px solid var(--line);
    margin-left: 20px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: -21px;
    top: -4px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--asphalt);
    background: var(--brand);
}
.steps > li > strong { display: block; color: var(--bone); margin-bottom: 4px; font-weight: 600; }
.steps > li p { margin-bottom: 8px; opacity: 0.9; }
.steps > li ul { margin: 8px 0 8px; }

/* ============================
   FIGURES
   ============================ */
.fig {
    margin: 26px 0 34px;
}
.fig__frame {
    position: relative;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
    padding: 12px;
    overflow: hidden;
}
.fig__frame::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 56px; height: 4px;
    background: var(--brand);
    z-index: 3;
}
.fig__frame::after {
    content: attr(data-tag);
    position: absolute;
    top: 12px; right: 12px;
    font-family: var(--f-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--asphalt);
    background: var(--brand);
    padding: 4px 8px;
    z-index: 3;
}
.fig__frame img { width: 100%; height: auto; }
.fig__cap {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--f-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mute);
    margin-top: 10px;
}
.fig__cap .right { color: var(--brand); }
.fig__frame img { cursor: zoom-in; }
.fig__hint {
    font-family: var(--f-mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mute-2);
}

/* ============================
   LIGHTBOX
   ============================ */
.lb {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: clamp(12px, 3vw, 40px);
    background: rgba(11, 11, 14, 0.94);
    cursor: zoom-out;
}
.lb.is-open { display: flex; }
.lb img {
    max-width: 100%;
    max-height: calc(100vh - 110px);
    width: auto;
    height: auto;
    border: 1px solid var(--line-2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    background: var(--asphalt-2);
}
.lb__cap {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bone);
    text-align: center;
    max-width: 90ch;
}
.lb__close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-2);
    background: var(--asphalt-2);
    color: var(--bone);
    font-family: var(--f-mono);
    font-size: 1.2rem;
    cursor: pointer;
}
.lb__close:hover { border-color: var(--brand); color: var(--brand); }

/* ============================
   DEFINITION GRID (term / meaning)
   ============================ */
.defs {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-bottom: none;
    margin: 18px 0 30px;
    font-size: 0.94rem;
}
.defs dt, .defs dd {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    line-height: 1.55;
}
.defs dt {
    font-family: var(--f-mono);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bone);
    background: var(--asphalt-2);
    border-right: 1px solid var(--line);
    white-space: nowrap;
}
.defs dd { opacity: 0.92; }

/* ============================
   CHAPTER CARDS (index page)
   ============================ */
.chapters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 28px 0 40px;
}
.chapter-card {
    background: var(--asphalt-2);
    border: 1px solid var(--line);
    padding: 22px 24px 24px;
    text-decoration: none !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--bone);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
}
.chapter-card:hover { border-color: var(--brand) !important; transform: translateY(-3px); color: var(--bone); }
.chapter-card__num {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: 2rem;
    line-height: 0.9;
    color: var(--brand);
    letter-spacing: -0.03em;
}
.chapter-card__title {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.05;
    color: var(--bone);
}
.chapter-card__desc { color: var(--mute); font-size: 0.9rem; line-height: 1.5; }
.chapter-card__read {
    margin-top: auto;
    font-family: var(--f-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand);
}

/* ============================
   SYSTEM MAP (index page)
   ============================ */
.sysmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin: 24px 0 36px;
}
.sysmap__cell {
    background: var(--asphalt-2);
    padding: 20px 20px 22px;
}
.sysmap__cell h3 {
    font-size: 1.05rem;
    margin: 0 0 8px;
    color: var(--bone);
}
.sysmap__cell .who {
    font-family: var(--f-mono);
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 10px;
    display: block;
}
.sysmap__cell p { font-size: 0.88rem; color: var(--mute); line-height: 1.5; margin: 0; }

/* ============================
   PREV / NEXT
   ============================ */
.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 70px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}
.pager a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    background: var(--asphalt-2);
    border: 1px solid var(--line) !important;
    text-decoration: none;
    color: var(--bone);
    transition: border-color 0.2s;
}
.pager a:hover { border-color: var(--brand) !important; color: var(--bone); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .lbl {
    font-family: var(--f-mono);
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mute);
}
.pager .ttl {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 1.15rem;
    text-transform: uppercase;
    line-height: 1.05;
}
.pager a:only-child { grid-column: 2; }

/* ============================
   INLINE CTA (rare)
   ============================ */
.inline-cta {
    margin: 50px 0;
    padding: 28px 30px;
    background: var(--asphalt-2);
    border-left: 4px solid var(--hi-vis);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
}
.inline-cta__copy { flex: 1 1 260px; min-width: 0; }
.inline-cta__kicker {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hi-vis);
    margin-bottom: 8px;
    display: block;
}
.inline-cta__body { font-size: 0.98rem; color: var(--bone); margin: 0; line-height: 1.5; opacity: 0.88; }
.inline-cta__btn {
    background: var(--hi-vis);
    color: var(--asphalt) !important;
    padding: 14px 24px;
    text-decoration: none;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border: 2px solid var(--hi-vis) !important;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.inline-cta__btn:hover { background: transparent; color: var(--hi-vis) !important; }

/* ============================
   FOOTER (matches main site)
   ============================ */
.footer {
    background: var(--asphalt);
    border-top: 1px solid var(--line);
    padding: 60px 0 32px;
}
.footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}
.footer__brand img { height: 30px; margin-bottom: 18px; display: block; }
.footer__tag {
    font-family: var(--f-mono);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mute);
    line-height: 1.6;
}
.footer__col h4 {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 14px;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer__col a { color: var(--bone); font-size: 0.88rem; text-decoration: none; transition: color 0.2s; }
.footer__col a:hover { color: var(--brand); }
.footer__bottom {
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-family: var(--f-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mute);
}
.footer__legal a { color: var(--mute); text-decoration: none; transition: color 0.2s; }
.footer__legal a:hover { color: var(--brand); }
.footer__legal span { margin: 0 10px; opacity: 0.4; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1180px) {
    .doc { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
    .toc { display: none; }
}
@media (max-width: 900px) {
    .doc { grid-template-columns: 1fr; gap: 28px; }
    .rail {
        position: static;
        max-height: none;
        overflow: visible;
        border: 1px solid var(--line);
        background: var(--asphalt-2);
    }
    .rail__label { padding: 14px 16px 6px; margin: 0; }
    .rail ol { border-left: none; display: grid; grid-template-columns: 1fr 1fr; }
    .rail__group { grid-column: 1 / -1; padding: 12px 16px 4px; }
    .rail li a { padding: 8px 16px; margin: 0; border-left: none; border-top: 1px solid var(--line); }
    .rail li a.is-active { border-left: none; }
    .footer__top { grid-template-columns: 1fr 1fr; gap: 32px; }
    .chead__row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 768px) {
    .nav { padding: 12px 18px; }
    .nav__links { display: none; }
    .hamburger { display: flex; }
    .nav__logo { height: 28px; }
    .chead { padding: 100px 0 32px; }
    .article { font-size: 0.98rem; }
    .article h2 { margin: 48px 0 16px; }
    .article table { font-size: 0.84rem; }
    .article th, .article td { padding: 10px 10px; }
    .article td:first-child { white-space: normal; }
    .defs { grid-template-columns: 1fr; }
    .defs dt { border-right: none; border-bottom: none; white-space: normal; padding-bottom: 4px; }
    .steps > li { padding-left: 48px; margin-left: 14px; }
    .steps > li::before { width: 36px; height: 36px; font-size: 1.05rem; left: -19px; }
    .pager { grid-template-columns: 1fr; }
    .pager a:only-child { grid-column: 1; }
    .footer__top { grid-template-columns: 1fr; gap: 28px; }
    .footer__bottom { flex-direction: column; align-items: flex-start; }
    .rail ol { grid-template-columns: 1fr; }
}
