/* atproto.how: type, layout, links, components and content elements
 * (DSYS-005 to DSYS-007, DSYS-015).
 *
 * Ported from the canvas artboards (Type, Content, Chapter, Forms, Home,
 * SignInStates), onto the class names the content renderer emits. Colours
 * come only from tokens.css. Nothing magenta from the canvas is styled here.
 */

:root {
  --serif: "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: 32px;
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Room for a scrollbar on every page, so a short page and a long one
     center the same column (the tool pages differ only in length). */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

/* Links (DSYS-006): site links in the accent, Lexicon Garden in its green. */

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

a.nsid,
a.lg {
  color: var(--garden);
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a.nsid:hover,
a.lg:hover {
  color: var(--garden);
  text-decoration-style: solid;
}

/* DSYS-021: an NSID breaks only at the <wbr> the build puts before each "."
   and "#" (COMP-041), never inside a segment. */
.nsid {
  font-family: var(--mono);
  font-size: 0.82em;
  overflow-wrap: normal;
  word-break: normal;
}

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

/* Layout. */

.wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Type scale (DSYS-005), from Type.dc.html. */

.book-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 56px;
  line-height: 62px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.ch-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 52px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 33px;
  color: var(--ink-2);
}

.doc {
  /* Inside a grid or flex parent, never grow past it for a long code line. */
  min-width: 0;
  max-width: var(--measure);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 30px;
  color: var(--ink);
}

/* Block spacing. The resets use :where() so they don't outrank it. */
.doc :where(p, dl, ul, ol, figure, aside) {
  margin: 0;
}

.doc > * + *,
.chapter-body > * + * {
  margin-top: 20px;
}

.doc h2 {
  margin: 18px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 26px;
  line-height: 34px;
  text-wrap: balance;
}

.doc h3 {
  margin: 28px 0 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 19px;
  line-height: 28px;
  text-wrap: balance;
}

.label {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.ui-small {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 24px;
  color: var(--ink-2);
}

figcaption {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

.lab {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Self-links on headings and components (COMP-038, READ-036): shown while
   the pointer is over what they link to, or while they have focus. */

.anchor {
  margin-left: 8px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 18px;
  color: var(--ink-3);
  text-decoration: none;
  opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor,
figure:hover > figcaption > .anchor,
.callout:hover > .callout-label > .anchor,
.app-sum:hover > .lbl > .anchor,
.scene:hover > .lbl > .anchor,
.refblock:hover > .head > .ttl > .anchor,
.faq .e:hover > dt > .anchor,
dl > dt:hover > .anchor,
.anchor:focus-visible {
  opacity: 1;
}

/* In a caption, label or term the # takes the text's own size. */
figcaption .anchor,
.callout-label .anchor,
.lbl .anchor,
.ttl .anchor,
dt .anchor {
  margin-left: 6px;
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
}

/* A signed value in code linked to its full form in an appendix
   (COMP-040, DSYS-020): the code's own colour, underlined. */
figure.code a.wv {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

figure.code a.wv:hover {
  text-decoration-style: solid;
}

/* "Link copied", for two seconds after a click (READ-035). */
.copied {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

/* Inline elements. */

.doc code,
.ic {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 1px 5px;
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink);
  overflow-wrap: break-word;
}

/* DSYS-021: in a table, short tokens and NSIDs keep whole and the column
   widens; only a long opaque value (code.long) breaks, anywhere. */
.doc td code,
td .nsid {
  white-space: nowrap;
}

td .nsid wbr,
.doc td code wbr {
  display: none;
}

.doc td code.long {
  white-space: normal;
  word-break: break-all;
}

.doc code.long {
  word-break: break-all;
}
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
  white-space: nowrap;
  text-decoration: none;
}

.prov::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.prov-spec {
  color: var(--prov-spec);
}

.prov-ref {
  color: var(--prov-ref);
}

.prov-crates {
  color: var(--prov-crates);
}

.prov-otc {
  color: var(--prov-otc);
}

.xref {
  color: var(--accent);
}

.fnref {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 0;
  font-weight: 600;
}

.fnref a {
  padding: 0 1px;
  text-decoration: none;
}

.chip {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--sunken);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Figures: code, tables, diagrams and widgets (DSYS-007). */

.doc > figure {
  margin-top: 28px;
}

figure.code {
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  max-width: 760px;
}

figure.code figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.lang {
  color: var(--ink-3);
}

figure.code pre {
  margin: 0;
  padding: 12px 16px;
  overflow-x: auto;
}

pre code,
figure.code code {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  color: var(--t-plain);
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
}

.tok-key,
.tok-header,
.tok-function {
  color: var(--t-key);
}

.tok-string,
.tok-value {
  color: var(--t-str);
}

.tok-number,
.tok-bool,
.tok-null,
.tok-status {
  color: var(--t-num);
}

.tok-type,
.tok-keyword,
.tok-method {
  color: var(--t-type);
  font-weight: 500;
}

.tok-did {
  color: var(--t-did);
}

.tok-comment {
  color: var(--t-com);
  font-style: italic;
}

.tok-punct {
  color: var(--t-punct);
}

.tok-path,
.tok-version,
.tok-attr {
  color: var(--t-plain);
}

figure.code a.nsid,
pre a.nsid {
  font-size: inherit;
  color: var(--t-nsid);
  text-underline-offset: 3px;
}

figure.table {
  overflow-x: auto;
}

figure.table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 22px;
}

figure.table th {
  text-align: left;
  padding: 6px 16px 6px 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1.5px solid var(--rule-strong);
  white-space: nowrap;
}

figure.table td {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

figure.table figcaption {
  padding-bottom: 8px;
}

.fig-num {
  font-weight: 600;
  color: var(--ink-2);
}

figure.diagram {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.diagram-svg svg {
  display: block;
  width: 100%;
  height: auto;
}

figure.diagram figcaption {
  padding-top: 10px;
}

/* Show only the SVG that matches the theme, with or without JavaScript. */

:root[data-theme="light"] [data-theme-only="dark"],
:root[data-theme="dark"] [data-theme-only="light"],
:root:not([data-theme]) [data-theme-only="dark"] {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) [data-theme-only="light"] {
    display: none;
  }

  :root:not([data-theme]) [data-theme-only="dark"] {
    display: block;
  }
}

figure.widget-frame {
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

figure.widget-frame figcaption {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
}

.widget {
  padding: 16px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
}

figure.widget-frame figcaption .fig-num {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Widgets: the static fallbacks and the islands (WIDG-007, WIDG-009,
   WIDG-015, WIDG-016), from Chapter.dc.html and Forms.dc.html. */

.wc,
.wx,
.wc-live,
.wx-live {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.wc-value,
.wc-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 0;
  min-width: 0;
}

.wc-value code,
.wc-ref code {
  flex: 1 1 260px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.wc-ref {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.wc-ref[hidden] {
  display: none;
}

.segs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 18px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.seg small {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.seg.auth {
  background: var(--accent-wash);
}

.seg.lit {
  background: var(--sunken);
}

.seg.ns {
  background: var(--garden-wash);
}

.seg.key,
.seg.text {
  background: var(--bg);
}

.seg.bad {
  background: var(--danger-wash);
  border-color: var(--danger);
}

.seg .nsid,
.seg .nsid-plain {
  font-size: 12.5px;
}

.seg-input {
  min-width: 8ch;
  padding: 2px 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.nsid-plain {
  font-family: var(--mono);
  color: var(--ink);
}

.kindpill {
  padding: 1px 8px;
  border-radius: 3px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kindpill.ok {
  background: var(--garden-wash);
  color: var(--garden);
}

.kindpill.bad {
  background: var(--danger-wash);
  color: var(--danger);
}

.verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

.verdict[hidden] {
  display: none;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.samples button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
}

.samples button.on {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.err {
  margin: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--danger);
}

.inp.bad {
  border-color: var(--danger);
}

.inp:focus-visible,
.seg-input:focus-visible,
.samples button:focus-visible,
.tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wx-method {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
}

dl.wx-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  font-size: 14px;
}

dl.wx-meta div {
  display: flex;
  gap: 8px;
}

dl.wx-meta dt {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

dl.wx-meta dd {
  margin: 0;
}

.wx-params,
.wc-scopes {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.wx-params th,
.wx-params td,
.wc-scopes th,
.wc-scopes td {
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.wx-params th,
.wc-scopes th {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wx-unset {
  color: var(--ink-3);
  font-style: italic;
}

.wx-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

figure.code.wx-sample {
  max-width: 100%;
}

.prm {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
}

.prm label {
  padding-top: 9px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.prm label small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
}

.prm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

/* States 5 and 6 (SignInStates.dc.html): a banner and its actions, in place
   of a send. */
.wx-notice {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wx-notice[hidden] {
  display: none;
}

.resp {
  margin: 0 -16px -16px;
  border-top: 1px solid var(--rule);
  background: var(--sunken);
}

.rh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-2);
}

.rh .timing {
  font-family: var(--mono);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
}

.status.s0 {
  background: var(--sunken);
  color: var(--ink-2);
}

.status.s2 {
  background: var(--garden-wash);
  color: var(--garden);
}

.status.s4 {
  background: var(--caution-wash);
  color: var(--caution);
}

.tabs {
  display: inline-flex;
  margin-left: auto;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--bg);
}

.tabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
}

.tabs button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.wx-view {
  margin: 0;
  padding: 12px 16px;
  overflow-x: auto;
}

.wx-view code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13.5px;
  line-height: 22px;
  white-space: pre;
}

/* A fixed example's request (WIDG-023) and its header notes (WIDG-024). */
.tok-verb {
  color: var(--t-type);
  font-weight: 600;
}

.tok-param,
.tok-hname {
  color: var(--t-key);
}

.tok-hvalue {
  color: var(--t-str);
}

.tok-elided {
  color: var(--t-com);
}

.wx-headers {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 21px;
}

.wx-headers[hidden] {
  display: none;
}

.wx-headers .h {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wx-headers dt {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--t-key);
}

.wx-headers dd {
  margin: 0;
  color: var(--ink-2);
  overflow-wrap: break-word;
}

/* Values the widgets show whole, not inline code. */
.wc-value code,
.wc-ref code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
}

.wx-view a.r {
  color: var(--t-nsid);
}

/* Callouts. */

.callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

.callout p {
  font-size: 16px;
  line-height: 26px;
}

.callout-label {
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callout-note {
  background: var(--accent-wash);
}

.callout-note .callout-label {
  color: var(--accent);
}

.callout-caution {
  background: var(--caution-wash);
}

.callout-caution .callout-label {
  color: var(--caution);
}

.callout-interop {
  background: var(--interop-wash);
}

.callout-interop .callout-label {
  color: var(--interop);
}

/* Reader passages (DSYS-019), from Content.dc.html: the app card, the
   common questions, and the Preface's non-developer box. */

.app-sum {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 18px 20px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-wash);
}

.app-sum > :not(.disc) {
  grid-column: 2;
}

.app-sum .disc {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.app-sum .lbl {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
}

.app-sum p {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 27px;
  color: var(--ink);
}

.app-sum p:not(.lbl) + p {
  margin-top: 8px;
}

.mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.mark-book {
  width: 20px;
  height: 20px;
}

.doc dl.faq {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.faq .e {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 12px;
}

.faq .q {
  grid-column: 1;
  grid-row: 1 / 3;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 30px;
  color: var(--accent);
}

.doc .faq dt {
  grid-column: 2;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17.5px;
  line-height: 27px;
}

.faq dd {
  grid-column: 2;
  margin: 0;
}

.faq dd > * + * {
  margin-top: 12px;
}

.nondev {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 26px 26px;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
}

.nondev .tab {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}

.doc .nondev h2 {
  margin: 0;
  border-top: 0;
  padding-top: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
}

.nondev p {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 29px;
}

/* A scene (DSYS-019): a story beat from the running example, unboxed
   between hairlines, a house mark beside its label, the story in serif. */

.scene {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.scene .lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.scene > :not(.lbl) {
  padding-left: 26px;
}

.scene p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 30px;
  color: var(--ink-2);
}

/* A reference block (DSYS-019): lookup material in a bordered surface
   panel, "Reference" over its sans title, then its blocks. */

.refblock {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.refblock .head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.refblock .kind {
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.refblock .ttl {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
}

.refblock p {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 25px;
}

/* Lists. */

.doc dl {
  display: grid;
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
  gap: 10px 18px;
}

.doc dt {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 30px;
}

.doc dd {
  margin: 0;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: var(--ink-2);
}

.doc ul,
.doc ol:not(.steps) {
  padding-left: 1.4em;
}

/* The lists that are layouts, not prose: stacks, method rows, the process
   walkthrough's track and path (COMP-042, COMP-044, WIDG-026). */
.doc ol.vstack,
.doc ol.a-list,
.doc ol.b-list,
.doc ol.pw-track,
.doc ol.pw-path {
  padding-left: 0;
}

/* Footnotes. */

.footnotes {
  margin: 0;
  padding-left: 1.6em;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

.fnback {
  text-decoration: none;
}

/* Book contents (the chapter page's left column). */

.toc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 20px;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.toc-chapters {
  margin-top: 4px;
}

.toc-appendices {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.toc a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--ink-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  background: var(--sunken);
}

.toc .n {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.toc a.on {
  color: var(--ink);
  font-weight: 600;
  background: var(--accent-wash);
}

.toc a.on .n {
  color: var(--accent);
}

.toc .secs {
  margin: 2px 0 6px 40px;
  border-left: 1px solid var(--rule);
}

.toc .secs a {
  display: block;
  padding: 4px 10px;
  font-size: 13px;
}

/* The rail. */

.otp ol {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 20px;
}

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

.otp a:hover {
  color: var(--accent);
}

.otp .sub {
  padding-left: 12px;
}

.rail-lexicons,
.rail-markers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.lex {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lex li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
}

.lex .nsid {
  font-size: 12.5px;
}

.kind {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.rail-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Header and footer. */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding-block: 14px;
}

.wm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
}

.wm b {
  font-weight: 600;
  color: var(--accent);
}

.wm svg {
  color: var(--ink);
}

.mark-tab {
  fill: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.nav a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 2px;
}

.nav a:hover {
  color: var(--accent);
}

.nav a.on {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 64px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px 40px;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-3);
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

/* The AT Protocol trademark notice, on its own row under the rest. */
.site-footer .trademark {
  flex-basis: 100%;
  font-size: 13px;
  line-height: 20px;
}

/* Buttons. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn.sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn[disabled] {
  background: var(--sunken);
  color: var(--ink-3);
  border-color: var(--rule);
  cursor: not-allowed;
}

.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
}

.kbd {
  padding: 0 4px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
}

/* The search dialog (SRCH-005), hosting the Pagefind UI. Pagefind's own
   variables are mapped to the site tokens, so results follow the theme. */

.search-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  --pagefind-ui-scale: 0.75;
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--surface);
  --pagefind-ui-border: var(--rule-strong);
  --pagefind-ui-tag: var(--sunken);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 5px;
  --pagefind-ui-font: var(--sans);
}

.search-dialog::backdrop {
  background: rgb(23 23 28 / 0.45);
}

.search-panel {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}

.search-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 22px;
}

.search-ui {
  padding: 16px;
  overflow-y: auto;
}

.search-status {
  margin: 0;
  padding: 0 16px 16px;
}

/* One book: scoping results by book waits for a second one, and each
   result's title already leads with its chapter, so the filter panel and
   the metadata tags are left out. Pagefind's own rules carry three classes,
   hence !important. */
.search-dialog .pagefind-ui__filter-panel,
.search-dialog .pagefind-ui__result-tags {
  display: none !important;
}

/* Matches, in the accent wash; Pagefind resets `mark` with one class. */
.search-dialog .pagefind-ui mark {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--accent-wash);
  color: var(--ink);
}

/* The sign-in page (AUTH-005, AUTH-015), from Login.dc.html and
   SignInStates.dc.html. */

.login {
  display: flex;
  justify-content: center;
  padding-block: 64px 96px;
}

.login-col {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  max-width: 560px;
}

.login-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 40px;
  line-height: 48px;
  letter-spacing: -0.01em;
}

.login-lead {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 29px;
  color: var(--ink-2);
}

.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
}

.login-form .field {
  gap: 8px;
}

.login-form label {
  font-weight: 500;
  font-size: 15px;
}

.hbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 12px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 7px;
  background: var(--bg);
}

.hbox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.hbox.bad {
  border-color: var(--danger);
}

.at {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--ink-3);
}

.hinp {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  outline: none;
}

.ta {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 32px -10px rgb(0 0 0 / 0.25);
}

.ta[hidden] {
  display: none;
}

.ta li button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.ta li.act button,
.ta li button:hover {
  background: var(--accent-wash);
}

.ta .foot {
  padding: 8px 10px 4px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
}

.ta .av {
  width: 36px;
  height: 36px;
  font-family: var(--mono);
  font-size: 13px;
}

.ta .nm {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 20px;
}

.ta .hd {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.ta .hd b {
  font-weight: 600;
  color: var(--ink);
}

.login-err {
  display: flex;
  gap: 8px;
}

.login-err svg {
  flex: 0 0 auto;
  margin-top: 3px;
}

.login-submit {
  align-self: stretch;
}

.login-note {
  margin: 0;
  padding-inline: 2px;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

.login-note a {
  color: inherit;
}

/* AUTH-017: the Enable typeahead option, under the note. */
.ta-opt {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: -12px;
  padding-inline: 2px;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 20px;
  color: var(--ink-2);
  cursor: pointer;
}

.ta-opt[hidden] {
  display: none;
}

.ta-opt input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.state-lab.danger {
  color: var(--danger);
}

.state-h {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
}

.state-p {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-2);
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* The account page (SESS-011), from Account.dc.html. */

.account-page {
  display: flex;
  justify-content: center;
  padding-block: 56px 88px;
}

.account-col {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  max-width: 680px;
}

.account-who {
  display: flex;
  align-items: center;
  gap: 18px;
}

.account-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.account-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 36px;
  line-height: 42px;
  overflow-wrap: anywhere;
}

.account-col .card h2 {
  margin: 0;
}

dl.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 20px;
  margin: 0;
}

dl.kv dt {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-3);
}

dl.kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.account-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 23px;
  color: var(--ink-2);
}

.scope-box {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--accent-ink);
}

.btn.danger:hover {
  background: var(--danger-wash);
  color: var(--danger);
}

.sign-out-form {
  align-self: flex-start;
}

.menu-form {
  margin: 0;
}

.signed-out-chip .banner {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}

/* Avatars and the account menu. */

.av {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sunken);
  color: var(--ink-3);
}

.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 22px;
  background: var(--surface);
  cursor: pointer;
}

.account-chip[aria-expanded="true"] {
  border-color: var(--accent);
}

.header-actions .account-chip .handle {
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip .handle,
.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* The menu drops down over the page from the chip, right edges aligned, as
   the typeahead list does (SESS-010). */
.account-menu {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: max-content;
  min-width: 240px;
  max-width: calc(100vw - 32px);
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 14px 32px -10px rgb(0 0 0 / 0.25);
}

.menu .who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}

.menu .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
}

.menu [role="menuitem"] {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu [role="menuitem"]:hover {
  background: var(--sunken);
}

/* Form parts and banners, from Forms.dc.html and SignInStates.dc.html. */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
}

.help {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-3);
}

.inp {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 22px;
}

/* A fixed example's fields (WIDG-022): disabled, but as legible as text. */
.inp[disabled] {
  background: var(--sunken);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  border-color: var(--rule);
  cursor: not-allowed;
  opacity: 1;
}

textarea.inp {
  display: block;
  min-height: 0;
  resize: none;
  white-space: pre;
  overflow: auto;
  font-size: 13px;
  line-height: 20px;
}

@media (max-width: 719px) {
  .wx-headers {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 0;
  }

  .wx-headers dd + dt {
    margin-top: 8px;
  }
}

.banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
}

.banner .t {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.banner.note {
  background: var(--accent-wash);
}

.banner.note .t {
  color: var(--accent);
}

.banner.caution {
  background: var(--caution-wash);
}

.banner.caution .t {
  color: var(--caution);
}

.banner.danger {
  background: var(--danger-wash);
}

.banner.danger .t {
  color: var(--danger);
}

/* Pages (reading-pages), from Home, Book, Chapter, Reference, NotFound and
 * Colophon. The cover uses the cover tokens; --cover-2 and --shelf on the
 * canvas are approximated with the cover ink and rule-strong. */

.page {
  padding-block: 36px 80px;
}

.narrow {
  max-width: 760px;
}

.page.doc {
  max-width: calc(var(--measure) + 2 * var(--gutter));
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

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

.crumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.prose {
  margin: 0;
  max-width: var(--measure);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 30px;
  color: var(--ink);
}

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-title a {
  color: inherit;
  text-decoration: none;
}

.hero .wrap {
  padding-block: 72px 80px;
}

/* The home hero (READ-001, home-hero): the copy, then the stack of books. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px 64px;
}

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

.hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 0;
}

.glance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 8px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

.glance b {
  margin-right: 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
}

/* The stack: one link to the library. The latest book's cover lies on the
   practicals' pamphlets and two blank covers, and fans out on hover. */
.stack {
  position: relative;
  display: block;
  width: 340px;
  max-width: 100%;
  height: 460px;
  margin-left: auto;
  color: inherit;
  text-decoration: none;
}

.stack > * {
  position: absolute;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stack .blank {
  box-sizing: border-box;
  width: 250px;
  height: 333px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 3px 7px 7px 3px;
  background: var(--surface);
}

.stack .b1 {
  left: 86px;
  top: 22px;
  transform: rotate(9deg);
}

.stack .b2 {
  left: 74px;
  top: 16px;
  transform: rotate(6deg);
}

.stack .pamphlet {
  width: 250px;
  left: 76px;
  top: 4px;
  transform: rotate(4deg);
}

.stack .cover {
  width: 260px;
  left: 0;
  top: 70px;
  padding: 22px 20px 20px 26px;
  box-shadow: inset 9px 0 0 rgba(0, 0, 0, 0.18), 0 18px 36px -18px rgba(23, 23, 28, 0.5);
  transform: rotate(-3deg);
}

.stack .cover-title {
  font-size: 30px;
  line-height: 33px;
}

.stack .cover-sub {
  font-size: 19px;
  line-height: 24px;
}

.stack:hover .cover,
.stack:focus-visible .cover {
  transform: rotate(-5deg) translate(-16px, 4px);
}

.stack:hover .pamphlet,
.stack:focus-visible .pamphlet {
  transform: rotate(6deg) translate(22px, -12px);
}

.stack:hover .b1,
.stack:focus-visible .b1 {
  transform: rotate(10deg) translate(22px, -2px);
}

.stack:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 8px;
}

/* One column: the stack centres under the copy, and the hero clips the
   tilted covers so a narrow phone never scrolls sideways. */
@media (max-width: 900px) {
  .hero {
    overflow-x: clip;
  }

  .stack {
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack > * {
    transition: none;
  }
}

.cover {
  aspect-ratio: 3 / 4;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 26px;
  border-radius: 4px 8px 8px 4px;
  background: var(--cover);
  color: var(--cover-ink);
  box-shadow: inset 10px 0 0 rgba(0, 0, 0, 0.18), 0 18px 40px -18px rgba(23, 23, 28, 0.45);
}

.cover-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.75;
}

.cover-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 40px;
  line-height: 44px;
  letter-spacing: -0.015em;
}

.cover-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  line-height: 30px;
  opacity: 0.8;
}

.cover-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cover-rule {
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

/* READ-031: a practical's cover, the pamphlet: light, with a bookcloth band
   where a book is solid bookcloth. */
.pamphlet {
  box-sizing: border-box;
  flex: 0 0 220px;
  aspect-ratio: 3 / 4;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px 22px 34px;
  border: 1px solid var(--rule-strong);
  border-left: 18px solid var(--cover);
  border-radius: 3px 6px 6px 3px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 30px -18px rgba(23, 23, 28, 0.4);
}

.pamphlet .ptop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.pamphlet .pf {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.pamphlet .pk {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pamphlet .pt {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 30px;
  color: var(--ink);
}

.pamphlet .pau {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-3);
}

.stack .pamphlet {
  height: auto;
  padding: 20px 18px 18px 22px;
  border-left-width: 16px;
}

.stack .pamphlet .pt {
  font-size: 24px;
  line-height: 28px;
}

/* READ-034: the books a practical builds on. */
.builds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.builds ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.builds li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink-2);
}

.builds li a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
}

/* READ-002: the practicals that build on a book, after its contents. */
.practicals {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

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

.pr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--rule-strong);
  border-left: 6px solid var(--cover);
  border-radius: 6px;
  background: var(--surface);
}

.pr-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pr-kind {
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.pr-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 30px;
}

.pr-title a {
  color: var(--ink);
  text-decoration: none;
}

.pr-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.pr-title a:focus-visible {
  outline: none;
}

.pr-desc {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 27px;
  color: var(--ink-2);
}

.pr-meta {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

/* READ-031: the author and the edition along the cover's foot. */
.cover-by {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  font-family: var(--sans);
  font-size: 12px;
  opacity: 0.85;
}

/* The privacy page's effective date and version (D19). */
.page-meta {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-3);
}

.band {
  border-top: 1px solid var(--rule);
  background: var(--surface);
}

.band .wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-block: 64px;
}

/* The book landing's contents (READ-002): chapter rows with their sections
   run in beside them, then the appendices in a grid. Nothing folds. */
.contents {
  display: flex;
  flex-direction: column;
}

.contents .label {
  margin: 0 0 10px;
}

.contents-chapters,
.contents-appendices {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1.5px solid var(--ink);
}

.contents-chapters > li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.contents .n {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 28px;
  color: var(--ink-3);
}

.contents-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 40px;
  min-width: 0;
}

.contents-title {
  flex: 1 1 260px;
  max-width: 360px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: var(--ink);
  text-decoration: none;
}

.contents-secs {
  flex: 3 1 420px;
  min-width: 0;
  margin: 0;
  padding: 2px 0 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink-2);
}

.contents-secs li {
  display: inline;
}

/* A no-break space keeps each dot off the start of a line. */
.contents-secs li:not(:last-child)::after {
  content: "\00a0\00b7";
  content: "\00a0\00b7" / "";
  color: var(--ink-3);
}

.contents-secs a {
  color: inherit;
  text-decoration: none;
}

.contents-appendices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  column-gap: 32px;
}

.contents-appendices li {
  border-bottom: 1px solid var(--rule);
}

.contents-appendices a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 12px 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 26px;
  color: var(--ink);
  text-decoration: none;
}

.contents-appendices .n {
  line-height: inherit;
}

.contents-chapters + .label {
  margin-top: 40px;
}

.contents a:hover {
  color: var(--accent);
}

/* The shelf (READ-001, READ-017): the published book and an untitled ghost
   per planned one. shelf.js sets --lift as the pointer passes. */
.shelf {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 24px 4px 0;
  border-bottom: 8px solid var(--rule-strong);
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 300px;
}

.spine {
  --lift: 0px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-radius: 3px 3px 0 0;
  text-decoration: none;
  transform: translateY(calc(var(--lift) * -1));
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}

.spine .st {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  line-height: 22px;
  white-space: nowrap;
}

.spine.live {
  width: 76px;
  min-height: 276px;
  justify-content: center;
  background: var(--cover);
  color: var(--cover-ink);
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18);
}

.spine.live:hover,
.spine.live:focus-visible {
  --lift: 18px;
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18), 0 14px 24px -14px rgba(23, 23, 28, 0.55);
}

/* No title is drawn or sent for a book that doesn't exist yet: two faint
   blurred bars stand in for a title and a mark. */
/* READ-033: a practical's spine stands beside the book it builds on:
   narrower and shorter, light with a bookcloth band at the top, and its
   title centered in ink, as the book's is (READ-001). */
.spine.practical {
  width: 50px;
  min-height: 226px;
  justify-content: center;
  gap: 12px;
  padding: 14px 0;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-top: 16px solid var(--cover);
  border-bottom: 0;
  color: var(--ink);
}

.spine.practical .st {
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
}

.spine.practical:hover,
.spine.practical:focus-visible {
  color: var(--ink);
  box-shadow: 0 14px 24px -14px rgba(23, 23, 28, 0.45);
}

.spine.ghost {
  width: var(--w, 58px);
  min-height: var(--h, 250px);
  justify-content: flex-start;
  gap: 12px;
  padding: 18px 0;
  background: var(--surface);
  border: 1.5px dashed var(--rule-strong);
  border-bottom: 0;
  opacity: 0.75;
}

.ghost-bar {
  flex: 0 0 auto;
  width: 10px;
  height: calc(var(--h, 250px) * 0.44);
  border-radius: 5px;
  background: var(--ink-3);
  opacity: 0.22;
  filter: blur(1.5px);
}

.ghost-bar.short {
  height: calc(var(--h, 250px) * 0.12);
  opacity: 0.16;
}

.spine.settling {
  animation: spine-settle 420ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes spine-settle {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spine,
  .spine.live:hover,
  .spine.live:focus-visible {
    transform: none;
    transition: none;
  }

  .spine.settling {
    animation: none;
  }
}

.book-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px 56px;
  margin: 28px 0 56px;
}

/* READ-037: the landing's cover and pamphlet keep their 3:4 shape at 300px,
   aligned to the top rather than stretched to the text beside them. */
.book-head .cover,
.book-head .pamphlet {
  flex: 0 0 300px;
  align-self: flex-start;
  height: auto;
  aspect-ratio: 3 / 4;
  max-width: 100%;
}

.book-head .pamphlet {
  padding: 28px 26px 28px 40px;
  border-left-width: 22px;
}

.book-head .pamphlet .pt {
  font-size: 36px;
  line-height: 40px;
  letter-spacing: -0.015em;
}

.book-head .pamphlet .pau {
  font-size: 12px;
}

.book-head .pamphlet .pf {
  font-size: 11px;
}

.book-intro {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.book-intro p {
  margin: 0;
}

/* The book's downloads (READ-018), from Book.dc.html. */
.downloads {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.downloads .label {
  margin: 0;
}

.downloads .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dl-meta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}

.download-note {
  font-size: 13.5px;
  line-height: 21px;
}

/* The book's edition and ISBNs (READ-019), from Book.dc.html. */
.edition {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.edition .label {
  margin: 0;
}

.isbns {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 14px;
  margin: 0 0 4px;
}

.isbns dt {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.isbns dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: var(--ink-2);
}

.edition .ui-small {
  font-size: 13.5px;
  line-height: 21px;
}

.book-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  line-height: 30px;
  color: var(--ink-2);
}

.page > .section-title {
  margin-bottom: 18px;
}

/* The chapter page: contents, reading column and rail. */

.chapter-layout {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 740px) minmax(0, 240px);
  justify-content: space-between;
  gap: 32px 48px;
  padding-block: 36px 80px;
}

/* The contents column (READ-026): the plain title at 1080 px and wider,
   the fold's toggle below that. */
.toc-title,
.toc-fold > summary {
  display: block;
  margin: 0 0 10px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--ink);
}

.toc-fold > summary {
  display: none;
  cursor: pointer;
  list-style: none;
}

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

.toc-book {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
}

.chapter-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chapter-head p {
  margin: 0;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

/* A chapter's first paragraph, before any heading, is its lead. */
.chapter-body > p:first-child {
  font-size: 21px;
  line-height: 33px;
  color: var(--ink-2);
}

.prevnext {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding-top: 28px;
  border-top: 1.5px solid var(--ink);
}

.pn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.pn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.pn.next {
  text-align: right;
}

.pn .d1 {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pn .d2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  line-height: 26px;
}

.position {
  margin: 0;
  color: var(--ink-3);
}

.rail {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-family: var(--sans);
  font-size: 14px;
}

.filters select {
  width: auto;
  min-height: 32px;
  padding: 4px 8px;
  font-family: var(--sans);
}

.filter-count,
.filter-empty {
  color: var(--ink-3);
}

.not-found {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.not-found p {
  margin: 0;
}

.address {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.address .part {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.address .sep {
  font-family: var(--mono);
  color: var(--ink-3);
}

.address .missing .mono {
  color: var(--danger);
}

/* The header's buttons drop to icons so it stays on one row (DSYS-018). */

@media (max-width: 959px) {
  .header-actions .ibtn-text,
  .header-actions .kbd,
  .header-actions [data-theme-label],
  .header-actions .account-chip .handle {
    display: none;
  }

  .header-actions .account-chip {
    padding: 4px;
  }
}

@media (max-width: 1079px) {
  .chapter-layout {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .toc-title {
    display: none;
  }

  .toc-fold > summary {
    display: block;
  }
}

/* The Toolbox and its tools (TOOL-001, TOOL-002), from Toolbox.dc.html,
   Resolve.dc.html and Lexicon.dc.html. */
.toolbox,
.tool-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-block: 48px 96px;
}

.tool-page {
  gap: 22px;
  padding-block: 36px 88px;
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-head .lead {
  max-width: 68ch;
}

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

.tool-card,
.tool-tile {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.tool-card {
  height: 100%;
}

.tool-card:hover,
.tool-tile:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.tool-card:focus-within,
.tool-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-card .tc-name a {
  color: inherit;
  text-decoration: none;
}

.tool-card .tc-name a:focus-visible {
  outline: none;
}

/* The name's link covers the card; the links in its meta line sit above. */
.tool-card .tc-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.tool-card .tc-meta a {
  position: relative;
  z-index: 1;
}

.tc-name {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 21px;
  line-height: 28px;
  color: var(--accent);
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

/* READ-001 (library-page): the band's last tile, only a link to the Toolbox. */
.tool-tile.tool-more {
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border-style: dashed;
  background: var(--sunken);
  text-align: center;
}

.tool-more .go {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
}

/* Band text runs the full column width. */
.band .prose {
  max-width: none;
}

/* READ-001 (library-page): the live consoles, a screenshot of chapter 3's
   console beside the copy, light or dark with the reader's theme. */
.console-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 24px 40px;
}

.console-shot {
  margin: 0;
  min-width: 0;
}

.console-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 24px -14px rgba(23, 23, 28, 0.45);
}

:root[data-theme="dark"] .console-shot .for-light,
:root:not([data-theme="dark"]) .console-shot .for-dark {
  display: none;
}

.console-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

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

  .console-shot {
    max-width: 240px;
  }
}

/* The Library page (READ-032): the latest book, then every book and
   practical, three to a row. */
.lib-hero {
  border-bottom: 1px solid var(--rule);
}

.lib-hero .wrap {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  gap: 40px 64px;
  padding-block: 56px 64px;
}

.lib-cover {
  display: block;
  text-decoration: none;
}

.lib-hero .cover-title {
  font-size: 34px;
  line-height: 38px;
}

.lib-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .lib-hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .lib-cover {
    max-width: 260px;
  }
}

.lib-body .wrap {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-block: 56px 88px;
}

.lib-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
}

.kinds {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--sunken);
}

.kinds[hidden] {
  display: none;
}

.kinds button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.kinds button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 23, 28, 0.12);
}

.kinds button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 980px) {
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.item[hidden] {
  display: none;
}

.item .art {
  display: block;
  width: 72%;
  transition: transform 160ms ease-out;
}

.item:hover .art {
  transform: translateY(-4px);
}

.item .cover {
  padding: 22px 20px 20px 26px;
}

.item .cover-title {
  font-size: 30px;
  line-height: 33px;
}

.item .cover-sub {
  font-size: 19px;
  line-height: 24px;
}

.item .kind {
  margin: 6px 0 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.item h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
  line-height: 30px;
}

.item h3 a {
  color: var(--ink);
  text-decoration: none;
}

.item h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.item h3 a:focus-visible {
  outline: none;
}

.item:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 6px;
}

.item .desc {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 27px;
  color: var(--ink-2);
}

.item .meta {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  .item .art {
    transition: none;
  }

  .item:hover .art {
    transform: none;
  }
}

.tool-tile {
  gap: 10px;
  padding: 20px 22px;
  background: var(--bg);
}

.tool-tile .tc-name {
  font-size: 19px;
  line-height: 26px;
}

.tc-desc {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 28px;
  color: var(--ink-2);
}

.tc-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.tc-steps span {
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-2);
}

.tc-steps span + span::before {
  content: "\2192  ";
  color: var(--ink-3);
}

.tc-meta {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--ink-3);
}

.tool {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tl-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.tl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tl-inp {
  flex: 1 1 320px;
  min-width: 0;
  min-height: 48px;
  font-family: var(--mono);
  font-size: 16px;
}

.tl-row .btn {
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
}

.tl-samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
}

.tl-samples > span {
  margin-right: 4px;
}

.tl-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.tl-chip.on {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.tl-chip:focus-visible,
.tl-copy:focus-visible,
.tl-check input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tl-check {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
}

.tl-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.tl-noscript {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--sunken);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

.tl-progress {
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 36px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
}

.tl-progress[hidden],
.tl-progress [hidden],
.tl-verdict[hidden] {
  display: none;
}

.tl-steps {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tl-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 16px;
}

.tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-rail::after {
  content: "";
  flex: 1 1 auto;
  width: 2px;
  margin: 6px 0;
  background: var(--rule);
}

.tl-step:last-child .tl-rail::after {
  display: none;
}

.tl-dot {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.tl-step.ok .tl-dot {
  border-color: var(--garden);
  background: var(--garden-wash);
  color: var(--garden);
}

.tl-step.none .tl-dot {
  background: var(--sunken);
  color: var(--ink-2);
}

.tl-step.fail .tl-dot {
  border-color: var(--danger);
  background: var(--danger-wash);
  color: var(--danger);
}

.tl-step.running .tl-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.tl-step.waiting {
  opacity: 0.55;
}

.tl-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 28px;
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.tl-head h3 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
}

.tl-st {
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.tl-st.ok {
  background: var(--garden-wash);
  color: var(--garden);
}

.tl-st.fail {
  background: var(--danger-wash);
  color: var(--danger);
}

.tl-st.running {
  background: var(--accent-wash);
  color: var(--accent);
}

.tl-target {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.tl-what,
.tl-text {
  margin: 0;
  max-width: 68ch;
  overflow-wrap: break-word;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 28px;
  color: var(--ink);
}

.tl-text {
  font-size: 16px;
  line-height: 26px;
}

.tl-why {
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--accent-wash);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 23px;
  color: var(--ink);
}

.tl-why .t {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tl-detail {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
  color: var(--danger);
  overflow-wrap: anywhere;
}

.tl-fig {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--sunken);
  overflow: hidden;
}

.tl-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tl-copy {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--accent);
  font: 600 12px/1 var(--cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.tl-copy:hover {
  background: var(--accent-wash);
}

.tl-code {
  margin: 0;
  padding: 10px 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 21px;
  color: var(--ink);
}

.tl-code .l {
  display: block;
  padding: 0 16px;
  white-space: pre;
}

.tl-code .l.c {
  color: var(--t-com);
}

.tl-code .l.hl {
  background: var(--garden-wash);
  box-shadow: inset 3px 0 0 var(--garden);
}

.tl-code .l.bad {
  background: var(--danger-wash);
  box-shadow: inset 3px 0 0 var(--danger);
}

.tl-verdict {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.tl-verdict.ok {
  border-color: var(--garden);
}

.tl-verdict.fail {
  border-color: var(--danger);
}

.tl-verdict .label {
  margin: 0;
  color: var(--ink-3);
}

.tl-verdict h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 36px;
}

.tl-kv {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0;
}

.tl-kv dt {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tl-kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tl-kv dd small {
  display: block;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--ink-2);
}

.tl-more {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

/* Phones (DSYS-005, DSYS-015). */

@media (max-width: 719px) {
  :root {
    --gutter: 16px;
  }

  .doc {
    max-width: 100%;
    font-size: 17px;
    line-height: 28px;
  }

  .ch-title {
    font-size: 34px;
    line-height: 42px;
  }

  .book-title {
    font-size: 40px;
    line-height: 46px;
  }

  figure.code,
  figure.code pre,
  figure.table {
    max-width: 100%;
    overflow-x: auto;
  }

  .doc dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  /* Two rows: the wordmark and the buttons, then the navigation (DSYS-018). */
  .site-header .wrap {
    column-gap: 12px;
  }

  .site-header .nav {
    order: 1;
    flex-basis: 100%;
  }

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

  .prm label {
    padding-top: 0;
  }

  .login {
    padding-block: 32px 64px;
  }

  .login-title {
    font-size: 32px;
    line-height: 40px;
  }

  .card {
    padding: 20px;
  }

  .section-title {
    font-size: 26px;
    line-height: 34px;
  }

  .hero .wrap,
  .band .wrap {
    padding-block: 40px;
  }

  .toolbox,
  .tool-page {
    padding-block: 32px 64px;
  }

  .tl-kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 0;
  }

  .tl-kv dd + dt {
    margin-top: 8px;
  }

  .tl-form,
  .tl-verdict {
    padding: 16px;
  }
}

/* The PLC operations page (TOOL-012), from Plc.dc.html: the caution notice
   under the lead, the Build and Check tabs, and the rotation key box. */
.notice {
  width: 100%;
  max-width: 860px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  border: 2px solid var(--caution);
  border-radius: 8px;
  background: var(--caution-wash);
  color: var(--ink);
}

.notice-icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--caution);
}

.notice-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notice h2 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
}

.notice p {
  margin: 0;
  max-width: 72ch;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 28px;
}

.notice a {
  color: var(--ink);
  font-weight: 500;
  text-decoration-thickness: 2px;
}

.plc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: flex-start;
  padding: 4px;
  border-radius: 8px;
  background: var(--sunken);
}

.plc-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
}

.plc-tab.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 23, 28, 0.12);
}

.plc-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.plc-page .tool[hidden],
.sa-page .tool[hidden],
.sa-page [data-sa-tabs][hidden] {
  display: none;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.plc-page .field .inp,
.sa-page .field .inp {
  flex: none;
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
}

.plc-page .field label.label,
.sa-page .field label.label {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
}

.label-note {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.keybox {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 6px;
}

.keybox .tl-samples {
  padding: 0;
}

.keyrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.keyrow .mono {
  min-width: 0;
  flex: 1 1 320px;
  font-size: 14px;
  line-height: 22px;
}

.kl {
  flex: 0 0 56px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.keynote {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 20px;
  color: var(--ink-2);
}

/* The service auth page (TOOL-018), from ServiceAuth.dc.html: the token
   box, the read-only method field, and the result's closing note. The tabs,
   notice and fields share the PLC page's styles. */
.jwt-in {
  width: 100%;
  min-height: 112px;
  box-sizing: border-box;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 21px;
  resize: vertical;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.inp.locked {
  background: var(--sunken);
  color: var(--ink-2);
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}

.sa-page .tl-form .keynote {
  margin: 0;
}

.aud-note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
}

/* The process walkthrough (WIDG-026 to WIDG-028), from Process.dc.html. A
   circle is a stage the browser runs; a square, one another service answers.
   Below 520px of its own width the track becomes a column. */

.pw {
  container-type: inline-size;
}

.pw-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 20px 20px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink);
}

.pw-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pw-track li {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.pw-track li::before {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(-50% + 24px);
  right: calc(50% + 24px);
  height: 2px;
  background: var(--rule-strong);
}

.pw-track li:first-child::before {
  display: none;
}

.pw-track li.lnk-done::before {
  background: var(--garden);
}

.pw-track li.lnk-stop::before {
  background: repeating-linear-gradient(90deg, var(--rule-strong) 0 4px, transparent 4px 8px);
}

.pw-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 4px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.pw-stage[aria-disabled="true"] {
  cursor: default;
}

.pw-stage:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.pw-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-2);
}

.pw-name .pw-n {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

li.viewing .pw-name {
  color: var(--ink);
  font-weight: 500;
}

li.viewing .pw-stage {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.pw-mark {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-3);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
}

.pw-mark.sq {
  border-radius: 7px;
}

.st-current .pw-mark {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

.st-running .pw-mark {
  border-color: var(--accent);
  color: var(--accent);
}

.st-running .pw-mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: pw-spin 1s linear infinite;
}

.st-done .pw-mark {
  border-color: var(--garden);
  background: var(--garden-wash);
  color: var(--garden);
}

.st-warn .pw-mark {
  border-color: var(--caution);
  background: var(--caution-wash);
  color: var(--caution);
}

.st-error .pw-mark {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--danger-wash);
}

.st-skipped .pw-mark {
  border-style: dashed;
  background: transparent;
}

.st-blocked .pw-mark {
  border-color: var(--rule);
  background: var(--sunken);
  opacity: 0.6;
}

.st-blocked .pw-name {
  opacity: 0.6;
}

@keyframes pw-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-running .pw-mark::after {
    animation: none;
    border-color: var(--accent);
    border-style: dotted;
  }
}

.pw-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
}

.pw-dhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.pw-of {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pw-who {
  font-size: 12.5px;
  color: var(--ink-3);
}

.pw-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
}

.pw-desc {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 27px;
  color: var(--ink);
}

.pw-link {
  margin: 0;
  font-size: 14px;
}

.pw-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 3px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pw-chip.ok {
  background: var(--garden-wash);
  color: var(--garden);
}

.pw-chip.warn {
  background: var(--caution-wash);
  color: var(--caution);
}

.pw-chip.err {
  background: var(--danger-wash);
  color: var(--danger);
}

.pw-chip.skip,
.pw-chip.pend,
.pw-chip.block {
  background: var(--sunken);
  color: var(--ink-2);
}

.pw-chip.run {
  background: var(--accent-wash);
  color: var(--accent);
}

.pw-data {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface);
}

.pw-data dt {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pw-data dd {
  margin: 0;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.pw-data dd.ok {
  color: var(--garden);
}

.pw-data dd.warn {
  color: var(--caution);
}

.pw-data dd.err {
  color: var(--danger);
}

.pw-data dd.dim {
  color: var(--ink-3);
}

.pw-err {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-left: 4px solid var(--danger);
  border-radius: 0 5px 5px 0;
  background: var(--danger-wash);
  font-size: 14px;
  line-height: 21px;
}

.pw-err strong {
  color: var(--danger);
}

.pw-pre {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pw-ctrl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pw-ctrl .pw-pos {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-3);
}

.btn.quiet {
  background: transparent;
  color: var(--ink-2);
  padding: 0 8px;
}

.btn[aria-disabled="true"] {
  background: var(--sunken);
  color: var(--ink-3);
  border-color: var(--rule);
  cursor: not-allowed;
}

.btn.quiet[aria-disabled="true"] {
  background: transparent;
  border-color: transparent;
}

@container (max-width: 520px) {
  .pw-track {
    flex-direction: column;
  }

  .pw-track li {
    justify-content: flex-start;
    padding-bottom: 14px;
  }

  .pw-track li::before {
    top: auto;
    bottom: calc(100% - 4px);
    left: 17px;
    right: auto;
    width: 2px;
    height: 22px;
  }

  .pw-track li.lnk-stop::before {
    background: repeating-linear-gradient(180deg, var(--rule-strong) 0 4px, transparent 4px 8px);
  }

  .pw-stage {
    flex-direction: row;
    gap: 12px;
    padding: 0;
    text-align: left;
  }

  li.viewing .pw-stage {
    box-shadow: none;
  }

  li.viewing .pw-name {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

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

  .pw-data dd {
    margin-bottom: 6px;
  }

  .pw-desc {
    font-size: 16px;
    line-height: 26px;
  }
}

/* Without JavaScript, and in the exports: every stage in order (WIDG-028). */

.pw-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0 0 0 22px;
}

.pw-list > li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pw-list .pw-title {
  font-size: 16px;
  line-height: 24px;
}

.pw-list .pw-state {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* The record proof tool (TOOL-026), from RecordProof.dc.html. */

.rp {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1000px;
}

.rp figure.widget-frame {
  margin: 0;
}

.rp-modes {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  padding: 4px;
  border-radius: 8px;
  background: var(--sunken);
}

.rp-modes button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.rp-modes button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 23, 28, 0.12);
}

.rp-modes button:focus-visible,
.rp-cp:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rp-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rp-form[hidden] {
  display: none;
}

.rp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-row .inp {
  flex: 1 1 320px;
  min-width: 0;
}

.inp.rp-ta {
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 19px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.rp-help {
  margin: 0;
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-3);
}

.rp-cmd {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--sunken);
}

.rp-cmd code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.rp-cp {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
}

.rp-cp[data-copied] {
  color: var(--garden);
  border-color: var(--garden);
}

.pw-path {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface);
}

.pw-path li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  line-height: 20px;
}

.pw-path li:last-child {
  border-bottom: 0;
}

.pw-path .d {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.pw-path code {
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pw-path .n {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

.pw-path li.leaf {
  background: var(--garden-wash);
}

.pw-path li.leaf .n {
  color: var(--garden);
  font-weight: 600;
}

@container (max-width: 520px) {
  .pw-path li {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .pw-path .n {
    grid-column: 2;
    white-space: normal;
  }
}

/* A step's link onward, such as the lexicon resolver's to the record proof
   (TOOL-030). */

.tl-link {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
}

/* A book's or practical's notice under the header (READ-038), from the
   boards' band. */

.gnotice {
  background: var(--notice-bg);
  color: var(--notice-ink);
  border-bottom: 1px solid var(--notice-rule);
}

.gnotice-in {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-block: 10px;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 22px;
}

.gnotice svg {
  flex: 0 0 auto;
  margin-top: 3px;
}

.gnotice p {
  margin: 0;
  min-width: 0;
}

/* A previous edition's card in the Library (READ-039), from Library.dc.html:
   a muted cover with a stamp, no link, and its notice, ISBNs and downloads. */

.item.ed-prev .cover {
  background: var(--prev-cover);
  color: var(--prev-ink);
  box-shadow: inset 9px 0 0 rgba(0, 0, 0, 0.16), 0 10px 22px -16px rgba(23, 23, 28, 0.45);
}

.item.ed-prev .stamp {
  align-self: flex-start;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
}

.item.ed-prev .art {
  transition: none;
}

.item.ed-prev:hover .art {
  transform: none;
}

.item.ed-prev .kind {
  color: var(--ink-3);
}

.item.ed-prev .ed-name {
  margin-top: -6px;
}

.ed-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--rule-strong);
  border-radius: 0 5px 5px 0;
  background: var(--sunken);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-2);
}

.ed-isbns {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 12px;
  margin: 0;
}

.ed-isbns dt {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.ed-isbns dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: var(--ink-2);
}

.ed-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Stacks: a table whose rows each describe one thing (COMP-042, DSYS-022),
   from Reference.dc.html. */

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

.vstack > li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 4px 16px;
  border-bottom: 1px solid var(--rule);
}

.stack-h {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 24px;
  color: var(--ink);
}

.stack-k {
  margin-right: 8px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stack-sub {
  margin-left: 6px;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-3);
}

.vstack .kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
}

.vstack .kv dt {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 24px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.vstack .kv dd {
  margin: 0;
  min-width: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 24px;
}

.cvrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.doc .cv,
.cv {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 19px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.cp {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
}

.cp:hover {
  color: var(--ink);
}

.cp:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cp[data-copied] {
  color: var(--garden);
  border-color: var(--garden);
}

@media (max-width: 719px) {
  .vstack .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .vstack .kv dd {
    margin-bottom: 6px;
  }
}

/* A signature base (COMP-043, DSYS-022): numbered real lines and a Wrap
   lines box; wrapped, a continued line hangs under its text unnumbered. */

figure.code .cap-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

figure.code figcaption:has(.cap-tools) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.wrapchk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

figure.code .ln {
  display: grid;
  grid-template-columns: 2.5ch minmax(0, 1fr);
  gap: 12px;
}

figure.code .ln .no {
  color: var(--ink-3);
  text-align: right;
  user-select: none;
}

figure.code .ln .tx {
  white-space: pre;
}

.code.wrapped .ln {
  display: grid;
  grid-template-columns: 2.5ch minmax(0, 1fr);
}

.code.wrapped .tx {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* Method rows (COMP-044 to COMP-047, DSYS-023), from MethodRows.dc.html. */

.mini {
  display: inline-block;
  min-width: 44px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11.5px;
  line-height: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mac {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.04em;
}

.mac.off {
  padding: 0;
  background: transparent;
  color: var(--ink-3);
  font-weight: 400;
}

/* A: dictionary entries. */
.a-group + .a-group {
  margin-top: 22px;
}

.a-group[hidden] {
  display: none;
}

.a-group .grp {
  margin: 0 0 10px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.a-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1.5px solid var(--rule-strong);
}

.a-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 80px;
}

.a-row[hidden] {
  display: none;
}

.a-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.a-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
}

.a-full {
  margin: 0;
  font-size: 13px;
}

.a-purpose {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 25px;
}

.a-auth {
  margin: 2px 0 0;
  font-size: 13.5px;
  line-height: 21px;
  color: var(--ink-2);
}

.t-type {
  display: inline-flex;
  padding: 0 7px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.t-type.procedure {
  border-color: var(--accent);
  color: var(--accent);
}

/* B: signatures. */
.prefix {
  margin: 0 0 12px;
}

.b-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1.5px solid var(--rule-strong);
}

.b-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 21px;
}

.b-sig {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.b-verb {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}

.b-name {
  font-weight: 600;
}

.pu {
  color: var(--ink-3);
}

.b-ret,
.b-meta {
  padding-left: 52px;
}

.b-ret {
  color: var(--ink-2);
}

.arrow {
  margin-right: 8px;
  color: var(--accent);
}

.b-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
}

/* C: prefix hoisted. */
.c-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--rule-strong);
}

.c-pre {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--garden);
}

.c-sub {
  font-size: 13.5px;
  color: var(--ink-2);
}

.c-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 64px;
  gap: 4px 16px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.c-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.c-name .nsid {
  font-size: 13.5px;
  font-weight: 600;
}

.c-type {
  font-size: 12px;
  color: var(--ink-3);
}

.c-io {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.c-io .mini {
  min-width: 36px;
}

.none {
  font-family: var(--sans);
  color: var(--ink-3);
}

.c-flags {
  text-align: right;
}

/* D: request cards. */
.d-card {
  margin: 0 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.d-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 20px;
}

.d-verb {
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 11px;
  line-height: 18px;
}

.d-path {
  min-width: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.d-path .nsid {
  font-size: 12.5px;
}

.d-path b {
  font-weight: 600;
}

.d-q {
  color: var(--ink-3);
}

.d-body {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 12px;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
}

.d-k {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11.5px;
  line-height: 21px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.d-body .ok {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--garden);
}

.d-errs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.d-plus {
  font-size: 13px;
  color: var(--ink-3);
}

/* F: who calls whom. */
.f-grid {
  display: flex;
  flex-direction: column;
  min-width: 520px;
}

figure.table:has(.f-grid) {
  overflow-x: auto;
}

.f-head,
.f-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.f-lanes,
.f-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--lanes, 5), minmax(0, 1fr));
}

.f-lane {
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--rule-strong);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: center;
}

.f-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.f-label {
  display: flex;
  flex-direction: column;
}

.f-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12.5px;
}

.f-auth {
  font-size: 12px;
  color: var(--ink-3);
}

.f-track {
  height: 24px;
}

.f-dot {
  justify-self: center;
  align-self: center;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rule-strong);
}

.f-arrow {
  position: absolute;
  top: 11px;
  height: 2px;
  background: var(--accent);
  left: calc((var(--a) + 0.5) * 100% / var(--lanes, 5));
  width: calc((var(--b) - var(--a)) * 100% / var(--lanes, 5));
}

.f-arrow::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.f-arrow.r::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -5px;
  border: 6px solid transparent;
  border-left: 9px solid var(--accent);
  border-right: 0;
}

.f-arrow.l::after {
  content: "";
  position: absolute;
  left: -2px;
  top: -5px;
  border: 6px solid transparent;
  border-right: 9px solid var(--accent);
  border-left: 0;
}

.f-arrow.l::before {
  left: auto;
  right: -4px;
}

@media (max-width: 719px) {
  .c-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .c-io {
    grid-column: 1 / -1;
  }

  .b-ret,
  .b-meta {
    padding-left: 0;
  }

  .d-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* E: expandable rows (COMP-048, READ-041). Open in the HTML and in print;
   method-rows.js closes them on the web. */
.e-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1.5px solid var(--rule-strong);
}

.doc ol.e-list {
  padding-left: 0;
}

.e-row {
  border-bottom: 1px solid var(--rule);
}

.e-head {
  display: grid;
  grid-template-columns: 16px minmax(0, 150px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.e-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chev {
  color: var(--ink-3);
}

.e-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.e-purpose {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
}

.e-row.open {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
}

.e-row.open .e-head {
  padding-left: 10px;
  padding-right: 10px;
}

.e-body {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 16px 36px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
}

.e-row.open .e-body {
  display: flex;
}

.e-full {
  font-size: 12.5px;
}

.e-sec {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.e-kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 14px;
  font-size: 13.5px;
}

.e-k {
  font-family: var(--mono);
  font-size: 12.5px;
}

.e-k i {
  margin-left: 6px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
}

.e-try {
  padding-top: 4px;
}

.btn-try {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 719px) {
  .e-head {
    grid-template-columns: 16px minmax(0, 1fr) auto;
  }

  .e-head .mac {
    grid-column: 3;
    grid-row: 1;
  }

  .e-purpose {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .e-body {
    padding-left: 14px;
  }

  .e-sec {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

@media print {
  .e-body {
    display: flex;
  }
}

/* The CAR explorer (TOOL-032 to TOOL-043), from CarExplorer.dc.html. */

.cx {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cx-src {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.cx-tabs {
  align-self: flex-start;
  flex-wrap: wrap;
}

.cx-tabs button {
  white-space: nowrap;
}

.cx-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cx-form[hidden] {
  display: none;
}

.cx-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cx-row .inp {
  flex: 1 1 380px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--bg);
  font: 13.5px var(--mono);
  color: var(--ink);
}

.cx-row .cx-since {
  flex: 0 1 220px;
}

.cx-row .cx-ta {
  min-height: 72px;
  padding: 8px 12px;
  resize: vertical;
}

.cx-drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 84px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 8px;
  background: var(--bg);
  font: 14px var(--sans);
  color: var(--ink-2);
  cursor: pointer;
}

.cx-drop.over,
.cx-drop:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cx-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cx-note {
  margin: 0;
  font: 12.5px/19px var(--sans);
  color: var(--ink-3);
}

.cx-note b {
  font-weight: 600;
  color: var(--ink-2);
}

.cx-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.cx-status p {
  margin: 0;
  font: 14px/21px var(--sans);
  color: var(--ink-2);
}

.cx-status p:empty {
  display: none;
}

.cx-cancel {
  min-height: 34px;
  font-size: 13px;
}

.cx-over {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-left: 4px solid var(--caution);
  border-radius: 0 6px 6px 0;
  background: var(--caution-wash);
  font: 14px/21px var(--sans);
  color: var(--ink);
}

.cx-over[hidden],
.cx-result[hidden] {
  display: none;
}

.cx-over b {
  color: var(--caution);
}

.cx-result {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.cx-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  font: 13px var(--sans);
  color: var(--ink-2);
}

.cx-sum code {
  font: 12.5px var(--mono);
  color: var(--ink);
}

.cx-sum b {
  color: var(--ink);
}

.cx-sum .ok {
  color: var(--garden);
  font-weight: 600;
}

.cx-sum .bad,
.cx-sum .warn {
  color: var(--caution);
  font-weight: 600;
}

.cx-meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cx-meter i {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--sunken);
}

.cx-meter i b {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--accent);
}

.cx-partial {
  margin: 0;
  font: 14px/21px var(--sans);
}

.cx-prooflink {
  margin: -6px 0 0;
  font: 14px var(--sans);
}

.cx-prooflink[hidden],
.cx-partial[hidden] {
  display: none;
}

.cx-ws {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 270px;
  gap: 14px;
  align-items: start;
}

.cx-pane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.cx-pane[hidden] {
  display: none;
}

.cx-pane-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  font: 600 12px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.cx-count,
.cx-selcid {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.cx-selcid {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cx-blist,
.cx-tree,
.cx-hex {
  position: relative;
  max-height: 560px;
  overflow: auto;
}

.cx-blist {
  height: min(560px, 60vh);
}

.cx-spacer {
  width: 1px;
}

.cx-blist:focus-visible,
.cx-tree-list:focus-visible,
.cx-hex:focus-visible,
.cx-diag:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cx-brow {
  position: absolute;
  left: 4px;
  right: 4px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  height: 42px;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
}

.cx-brow:hover {
  background: var(--bg);
}

.cx-brow.on {
  background: var(--accent-wash);
}

.cx-blist:focus-visible .cx-brow.on {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cx-sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.cx-sw.commit {
  background: var(--accent);
}

.cx-sw.mst {
  background: var(--garden);
}

.cx-sw.record {
  background: var(--caution);
}

.cx-sw.other {
  background: var(--ink-3);
}

.cx-brow .bl {
  overflow: hidden;
  font: 500 13px var(--sans);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cx-brow .bs {
  font: 11.5px var(--mono);
  color: var(--ink-3);
  text-align: right;
}

.cx-brow .bc {
  grid-column: 2 / 4;
  overflow: hidden;
  font: 11px var(--mono);
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cx-brow .bc.bad {
  color: var(--danger);
}

.cx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--rule);
  font: 12px var(--sans);
  color: var(--ink-2);
}

.cx-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cx-legend > span[hidden] {
  display: none;
}

.cx-legend i {
  display: inline-block;
  width: 14px;
  height: 12px;
  border-radius: 2px;
}

.cx-legend i.cx-sw {
  width: 10px;
  height: 10px;
}

.cx-vtabs {
  display: flex;
  gap: 2px;
}

.cx-vtabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: 500 12.5px var(--sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
  cursor: pointer;
}

.cx-vtabs button.on {
  background: var(--accent-wash);
  color: var(--accent);
}

.cx-vtabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cx-tree[hidden],
.cx-bytes[hidden],
.cx-diag[hidden],
.cx-blocknote[hidden],
.cx-window[hidden] {
  display: none;
}

.cx-tree-list {
  position: relative;
  min-height: 100%;
  padding: 6px 0;
  font: 12.5px/22px var(--mono);
}

.cx-trow {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  height: 22px;
  padding-right: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.cx-trow:hover {
  background: var(--bg);
}

.cx-trow.on {
  background: var(--accent-wash);
}

.cx-tree-list:focus-visible .cx-trow.on {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cx-trow .tw {
  width: 10px;
  color: var(--ink-3);
}

.cx-trow .k {
  color: var(--ink-2);
}

.cx-trow .t {
  padding: 0 5px;
  border-radius: 3px;
  background: var(--sunken);
  font: 600 10.5px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cx-trow .v {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
}

.cx-trow .v.cid {
  color: var(--garden);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.cx-trow .v.str {
  color: var(--t-str);
}

.cx-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule);
  font: 12.5px var(--sans);
  color: var(--ink-2);
}

.cx-hex {
  padding: 8px 12px;
  font: 12.5px/22px var(--mono);
}

.cx-hex .hx {
  position: absolute;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: 56px repeat(16, 2.3ch) 12px minmax(0, 1fr);
  align-items: center;
  height: 22px;
}

.cx-hex .off {
  color: var(--ink-3);
}

.cx-hex span.b {
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
}

.cx-hex .asc {
  padding-left: 8px;
  color: var(--ink-3);
  white-space: pre;
}

:is(.car-page, .star-page) .b.h-map,
:is(.car-page, .star-page) .b.h-array {
  background: rgba(62, 58, 158, 0.18);
  color: var(--accent);
}

:is(.car-page, .star-page) .b.h-text,
:is(.car-page, .star-page) .b.text {
  background: rgba(154, 61, 18, 0.12);
}

:is(.car-page, .star-page) .b.h-text {
  color: var(--t-str);
  font-weight: 600;
}

:is(.car-page, .star-page) .b.h-bytes,
:is(.car-page, .star-page) .b.bytes {
  background: rgba(10, 107, 78, 0.12);
}

:is(.car-page, .star-page) .b.h-bytes {
  color: var(--garden);
  font-weight: 600;
}

:is(.car-page, .star-page) .b.h-tag {
  background: rgba(10, 107, 78, 0.28);
  color: var(--garden);
  font-weight: 600;
}

:is(.car-page, .star-page) .b.h-uint {
  background: rgba(143, 83, 0, 0.16);
  color: var(--caution);
  font-weight: 600;
}

:is(.car-page, .star-page) .b.sel {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}

:is(.car-page, .star-page) .b.flag {
  box-shadow: inset 0 -3px 0 var(--caution);
}

.cx-hex:focus-visible .b.cur {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.cx-diag {
  max-height: 560px;
  margin: 0;
  overflow: auto;
  padding: 12px 14px;
  font: 12.5px/21px var(--mono);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
}

.cx-blocknote {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  font: 13px/20px var(--sans);
  color: var(--ink-2);
}

.cx-insp-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}

.cx-insp-body dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
}

.cx-insp-body dt {
  font: 600 11.5px/20px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cx-insp-body dd {
  margin: 0;
  font: 12.5px/20px var(--mono);
  color: var(--ink);
  word-break: break-all;
}

.cx-insp-body p {
  margin: 0;
  font: 13px/20px var(--sans);
  color: var(--ink-2);
}

.cx-insp-body p[hidden],
.cx-jump[hidden] {
  display: none;
}

.cx-jump {
  align-self: flex-start;
  min-height: 34px;
  font-size: 13px;
}

.cx-flist {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cx-flist li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font: 13.5px/21px var(--sans);
  color: var(--ink-2);
}

.cx-flist li:last-child {
  border-bottom: 0;
}

.cx-flist code {
  font: 600 12.5px var(--mono);
  color: var(--caution);
}

.cx-sec-lab {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--rule);
  font: 11px/16px var(--mono);
  color: var(--ink-3);
}

.cx-mst {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.cx-mst[hidden],
.cx-mst-ops[hidden],
.cx-mst-outcome[hidden] {
  display: none;
}

.cx-mst-ops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cx-mst-ops select {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--bg);
  font: 13px var(--mono);
  color: var(--ink);
}

.cx-mst .cx-legend {
  padding: 0;
  border: 0;
}

.cx-lg-path {
  border: 2px solid var(--accent);
  background: var(--surface);
}

.cx-lg-node {
  border: 1px solid var(--rule-strong);
  background: var(--bg);
}

.cx-lg-stub {
  border: 1.5px dashed var(--rule-strong);
}

.cx-mst-outcome {
  margin: 0;
  font: 14px/21px var(--sans);
}

.cx-mstw {
  position: relative;
  max-height: 720px;
  overflow: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.cx-mstc {
  position: relative;
}

.cx-mstc svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cx-mstc path.edge {
  stroke: var(--rule-strong);
  stroke-width: 1.5;
}

.cx-mstc path.hot {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.cx-mstc path.dash {
  stroke: var(--rule-strong);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.cx-mst-nodes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cx-mstc .lay {
  position: absolute;
  left: 10px;
  font: 600 11px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cx-mstc .mn {
  position: absolute;
  box-sizing: border-box;
  width: 236px;
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--bg);
  font: 12px/18px var(--sans);
}

.cx-mstc .mn.on {
  border: 2px solid var(--accent);
  background: var(--surface);
}

.cx-mstc .mh {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font: 600 11px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cx-mstc .mn ol {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.cx-mstc .mn li {
  overflow: hidden;
  font: 11.5px/18px var(--mono);
  color: var(--ink-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cx-mstc .mn li.hit {
  color: var(--accent);
  font-weight: 600;
}

.cx-mstc .miss {
  margin-top: 4px;
  font: 11.5px var(--sans);
  color: var(--ink-3);
}

.cx-mstc .empty {
  font: italic 11.5px var(--sans);
  color: var(--ink-3);
}

.cx-mstc .stub {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 120px;
  padding: 6px 8px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  font: 11.5px/16px var(--sans);
  color: var(--ink-3);
}

.cx-mstc .stub b {
  font: 600 12px var(--sans);
  color: var(--ink-2);
}

.cx-collapsed {
  padding: 14px 16px;
  font: 14px/21px var(--sans);
}

.cx-collapsed p {
  margin: 0 0 10px;
}

.cx-collapsed ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cx-collapsed li {
  padding: 4px 0;
  border-bottom: 1px solid var(--rule);
}

.cx-limits summary {
  padding: 6px 0;
  font: 600 15px var(--sans);
  color: var(--ink);
  cursor: pointer;
}

.cx-limtab {
  width: 100%;
  border-collapse: collapse;
  font: 13.5px/21px var(--sans);
}

.cx-limtab th {
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--rule-strong);
  font: 600 12px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
}

.cx-limtab td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: top;
}

.cx-limtab td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.cx-limtab td:nth-child(2) {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
}

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

  .cx-blist {
    height: min(360px, 50vh);
  }
}

@media (max-width: 640px) {
  .cx-src {
    padding: 14px;
  }

  .cx-hex {
    padding: 8px 6px;
  }

  .cx-hex .hx {
    left: 6px;
    right: 6px;
    grid-template-columns: 40px repeat(16, minmax(0, 1fr));
    font-size: 11px;
  }

  .cx-hex .hx > span:nth-last-child(-n + 2) {
    display: none;
  }

  .cx-limtab thead {
    display: none;
  }

  .cx-limtab tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-bottom: 1px solid var(--rule);
  }

  .cx-limtab td {
    border-bottom: 0;
  }

  .cx-limtab td:last-child {
    grid-column: 1 / -1;
    padding-top: 0;
  }
}

/* The STAR explorer (TOOL-045 to TOOL-054), from StarExplorer.dc.html. It
   shares the CAR explorer's source panel, panes, tree, hex grid, tabs, limits
   table and byte colours (.cx-*), and adds these. */

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

.sx-smp {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

.sx-smpg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.sx-smpg button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 15px;
  background: var(--bg);
  font: 12.5px var(--sans);
  color: var(--ink-2);
  cursor: pointer;
}

.sx-smpg button.on {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.sx-smpg button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sx-smpk {
  min-width: 60px;
  font: 600 11px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.sx-result {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sx-result[hidden],
.sx-errp[hidden] {
  display: none;
}

.sx-sum {
  justify-content: space-between;
}

/* Reader Overview, and the Layout view: the Field Guide's Figure 7.1. */
.sx-fig {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.sx-fig[hidden] {
  display: none;
}

.sx-layout {
  max-height: 560px;
  overflow: auto;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
}

.sx-frow[hidden] {
  display: none;
}

.sx-fh {
  margin: 0 0 8px;
  font: 13px/18px var(--sans);
  color: var(--ink-2);
}

.sx-fh b {
  margin-right: 6px;
  font: 600 15px var(--sans);
  color: var(--ink);
}

.sx-fgr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.sx-fg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sx-fg.w {
  flex: 1 1 220px;
}

.sx-fg .cells {
  display: flex;
  min-width: 0;
}

.sx .c {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 36px;
  height: 40px;
  padding: 0 8px;
  border-radius: 5px;
  font: 13px var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sx .c.fixed {
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 500;
}

.sx .c.len {
  border: 1px solid var(--caution);
  background: var(--caution-wash);
  color: var(--caution);
  font-weight: 500;
}

.sx .c.content {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 38px;
  text-align: center;
  border: 1px solid var(--rule-strong);
  background: var(--sunken);
  color: var(--ink-2);
  font-size: 12.5px;
}

.sx .gl {
  font: 12.5px/16px var(--sans);
  color: var(--ink-2);
  text-align: center;
  white-space: nowrap;
}

.sx .gl.br {
  position: relative;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid var(--ink-3);
}

.sx .gl.br::before,
.sx .gl.br::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 1px;
  height: 6px;
  background: var(--ink-3);
}

.sx .gl.br::before {
  left: 0;
}

.sx .gl.br::after {
  right: 0;
}

.sx-fmore {
  align-self: flex-start;
  margin: 0;
  padding: 8px 12px;
  border: 1px dashed var(--rule-strong);
  border-radius: 5px;
  font: 12.5px var(--mono);
  color: var(--ink-3);
}

.sx-fend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font: 14px var(--sans);
  color: var(--ink-2);
}

.sx-fend span:last-child {
  font: 12px var(--mono);
  color: var(--ink-3);
}

.sx-flg {
  order: 9;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font: 13px var(--sans);
  color: var(--ink-2);
}

.sx-flg span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sx-flg i.c {
  flex: none;
  width: 16px;
  min-width: 0;
  height: 16px;
  padding: 0;
  border-radius: 4px;
}

.small .c {
  height: 30px;
  min-width: 30px;
  padding: 0 6px;
  font-size: 11.5px;
}

.small .gl {
  font-size: 11px;
}

.small .c.content {
  line-height: 28px;
}

/* The Explorer: keys beside the value. */
.sx-kv {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sx-count {
  font: 400 12px var(--mono);
  letter-spacing: 0;
}

.sx-filter {
  padding: 8px;
  border-bottom: 1px solid var(--rule);
}

.sx-filter .inp {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  font-size: 12.5px;
}

.sx-klist {
  position: relative;
  height: min(860px, 70vh);
  overflow: auto;
}

.sx-klist:focus-visible,
.sx-ann:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sx-krow {
  position: absolute;
  left: 4px;
  right: 4px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
}

.sx-krow:hover {
  background: var(--bg);
}

.sx-krow.on {
  background: var(--accent-wash);
  color: var(--accent);
}

.sx-klist:focus-visible .sx-krow.on {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sx-krow .kn {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font: 12.5px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-krow .ks {
  flex: none;
  font: 11.5px var(--mono);
  color: var(--ink-3);
  white-space: nowrap;
}

.sx-nomatch {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--rule);
  font: 12.5px var(--sans);
  color: var(--ink-3);
}

.sx-nomatch[hidden] {
  display: none;
}

.sx-vtitle {
  min-width: 0;
  overflow: hidden;
  font: 400 12.5px var(--mono);
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.sx-vh {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px 10px;
}

.sx-value .cx-pane-h {
  flex-wrap: wrap;
  padding-block: 6px;
}

.sx-vtype {
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--sunken);
  font: 600 11px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.sx-value .cx-vtabs button[hidden] {
  display: none;
}

.sx-vhead {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
}

.sx-vhead .cx-note span[hidden] {
  display: none;
}

.sx-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 18px;
  margin: 0;
}

.sx-facts div {
  min-width: 0;
}

.sx-facts dt {
  font: 600 11px/16px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sx-facts dd {
  margin: 0;
  font: 12.5px/19px var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sx-value .cx-tree,
.sx-value .cx-bytes,
.sx-value .cx-diag {
  border-top: 1px solid var(--rule);
}

.sx-value .cx-tree[hidden],
.sx-value .cx-bytes[hidden],
.sx-value .cx-diag[hidden],
.sx-annw[hidden] {
  display: none;
}

.sx-text {
  white-space: pre-wrap;
}

/* Annotated: the PLC tool's "DAG-CBOR, annotated" block. */
.sx-annw {
  margin: 0 16px 16px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.sx-annh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
  font: 600 12px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.sx-annc {
  min-height: 32px;
  border: 0;
  background: transparent;
  font: 600 12px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
}

.sx-ann {
  position: relative;
  max-height: 560px;
  overflow: auto;
  background: var(--sunken);
}

.sx-ar {
  position: absolute;
  left: 0;
  right: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  height: 22px;
  padding-right: 14px;
  border-left: 4px solid transparent;
  font: 13px/22px var(--mono);
  color: var(--ink);
  cursor: pointer;
}

.sx-ar:hover {
  background: var(--bg);
}

.sx-ar.on {
  border-left-color: var(--garden);
  background: var(--garden-wash);
}

.sx-ar .ax,
.sx-ar .ad {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-ar .ad {
  color: var(--ink-2);
}

/* Checks. */
.sx-checks {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
}

.sx-checks li {
  display: grid;
  grid-template-columns: 28px 190px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  font: 14px/22px var(--sans);
  color: var(--ink-2);
}

.sx-checks li:last-child {
  border-bottom: 0;
}

.sx-checks .n {
  font: 600 13px var(--mono);
  color: var(--ink-3);
}

.sx-checks .t {
  font-weight: 600;
  color: var(--ink);
}

.sx-checks .ok {
  font-weight: 600;
  color: var(--garden);
}

.sx-checks .bad {
  font-weight: 600;
  color: var(--danger);
}

.sx-checks code {
  font: 12.5px var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* The error panel and the invalid-archive messages. */
.sx-errp {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: 0 8px 8px 0;
  background: var(--danger-wash);
}

.sx-errh {
  margin: 0;
  font: 600 17px var(--sans);
  color: var(--ink);
}

.sx-errm {
  margin: 0;
  font: 15px/23px var(--sans);
  color: var(--ink);
}

.sx-errm code {
  margin-right: 6px;
  font: 600 12.5px var(--mono);
  color: var(--danger);
}

.sx-hex {
  padding: 8px 12px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  font: 12.5px/22px var(--mono);
}

.sx-hex .hx {
  display: grid;
  grid-template-columns: 56px repeat(16, 2.3ch) 12px minmax(0, 1fr);
  align-items: center;
}

.sx-hex .off,
.sx-hex .asc {
  color: var(--ink-3);
}

.sx-hex .asc {
  padding-left: 8px;
  white-space: pre;
}

.sx-hex .b {
  text-align: center;
  border-radius: 2px;
}

.sx-hex .b.err {
  outline: 2px solid var(--danger);
  outline-offset: -1px;
  background: var(--surface);
  color: var(--danger);
  font-weight: 600;
}

.sx-errs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sx-errs li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--danger);
  border-radius: 0 6px 6px 0;
  background: var(--danger-wash);
  font: 13.5px/21px var(--sans);
  color: var(--ink);
}

.sx-errs code {
  font: 600 12.5px var(--mono);
  color: var(--danger);
}

.sx-prof td:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
}

.sx-prof td:nth-child(2) {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: normal;
}

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

  .sx-klist {
    height: min(360px, 50vh);
  }
}

@media (max-width: 700px) {
  .sx-errs li {
    grid-template-columns: minmax(0, 1fr);
  }

  .sx-checks li {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .sx-checks li > span:last-child {
    grid-column: 2;
  }

  .sx-hex .hx {
    grid-template-columns: 40px repeat(16, minmax(0, 1fr));
    font-size: 11px;
  }

  .sx-hex .hx > span:nth-last-child(-n + 2) {
    display: none;
  }
}
