/* ==========================================================================
   THE SITE'S COMPONENTS — the public pages in the one design system.

   Every colour, face, space, rule, radius and duration here is a token of
   the one owner, `src/cockpit/tokens.css`, served to the site as the
   generated `assets/css/tokens.css` (scripts/floor/site-design.mjs). This
   file declares no custom property, no theme block and no colour or
   duration literal (guard: tests/public/site-design-system.test.mjs); a
   theme is the owner's, switched by `data-theme` on <html>.

   The language: a logbook page. Paper ground, ink ramp, hairline rules
   between entries, a heavy rule where a ledger starts, a dashed rule between
   a receipt's line items, mono only for values, code and identifiers. The
   accent (the one beam hue) marks links, focus and a primary action;
   ok / warn / alarm are states and nothing else.
   ========================================================================== */

/* ── Ground ──────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--sp-6);
}

body {
  margin: 0;
  background: var(--ground-0);
  color: var(--ink-1);
  font-family: var(--face-sans);
  font-size: var(--f-page-size);
  line-height: var(--f-page-lh);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink-1);
}

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

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: var(--hairline-w);
  text-decoration-color: var(--page-link-underline);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--t-1) var(--ease-out);
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

hr {
  height: 0;
  margin: var(--sp-7) 0;
  border: 0;
  border-top: var(--hairline-w) solid var(--line-1);
}

.wrap {
  width: 100%;
  max-width: calc(var(--page-max) + var(--page-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html:not(.js) .js-only {
  display: none;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: var(--sp-2);
  left: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink-1);
  color: var(--ground-0);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ── The preview strip: the one sentence every page carries ─────────────── */

.preview-strip {
  margin: 0;
  border-bottom: var(--hairline-w) solid var(--line-1);
  background: var(--ground-1);
  color: var(--ink-2);
  font-size: var(--f-micro-size);
  line-height: var(--lh-readout);
}

.preview-strip .wrap {
  display: block;
  padding-block: var(--sp-2);
}

.preview-strip strong {
  color: var(--warn);
  font-weight: 600;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  border-bottom: var(--hairline-w) solid var(--line-1);
  background: var(--ground-0);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--page-header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--hit-min);
  color: var(--ink-1);
  font-size: var(--f-page-h3);
  font-weight: 600;
  letter-spacing: var(--f-page-heading-track);
  text-decoration: none;
}

.brand-mark {
  width: var(--sp-6);
  height: var(--sp-6);
  flex: none;
}

.site-nav {
  margin-inline-start: auto;
}

.site-nav ul,
.site-menu-panel ul,
.footer-index ul,
.breadcrumb ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav ul {
  display: flex;
  gap: var(--sp-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-min);
  padding-inline: var(--sp-3);
  color: var(--ink-2);
  font-size: var(--f-ui-size);
  text-decoration: none;
  background: linear-gradient(var(--ink-1), var(--ink-1)) center bottom / 0 var(--rule-w) no-repeat;
  transition: color var(--t-1) var(--ease-out), background-size var(--t-2) var(--ease-out);
}

.site-nav a:hover {
  color: var(--ink-1);
}

.site-nav a[aria-current] {
  color: var(--ink-1);
  font-weight: 560;
  background-size: calc(100% - var(--sp-6)) var(--rule-w);
}

.site-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--hit-min);
  padding-inline: var(--sp-3);
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--f-ui-size);
  text-decoration: none;
  cursor: pointer;
}

.tool:hover {
  background: var(--layer-hover);
  color: var(--ink-1);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 var(--sp-1);
  border: var(--hairline-w) solid var(--line-2);
  border-radius: var(--sp-1);
  color: var(--ink-2);
  font-family: var(--face-mono);
  font-size: var(--f-nano-size);
  line-height: var(--lh-readout);
  text-align: center;
}

/* The phone menu is a native disclosure: it opens without a script. */
.site-menu {
  position: relative;
  display: none;
}

.site-menu > summary {
  list-style: none;
}

.site-menu > summary::-webkit-details-marker {
  display: none;
}

.site-menu[open] > summary {
  background: var(--layer-select);
  color: var(--ink-1);
}

.site-menu-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--sp-2));
  right: 0;
  min-width: min(18rem, calc(100vw - var(--page-gutter) * 2));
  padding: var(--sp-2);
  border: var(--hairline-w) solid var(--line-2);
  border-radius: var(--radius-card);
  background: var(--ground-2);
  box-shadow: var(--shadow-sheet);
}

.site-menu-panel a {
  display: flex;
  align-items: center;
  min-height: var(--hit-min);
  padding-inline: var(--sp-3);
  border-radius: var(--sp-1);
  color: var(--ink-1);
  text-decoration: none;
}

.site-menu-panel a:hover {
  background: var(--layer-hover);
}

.site-menu-panel a[aria-current] {
  font-weight: 600;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */

.breadcrumb {
  margin-block: var(--sp-6) var(--sp-5);
  color: var(--ink-2);
  font-size: var(--f-micro-size);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.breadcrumb li + li::before {
  content: "/";
  margin-inline-end: var(--sp-2);
  color: var(--ink-2);
}

.breadcrumb a {
  color: var(--ink-2);
}

/* ── Reading: the article page ──────────────────────────────────────────── */

main {
  display: block;
  padding-block-end: var(--page-section-gap);
  /* A long address or identifier breaks rather than pushing the page wider
     than a phone. */
  overflow-wrap: break-word;
}

/* Running text keeps the reading measure; ledgers, code and figures take
   the column's full width. */
main > p,
main > ul,
main > ol,
main > dl,
main > h1,
main > h3,
main > h4,
main > blockquote,
.doc > p,
.doc > ul,
.doc > ol,
.doc > dl,
.doc > h1,
.doc > h3,
.doc > h4,
.doc > blockquote,
.doc > .callout,
.doc > .callout-warning {
  max-width: var(--page-measure);
}

/* ── The reading page: the documentation's index, the page, its sections ── */

.reading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

.doc {
  min-width: 0;
}

.docs-nav,
.page-toc {
  display: none;
  position: sticky;
  top: var(--sp-5);
  max-height: calc(100vh - var(--sp-6));
  overflow-y: auto;
  font-size: var(--f-micro-size);
  line-height: var(--lh-readout);
}

@media (min-width: 1100px) {
  .reading {
    grid-template-columns: 13rem minmax(0, 1fr);
  }

  .docs-nav {
    display: block;
  }
}

@media (min-width: 1360px) {
  .reading {
    grid-template-columns: 13rem minmax(0, 1fr) 12rem;
  }

  .page-toc {
    display: block;
  }
}

.docs-nav ul,
.page-toc ol {
  margin: 0 0 var(--sp-5);
  padding: 0;
  list-style: none;
}

.docs-nav li,
.page-toc li {
  margin: 0;
  padding: 0;
}

.docs-nav-heading,
.page-toc-title {
  margin: 0 0 var(--sp-2);
  color: var(--ink-1);
  font-weight: 600;
}

.docs-nav a,
.page-toc a {
  display: block;
  padding: var(--sp-1) var(--sp-2);
  margin-inline-start: calc(var(--sp-2) * -1);
  border-radius: var(--sp-1);
  color: var(--ink-2);
  text-decoration: none;
}

.docs-nav a:hover,
.page-toc a:hover {
  background: var(--layer-hover);
  color: var(--ink-1);
}

.docs-nav a[aria-current] {
  background: var(--layer-select);
  color: var(--ink-1);
  font-weight: 600;
}

.page-toc {
  padding-inline-start: var(--sp-4);
  border-inline-start: var(--hairline-w) solid var(--line-1);
}

/* A decision record's own front matter, as the record's header. */
.record-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin: 0 0 var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: var(--hairline-w) dashed var(--line-2);
  font-size: var(--f-micro-size);
}

.record-head dt {
  color: var(--ink-2);
  font-weight: 400;
}

.record-head dd {
  margin: 0;
  color: var(--ink-1);
}

/* A section's link, shown when its heading is pointed at or focused. */
.heading-anchor {
  margin-inline-start: var(--sp-2);
  color: var(--ink-2);
  font-weight: 400;
  text-decoration: none;
  opacity: var(--opacity-off);
  transition: opacity var(--t-1) var(--ease-out);
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus-visible {
  opacity: var(--opacity-on);
}

@media (hover: none) {
  .heading-anchor {
    display: none;
  }
}

h1,
h2,
h3,
h4 {
  color: var(--ink-1);
  font-weight: 600;
  letter-spacing: var(--f-page-heading-track);
  text-wrap: balance;
}

main h1 {
  margin: 0 0 var(--sp-5);
  font-size: var(--f-page-h1);
  line-height: 1.12;
}

main h1 + p {
  max-width: 60ch;
  color: var(--ink-2);
  font-size: var(--f-lede-size);
  line-height: 1.55;
}

/* A section of a logbook page starts on its own rule. */
main h2 {
  margin: var(--sp-7) 0 var(--sp-4);
  padding-top: var(--sp-5);
  border-top: var(--hairline-w) solid var(--line-1);
  font-size: var(--f-page-h2);
  line-height: 1.25;
}

main h3 {
  margin: var(--sp-6) 0 var(--sp-3);
  font-size: var(--f-page-h3);
  line-height: 1.35;
}

main h4 {
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: var(--f-page-size);
  line-height: 1.4;
}

main h2 + h3 {
  margin-top: var(--sp-4);
}

main p,
main ul,
main ol,
main dl {
  margin: 0 0 var(--sp-4);
}

main ul,
main ol {
  padding-inline-start: 1.4em;
}

main li {
  margin-block: var(--sp-1);
  padding-inline-start: var(--sp-1);
}

main li::marker {
  color: var(--ink-2);
}

main li > ul,
main li > ol {
  margin-block: var(--sp-1);
}

main strong {
  font-weight: 600;
}

main dt {
  font-weight: 600;
}

main dd {
  margin: 0 0 var(--sp-3);
  color: var(--ink-2);
}

/* A task list (GitHub's `- [ ]`): the box is the marker. */
.task-list {
  padding-inline-start: 0;
  list-style: none;
}

/* A task's text stays one inline run (its code spans wrap with it); the box
   hangs in the gutter. A flex row would make every code span a column. */
.task-list-item {
  position: relative;
  padding-inline-start: calc(var(--sp-2) + 1em);
}

.task-list-item-checkbox {
  font: inherit;
  position: absolute;
  inset-inline-start: 0;
  top: 0.4em;
  margin: 0;
  accent-color: var(--ok);
}

/* The home page composes its own sections across the full column. */
.home main > * {
  max-width: none;
}

/* ── Code ───────────────────────────────────────────────────────────────── */

code,
kbd,
pre,
samp {
  font-family: var(--face-mono);
}

:not(pre) > code {
  padding: 0.1em 0.3em;
  border-radius: var(--sp-1);
  background: var(--layer-select);
  font-size: var(--f-data-size);
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  overflow-x: auto;
  border: var(--hairline-w) solid var(--line-1);
  border-radius: var(--radius-card);
  background: var(--ground-1);
  color: var(--ink-1);
  font-size: var(--f-data-size);
  line-height: var(--f-code-lh);
  tab-size: 2;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.highlight {
  margin: 0;
  background: transparent;
}

/* A comment keeps its own ink and its own marker, upright: an italic mono face
   is a file the page fetches after its first paint, and its swap moves the
   code (the load under stress found it on /cli/). */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .cd {
  color: var(--ink-2);
}

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt {
  color: var(--syn-keyword);
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .ss {
  color: var(--syn-string);
}

.highlight .m,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .il {
  color: var(--syn-number);
}

.highlight .nf,
.highlight .fm,
.highlight .nc,
.highlight .nn {
  color: var(--syn-func);
}

.highlight .nb,
.highlight .bp,
.highlight .nt,
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi,
.highlight .na {
  color: var(--syn-type);
}

.highlight .o,
.highlight .ow,
.highlight .p {
  color: var(--syn-punct);
}

.highlight .gp,
.highlight .gh,
.highlight .gu {
  color: var(--syn-meta);
  font-weight: 600;
}

.highlight .gd,
.highlight .err {
  color: var(--alarm);
  background: transparent;
}

.highlight .gi {
  color: var(--ok);
}

.copy-code {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  min-height: var(--sp-6);
  padding-inline: var(--sp-3);
  border: var(--hairline-w) solid var(--line-2);
  border-radius: var(--sp-1);
  background: var(--ground-2);
  color: var(--ink-2);
  font-family: var(--face-sans);
  font-size: var(--f-nano-size);
  cursor: pointer;
  opacity: var(--opacity-off);
  transition: opacity var(--t-1) var(--ease-out);
}

pre:hover .copy-code,
pre:focus-within .copy-code {
  opacity: var(--opacity-on);
}

.copy-code:hover,
.copy-code.is-copied {
  border-color: var(--ink-2);
  color: var(--ink-1);
}

@media (hover: none) {
  .copy-code {
    opacity: var(--opacity-on);
  }
}

/* ── Tables: a ledger ───────────────────────────────────────────────────── */

table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: var(--sp-5) 0 var(--sp-6);
  overflow-x: auto;
  border-collapse: collapse;
  border-top: var(--rule-w) solid var(--ink-1);
  font-size: var(--f-ui-size);
  line-height: 1.5;
}

thead th {
  border-bottom: var(--hairline-w) solid var(--line-2);
  color: var(--ink-2);
  font-size: var(--f-micro-size);
  font-weight: var(--f-micro-weight);
  white-space: nowrap;
}

th,
td {
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 0;
  text-align: left;
  vertical-align: top;
}

td {
  border-bottom: var(--hairline-w) dashed var(--line-2);
}

tbody tr:last-child td {
  border-bottom: var(--hairline-w) solid var(--line-2);
}

td code {
  white-space: nowrap;
}

/* ── Callouts: a note, and a limit ──────────────────────────────────────── */

/* A note is a slip pinned to the page: its edge is a rule, never a frame,
   never a fill of colour. A note's edge is ink; a limit's is warn. */
.callout,
.callout-warning,
main blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border: 0;
  border-top: var(--rule-w) solid var(--ink-2);
  background: var(--ground-1);
  color: var(--ink-1);
}

/* A limit wears the refusal grammar: the warn hue on the edge, never the fill. */
.callout.warning,
.callout-warning,
.callout-caution,
.callout-important {
  border-top-color: var(--warn);
}

.callout > :last-child,
.callout-warning > :last-child,
main blockquote > :last-child {
  margin-bottom: 0;
}

.callout.warning strong:first-child,
.callout-warning strong:first-child {
  color: var(--warn);
}

/* ── Actions ────────────────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: var(--sp-6) 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--hit-min) + var(--sp-1));
  padding: 0 var(--sp-5);
  border: var(--hairline-w) solid var(--ink-2);
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--ink-1);
  font: inherit;
  font-size: var(--f-ui-size);
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-1) var(--ease-out), border-color var(--t-1) var(--ease-out);
}

.button:hover {
  border-color: var(--ink-1);
  background: var(--layer-hover);
}

.button:active {
  background: var(--layer-press);
}

.button.primary {
  border-color: var(--ink-1);
  background: var(--ink-1);
  color: var(--ground-0);
}

.button.primary:hover {
  background: var(--page-button-hover);
}

/* ── States: what a claim, a row or an item honestly is ─────────────────── */

.state {
  font-weight: 600;
  white-space: nowrap;
}

.state[data-state="holds"],
.state[data-state="done"],
.state[data-state="pass"] {
  color: var(--ok);
}

.state[data-state="designed"],
.state[data-state="refused"],
.state[data-state="partial"] {
  color: var(--warn);
}

.state[data-state="pending"] {
  color: var(--warn);
}

.state[data-state="in-force"] {
  color: var(--ok);
}

.state[data-state="standing"] {
  color: var(--ink-1);
}

.state[data-state="not-claimed"],
.state[data-state="planned"],
.state[data-state="superseded"] {
  color: var(--ink-2);
}

.state[data-state="retracted"],
.state[data-state="fail"] {
  color: var(--alarm);
}

.retracted {
  text-decoration: line-through;
  text-decoration-color: var(--alarm);
}

/* ── Receipt: line items on a slip ──────────────────────────────────────── */

.receipt {
  max-width: 34rem;
  margin: var(--sp-5) 0;
  padding: var(--sp-5);
  border-block: var(--hairline-w) dashed var(--line-2);
  background: var(--ground-2);
  font-size: var(--f-ui-size);
}

.receipt-title {
  margin: 0 0 var(--sp-3);
  font-size: var(--f-page-size);
  font-weight: 600;
}

.receipt dl {
  margin: 0;
}

.receipt-line {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding-block: var(--sp-1);
}

.receipt-line dt {
  color: var(--ink-2);
  font-weight: 400;
}

/* The leader: a dotted line from the item to its value. */
.receipt-line::after {
  content: "";
  order: 1;
  flex: 1;
  min-width: var(--sp-4);
  border-bottom: var(--hairline-w) dotted var(--line-2);
}

.receipt-line dd {
  order: 2;
  margin: 0;
  color: var(--ink-1);
  font-family: var(--face-mono);
  font-size: var(--f-data-size);
  text-align: right;
  overflow-wrap: anywhere;
}

.stamp {
  margin: var(--sp-4) 0 0;
  padding-top: var(--sp-3);
  border-top: var(--hairline-w) dashed var(--line-2);
  color: var(--ink-2);
  font-family: var(--face-mono);
  font-size: var(--f-nano-size);
  line-height: var(--lh-readout);
}

/* ── Refusal: the model's call and the harness's answer ─────────────────── */

.refusal {
  margin: var(--sp-5) 0;
  border: var(--hairline-w) solid var(--line-1);
  border-radius: var(--radius-card);
  background: var(--ground-2);
  overflow: hidden;
}

.refusal-call,
.refusal-answer {
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
}

.refusal-call {
  box-shadow: inset 0 var(--rule-w) 0 var(--cat-turn);
  font-family: var(--face-mono);
  font-size: var(--f-data-size);
}

.refusal-answer {
  border-top: var(--hairline-w) solid var(--line-1);
  box-shadow: inset 0 var(--rule-w) 0 var(--warn);
}

.refusal-who {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--ink-2);
  font-family: var(--face-sans);
  font-size: var(--f-micro-size);
}

.refusal-code {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--warn);
  font-family: var(--face-mono);
  font-size: var(--f-page-size);
  font-weight: 600;
}

.refusal-source {
  display: block;
  margin-top: var(--sp-3);
  color: var(--ink-2);
  font-family: var(--face-mono);
  font-size: var(--f-nano-size);
  overflow-wrap: anywhere;
}

/* ── Definition: a word, its part of speech, its sense, its source ──────── */

.definition {
  margin: var(--sp-6) 0;
}

.definition-word {
  margin: 0;
  font-size: var(--f-page-h1);
  font-weight: 600;
  letter-spacing: var(--f-hero-track);
  line-height: 1.1;
}

.definition-word small {
  margin-inline-start: var(--sp-3);
  color: var(--ink-2);
  font-family: var(--face-mono);
  font-size: var(--f-data-size);
  font-weight: 400;
  letter-spacing: 0;
}

.definition-sense {
  margin: var(--sp-3) 0 var(--sp-2);
  font-size: var(--f-lede-size);
  font-style: italic;
}

.definition-source {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--f-micro-size);
}

/* ── The page's own parts: hero, sections, figures ──────────────────────── */

.hero {
  padding-block: var(--sp-7) var(--sp-6);
}

.hero h1 {
  max-width: 14ch;
  margin: 0;
  font-size: var(--f-hero-size);
  line-height: var(--f-hero-lh);
  letter-spacing: var(--f-hero-track);
}

.lede {
  max-width: var(--page-measure);
  margin: var(--sp-5) 0 0;
  color: var(--ink-2);
  font-size: var(--f-lede-size);
  line-height: 1.55;
}

/* A quiet kicker: sentence case, never a tracked capital label. */
.eyebrow,
.feature-kicker {
  margin: 0 0 var(--sp-2);
  color: var(--ink-2);
  font-size: var(--f-micro-size);
  font-weight: var(--f-micro-weight);
}

.eyebrow .dot::before {
  content: "·";
  margin-inline: var(--sp-1);
}

.beam-text {
  color: var(--ink-2);
}

.hero-note {
  margin: var(--sp-4) 0 0;
  color: var(--ink-2);
  font-family: var(--face-mono);
  font-size: var(--f-data-size);
}

.section {
  margin-top: var(--page-section-gap);
}

.cta {
  padding-top: var(--sp-6);
  border-top: var(--rule-w) solid var(--ink-1);
}

.section-head {
  max-width: var(--page-measure);
  margin-bottom: var(--sp-6);
}

.section-head h2,
.section h2 {
  margin: 0;
  padding-top: 0;
  border-top: 0;
  font-size: var(--f-page-h2);
  line-height: 1.25;
}

.section-lede {
  margin: var(--sp-3) 0 0;
  color: var(--ink-2);
}

.prose {
  max-width: var(--page-measure);
}

.prose p {
  margin: 0 0 var(--sp-4);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  border-top: var(--rule-w) solid var(--ink-1);
}

.feature {
  padding: var(--sp-5) var(--sp-5) var(--sp-5) 0;
  border-bottom: var(--hairline-w) solid var(--line-1);
}

.feature h3 {
  margin: 0 0 var(--sp-2);
  font-size: var(--f-page-h3);
  line-height: 1.3;
}

.feature p {
  margin: 0 0 var(--sp-3);
  color: var(--ink-2);
}

.feature p:last-child {
  margin-bottom: 0;
}

figure {
  margin: var(--sp-6) 0;
}

figure img {
  display: block;
  border: var(--hairline-w) solid var(--line-1);
  border-radius: var(--radius-card);
}

figcaption {
  margin-top: var(--sp-3);
  color: var(--ink-2);
  font-size: var(--f-micro-size);
  line-height: var(--lh-readout);
}

.hero-figure,
.system-figure {
  max-width: 100%;
}

/* A figure drawn to a fixed width keeps its type legible on a narrow screen:
   it scrolls inside its own frame (which takes focus, so a keyboard scrolls
   it too) instead of shrinking its labels below reading size. */
.system-figure {
  overflow-x: auto;
}

.system-figure > .fig {
  min-width: 600px;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

.screenshot {
  margin: 0;
}

.floor-banner {
  border-bottom: var(--hairline-w) solid var(--line-1);
  background: var(--ground-1);
  color: var(--ink-2);
  font-size: var(--f-micro-size);
}

.floor-banner .wrap {
  padding-block: var(--sp-2);
}

/* ── Figures drawn inline from data (shared/figures.ts): inked by the live
   theme, like the page around them. ─────────────────────────────────────── */

.fig {
  display: block;
  width: 100%;
  height: auto;
  border: var(--hairline-w) solid var(--line-1);
  border-radius: var(--radius-card);
}

.fig-ground {
  fill: var(--ground-1);
}

.fig-box {
  fill: var(--ground-2);
  stroke: var(--line-2);
}

.fig-box-accent {
  stroke: var(--accent);
}

.fig-rule {
  stroke: var(--line-1);
}

.fig-heading,
.fig-label {
  fill: var(--ink-1);
  font-family: var(--face-sans);
  font-size: var(--f-ui-size);
  font-weight: 600;
}

.fig-note {
  fill: var(--ink-2);
  font-family: var(--face-sans);
  font-size: var(--f-micro-size);
}

.fig-tag {
  fill: var(--ink-2);
  font-family: var(--face-mono);
  font-size: var(--f-nano-size);
}

.fig-edge {
  fill: none;
  stroke: var(--accent);
  stroke-width: var(--hairline-w);
}

.fig-edge-muted {
  stroke: var(--ink-2);
  stroke-dasharray: 4 4;
}

.fig-arrow {
  fill: var(--accent);
}

.fig-arrow-muted {
  fill: var(--ink-2);
}

.fig-count {
  fill: var(--ink-1);
  font-family: var(--face-sans);
  font-size: var(--f-page-h3);
  font-weight: 600;
}

/* A part bar's parts (shared/figures.ts PART_INKS): a solid part is filled,
   a hatched one outlined, its hatching drawn in the same ink. */
.fig-fill-ok {
  fill: var(--ok);
}

.fig-fill-warn {
  fill: var(--warn);
}

.fig-fill-alarm {
  fill: var(--alarm);
}

.fig-fill-quiet {
  fill: var(--ink-2);
}

.fig-line-ok {
  stroke: var(--ok);
}

.fig-line-warn {
  stroke: var(--warn);
}

.fig-line-alarm {
  stroke: var(--alarm);
}

.fig-line-quiet {
  stroke: var(--ink-2);
}

/* ── Footer: the index, then the colophon ───────────────────────────────── */

.site-footer {
  border-top: var(--rule-w) solid var(--ink-1);
  background: var(--ground-1);
  color: var(--ink-2);
  font-size: var(--f-ui-size);
}

.footer-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--sp-6) var(--sp-5);
  padding-block: var(--sp-7);
}

.footer-heading {
  margin: 0 0 var(--sp-3);
  color: var(--ink-1);
  font-size: var(--f-micro-size);
  font-weight: 600;
  letter-spacing: 0;
}

.footer-index li {
  margin-block: var(--sp-1);
}

.footer-index a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-index a:hover {
  color: var(--ink-1);
  text-decoration: underline;
}

.colophon {
  display: grid;
  gap: var(--sp-2);
  padding-block: var(--sp-6);
  border-top: var(--hairline-w) solid var(--line-1);
}

.colophon p {
  margin: 0;
}

.colophon-fine {
  font-size: var(--f-micro-size);
}

/* ── Search: a dialog over the static index ─────────────────────────────── */

.search-dialog {
  width: min(40rem, calc(100vw - var(--page-gutter) * 2));
  max-height: min(36rem, calc(100vh - var(--sp-7) * 2));
  margin: var(--sp-7) auto auto;
  padding: 0;
  border: var(--hairline-w) solid var(--line-2);
  border-radius: var(--radius-card);
  background: var(--ground-2);
  color: var(--ink-1);
  box-shadow: var(--shadow-sheet);
}

.search-dialog::backdrop {
  background: var(--page-scrim);
}

.search-panel {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.search-head h2 {
  margin: 0;
  font-size: var(--f-page-h3);
}

.search-close {
  min-height: var(--hit-min);
  padding-inline: var(--sp-3);
  border: var(--hairline-w) solid var(--line-2);
  border-radius: var(--sp-1);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--f-micro-size);
  cursor: pointer;
}

.search-input {
  width: 100%;
  min-height: calc(var(--hit-min) + var(--sp-2));
  padding: 0 var(--sp-4);
  border: var(--hairline-w) solid var(--ink-2);
  border-radius: var(--radius-card);
  background: var(--ground-0);
  color: var(--ink-1);
  font: inherit;
}

.search-input:focus-visible {
  outline-offset: 0;
}

.search-status,
.search-hint {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--f-micro-size);
}

.search-results {
  max-height: 22rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.search-result {
  display: block;
  padding: var(--sp-3);
  border-radius: var(--sp-1);
  color: var(--ink-1);
  text-decoration: none;
}

.search-result.is-active,
.search-result:hover {
  background: var(--layer-select);
}

.search-result-title {
  display: block;
  font-weight: 600;
}

.search-result-description {
  display: block;
  color: var(--ink-2);
  font-size: var(--f-micro-size);
}

body.search-open {
  overflow: hidden;
}

/* ── Narrow screens ─────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .site-nav,
  .tool-wide {
    display: none;
  }

  .site-menu {
    display: block;
  }

  .site-tools {
    margin-inline-start: auto;
  }
}

@media (max-width: 640px) {
  main h2 {
    margin-top: var(--sp-6);
  }

  th,
  td {
    padding-inline-end: var(--sp-3);
  }

  .button {
    flex: 1 1 100%;
  }

  [data-search-open] kbd {
    display: none;
  }
}

/* ── Print: the page as a document ──────────────────────────────────────── */

@media print {
  .preview-strip,
  .site-nav,
  .site-tools,
  .breadcrumb,
  .footer-index,
  .copy-code,
  .search-dialog,
  .skip-link {
    display: none;
  }

  body {
    background: none;
  }

  .site-header,
  .site-footer {
    border: 0;
    background: none;
  }

  a {
    color: inherit;
  }

  pre,
  table,
  figure,
  .receipt,
  .refusal {
    break-inside: avoid;
  }
}
