/* dharmatiles docs: the one shared stylesheet (docs/assets/site.css).
   Layout: one reading measure (33em, about 66 characters) inside a 1120px frame; a margin column beside it holds the contents list and, on a page that has one, its picture; sticky nav strip on top. */
@import url("theme.css");
/* the old names, kept for pages' own <style> blocks: each is a theme token */
:root {
  --measure: 33em;
  --fg: var(--ink); --card: var(--raised); --rule: var(--line); --alert: var(--err); --gold: var(--accent);
  --c-field: var(--water); --c-place: var(--earth); --c-solid: var(--stone); --c-finish: var(--moss); --c-compose: var(--bloom); --c-guard: var(--err); --c-rand: var(--accent);
  --display: var(--f-display); --body: var(--f-body); --mono: var(--f-code);
}
body { background: var(--bg); color: var(--ink); font: 16px/1.62 var(--f-body); font-feature-settings: "ss02"; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 72px; }
nav.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
nav.top .wrap { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; padding-block: 11px; }
nav.top .brand { font: 800 21px/1 var(--f-display); letter-spacing: .01em; margin-right: 14px; display: inline-flex; align-items: center; gap: 7px; }
nav.top .brand::before { content: ""; width: 22px; height: 22px; background: var(--accent); -webkit-mask: url("logo.svg") center / contain no-repeat; mask: url("logo.svg") center / contain no-repeat; }
nav.top a { color: var(--muted); text-decoration: none; font: 500 13.5px/1.6 var(--f-body); position: relative; transition: color .15s var(--ease); }
nav.top a:hover, nav.top a:focus-visible { color: var(--fg); }
nav.top a[aria-current="page"] { color: var(--ink); }
nav.top a[aria-current="page"]:not(.brand)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 2px; background: var(--accent); }
header.hero { padding-block: 48px 20px; }
.eyebrow { font: 500 14px/1.3 var(--f-body); color: var(--muted); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; line-height: 1.02; letter-spacing: .005em; }
h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 850; margin: 8px 0 18px; letter-spacing: -.005em; }
h2 { font-size: clamp(28px, 3vw, 36px); font-weight: 800; margin: 72px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); position: relative; }
h2::before { content: ""; position: absolute; top: -1px; left: 0; width: 35px; height: 3px; background: var(--accent); }
h3 { font-size: clamp(22px, 2vw, 24px); font-weight: 750; margin: 32px 0 6px; }
p, li { max-width: var(--measure); }
.lede { font-size: 17px; line-height: 1.6; max-width: var(--measure); color: var(--ink); }
.muted { color: var(--muted); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
a:hover { color: var(--accent-hi); text-decoration-color: currentColor; }
code, .mono { font-family: var(--f-code); font-size: .86em; font-variant-ligatures: none; }
code { background: var(--code-bg); padding: 1px 3px; border-radius: var(--r); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
pre { background: var(--code-bg); color: var(--ink); padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); border-left: 3px solid var(--accent); overflow-x: auto; font: 13.5px/1.62 var(--f-code); font-variant-ligatures: none; max-width: 100%; }
pre code { background: none; padding: 0; border: 0; font-size: inherit; }
figure { margin: 24px 0; }
figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; max-width: var(--measure); }
.diagram { overflow-x: auto; }
.diagram svg { display: block; max-width: 100%; height: auto; color: var(--fg); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.card h3 { margin-top: 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl { overflow-x: auto; margin: 16px 0; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--rule); }
th { font: 600 13px/1.3 var(--f-body); color: var(--muted); border-bottom-color: var(--line-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font: 500 12px/1 var(--f-body); padding: 4px 7px; border-radius: var(--r); border: 1px solid currentColor; white-space: nowrap; }
.k-field { color: var(--c-field); } .k-place { color: var(--c-place); } .k-solid { color: var(--c-solid); }
.k-region { color: var(--c-compose); }
.k-finish { color: var(--c-finish); } .k-compose { color: var(--c-compose); } .k-guard { color: var(--c-guard); } .k-rand { color: var(--c-rand); }
.verdict { display: inline-block; font: 600 11.5px/1 var(--f-body);  padding: 4px 6px; border-radius: var(--r); }
.v-keep { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.v-merge { background: color-mix(in srgb, var(--water) 18%, transparent); color: var(--water); }
.v-cut { background: color-mix(in srgb, var(--alert) 16%, transparent); color: var(--alert); }
.v-fix { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
ol.findings { counter-reset: f; list-style: none; padding: 0; display: grid; gap: 14px; }
ol.findings li { counter-increment: f; position: relative; padding-left: 48px; max-width: 80ch; }
ol.findings li::before { content: counter(f, decimal-leading-zero); position: absolute; left: 0; top: 0; font: 700 22px/1.2 var(--display); font-stretch: 115%; color: var(--accent); }
.controls:not(table) { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 10px 0; font-size: 13.5px; }
button, select { font: 500 13px/1 var(--f-body); color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 11px; cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
button:hover { border-color: var(--line-2); }
button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); }
canvas { display: block; max-width: 100%; height: auto; background: var(--plate); border-radius: var(--r-lg); }
.shot { margin: 0; }
.shot img { border-radius: var(--r-lg); display: block; width: 100%; height: auto; background: var(--plate); box-shadow: var(--shadow); }
.steps { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; counter-reset: s; }
.steps li { counter-increment: s; padding: 6px 10px 6px 38px; position: relative; border-radius: var(--r-lg); font-size: 14px; max-width: none; cursor: pointer; }
.steps li::before { content: counter(s); position: absolute; left: 10px; top: 6px; font: 800 15px/1.4 var(--f-display); color: var(--muted); }
.steps li.on { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }
.steps li.on::before { color: var(--accent); }
.callout { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 18px 0; max-width: 72ch; }
.quote { font-style: italic; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: baseline; margin-right: 5px; }
.small { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.rev { border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 7%, transparent); padding: 10px 16px; margin: 18px 0; max-width: 80ch; border-radius: 0 4px 4px 0; }
.rev p { margin: 4px 0; }
.st { display: inline-block; font: 600 11.5px/1 var(--f-body);  padding: 4px 6px; border-radius: var(--r); white-space: nowrap; }
.st-settled { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.st-proposed { background: color-mix(in srgb, var(--water) 18%, transparent); color: var(--water); }
.st-owner { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold); }
.st-risk { background: color-mix(in srgb, var(--alert) 16%, transparent); color: var(--alert); }
dl.defs { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 6px 16px; margin: 12px 0; }
dl.defs dt { font: 600 13px/1.5 var(--mono); } dl.defs dd { margin: 0; font-size: 14px; max-width: 70ch; }
@media (max-width: 560px) { dl.defs { grid-template-columns: minmax(0, 1fr); } dl.defs dd { margin-bottom: 8px; } }

/* ---- base for standalone pages  ---- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
nav.top a.brand { color: var(--fg); text-decoration: none; }

/* ---- converted documents ---- */
.srcnote { font-size: 13px; color: var(--muted); max-width: 80ch; margin: 0; }
.srcnote code { font-size: .92em; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 56px; }
.doc-layout > * { min-width: 0; }
.doc-layout > header.hero { padding-block: 36px 8px; }
header.hero p.small { font-size: inherit; }
/* the contents list: one disclosure, folded above the content on a phone (site.js), always open in the margin column on a wide screen */
nav.toc { font-size: 13.5px; border-block: 1px solid var(--rule); margin: 8px 0 0; }
nav.toc summary { cursor: pointer; font: 600 13.5px/1.3 var(--f-body); color: var(--muted); padding: 10px 0; }
nav.toc ol { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
nav.toc a { color: var(--muted); text-decoration: none; }
nav.toc a:hover, nav.toc a:focus-visible { color: var(--accent); }
nav.toc code { background: none; padding: 0; }
/* the margin column: the contents list and, on a page that has a picture, the picture above it */
.doc-layout > .margin figure { margin: 16px 0 0; }
.doc-layout > .margin figure img { width: 100%; height: auto; border-radius: var(--r-lg); display: block; background: var(--plate); }
@media (min-width: 1000px) {
  .doc-layout { grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); }
  .doc-layout > header.hero, .doc-layout > article.doc { grid-column: 1; }
  .doc-layout > header.hero { grid-row: 1; }
  .doc-layout > article.doc { grid-row: 2; }
  .doc-layout > .margin { grid-column: 2; grid-row: 1 / span 2; max-width: 22em; padding-top: 44px; }
  .doc-layout > .margin figure { margin: 0 0 20px; }
  .doc-layout > .margin nav.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 56px); max-height: calc(100vh - 80px); overflow-y: auto; border-top: 0; margin-top: 0; }
  .doc-layout > .margin nav.toc summary { cursor: default; pointer-events: none; list-style: none; padding-top: 0; }
  .doc-layout > .margin nav.toc summary::-webkit-details-marker { display: none; }
}
article.doc { padding-bottom: 40px; }
article.doc > h2:first-child { margin-top: 24px; }
article.doc h4 { font: 600 15px/1.3 var(--display); margin: 22px 0 4px; }
article.doc blockquote { margin: 16px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--rule); color: var(--muted); max-width: 72ch; }
article.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
article.doc td code, article.doc th code { white-space: normal; overflow-wrap: anywhere; }
article.doc p code, article.doc li code { overflow-wrap: anywhere; }
article.doc a code { color: inherit; }
article.doc table { min-width: 520px; }
article.doc em { font-style: italic; }

/* Out-of-date notes: visible, but clearly separate from the original text. */
aside.stale { display: flex; gap: 10px; align-items: baseline; border: 1px solid color-mix(in srgb, var(--alert) 45%, transparent); background: color-mix(in srgb, var(--alert) 8%, var(--bg)); border-radius: var(--r-lg); padding: 10px 14px; margin: 12px 0 18px; max-width: 80ch; font-size: 14px; }
aside.stale .stale-tag { flex: none; font: 600 11.5px/1 var(--f-body);  color: var(--alert); padding: 4px 6px; border: 1px solid currentColor; border-radius: var(--r); }
aside.stale .stale-src { color: var(--muted); font-size: 12.5px; }
header.hero aside.stale { margin-top: 14px; }
@media (max-width: 560px) { aside.stale { flex-direction: column; gap: 6px; } }

/* ---- hub ---- */
.hub-area { margin-top: 8px; }
ul.doclist { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 2px; }
ul.doclist li { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
ul.doclist a { font-weight: 600; text-decoration: none; }
ul.doclist a:hover, ul.doclist a:focus-visible { text-decoration: underline; }
ul.doclist .sum { color: var(--fg); font-size: 14.5px; max-width: 80ch; }
ul.doclist .meta { font: 500 12px/1.4 var(--mono); color: var(--muted); }
.flag { display: inline-block; font: 600 11px/1 var(--f-body);  padding: 3px 5px; border-radius: var(--r); color: var(--alert); border: 1px solid currentColor; margin-left: 6px; vertical-align: 2px; }
.labgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 14px 0; }
.labgrid > * { min-width: 0; }
.labgrid .card h3 { margin: 0 0 4px; font-size: 17px; }
.labgrid .card p { margin: 4px 0 8px; font-size: 14px; }
.labgrid .card ul { margin: 0; padding-left: 18px; font-size: 14px; }
ul.historic { font-size: 14px; padding-left: 18px; }
ul.historic li { margin: 3px 0; }

/* ---- look pages: facts strip, short terms list, and the quieter design record ---- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 18px 0 6px; max-width: 900px; }
.facts > div { background: var(--raised); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.facts .k { font: 500 12.5px/1.3 var(--f-body);  color: var(--muted); }
.facts .v { font-size: 14.5px; margin-top: 3px; }
details.words { margin: 14px 0 0; max-width: 80ch; }
details.words summary { cursor: pointer; font: 600 13.5px/1.6 var(--body); color: var(--accent); }
td.q { font-style: italic; }
td.d, th.d { white-space: nowrap; font-variant-numeric: tabular-nums; }
.shot { margin: 22px 0; }
.shot.narrow { max-width: 520px; }
.hero-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 20px 0 4px; }
.hero-shots > * { min-width: 0; margin: 0; }
.hero-shots img { width: 100%; height: 100%; max-height: 420px; object-fit: contain; border-radius: var(--r-lg); display: block; background: var(--plate); }
section.record { margin-top: 72px; padding-top: 6px; border-top: 1px dashed var(--rule); font-size: 14px; color: var(--muted); }
section.record > h2:first-child { margin-top: 18px; font-size: 22px; color: var(--muted); border-top: 0; padding-top: 0; }
section.record h3 { font-size: 16px; color: var(--muted); }
section.record p, section.record li { max-width: 80ch; }
section.record table { font-size: 13px; }
section.record a { color: var(--muted); text-decoration-color: var(--rule); }
section.record a:hover { color: var(--accent); }
section.record details { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 8px 14px; margin: 12px 0; background: color-mix(in srgb, var(--panel) 40%, transparent); }
section.record details > summary { cursor: pointer; font: 600 14px/1.6 var(--display); color: var(--fg); }
section.record details[open] > summary { margin-bottom: 6px; }
section.record .note { font-size: 13px; }
/* the reference: element pages' generated controls tables, the element index */
table.controls td:first-child { white-space: nowrap; }
table.controls dl.words { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 6px 0 0; font-size: 13.5px; }
table.controls dl.words dt { margin: 0; } table.controls dl.words dd { margin: 0; color: var(--muted); }
.tag { display: inline-block; font: 500 11px/1.4 var(--mono); padding: 0 6px; border: 1px solid var(--rule); border-radius: var(--r); color: var(--muted); }
ul.tiles { columns: 2 260px; padding-left: 18px; } ul.tiles li { break-inside: avoid; }
.elements { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 28px; }
.elements a { display: block; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 8px 12px; color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.elements a:hover, .elements a:focus-visible { border-color: var(--accent); box-shadow: var(--shadow); }
.elements a:not(:has(img, svg))::before { content: attr(data-name); display: grid; place-items: center; font: 800 clamp(34px, 4vw, 52px)/1 var(--f-display); color: color-mix(in srgb, var(--plate-ink) 38%, var(--plate)); aspect-ratio: 4 / 3; margin-bottom: 10px; border-radius: var(--r); background-color: var(--plate); background-image: linear-gradient(color-mix(in srgb, var(--plate-ink) 10%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--plate-ink) 10%, transparent) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }
.elements a img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: var(--r); display: block; margin-bottom: 10px; background: var(--plate); }
.elements a code { font: 800 22px/1 var(--f-display); background: none; border: 0; padding: 0 4px; color: var(--ink); } .elements a span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; padding: 0 4px; line-height: 1.45; }
.syntax { font: 13px/1.6 var(--mono); }
.demo canvas { width: 100%; max-width: 560px; height: auto; border-radius: var(--r-lg); display: block; background: var(--panel); }
nav.top .links { display: flex; gap: 4px 16px; align-items: center; min-width: 0; }
nav.top .theme { margin-left: auto; }
@media (max-width: 1159px) {
  nav.top .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding-block: 8px 0; }
  nav.top .links { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; padding-bottom: 9px; gap: 18px; -webkit-mask: linear-gradient(90deg, #000 88%, transparent); mask: linear-gradient(90deg, #000 88%, transparent); }
  nav.top .links::-webkit-scrollbar { display: none; }
  nav.top .links a { white-space: nowrap; }
  nav.top a[aria-current="page"]:not(.brand)::after { bottom: -9px; }
}
@media (max-width: 760px) { h2 { margin-top: 56px; } }
/* a link that is code: the box carries the colour, no underline through it */
a:has(> code:only-child) { text-decoration: none; }
a > code { color: var(--accent); transition: background-color .15s var(--ease); }
a:hover > code { background: color-mix(in srgb, var(--accent) 10%, var(--code-bg)); }
/* a picture pair (line: wobble 0 and 5) and a numbered build sequence (stack) */
figure.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 720px; }
figure.pair > div { margin: 0; }
figure.pair img { width: 100%; height: auto; border-radius: var(--r-lg); background: var(--plate); display: block; }
figure.pair p { margin: 6px 0 0; text-align: center; }
figure.pair figcaption { grid-column: 1 / -1; }
ol.stack-steps { list-style: none; counter-reset: st; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
ol.stack-steps li { counter-increment: st; max-width: none; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
ol.stack-steps img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; border-radius: var(--r-lg); background: var(--plate); display: block; }
ol.stack-steps li::before { content: counter(st); font: 800 20px/1 var(--f-display); color: var(--accent); order: 1; }
ol.stack-steps li img { order: 0; } ol.stack-steps li code { order: 2; overflow-wrap: anywhere; }
/* element families: the material colours (theme.css), on cards, page marks and the key */
.elements a[class*="fam-"] { border-top: 3px solid var(--fam); }
.fam-mark { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--fam); margin-right: 8px; vertical-align: 0; }
.fam-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }
.fam-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--fam); margin-right: 6px; }

/* ---- the editor's pictures (xtask shots): a screenshot with numbered callouts drawn over it and a key beside it.
   The pictures are light and dark; the callouts' boxes come from shots.json, read by site.js, so a redrawn picture moves them. */
figure.shot { margin: 8px 0 32px; }
figure.shot .frame { position: relative; border-radius: var(--r-lg); background: var(--plate); line-height: 0; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
figure.shot .frame img { display: block; width: 100%; height: auto; border-radius: inherit; }
figure.shot .frame img.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) figure.shot .frame img.shot-light { display: none; }
  :root:not([data-theme="light"]) figure.shot .frame img.shot-dark { display: block; }
}
:root[data-theme="dark"] figure.shot .frame img.shot-light { display: none; }
:root[data-theme="dark"] figure.shot .frame img.shot-dark { display: block; }
figure.shot .pins { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
figure.shot .pin { position: absolute; box-sizing: border-box; border: 2px solid var(--ink); border-radius: var(--r-mark); box-shadow: 0 0 0 2px var(--plate), inset 0 0 0 2px var(--plate); max-width: none; transition: background-color .15s var(--ease); }
figure.shot .pin.on { background: color-mix(in srgb, var(--ink) 16%, transparent); }
/* the number: a square mark on the box's top-left corner (its bottom-left when the box is at the picture's foot), so it covers none of what it points at */
figure.shot .pin b, figure.shot ol.key > li::before { display: grid; place-items: center; width: 22px; height: 22px; box-sizing: border-box; border-radius: var(--r-mark); background: var(--ink); color: var(--bg); font: 700 var(--fs-s)/1 var(--f-body); }
figure.shot .pin b { position: absolute; left: 0; top: 0; transform: translate(-60%, -60%); box-shadow: 0 0 0 2px var(--plate); }
figure.shot .pin.foot b { top: auto; bottom: 0; transform: translate(-60%, 60%); }
figure.shot ol.key { counter-reset: key; list-style: none; margin: 16px 0 0; padding: 0; columns: 2 20em; column-gap: 32px; }
figure.shot ol.key > li { counter-increment: key; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 10px; align-items: start; break-inside: avoid; max-width: none; margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: default; }
figure.shot ol.key > li::before { content: counter(key); margin-top: 1px; }
figure.shot ol.key > li > span > b { color: var(--ink); font-weight: 600; }
figure.shot ol.key > li > span { min-width: 0; }
figure.shot figcaption { margin-top: 12px; }
/* a page that opens with one: the picture runs the full width under the title, the contents list stays beside the text */
@media (min-width: 1000px) {
  .doc-layout.has-shot > figure.shot { grid-column: 1 / -1; grid-row: 2; }
  .doc-layout.has-shot > article.doc { grid-row: 3; }
  .doc-layout.has-shot > .margin { grid-row: 3; padding-top: 0; }
  .doc-layout.has-shot > .margin nav.toc { margin-top: 24px; }
}
/* a picture inside the text is as narrow as the text: one column of key */
article.doc figure.shot ol.key { columns: 1; }

/* An error page (docs/e/, written by `cargo xtask docs`): the frame's full width, compact headings, the message as
   printed, what to do beside the rule, the broken document beside its fix with the change marked. */
.codepage { padding-block: 0 56px; }
.codepage header.hero { padding-block: 32px 4px; }
.codepage .eyebrow a { color: inherit; }
.codepage h1 { margin-bottom: 10px; }
.codepage h2 { font-size: 22px; margin: 36px 0 10px; padding-top: 12px; }
.codepage h2::before { width: 28px; }
.codepage .lede { font-size: 18px; max-width: 60ch; }
.codepage pre.said { max-width: min(88ch, 100%); border-left-color: var(--err); margin: 0; }
.codepage.note pre.said { border-left-color: var(--accent); }
/* what the terminal draws for itself (the message, the gutter, the labels), read back from its ANSI colours by
   `cargo xtask docs`; the document's own colours in the snippet come back as the tk- classes of theme.css */
.a-31 { color: var(--err); } .a-32 { color: var(--moss); } .a-33 { color: var(--earth); } .a-34 { color: var(--water); }
.a-35 { color: var(--bloom); } .a-36, .a-96 { color: var(--accent); } .a-90 { color: var(--stone); }
.a-b { font-weight: 600; } .a-d { opacity: .7; } .a-i { font-style: italic; } .a-u { text-decoration: underline; }
.cp-grid, .cp-pair { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 48px; }
.cp-grid p { max-width: none; }
blockquote.rule { margin: 0 0 10px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line-2); }
blockquote.rule p { margin: 0; }
.cp-in { font-size: 14px; margin: 0; }
.cp-pair { row-gap: 14px; }
.cp-pair figure { margin: 0; }
.cp-pair figcaption { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; }
.cp-pair pre { margin: 0; }
.cp-pair .broken pre { border-left-color: var(--err); }
/* the change between a broken document and its fix: a tint and a solid underline in the danger red (what the
   program refused) or the ok green (what it reads), strong enough to find at a glance in either theme */
pre mark { color: var(--ink); border-radius: 3px 3px 0 0; padding: 1px 2px 0; margin: 0 -1px; font-weight: 600; }
pre mark [class^="tk-"], pre mark [class^="a-"] { color: inherit; font-style: normal; } /* the change reads in plain ink, the most contrast either theme has */
pre mark.del { background: color-mix(in srgb, var(--err) 38%, var(--code-bg)); box-shadow: inset 0 -2px 0 var(--err); }
pre mark.ins { background: color-mix(in srgb, var(--ok) 38%, var(--code-bg)); box-shadow: inset 0 -2px 0 var(--ok); }
pre mark.at { display: inline-block; width: 2px; height: 1.1em; vertical-align: text-bottom; padding: 0; }
pre mark.del.at { background: var(--err); } pre mark.ins.at { background: var(--ok); }
.cp-foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 28px; }
.cp-foot a code { color: var(--accent); }
@media (min-width: 860px) {
  .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
blockquote.rule ul, blockquote.rule ol { margin: 0; padding-left: 1.2em; }
blockquote.rule li { margin: 0 0 4px; }
/* a code named on any page links to its error page (written by `cargo xtask docs`) */
a.codelink { text-decoration: none; }
a.codelink code { color: var(--accent); }
a.codelink:hover code { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

/* the guide: a rule is a section of its own; long code scrolls inside its box, never past the page */
article.guide section.rule { margin-top: 8px; }
article.guide section.rule > h3 { margin-top: 28px; }
.not-yet { border-left: 3px solid var(--muted); padding: 2px 0 2px 14px; color: var(--muted); max-width: 72ch; }
.toc-h { font: 600 13.5px/1.3 var(--f-body); color: var(--muted); margin: 14px 0 6px; }
nav.toc ol.guide-pages { margin-bottom: 4px; }
nav.toc ol.guide-pages a[aria-current="page"] { color: var(--ink); font-weight: 600; }
ul.explains { list-style: none; padding: 0; display: grid; gap: 6px; }
.guide-map { padding-left: 1.4em; display: grid; gap: 6px; }
dt-example { display: block; min-width: 0; max-width: 100%; }
.dtx-grid > * { min-width: 0; }
.hero code, .hero pre, article.doc pre { max-width: 100%; }
.hero code { overflow-wrap: anywhere; }
article.doc pre { overflow-x: auto; }
