/*
 * IndieWiki stylesheet
 * ------------------------------------------------------------------
 * Look: a field manual. Cool paper, ink-navy text, cobalt links, and one
 * marker yellow kept for "reviewed" stamps, search hits and progress.
 * Type: Atkinson Hyperlegible Next + Mono (Braille Institute, SIL OFL),
 * chosen because legibility is the whole point of a reference wiki.
 *
 * Sections:
 *   1. Fonts           5. Header and search    9. Toolbox
 *   2. Tokens          6. Layout and nav      10. Home
 *   3. Base            7. Article and prose   11. Footer, toast, misc
 *   4. Utilities       8. Checklists          12. Print
 */

/* 1. Fonts ------------------------------------------------------------- */
@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/atkinson-next-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/atkinson-next-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Next";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/atkinson-next-latin-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Atkinson Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/atkinson-mono-latin.woff2") format("woff2-variations");
}

/* 2. Tokens ------------------------------------------------------------ */
:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --sunk: #eceee9;
  --ink: #17202b;
  --ink-2: #4a5563;
  --ink-3: #5c6570;
  --rule: #d9ddd7;
  --rule-strong: #b9bfb7;
  --link: #1f45c4;
  --link-hover: #0f2e9e;
  --marker: #fbdb54;
  --marker-ink: #17202b;
  --focus: #1f45c4;
  --tip-bg: #e8f4ec;   --tip-line: #2b7a4b;
  --note-bg: #eaf0fd;  --note-line: #1f45c4;
  --warn-bg: #fff4d1;  --warn-line: #946200;
  --danger-bg: #fce8e6; --danger-line: #b42318;
  --india-bg: #fff0e0; --india-line: #a85300;
  --shadow: 0 1px 0 rgb(23 32 43 / 6%), 0 8px 24px -12px rgb(23 32 43 / 18%);

  --font: "Atkinson Next", "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.6vw, 4.25rem);

  --radius: 6px;
  --radius-lg: 12px;
  --header-h: 64px;
  --measure: 70ch;
  --gutter: clamp(16px, 4vw, 32px);
}

:root[data-theme="dark"] {
  --bg: #11161d;
  --surface: #18202a;
  --sunk: #0c1015;
  --ink: #e7ebf0;
  --ink-2: #b1bac6;
  --ink-3: #8d97a4;
  --rule: #2a3441;
  --rule-strong: #3d4a5a;
  --link: #9db5ff;
  --link-hover: #c4d3ff;
  --marker: #e9c93f;
  --marker-ink: #11161d;
  --focus: #9db5ff;
  --tip-bg: #13281c;   --tip-line: #5cc58a;
  --note-bg: #16213d;  --note-line: #9db5ff;
  --warn-bg: #2b2310;  --warn-line: #e6b84a;
  --danger-bg: #331614; --danger-line: #ff8f84;
  --india-bg: #2e1d0d; --india-line: #f2a05a;
  --shadow: 0 1px 0 rgb(0 0 0 / 30%), 0 10px 30px -14px rgb(0 0 0 / 60%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d;
    --surface: #18202a;
    --sunk: #0c1015;
    --ink: #e7ebf0;
    --ink-2: #b1bac6;
    --ink-3: #8d97a4;
    --rule: #2a3441;
    --rule-strong: #3d4a5a;
    --link: #9db5ff;
    --link-hover: #c4d3ff;
    --marker: #e9c93f;
    --marker-ink: #11161d;
    --focus: #9db5ff;
    --tip-bg: #13281c;   --tip-line: #5cc58a;
    --note-bg: #16213d;  --note-line: #9db5ff;
    --warn-bg: #2b2310;  --warn-line: #e6b84a;
    --danger-bg: #331614; --danger-line: #ff8f84;
    --india-bg: #2e1d0d; --india-line: #f2a05a;
    --shadow: 0 1px 0 rgb(0 0 0 / 30%), 0 10px 30px -14px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

/* 3. Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--marker); color: var(--marker-ink); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p, ul, ol, dl { margin: 0; }
button, input { font: inherit; color: inherit; }
kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 0.05em 0.45em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  white-space: nowrap;
}
.kbd-plus { padding: 0 0.15em; color: var(--ink-3); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--sunk); padding: 0.1em 0.35em; border-radius: 4px; }
mark { background: var(--marker); color: var(--marker-ink); border-radius: 2px; padding: 0 0.1em; }
progress { accent-color: var(--ink); }

/* 4. Utilities ---------------------------------------------------------- */
.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: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--bg); }
.icon { display: block; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--link); border-color: var(--link); color: #fff; }
.btn--quiet { border-color: var(--rule-strong); font-weight: 600; background: transparent; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--sunk); }
.pill {
  display: inline-block; font-size: var(--step--1); font-weight: 700; line-height: 1;
  padding: 5px 9px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); white-space: nowrap;
}
.pill--pick { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.stamp {
  display: inline-block; background: var(--marker); color: var(--marker-ink);
  font-weight: 700; font-size: var(--step--1); padding: 3px 8px; border-radius: 3px;
  transform: rotate(-0.6deg);
}
.type-tag {
  display: inline-block; font-size: var(--step--1); font-weight: 700;
  padding: 2px 8px; border-radius: 3px; border: 1.5px solid currentColor; color: var(--ink-2);
}
.meta-plain { color: var(--ink-2); font-size: var(--step--1); }

/* 5. Header and search --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  height: var(--header-h); max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand:hover { color: var(--ink); }
.brand__name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo-mark__bg { fill: var(--ink); }
.logo-mark__brackets, .logo-mark__stem { stroke: var(--bg); }
.logo-mark__dot { fill: var(--marker); }
.nav-toggle { display: none; margin-left: -8px; }

.search { position: relative; flex: 1 1 auto; max-width: 560px; margin-left: auto; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search__input {
  width: 100%; height: 44px; padding: 0 44px 0 42px;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface);
}
.search__input::placeholder { color: var(--ink-3); }
.search__input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__key { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search__input:focus ~ .search__key { display: none; }
.search__panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); max-height: min(70vh, 560px); overflow: auto; padding: 8px;
}
.search__status { font-size: var(--step--1); color: var(--ink-2); padding: 6px 10px; }
.search__results { list-style: none; padding: 0; }
.search__results a, .search-page__results a.result {
  display: block; padding: 10px; border-radius: var(--radius); text-decoration: none; color: var(--ink);
}
.search__results a:hover, .search__results a:focus-visible { background: var(--sunk); outline-offset: -3px; }
.result__title { display: block; font-weight: 700; color: var(--link); }
.result__where { display: block; font-size: var(--step--1); color: var(--ink-3); }
.result__text { display: block; font-size: var(--step--1); color: var(--ink-2); margin-top: 2px; }
.search__more { display: block; padding: 10px; font-weight: 700; }

.top-links ul { display: flex; gap: 4px; list-style: none; padding: 0; }
.top-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.top-links a:hover { background: var(--sunk); }
.top-links a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--ink); border-radius: 0; }
.theme-toggle__light { display: none; }
:root[data-theme="dark"] .theme-toggle__light { display: block; }
:root[data-theme="dark"] .theme-toggle__dark { display: none; }

/* 6. Layout and navigation ------------------------------------------------ */
.shell {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px;
}
.shell--toc { grid-template-columns: 250px minmax(0, 1fr) 220px; }
.main { min-width: 0; padding: 32px 0 64px; }
.main:focus { outline: none; }
.main--wide { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 72px; }

.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 8px 40px 0; font-size: 0.95rem;
}
.sidebar__head { display: none; }
.sidebar__heading { font-weight: 800; color: var(--ink-3); font-size: var(--step--1); margin: 18px 0 8px; }
.sidebar__heading:first-of-type { margin-top: 0; }
.nav-stages, .nav-ref, .nav-group__items { list-style: none; padding: 0; }
.nav-group__title {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.nav-group__num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none;
  border: 1.5px solid var(--ink); border-radius: 50%; font-size: 0.75rem; font-weight: 800;
}
.nav-group__row { display: flex; align-items: center; gap: 2px; }
.nav-group__row .nav-group__title { flex: 1; min-width: 0; }
.nav-group__toggle {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: var(--radius); background: none; color: var(--ink-2); cursor: pointer;
}
.nav-group__toggle[hidden] { display: none; }
.nav-group__toggle:hover { background: var(--sunk); color: var(--ink); }
.nav-group__toggle .icon { transition: transform 0.15s ease; }
.nav-group__toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.nav-group__items { display: none; margin: 2px 0 8px 19px; padding-left: 14px; border-left: 1.5px solid var(--rule); }
.nav-group.is-open .nav-group__items { display: block; }
.nav-group__items a, .nav-ref a {
  display: block; padding: 5px 8px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; line-height: 1.35;
}
.nav-group__title:hover, .nav-group__items a:hover, .nav-ref a:hover { background: var(--sunk); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.sidebar a[aria-current="page"] .nav-group__num { border-color: var(--bg); }
.nav-ref--mobile, .sidebar__heading:last-of-type { display: none; }
.nav-scrim { position: fixed; inset: 0; z-index: 44; background: rgb(10 14 20 / 45%); }

.toc {
  position: sticky; top: calc(var(--header-h) + 24px); align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding: 32px 0; font-size: 0.9rem;
}
.toc__title { font-weight: 800; color: var(--ink-3); font-size: var(--step--1); margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; border-left: 1.5px solid var(--rule); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1.5px; border-left: 1.5px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--ink); font-weight: 700; }
.toc__l3 a { padding-left: 24px; font-size: 0.85rem; }

/* 7. Article and prose ------------------------------------------------------ */
.doc { max-width: var(--measure); }
.doc--wide { max-width: 980px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; padding: 0; font-size: var(--step--1); color: var(--ink-3); }
.breadcrumbs li:not(:last-child)::after { content: "/"; padding: 0 8px; color: var(--rule-strong); }
.breadcrumbs a { color: var(--ink-2); }
.doc__header { margin: 18px 0 28px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.doc__header h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.025em; }
.doc__lede { font-size: var(--step-1); color: var(--ink-2); margin-top: 12px; line-height: 1.45; }
.doc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; }
.stage-label { font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }

.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--step-2); font-weight: 800; margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { font-size: var(--step-1); font-weight: 750; margin-top: 1.8em; }
.prose h4 { font-size: var(--step-0); font-weight: 800; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li > ul, .prose li > ol { margin-top: 0.35em; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--rule-strong); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose img { border: 1px solid var(--rule); border-radius: var(--radius); }
.prose strong { font-weight: 750; }
.heading-anchor {
  margin-left: 0.35em; color: var(--ink-3); text-decoration: none; font-weight: 400;
  opacity: 0; transition: opacity 0.15s;
}
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }
a.ext::after {
  content: ""; display: inline-block; width: 0.62em; height: 0.62em; margin-left: 0.22em; vertical-align: 0.05em;
  background: currentColor; opacity: 0.75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 1h7v7M11 1 1 11' fill='none' stroke='black' stroke-width='2'/%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 12 12'%3E%3Cpath d='M4 1h7v7M11 1 1 11' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tool-ref { font-weight: 650; text-decoration-style: dotted; }
.term-ref { text-decoration-style: dashed; color: inherit; }

.table-wrap { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 3px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
thead th { background: var(--sunk); font-weight: 800; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 700; }

.code-block { position: relative; }
.code-block pre {
  margin: 0; overflow-x: auto; padding: 16px 18px; padding-top: 30px;
  background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: 0.88rem; line-height: 1.55;
}
.code-block pre code { background: none; padding: 0; font-size: inherit; }
.code-lang { position: absolute; top: 6px; left: 12px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
.copy-code {
  position: absolute; top: 6px; right: 6px; min-height: 32px; padding: 4px 10px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer;
}

.callout {
  border-left: 5px solid var(--note-line); background: var(--note-bg);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px;
}
.callout__title { font-weight: 800; margin-bottom: 4px; }
.callout__body > * + * { margin-top: 0.6em; }
.callout--tip { border-color: var(--tip-line); background: var(--tip-bg); }
.callout--warning { border-color: var(--warn-line); background: var(--warn-bg); }
.callout--danger { border-color: var(--danger-line); background: var(--danger-bg); }
.callout--india { border-color: var(--india-line); background: var(--india-bg); }

.steps > ol { list-style: none; counter-reset: step; padding-left: 0; }
.steps > ol > li { counter-increment: step; position: relative; padding-left: 52px; min-height: 36px; }
.steps > ol > li + li { margin-top: 1.1em; }
.steps > ol > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 0.95rem;
}
.steps > ol > li > p:first-child strong:first-child { font-size: 1.05em; }

.faq, .mentioned, .sources, .related { margin-top: 48px; }
.faq h2, .mentioned h2, .sources h2, .related h2 { font-size: var(--step-1); font-weight: 800; margin-bottom: 12px; }
.faq__item { border-top: 1px solid var(--rule); }
.faq__item:last-child { border-bottom: 1px solid var(--rule); }
.faq__item summary { cursor: pointer; padding: 14px 4px; font-weight: 700; list-style-position: outside; }
.faq__answer { padding: 0 4px 16px; color: var(--ink-2); }
.mentioned__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.mentioned__list li { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.mentioned__list a { font-weight: 700; }
.mentioned__list span { font-size: var(--step--1); color: var(--ink-3); }
.sources ol { padding-left: 1.4em; font-size: 0.95rem; }
.related ul { list-style: none; padding: 0; }
.related li { padding: 10px 0; border-top: 1px solid var(--rule); }
.related a { font-weight: 700; }
.related p { color: var(--ink-2); font-size: 0.95rem; }

.doc__footer { margin-top: 56px; padding-top: 20px; border-top: 2px solid var(--ink); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.pager__link {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); text-decoration: none; color: var(--ink);
}
.pager__link:hover { border-color: var(--ink); color: var(--ink); }
.pager__link--next { text-align: right; grid-column: 2; }
.pager__label { font-size: var(--step--1); color: var(--ink-3); }
.pager__title { font-weight: 700; color: var(--link); }

.list-heading { font-size: var(--step-1); font-weight: 800; margin: 32px 0 12px; }
.page-list { list-style: none; padding: 0; }
.page-list > li { padding: 16px 0; border-top: 1px solid var(--rule); }
.page-list > li:last-child { border-bottom: 1px solid var(--rule); }
.page-list__title { font-weight: 750; font-size: 1.12rem; margin-right: 8px; }
.page-list p { color: var(--ink-2); margin-top: 4px; }
.next-stage { margin-top: 28px; font-weight: 600; }

/* 8. Checklists --------------------------------------------------------------- */
.checklist-bar {
  position: sticky; top: calc(var(--header-h) + 8px); z-index: 20;
  display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center;
  padding: 14px 16px; margin: 0 0 28px; background: var(--surface);
  border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.checklist-bar__progress { display: grid; gap: 6px; }
.checklist-bar__progress label { font-weight: 800; }
.checklist-bar progress {
  width: 100%; height: 12px; appearance: none; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--sunk); overflow: hidden;
}
.checklist-bar progress::-webkit-progress-bar { background: var(--sunk); }
.checklist-bar progress::-webkit-progress-value { background: var(--marker); }
.checklist-bar progress::-moz-progress-bar { background: var(--marker); }
.checklist-bar__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.checklist-bar__actions .btn { min-height: 40px; padding: 6px 10px; font-size: 0.9rem; }
.checklist-bar__note { grid-column: 1 / -1; font-size: var(--step--1); color: var(--ink-3); }
.checklist-bar.is-complete { border-color: var(--tip-line); }

.prose ul.checklist { list-style: none; padding-left: 0; }
.prose li.check {
  position: relative; padding: 10px 12px 10px 48px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
}
.prose li.check + li.check { margin-top: 6px; }
.check__box {
  position: absolute; left: 12px; top: 11px; width: 24px; height: 24px; margin: 0;
  appearance: none; border: 2px solid var(--ink); border-radius: 5px; background: var(--surface); cursor: pointer;
}
.check__box:checked { background: var(--ink); }
.check__box:checked::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px;
  border: solid var(--marker); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
li.check.is-done { background: transparent; border-style: dashed; }
li.check.is-done .check__label { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); text-decoration-thickness: 1.5px; }
li.check.is-done .check__label a { color: var(--ink-3); }

/* 9. Toolbox --------------------------------------------------------------------- */
.tool-group { margin-top: 36px; }
.tool-group h2 { font-size: var(--step-1); font-weight: 800; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.category-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 32px; }
.category-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.category-list a { font-weight: 750; }
.category-list__count { color: var(--ink-3); font-size: var(--step--1); margin-left: 4px; }
.category-list p { color: var(--ink-2); font-size: 0.95rem; margin-top: 2px; }
.compare .price-model { display: block; font-weight: 700; }
.compare th[scope="row"] { white-space: nowrap; }
.tools { margin-top: 40px; }
.tool { padding: 28px 0; border-top: 2px solid var(--ink); scroll-margin-top: calc(var(--header-h) + 12px); }
.tool:target { background: linear-gradient(90deg, color-mix(in srgb, var(--marker) 22%, transparent), transparent 70%); }
.tool__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.tool__head h2 { font-size: var(--step-2); font-weight: 800; }
.tool__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tool__summary { margin-top: 8px; font-size: 1.1rem; }
.tool__facts { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 28px; justify-content: start; margin-top: 16px; }
.tool__facts > div { display: contents; }
.tool__facts dt { grid-row: 1; font-size: var(--step--1); font-weight: 800; color: var(--ink-3); }
.tool__facts dd { grid-row: 2; margin: 0; max-width: 36ch; }
.tool__pc { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
.tool__pc h3 { font-size: var(--step-0); font-weight: 800; margin-bottom: 6px; }
.tool__pc ul { padding-left: 1.2em; }
.tool__pc li { color: var(--ink-2); }
.tool__pc li + li { margin-top: 4px; }
.tool__pros li::marker { content: "+  "; color: var(--tip-line); font-weight: 800; }
.tool__cons li::marker { content: "−  "; color: var(--danger-line); font-weight: 800; }
.tool__note { margin-top: 14px; padding: 10px 14px; background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
.tool__links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.tool__links > a { font-weight: 700; }
.tool__used { font-size: var(--step--1); color: var(--ink-3); }

/* 10. Home ------------------------------------------------------------------------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(36px, 6vw, 64px); max-width: 980px; }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 16ch; }
.hero__lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); color: var(--ink-2); max-width: 58ch; margin-top: 22px; line-height: 1.5; }
.hero-search { display: flex; gap: 8px; margin-top: 30px; max-width: 680px; }
.hero-search input {
  flex: 1; min-width: 0; height: 56px; padding: 0 18px; font-size: 1.1rem;
  border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface);
}
.hero-search input:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 35%, transparent); }
.hero-search .btn { min-height: 56px; padding: 0 22px; }
.hero-search--page { margin: 0 0 20px; }
.hero__try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 16px; color: var(--ink-3); font-size: 0.95rem; }
.hero__try ul { display: contents; list-style: none; }
.hero__try a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.hero__try a:hover { border-color: var(--ink); }

.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.block-head h2 { font-size: var(--step-2); font-weight: 800; }
.block-head p { color: var(--ink-2); }

.route-block { margin-top: 8px; }
.route { list-style: none; padding: 0; }
.route__stop {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1.05fr) minmax(0, 1.2fr); gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.route__stop::before {
  content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 3px; background: var(--ink);
}
.route__stop:first-child::before { top: 30px; }
.route__stop:last-child::before { bottom: calc(100% - 30px); }
.route__num {
  position: relative; display: grid; place-items: center; width: 45px; height: 45px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--ink); font-weight: 800; font-size: 1.15rem;
}
.route__stop:hover .route__num { background: var(--marker); color: var(--marker-ink); }
.route__body h3 { font-size: var(--step-2); font-weight: 800; }
.route__body h3 a { color: var(--ink); text-decoration: none; }
.route__body h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.route__body p { color: var(--ink-2); margin-top: 4px; }
.route__links { list-style: none; padding: 4px 0 0; display: grid; gap: 4px; align-content: start; }
.route__links a { font-weight: 600; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 48px; margin-top: 64px; }
.checklist-index, .tool-index { list-style: none; padding: 0; }
.checklist-index li, .tool-index li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.checklist-index a, .tool-index a { font-weight: 700; }
.tool-index { column-count: 2; column-gap: 28px; }
.tool-index li { break-inside: avoid; }
.checklist-index__count, .tool-index span { color: var(--ink-3); font-size: var(--step--1); white-space: nowrap; }
.checklist-index__count.has-progress { color: var(--marker-ink); background: var(--marker); padding: 1px 8px; border-radius: 3px; font-weight: 700; }
.page-list--checklists .checklist-index__count { display: inline-block; }

.recent { margin-top: 64px; }
.recent__list { list-style: none; padding: 0; margin-bottom: 14px; }
.recent__list li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.recent__list time { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); }
.recent__list a { font-weight: 650; }
.recent__list--full li { grid-template-columns: 7.5em 1fr auto; }
.recent__section { font-size: var(--step--1); color: var(--ink-3); }

.contribute-band {
  margin-top: 72px; padding: clamp(24px, 4vw, 40px); background: var(--ink); color: var(--bg); border-radius: var(--radius-lg);
}
.contribute-band h2 { font-size: var(--step-2); font-weight: 800; }
.contribute-band p { margin-top: 10px; max-width: 60ch; color: color-mix(in srgb, var(--bg) 82%, var(--ink)); }
.contribute-band__ways { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin-top: 20px; }
.contribute-band .btn { border-color: var(--bg); background: var(--bg); color: var(--ink); }
.contribute-band .btn--quiet { background: transparent; color: var(--bg); }
.contribute-band .btn:hover { background: var(--marker); border-color: var(--marker); color: var(--marker-ink); }

.letters ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin-bottom: 20px; }
.letters a { display: grid; place-items: center; min-width: 40px; min-height: 40px; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.letters a:hover { border-color: var(--ink); }
.glossary__letter { margin-top: 28px; }
.glossary__heading { font-size: var(--step-2); font-weight: 800; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.glossary__entry { padding: 14px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--header-h) + 12px); }
.glossary__entry:target { background: color-mix(in srgb, var(--marker) 28%, transparent); }
.glossary__entry dt { font-weight: 800; font-size: 1.08rem; }
.glossary__entry dd { margin: 4px 0 0; color: var(--ink-2); }

.search-page__status { color: var(--ink-2); margin-bottom: 8px; }
.search-page__results { list-style: none; padding: 0; }
.search-page__results li { border-bottom: 1px solid var(--rule); }

/* 11. Footer, toast, misc ------------------------------------------------------------ */
.site-footer { border-top: 2px solid var(--ink); margin-top: 40px; font-size: 0.95rem; }
.site-footer__inner {
  max-width: 1440px; margin: 0 auto; padding: 40px var(--gutter) 24px;
  display: grid; grid-template-columns: minmax(220px, 1fr) 2.2fr; gap: 40px;
}
.site-footer__about p { color: var(--ink-2); margin-top: 12px; max-width: 34ch; }
.site-footer__nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.site-footer__nav h2 { font-size: var(--step--1); font-weight: 800; color: var(--ink-3); margin-bottom: 8px; }
.site-footer__nav ul { list-style: none; padding: 0; }
.site-footer__nav li + li { margin-top: 6px; }
.site-footer__nav a { color: var(--ink); text-decoration: none; }
.site-footer__nav a:hover { text-decoration: underline; color: var(--link); }
.site-footer__legal {
  max-width: 1440px; margin: 0 auto; padding: 16px var(--gutter) 32px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; border-top: 1px solid var(--rule); color: var(--ink-2);
}
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; padding: 0; }
.site-footer__legal a { color: var(--ink-2); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--radius);
  background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: var(--shadow);
}

/* Responsive ----------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .shell--toc { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1000px) {
  .top-links { display: none; }
  .nav-ref--mobile, .sidebar__heading:last-of-type { display: block; }
}
@media (max-width: 900px) {
  :root { --header-h: 60px; }
  .nav-toggle { display: inline-grid; }
  .shell, .shell--toc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar {
    /* align-self must be reset: with "start" a fixed grid child grows to its content height and cannot scroll. */
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 45; width: min(86vw, 340px);
    align-self: stretch; height: 100vh; height: 100dvh; max-height: none;
    padding: 0 16px 40px; background: var(--bg); border-right: 1.5px solid var(--ink);
    transform: translateX(-102%); transition: transform 0.22s ease; visibility: hidden;
  }
  .sidebar.is-open { transform: none; visibility: visible; }
  .sidebar__head {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0;
    background: var(--bg); padding: 8px 0; margin-bottom: 8px; border-bottom: 1px solid var(--rule);
  }
  .sidebar__label { font-weight: 800; }
  .nav-group__title, .nav-group__items a, .nav-ref a { padding-top: 9px; padding-bottom: 9px; }
  .nav-group__toggle { width: 44px; height: 44px; }
  .main { padding-top: 20px; }
  .route__stop { grid-template-columns: 52px minmax(0, 1fr); }
  .route__links { grid-column: 2; }
  .home-grid { grid-template-columns: 1fr; gap: 40px; }
  .tool-index { column-count: 1; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .brand__name { font-size: 1.05rem; }
  .search { margin-left: 0; }
  .search__input { padding-right: 12px; }
  .search__key { display: none; }
  .site-header__inner { gap: 6px; }
  .brand { gap: 8px; }
  .search__panel { position: fixed; top: calc(var(--header-h) + 4px); left: 8px; right: 8px; }
  .hero-search { flex-direction: column; }
  .hero-search input { flex: none; }
  .tool__facts { grid-template-columns: 1fr; }
  .tool__facts > div { display: block; }
  .tool__facts > div + div { margin-top: 10px; }
  .tool__pc { grid-template-columns: 1fr; }
  .checklist-bar { grid-template-columns: 1fr; position: static; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { grid-column: 1; }
  .site-footer__nav { grid-template-columns: 1fr 1fr; }
  .recent__list li, .recent__list--full li { grid-template-columns: 1fr; gap: 0; }
  .recent__section { display: none; }
  .compare th[scope="row"] { white-space: normal; }
}
@media (max-width: 420px) {
  /* Hide the wordmark visually but keep it as the link's accessible name. */
  .site-header .brand__name {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-contrast: more) {
  :root { --ink-2: var(--ink); --ink-3: var(--ink); --rule: var(--rule-strong); }
}
@media (forced-colors: active) {
  .check__box:checked { background: CanvasText; }
  .stamp, .pill--pick { border: 1px solid CanvasText; }
}

/* 12. Print: checklists and guides print clean ----------------------------------------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --sunk: #f3f3f3; --ink: #000; --ink-2: #222; --ink-3: #444; }
  .site-header, .sidebar, .toc, .site-footer, .page-actions, .pager, .checklist-bar__actions, .checklist-bar__note,
  .heading-anchor, .copy-code, .skip-link, .toast, .nav-scrim, .contribute-band { display: none !important; }
  .shell, .shell--toc { display: block; padding: 0; }
  .main { padding: 0; }
  .doc { max-width: none; }
  .checklist-bar { position: static; box-shadow: none; }
  .prose li.check { break-inside: avoid; }
  a.ext::after { display: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #444; }
}
