/* Zaira documentation: chapters in the six demo colours, a reading rail on the right. Fonts and tokens come from base.css. */

:root {
    --night: #0B1726;
    --night-2: #10213A;
    --gutter: 16px;
    --shadow-lg: 0 40px 80px -36px rgba(4, 10, 20, .65);
    --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 761px) { :root { --gutter: 28px; } }
html { scroll-padding-top: 76px; } /* the sticky top bar; sections add their own space above the title */
.d-wrap { width: min(1320px, 100% - var(--gutter) * 2); margin-inline: auto; }
kbd { display: inline-block; font: 600 11px/1.5 var(--body); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--newsprint); color: var(--muted); }

/* Top bar */
.dh { position: sticky; top: 0; z-index: 50; background: var(--night); box-shadow: 0 1px 0 rgba(255, 255, 255, .07); }
.dh-row { width: min(1320px, 100% - var(--gutter) * 2); margin-inline: auto; display: flex; align-items: center; gap: 14px; min-height: 68px; }
.dh-brand { flex: none; }
.dh-brand img { width: 108px; }
.dh-docs { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); color: #fff; font: 700 13px/1.2 var(--head); text-decoration: none; }
.dh-docs span { color: var(--coral); }
.dh-chapters { display: flex; gap: 2px; margin-inline: auto; }
.dh-chapters a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: rgba(255, 255, 255, .74); font: 600 14px/1.2 var(--body); text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s; }
.dh-chapters b { font: 800 11px/1 var(--head); color: var(--c); }
.dh-chapters a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.dh-chapters a.is-current { color: #fff; background: color-mix(in srgb, var(--c) 22%, transparent); }
.dh-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.dh-search { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #C9D4E0; font: 500 14px var(--body); cursor: pointer; }
.dh-search svg { width: 16px; height: 16px; }
.dh-search kbd { background: transparent; border-color: rgba(255, 255, 255, .2); color: #A9B7C6; }
.dh-search:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }
.dh .night-toggle { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); justify-content: center; color: #fff; }
.dh .night-toggle svg { width: 18px; height: 18px; }
.dh .night-toggle:hover { border-color: rgba(255, 255, 255, .4); }
.night-toggle .sun, :root[data-theme="dark"] .night-toggle .moon { display: none; }
:root[data-theme="dark"] .night-toggle .sun { display: block; }
.dh-buy { display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 999px; background: var(--coral); color: #fff; font: 700 14px/1 var(--head); text-decoration: none; white-space: nowrap; transition: background-color .2s; }
.dh-buy svg { width: 10px; height: 10px; }
.dh-buy:hover { background: #fff; color: var(--night); }
.dh-progress { height: 2px; }
.dh-progress i { display: block; height: 100%; background: var(--coral); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }

/* Hero */
/* No overflow clip: the search results hang below the hero. z-index keeps them above the article. */
.d-hero { position: relative; z-index: 2; background: var(--night); color: #B9C6D3; padding-top: 64px; isolation: isolate; }
.d-hero::before, .d-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.d-hero::before { background: radial-gradient(560px 420px at 92% 0%, rgba(244, 121, 108, .24), transparent 70%), radial-gradient(560px 440px at 0% 100%, rgba(61, 139, 255, .15), transparent 70%); }
.d-hero::after { background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px); background-size: 26px 26px; -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent); mask-image: linear-gradient(180deg, #000 40%, transparent); }
.d-hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 64px; align-items: center; padding-bottom: 56px; }
.d-badge { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); color: #DCE5EE; font: 600 13px/1.4 var(--body); }
.d-badge span { padding: 3px 10px; border-radius: 999px; background: var(--coral); color: #fff; font: 800 12px/1.4 var(--head); }
.d-hero h1 { color: #fff; font-size: clamp(40px, 5vw, 66px); font-weight: 800; line-height: 1.02; letter-spacing: -.04em; margin: 22px 0 18px; }
.d-hero h1 .mark { color: var(--coral); background: linear-gradient(transparent 80%, rgba(244, 121, 108, .3) 80%, rgba(244, 121, 108, .3) 93%, transparent 93%); }
.d-lead { font-size: 18px; max-width: 590px; margin: 0; }
.popular { margin: 16px 0 0; font: 500 14px/2 var(--body); }
.popular span { color: #8FA0B2; margin-inline-end: 6px; }
.popular a { color: #fff; text-decoration: none; border-bottom: 1px dashed rgba(255, 255, 255, .32); margin-inline-end: 14px; white-space: nowrap; }
.popular a:hover { color: var(--coral); border-color: var(--coral); }

/* Search field and results (hero and dialog) */
.finder { position: relative; }
.finder > svg { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: #7C8B9B; pointer-events: none; }
.finder input { width: 100%; border: 0; font: 500 16px var(--body); color: var(--night); background: #fff; -webkit-appearance: none; appearance: none; }
.finder input::-webkit-search-cancel-button { -webkit-appearance: none; }
.finder input::placeholder { color: #7C8B9B; }
.finder-hero { max-width: 620px; margin-top: 30px; }
.finder-hero input { height: 60px; border-radius: 999px; padding: 0 92px 0 54px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .6); }
.finder-hero input:focus { outline: 3px solid var(--coral); outline-offset: 2px; }
.finder-hero kbd { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; background: #F1F4F7; border-color: #DCE3E8; color: #6B7480; }
.finder-list { position: absolute; z-index: 30; top: calc(100% + 10px); left: 0; right: 0; list-style: none; margin: 0; padding: 8px; max-height: min(430px, 60vh); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); text-align: start; }
.finder-list a { display: block; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--text); }
.finder-list .r-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.finder-list .r-title { font: 700 15px/1.35 var(--head); color: var(--ink); }
.finder-list .r-ch { display: inline-flex; align-items: center; gap: 6px; flex: none; font: 600 11.5px/1.3 var(--body); color: var(--muted); }
.finder-list .r-ch::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.finder-list .r-snip { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.finder-list [aria-selected="true"] a, .finder-list a:hover { background: var(--newsprint); }
.finder-list mark { background: rgba(244, 121, 108, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
.finder-list .r-empty { padding: 14px; font-size: 14px; color: var(--muted); }
:root[data-theme="dark"] .finder input { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] .finder-hero kbd { background: var(--newsprint); border-color: var(--line); color: var(--muted); }

/* First 15 minutes */
.quick { background: var(--card); color: var(--text); border-radius: 24px; padding: 28px 28px 22px; box-shadow: var(--shadow-lg); }
.quick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quick-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.quick-count { flex: none; font: 700 12.5px/1 var(--body); color: var(--muted); background: var(--newsprint); padding: 7px 11px; border-radius: 999px; }
.quick-bar { height: 6px; border-radius: 999px; background: var(--newsprint); margin: 18px 0 8px; overflow: hidden; }
.quick-bar i { display: block; height: 100%; width: var(--done, 0%); border-radius: inherit; background: linear-gradient(90deg, #F28C38, var(--coral)); transition: width .4s var(--ease); }
.quick-list { list-style: none; margin: 0; padding: 0; }
.quick-list li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.quick-list li:first-child { border-top: 0; }
.quick-list input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quick-list label { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; cursor: pointer; transition: background-color .2s, border-color .2s; }
.quick-list label svg { width: 14px; height: 14px; color: transparent; }
.quick-list label:hover { border-color: var(--coral); }
.quick-list input:checked + label { background: var(--coral); border-color: var(--coral); }
.quick-list input:checked + label svg { color: #fff; }
.quick-list input:focus-visible + label { outline: 3px solid var(--coral); outline-offset: 2px; }
.quick-list a { text-decoration: none; min-width: 0; }
.quick-list b { display: block; font: 700 15.5px/1.35 var(--head); color: var(--ink); }
.quick-list small { display: block; font-size: 13px; color: var(--muted); }
.quick-list a:hover b { color: var(--coral-text); }
.quick-list li.is-done b { text-decoration: line-through; text-decoration-color: var(--coral); opacity: .65; }
.quick-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.facts { list-style: none; display: flex; flex-wrap: wrap; padding: 20px 0 24px; border-top: 1px solid rgba(255, 255, 255, .1); }
.facts li { flex: 1 1 0; min-width: 150px; padding-inline-end: 16px; font: 500 13.5px/1.5 var(--body); color: #8FA0B2; }
.facts b { display: block; font: 800 15px/1.4 var(--head); color: #fff; }

/* Body: article + rail */
.d-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 72px; padding-bottom: 72px; }
.manual { min-width: 0; }

/* Chapter openers */
.chapter { padding-top: 64px; }
.ch-open { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 28px; align-items: center; padding: 30px 32px; border-radius: 24px; background: color-mix(in srgb, var(--c) 9%, var(--paper)); border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); }
.ch-num { grid-row: span 2; font: 800 96px/.82 var(--head); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 2px var(--c); }
.ch-kicker { margin: 0 0 6px; font: 700 12px/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ch-copy h2 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
.ch-copy p:last-child { margin: 0; font-size: 16.5px; }
.ch-links { grid-column: 2; list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ch-links a { display: inline-block; padding: 6px 13px; border-radius: 999px; background: var(--paper); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); color: var(--ink); font: 600 13.5px/1.3 var(--body); text-decoration: none; transition: border-color .2s, background-color .2s; }
.ch-links a:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--paper)); }

/* Sections */
.doc { padding-top: 46px; }
.doc-head { position: relative; display: flex; align-items: center; gap: 8px; padding-top: 24px; margin-bottom: 18px; border-top: 1px solid var(--line); }
.doc-head::before { content: ""; position: absolute; top: -2px; left: 0; width: 56px; height: 3px; border-radius: 3px; background: var(--c); }
.doc h3 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.025em; }
.anchor { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--muted); opacity: 0; transition: opacity .2s, background-color .2s; }
.anchor svg { width: 16px; height: 16px; }
.doc-head:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { background: var(--newsprint); color: var(--ink); }
@media (hover: none) { .anchor { opacity: .7; } }
.doc h4 { font-size: 19px; font-weight: 800; letter-spacing: -.015em; margin: 32px 0 10px; }
.doc p, .doc li { font-size: 16px; max-width: 760px; }
.doc a { color: var(--coral-text); text-underline-offset: 3px; }
.doc strong { color: var(--ink); font-weight: 650; }
.doc code { font: 500 14px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--newsprint); color: var(--ink); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.lede { font-size: 18px !important; color: var(--ink); }

/* Admin path */
.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px 11px; border-radius: 999px; background: var(--newsprint); border: 1px solid var(--line); font: 600 14px/1.45 var(--body); color: var(--ink); }
.path b { font-weight: 600; }
.path i { font-style: normal; font-weight: 700; color: var(--coral-text); }

/* Lists */
.ticks { list-style: none; margin: 14px 0; padding: 0; max-width: 760px; }
.ticks li { position: relative; padding-inline-start: 28px; margin-bottom: 9px; }
.ticks li::before { content: ""; position: absolute; left: 5px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); }
.steps { list-style: none; counter-reset: step; margin: 18px 0 10px; padding: 0; max-width: 760px; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 22px 54px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -3px; width: 36px; height: 36px; border-radius: 12px; border: 2px solid var(--c); background: var(--paper); color: var(--ink); font: 800 15px/32px var(--head); text-align: center; }
.steps > li::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: 6px; width: 2px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; font: 700 17px/1.4 var(--head); color: var(--ink); margin-bottom: 3px; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 860px; margin: 16px 0 20px; }
.pair > div { padding: 18px 20px; border-radius: 16px; background: var(--newsprint); color: var(--muted); font-size: 14.5px; }
.pair b { font: 800 16px/1.3 var(--head); color: var(--ink); }
.pair p { margin: 6px 0 0; font-size: 14.5px; color: var(--text); }

/* Notes */
.note { --n: #3D8BFF; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; max-width: 800px; margin: 22px 0; padding: 18px 20px; border-radius: 16px; background: color-mix(in srgb, var(--n) 8%, var(--paper)); border: 1px solid color-mix(in srgb, var(--n) 26%, transparent); }
.note > svg { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--n); color: #fff; }
.note b { display: block; font: 700 15.5px/1.35 var(--head); color: var(--ink); margin-bottom: 4px; }
.note p { font-size: 15px; }
.note p:last-child { margin-bottom: 0; }
.note.tip { --n: #19B5A5; }
.note.warn { --n: #E59A00; }
.note.warn > svg { color: var(--night); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0; max-width: 100%; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--newsprint); color: var(--ink); font: 700 12.5px/1.3 var(--head); letter-spacing: .03em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink); font-weight: 600; }
.doc td:first-child code { white-space: nowrap; overflow-wrap: normal; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--newsprint); color: var(--text); font: 700 12px/1.4 var(--body); white-space: nowrap; }
.tag.must { background: #E3F5F2; color: #0E6E64; }
.tag.soft { background: transparent; border: 1px solid var(--line); color: var(--muted); }
:root[data-theme="dark"] .tag.must { background: rgba(25, 181, 165, .16); color: #63D6C8; }

/* Figures */
.shot { margin: 22px 0 10px; max-width: 900px; }
.shot img { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
.shot figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.shot.narrow { max-width: 620px; }

/* Table of contents: post headings on the left, the list they make on the right */
.toc-map { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 14px 16px; max-width: 860px; margin: 18px 0 22px; padding: 20px; border-radius: 18px; background: var(--newsprint); border: 1px solid var(--line); }
.tm-side { min-width: 0; align-self: stretch; display: flex; flex-direction: column; }
.tm-label { display: block; margin-bottom: 10px; font: 700 12px/1.3 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc-map ol { list-style: none; margin: 0; padding: 0; }
.doc .toc-map li { max-width: none; }
.tm-blocks { display: grid; gap: 6px; }
.doc .tm-blocks li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font: 700 14.5px/1.35 var(--head); color: var(--ink); }
.tm-blocks i { flex: none; min-width: 28px; padding: 4px 5px; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); font: 800 11px/1 var(--body); font-style: normal; text-align: center; }
.doc .tm-blocks .tm-sub { margin-inline-start: 22px; font-weight: 600; }
.doc .tm-blocks .tm-p { background: transparent; border-style: dashed; color: var(--muted); font: 500 14px/1.35 var(--body); }
.tm-blocks .tm-p i { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tm-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--coral); color: #fff; }
.tm-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tm-box { flex: 1; padding: 18px 20px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.tm-box > b { position: relative; display: block; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font: 800 16px/1.3 var(--head); color: var(--ink); }
.tm-box > b::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -2px; width: 34px; height: 3px; border-radius: 2px; background: var(--coral); }
.doc .tm-box > ol > li { margin-bottom: 8px; font: 700 14.5px/1.4 var(--head); color: var(--ink); }
.tm-box em { display: inline-block; min-width: 26px; font-style: normal; font-weight: 800; color: var(--coral-text); }
.tm-box ol ol { margin: 6px 0 0; margin-inline-start: 26px; }
.doc .tm-box ol ol li { position: relative; margin-bottom: 4px; padding-inline-start: 14px; font: 500 14px/1.4 var(--body); color: var(--text); }
.tm-box ol ol li::before { content: ""; position: absolute; inset-inline-start: 0; top: .68em; width: 7px; height: 2px; background: var(--coral); }
.toc-map figcaption { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
@media (max-width: 760px) {
    .toc-map { grid-template-columns: minmax(0, 1fr); padding: 16px; }
    .tm-arrow { justify-self: center; transform: rotate(90deg); }
}

/* Demo cards (static images, lift on hover) */
.demo-list { list-style: none; margin: 20px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.demo-list li { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--card); transition: transform .3s var(--ease), box-shadow .3s; }
.demo-list li:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.demo-list img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.demo-list div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 12px 14px; }
.demo-list b { font: 800 15px/1.3 var(--head); color: var(--ink); }
.demo-list b small { font: 600 11.5px var(--body); color: var(--muted); margin-inline-start: 4px; }
.demo-list span { display: flex; gap: 12px; }
.doc .demo-list a { font: 600 13.5px/1.3 var(--body); text-decoration: none; }
.doc .demo-list a:hover { text-decoration: underline; }
.demo-list a[lang="ar"] { font-family: var(--ar-body); font-size: 14.5px; }

/* Colour swatches */
.swatches { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 860px; }
.swatches li { position: relative; padding: 66px 12px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.swatches li::before { content: ""; position: absolute; inset: 6px 6px auto; height: 52px; border-radius: 9px; background: var(--s); }
.swatches b { display: block; font: 700 14px/1.3 var(--head); color: var(--ink); }
.swatches span { display: block; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.doc .swatches code { display: inline-block; margin-top: 6px; font-size: 12px; }

/* Which header wins */
.order { list-style: none; counter-reset: ord; margin: 18px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; max-width: 760px; }
.order li { counter-increment: ord; padding: 14px 16px; background: var(--newsprint); margin: 0; }
.order li:first-child { border-radius: 14px 0 0 14px; }
.order li:last-child { border-radius: 0 14px 14px 0; }
.order b { display: block; font: 800 14.5px/1.3 var(--head); color: var(--ink); }
.order b::before { content: counter(ord); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-inline-end: 8px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; }
.order span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* Code */
.code { max-width: 760px; margin: 16px 0; border-radius: 14px; overflow: hidden; background: var(--night); border: 1px solid #1D3048; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 8px 7px 16px; background: var(--night-2); color: #8FA0B2; font: 600 12.5px var(--body); }
.copy { padding: 5px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07); color: #fff; font: 600 12px var(--body); cursor: pointer; }
.copy:hover { border-color: rgba(255, 255, 255, .4); }
.copy.is-done { background: var(--coral); border-color: var(--coral); color: #fff; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 500 13.5px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; color: #DDE6EF; tab-size: 4; }
.doc .code code { background: none; padding: 0; color: inherit; font: inherit; overflow-wrap: normal; }

/* Troubleshooting */
.faq { max-width: 860px; margin-top: 8px; }
.faq details { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.faq summary { position: relative; list-style: none; cursor: pointer; padding: 15px 56px 15px 18px; font: 700 15.5px/1.4 var(--head); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 14px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--newsprint); color: var(--coral-text); font: 700 18px/28px var(--body); text-align: center; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0; padding: 0 18px 16px; font-size: 15px; }

/* Changelog and credits */
.release { position: relative; padding-inline-start: 24px; border-inline-start: 2px solid var(--line); margin-bottom: 8px; }
.release::before { content: ""; position: absolute; left: -7px; top: 36px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--paper); }
.release h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.release h4 small { font: 500 14px var(--body); color: var(--muted); letter-spacing: 0; }
.release ul { padding-inline-start: 20px; max-width: 760px; }
.release li { margin-bottom: 6px; }
.credits { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 860px; }
.doc .credits li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--muted); }
.credits b { display: block; font: 700 14px/1.35 var(--head); color: var(--ink); }

/* Rail */
.rail { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 70px); overflow-y: auto; padding: 64px 4px 24px 0; scrollbar-width: thin; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font: 700 12px/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rail-close { display: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; place-items: center; }
.rail-close svg { width: 16px; height: 16px; }
.rail-group { margin-bottom: 4px; }
.rail-ch { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--ink); font: 700 14px/1.3 var(--head); text-decoration: none; }
.rail-ch b { display: grid; place-items: center; width: 28px; height: 22px; flex: none; border-radius: 7px; background: color-mix(in srgb, var(--c) 20%, transparent); font: 800 11px/1 var(--head); }
.rail-ch:hover { background: var(--newsprint); }
.rail-group ul { list-style: none; margin: 2px 0 10px 21px; padding: 0; border-inline-start: 2px solid var(--line); }
.js .rail-group:not(.is-open) ul { display: none; }
.rail-group ul a { display: block; margin-inline-start: -2px; padding: 5px 12px; border-inline-start: 2px solid transparent; color: var(--text); font-size: 14px; line-height: 1.4; text-decoration: none; }
.rail-group ul a:hover { color: var(--ink); }
.rail-group ul a.is-current { border-color: var(--c); color: var(--ink); font-weight: 600; }
.rail-help { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--newsprint); text-decoration: none; color: var(--muted); font-size: 13px; line-height: 1.4; }
.rail-help svg { width: 36px; height: 36px; flex: none; padding: 8px; border-radius: 50%; background: var(--coral); color: #fff; }
.rail-help b { display: block; font: 700 14px/1.3 var(--head); color: var(--ink); }

/* Footer */
.d-foot { background: var(--night); color: #B9C6D3; padding-top: 64px; }
:root[data-theme="dark"] .d-foot { border-top: 1px solid var(--line); }
.d-foot-cta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.d-foot .kicker { color: var(--coral); }
.d-foot h2 { color: #fff; font-size: clamp(26px, 3vw, 38px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 10px; }
.d-foot-cta p:last-child { margin: 0; max-width: 520px; }
.d-foot-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px; border: 2px solid transparent; font: 700 15px/1 var(--head); text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s; }
.pill svg { width: 10px; height: 10px; }
.pill-coral { background: var(--coral); color: #fff; }
.pill-coral:hover { background: #fff; color: var(--night); }
.pill-ghost { border-color: rgba(255, 255, 255, .28); color: #fff; }
.pill-ghost:hover { border-color: #fff; }
.d-foot-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 22px 0 28px; font-size: 13.5px; color: #8FA0B2; }
.d-foot-bar img { width: 132px; }
.d-foot-bar span { padding-inline-start: 24px; border-inline-start: 1px solid rgba(255, 255, 255, .14); }

/* Floating bits */
.contents-fab { display: none; position: fixed; left: 50%; bottom: 18px; z-index: 45; transform: translateX(-50%); align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); background: var(--night); color: #fff; font: 700 14px/1 var(--head); box-shadow: 0 18px 36px -14px rgba(4, 10, 20, .6); cursor: pointer; }
.contents-fab svg { width: 18px; height: 18px; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(5, 12, 22, .55); }
.scrim[hidden] { display: none; }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--coral); color: #fff; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top svg { width: 18px; height: 18px; }
.to-top.is-on { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--night); color: #fff; }
.toast { position: fixed; left: 50%; bottom: 84px; z-index: 90; transform: translate(-50%, 16px); padding: 10px 18px; border-radius: 999px; background: var(--night); color: #fff; border: 1px solid rgba(255, 255, 255, .16); font: 600 14px var(--body); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Search dialog */
.search-pop { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(5, 12, 22, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.search-pop[hidden] { display: none; }
.search-card { width: min(640px, 100%); padding: 8px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow-lg); }
.finder-pop > svg { left: 16px; top: 28px; }
.finder-pop input { height: 56px; padding: 0 56px 0 46px; border-radius: 14px; background: var(--card); color: var(--ink); font-size: 17px; border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.finder-pop input:focus { outline: none; }
.search-close { position: absolute; right: 6px; top: 8px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--newsprint); color: var(--ink); cursor: pointer; }
.search-close svg { width: 16px; height: 16px; }
.finder-pop .finder-list { position: static; max-height: 55vh; margin-top: 6px; padding: 0; border: 0; box-shadow: none; }
.search-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; padding: 10px 12px 4px; font-size: 12.5px; color: var(--muted); }
.search-hint span { display: inline-flex; align-items: center; gap: 4px; }

/* Narrower screens */
@media (max-width: 1360px) {
    .dh-search span, .dh-search kbd { display: none; }
    .dh-search { width: 40px; padding: 0; justify-content: center; }
    .dh-chapters a { padding: 8px 10px; }
}
@media (max-width: 1180px) {
    .dh-chapters { display: none; }
    .dh-tools { margin-inline-start: auto; }
    .dh-search span { display: inline; }
    .dh-search { width: auto; padding: 0 14px 0 13px; }
    .d-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .rail { position: fixed; z-index: 60; inset: auto 0 0; top: auto; max-height: 80vh; padding: 18px 20px 26px; border-radius: 22px 22px 0 0; background: var(--paper); box-shadow: 0 -24px 50px -20px rgba(4, 10, 20, .45); transform: translateY(105%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s; }
    .rail.is-open { transform: none; visibility: visible; transition: transform .3s var(--ease); }
    .rail-head { position: sticky; top: -18px; z-index: 1; margin: -18px -20px 8px; padding: 14px 20px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
    .rail-close { display: grid; }
    .js .rail-group:not(.is-open) ul { display: block; }
    .contents-fab { display: inline-flex; }
    .to-top { bottom: 18px; right: 16px; }
    .d-hero-grid { gap: 40px; }
}
@media (max-width: 900px) {
    .d-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .quick { max-width: 640px; }
}
@media (max-width: 760px) {
    .dh-search span { display: none; }
    .dh-search { width: 40px; padding: 0; }
    .d-hero { padding-top: 40px; }
    .d-lead { font-size: 16.5px; }
    .facts li { flex-basis: 50%; padding-bottom: 10px; }
    .chapter { padding-top: 48px; }
    .ch-open { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
    .ch-num { grid-row: auto; font-size: 60px; }
    .ch-links { grid-column: 1; }
    .pair, .order { grid-template-columns: minmax(0, 1fr); }
    .order li:first-child { border-radius: 14px 14px 0 0; }
    .order li:last-child { border-radius: 0 0 14px 14px; }
    .demo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .swatches, .credits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .note { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .steps > li { padding-inline-start: 50px; }
    .quick { padding: 22px 20px 18px; }
}
@media (max-width: 520px) {
    .dh-row { gap: 10px; }
    .dh-buy { display: none; }
    .finder-hero input { height: 54px; padding-right: 18px; font-size: 15px; }
    .finder-hero kbd { display: none; }
    .demo-list, .credits { grid-template-columns: minmax(0, 1fr); }
    .facts li { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .rail, .demo-list li, .quick-bar i, .toast, .to-top, .ch-links a { transition: none; }
}
@media print {
    .dh, .rail, .contents-fab, .to-top, .search-pop, .quick, .finder, .popular, .anchor, .copy, .d-foot-btns { display: none !important; }
    .d-hero { background: none; color: #000; padding-top: 0; }
    .d-hero h1 { color: #000; }
    .d-body { display: block; }
    .faq details > p { display: block; }
}
