/* Page components. Link after kit/brand.css:
   <link rel="stylesheet" href="../kit/brand.css"><link rel="stylesheet" href="../kit/components.css">
   Values come from kit/tokens.css. Behaviour: kit/header.js (header, footer), kit/docs.js (docs and reference
   navs), kit/code.js (code blocks, tabs), kit/copy.js (Copy buttons), kit/bands.js (the layer bands). */

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: var(--t-xs); line-height: 1.45; }
.tiny { font-size: 12px; line-height: 1.4; }
/* a box that holds drawings: they run off its edges, its .in sits above them */
.drawn { position: relative; overflow: hidden; }
.drawn > .in { position: relative; z-index: 2; }
/* a quiet link with an arrow: "Spaces and permissions →" */
.go { display: inline-block; margin-top: 6px; font: 500 var(--t-sm) var(--sans); color: var(--black); text-decoration: none; transition: translate var(--spring-d) var(--spring); }
.go:hover { translate: 3px 0; }
/* inline code in running text gets a panel chip */
.split .txt code, .items code, .band-more .txt code, .row p code, .row span code, .rx-lede code, .rx-lede2 code {
  background: var(--panel); padding: 1px 5px; border-radius: 4px; font-size: .82em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }


/* ---------- the site footer, filled in by kit/header.js: <footer class="tx-foot"></footer> ---------- */
.tx-foot { margin-top: 120px; border-top: 1px solid var(--rule); font: 400 var(--t-sm)/1.4 var(--sans); color: var(--muted); }
.tx-foot-row { display: flex; justify-content: space-between; align-items: baseline; padding: 32px 48px 72px; }
.tx-foot .logo { font-size: 22px; }
.tx-foot .links { display: flex; gap: 28px; }
.tx-foot a, .tx-foot code { color: var(--black); text-decoration: none; }
/* a quiet line under the footer: <footer class="tx-foot"><p class="tx-under">…</p></footer> */
.tx-under { margin: -56px 48px 0; padding-bottom: 56px; font: 400 12px var(--sans); color: var(--muted); }
.tx-foot .tx-under a { color: var(--muted); text-decoration: underline; }
/* techne.town: inside the page column, black text, one link */
.wrap > .tx-foot { margin-top: 0; color: var(--black); }
.wrap > .tx-foot .tx-foot-row { padding: 32px 0 80px; }
.tx-foot a.dev { border-bottom: 1px solid var(--black); padding-bottom: 1px; }
/* techne.pub: columns of links over drawings */
.tx-foot.pub { position: relative; overflow: hidden; margin-top: 40px; padding: 56px 40px 200px; color: var(--black); font-size: var(--t-p); }
.tx-foot.pub .cols { position: relative; z-index: 2; display: flex; gap: 64px; align-items: flex-start; }
.tx-foot.pub .cols a { display: block; margin: 6px 0; font-size: 15px; }
.tx-foot.pub .cols .accent { color: var(--muted); margin-bottom: 8px; }
.tx-foot.pub .cols code { background: var(--panel); padding: 1px 5px; border-radius: 4px; }

/* ---------- a page column ---------- */
.wrap { max-width: var(--wrap, 1200px); margin: 0 auto; padding: 0 var(--wrap-x, 48px); box-sizing: border-box; }

/* ---------- centred page hero: <section class="hero"><div class="in"><div class="accent">…</div><h1 class="h1">…</h1><p class="p">…</p></div> drawings </section> ---------- */
.hero { position: relative; overflow-x: clip; text-align: center; padding: 64px 0 88px; }
.hero .in { position: relative; z-index: 2; }
.hero .h1 { margin: 16px 0 16px; }
.hero .p { margin: 0 auto; max-width: 600px; }
/* its drawings stand on the hero's bottom edge at the page's two sides and run on beneath the white cards that
   follow (guide: drawings slip beneath the paper). .lg left, .sm right; z-index -1 keeps them under the page. */
.hero > .drawing { z-index: -1; bottom: 0; transform: translateY(var(--sink, 50%)); }
.hero > .drawing.lg { width: var(--lg-w, 460px); left: var(--lg-x, -200px); }
.hero > .drawing.sm { width: var(--sm-w, 300px); right: var(--sm-x, -110px); --sink: 62%; }
.hero .p a { color: var(--black); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- techne.computer docs: the sidebar (kit/docs.js) on the left, the page on the right ---------- */
.dx { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; max-width: 1392px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.dx-side { position: sticky; top: var(--head-room); align-self: start; max-height: calc(100vh - 128px); overflow-y: auto; padding: 32px 0 24px 10px; box-sizing: border-box; }
.dx-side h4 { margin: 22px 0 6px; padding-left: 12px; font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dx-side h4:first-child, .dx-side .dx-toggle + h4 { margin-top: 0; }
.dx-side ul { list-style: none; margin: 0; padding: 0; }
.dx-side a, .dx-side .soon { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); font: 400 14.5px/1.35 var(--sans); color: var(--black); text-decoration: none; }
.dx-side a:hover { background: var(--hover); }
.dx-side a.on { background: var(--tint); font-weight: 500; }
.dx-side .soon { color: var(--faint); cursor: default; }
.dx-side .soon small { font: 500 10px var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.dx-main { min-width: 0; padding-top: 32px; }
/* the page head: kicker, title, one line; drawings bottom right */
/* the head sits on a rule its drawings rise from (kit/brand.css .rise); what follows starts 40px under it */
.dx-head { --lg-w: 420px; --lg-x: -36px; --sm-x: 320px; --script-x: 220px; padding: 8px 0 48px; margin-bottom: 40px; border-bottom: 1px solid var(--rule); }
.dx-head > .drawing.d-map.lg { --sink: 60%; }
.dx-head .in { position: relative; z-index: 2; max-width: 600px; }
.dx-head .h1 { margin: 16px 0 16px; }
/* a list straight under the head uses the head's rule as its first line */
.dx-head + .items { margin-top: -40px; }
.dx-head + .items > li:first-child { border-top: 0; }
.dx-head .p { margin: 0; color: var(--ink-2); }
.dx-head .p a { color: var(--black); text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* <nav class="dx-next"></nav> becomes a link to the next docs page */
.dx-next { display: flex; justify-content: flex-end; margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--rule); font: 500 15px var(--sans); }
.dx-next a { text-decoration: none; display: inline-block; transition: translate var(--spring-d) var(--spring); }
.dx-next a:hover { translate: 3px 0; }
.dx-next a span { display: block; font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; text-align: right; }

/* ---------- a white card on beige ---------- */
.card { background: var(--white); border-radius: var(--r-card); border: 1px solid var(--rule-soft); padding: 24px 32px 28px; }
.card + .card { margin-top: 24px; }
.card > h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; font: 500 var(--t-h3)/1.3 var(--serif); }
.card > h2 code, .card > h2 small { font: 400 var(--t-xs) var(--mono); color: var(--muted); }
.card > h2 small { font: 400 var(--t-sm) var(--sans); }
.card p.t { margin: 0 0 12px; font: 400 15px/1.55 var(--sans); }
.card a { color: var(--black); }
.card > .row:last-child { padding-bottom: 0; }

/* ---------- rows: a name, what it does, and a note. Set the columns with --cols ---------- */
.row { display: grid; grid-template-columns: var(--cols, 230px minmax(0, 1fr)); gap: 24px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--rule); font: 400 15px/1.5 var(--sans); }
.code + .row { margin-top: 16px; }
.row .n { font: 13.5px/1.4 var(--mono); color: var(--black); overflow-wrap: anywhere; }
.row .n i { font-style: normal; color: var(--muted); }
.row a.n { text-decoration: none; }
.row a.n span { border-bottom: 1px solid var(--black); }
.row a.n:hover span { border-bottom-width: 2px; }
.row a.n::after { content: ' →'; font-family: var(--sans); }
.row p { margin: 0; }
.row .via { font: 400 12px var(--sans); color: var(--muted); text-align: right; }
.row .via code { font-size: 12px; color: var(--black); }

/* ---------- numbered items: number, title, a sentence or two ---------- */
.items { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.items li { counter-increment: n; display: grid; grid-template-columns: 48px 340px minmax(0, 1fr); gap: 0 24px; padding: 22px 0; border-top: 1px solid var(--rule); }
.items li:last-child { border-bottom: 1px solid var(--rule); }
.items li::before { content: counter(n); font: 500 var(--t-h3)/1.3 var(--serif); }
.items h2 { margin: 0; font: 500 var(--t-h3)/1.3 var(--serif); }
.items p { margin: 0; font: 400 var(--t-p)/1.55 var(--sans); max-width: 620px; }
.items a { color: var(--black); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.items a.go { text-decoration: none; }
/* short: number and one sentence */
.items.short li { grid-template-columns: 40px minmax(0, 1fr); gap: 0; padding: 18px 0; font: 400 17px/1.5 var(--sans); }
.items.short li::before { line-height: 1.1; }
/* a line of further links: "On atproto.com: Overview DIDs …" */
/* a plain diagram (docs/atproto): a wide SVG on desktop, a tall one below 600px */
.diag { margin: 0 0 40px; background: var(--white); border-radius: var(--r-fig); border: 1px solid var(--rule-soft); }
.diag svg { display: block; width: 100%; height: auto; }
.diag svg.tall { display: none; max-width: 340px; margin: 0 auto; }
.diag text { font-family: var(--sans); }
.diag .t { font: 500 20px var(--serif); }
.diag .s { font-size: 13px; fill: var(--muted); }
.diag .l { font-size: 12px; fill: var(--muted); }
/* a closing pair of reasons (docs/atproto "Why Techne builds on it") */
.why { margin: 72px 0 0; }
.why .h2 { margin: 0; }
.why-grid { margin: 28px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.why-grid > div { background: var(--white); border: 1px solid var(--rule-soft); border-radius: var(--r-md); padding: 24px 28px; }
.why-grid h3 { margin: 0 0 8px; font: 500 var(--t-h3)/1.3 var(--serif); }
.why-grid p { margin: 0; font: 400 var(--t-p)/1.55 var(--sans); }
.seealso { margin: 28px 0 0; font: 400 var(--t-sm) var(--sans); color: var(--muted); }
.seealso a { color: var(--black); margin-right: 18px; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- a split section: words on the left, code on the right (Quickstart) ---------- */
.split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; align-items: start; }
.split + .split { margin-top: 72px; }
.split .txt { padding-top: 8px; }
.split h2 { font: 500 var(--t-h2)/1.2 var(--serif); letter-spacing: -.02em; margin: 0 0 16px; }
.split .txt p { margin: 0 0 12px; font: 400 var(--t-p)/1.55 var(--sans); }
.split .txt a { color: var(--black); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.split .txt a.go { text-decoration: none; }

/* ---------- a term list: <dl class="terms"><dt><code>…</code></dt><dd>…</dd></dl> ---------- */
dl.terms { margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid var(--rule); font: 400 13.5px/1.5 var(--sans); color: var(--muted); }
dl.terms dt { color: var(--black); margin-top: 10px; }
dl.terms dt:first-child { margin-top: 0; }
dl.terms dt code, .split .txt dl.terms dt code { background: none; padding: 0; font-size: 12.5px; }
.split .txt dl.terms dd code { font-size: 13px; }
dl.terms dd { margin: 2px 0 0; }
dl.terms a { color: var(--black); }

/* ---------- code blocks (kit/code.js renders <script type="text/x-code" data-lang="ts|sh|http">; kit/copy.js adds Copy) ----------
   .code is panel, .code.dark is black; mono 13px; one muted colour for strings (.s), comments (.c), verbs (.k) */
.code { margin: 0; background: var(--panel); color: var(--black); border: 1px solid rgba(0,0,0,.06); border-radius: var(--r-chip); padding: 18px 20px; font: var(--t-code)/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.code.dark { background: var(--black); color: var(--code-ink); border-color: var(--black); }
.code pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.code .s { color: var(--code-str); }
.code.dark .s { color: var(--code-str-dark); }
.code .c { color: var(--muted); }
.code.dark .c { color: var(--code-cm-dark); }
.code .k { font-weight: 700; }
/* a caption inside the block, top right (hidden while the Copy button shows) */
.code .cap { position: absolute; right: 14px; top: 10px; font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.code + .code { margin-top: 10px; }
/* a label over a block, and a caption under it */
.clab { margin: 18px 0 8px; font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.clab:first-child { margin-top: 0; }
.ccap { margin: 10px 0 0; font: 400 var(--t-xs)/1.5 var(--sans); color: var(--muted); }
.ccap code { color: var(--black); font-size: 12.5px; }
.ccap a { color: var(--black); }

/* ---------- tabs: one choice (React, SDK, MCP) for the whole site, kept across pages (kit/code.js) ----------
   <div class="tabbox" data-tabs><div class="pane" data-pane="react">…</div><div class="pane" data-pane="sdk">…</div></div>
   All panes share one grid cell, so the box is as tall as its tallest pane and switching never moves the page. */
.tabbox { display: grid; grid-template-columns: minmax(0, 1fr); }
.tabbox > .tabs { grid-area: 1 / 1; }
.tabbox > .pane { grid-area: 2 / 1; min-width: 0; }
.tabbox > .pane[hidden] { display: block; visibility: hidden; }
/* switching cross-fades: the old pane fades out while the new one fades in, in the same cell, so nothing moves */
.tabbox > .pane { opacity: 1; transition: opacity .26s ease-out .06s, visibility 0s; }
.tabbox > .pane[hidden] { opacity: 0; transition: opacity .14s ease-in, visibility 0s .14s; }
.card.tabbox { padding: 18px 22px 22px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { height: 32px; padding: 0 15px; border-radius: var(--r-pill); border: 1.5px solid var(--black); background: transparent; color: var(--black); font: 500 var(--t-sm) var(--sans); cursor: pointer; transition: background-color .18s, color .18s, translate var(--spring-d) var(--spring), scale var(--spring-snap-d) var(--spring-snap); }
.tabs button:hover { translate: 0 -1px; }
.tabs button:active { scale: .96; translate: 0; }
.tabs button[aria-selected="true"] { background: var(--black); color: var(--white); }
.tabs button:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; border-radius: var(--r-pill); }

/* ---------- diagrams: a white figure, and nodes with one colour dot (How Techne works, Spaces, atproto) ---------- */
.fig { position: relative; margin: 0; background: var(--white); border-radius: var(--r-fig); border: 1px solid var(--rule-soft); overflow: hidden; }
.node { position: relative; z-index: 2; box-sizing: border-box; display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1.5px solid var(--black); border-radius: var(--r-chip); padding: 13px 16px; }
.node > i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--black); margin-top: 3px; }
.node b { display: block; font: 500 20px/1.2 var(--serif); }
.node span { display: block; margin-top: 4px; font: 400 var(--t-xs)/1.4 var(--sans); color: var(--muted); }
.node p { margin: 0; font: 500 15px/1.35 var(--sans); }
.node p code { font-size: 13.5px; }
.node p b { display: inline; font: inherit; font-weight: 700; }
.node > div > code { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.node.dim { border-style: dashed; border-color: rgba(0,0,0,.4); }
.node.dim b { color: var(--muted); }
/* a column label over a diagram */
.fig-lab { font: 500 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- layer bands: the five layers, one coloured band each, a node on a dashed path; click for code (kit/bands.js) ---------- */
.bands svg.path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.bands .start, .bands .end { display: grid; grid-template-columns: 328px 1fr; }
.bands .start .fig-lab, .bands .end .fig-lab { padding: 0 28px; display: flex; align-items: center; }
.bands .start .track, .bands .end .track { padding: 36px 0 36px 32px; }
.bands .end { border-top: 1px solid var(--rule); }
.bands .end .track { padding-left: calc(32px + 4 * 104px); }
.bands .rec { position: relative; z-index: 2; width: 300px; box-sizing: border-box; background: var(--black); color: var(--white); border-radius: var(--r-chip); padding: 16px 18px; }
.bands .rec b { display: block; font: 500 var(--t-h3)/1.3 var(--serif); }
.bands .rec code { display: block; margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.6); }
.bands .rec span { display: block; margin-top: 8px; font: 400 var(--t-xs) var(--sans); color: rgba(255,255,255,.75); }
.band { border-top: 1px solid var(--rule); }
.band .hd, .band .st { display: grid; grid-template-columns: 328px 1fr; }
.band .hd { cursor: pointer; outline: none; min-height: 132px; }
.band .hd:focus-visible .node { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 60%, #fff); }
.band .lab { display: flex; align-items: center; gap: 16px; padding: 20px 24px 20px 28px; box-shadow: inset 5px 0 0 var(--c); transition: box-shadow .2s; }
.band .lab .n { flex: none; font: 500 var(--t-h2)/1 var(--serif); color: var(--black); width: 32px; margin: 0; text-align: center; }
.band .lab b { display: block; font: 500 var(--t-h3)/1.3 var(--serif); }
.band .lab span { display: block; font: 400 var(--t-sm) var(--sans); color: var(--muted); margin-top: 4px; }
.band .lab code { font-size: var(--t-xs); color: var(--black); }
.band .track { position: relative; min-height: 132px; background: color-mix(in srgb, var(--c) 13%, #fff); transition: background .2s; }
.band .hd:hover .track, .band.open .track { background: color-mix(in srgb, var(--c) 22%, #fff); }
.band .hd:hover .lab, .band.open .lab { box-shadow: inset 8px 0 0 var(--c); }
.band .node { transition: box-shadow .25s; }
.band .hd:hover .node { box-shadow: var(--sh-chip); }
.band .node { position: absolute; top: 50%; transform: translateY(-50%); left: calc(32px + var(--i) * 104px); width: 264px; }
.band .node > i { margin-top: 2px; }
.band .show { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font: 500 12px var(--sans); font-style: normal; color: var(--muted); transition: color .2s; }
.band .show::after { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--spring-d) var(--spring); }
.band .hd:hover .show, .band.open .show { color: var(--black); }
.band.open .show::after { transform: translateY(2px) rotate(-135deg); }
/* the panel under a band; closed panels stay out of the tab order (their code and Copy buttons) */
/* opening: the height follows the critically damped spring (no overshoot, so the page below never bounces) and the
   content fades up a beat later; closing: the content fades first, then the height folds quickly */
.band-more { position: relative; z-index: 2; height: 0; overflow: hidden; background: var(--white); box-shadow: inset 8px 0 0 var(--c); visibility: hidden; transition: height .3s var(--out) .04s, visibility 0s .34s; }
.band.open .band-more { visibility: visible; transition: height var(--spring-soft-d) var(--spring-soft), visibility 0s; }
.band-more > .in { opacity: 0; translate: 0 -8px; transition: opacity .12s, translate 0s .12s; }
.band.open .band-more > .in { opacity: 1; translate: 0; transition: opacity .3s ease-out .1s, translate var(--spring-d) var(--spring) .1s; }
.band-more .in { display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 40px; padding: 32px 32px 36px 40px; border-top: 1px solid var(--rule); }
.band-more .txt { align-self: start; }
.band-more h3 { font: 500 var(--t-h3)/1.3 var(--serif); margin: 0 0 16px; }
.band-more .txt p { margin: 0; font: 400 var(--t-p)/1.55 var(--sans); }
.band-more .txt a { color: var(--black); }
.band-more .codes { min-width: 0; }
.band-more .code + .clab { margin-top: 22px; }
/* what people see: an app card */
.app { position: relative; z-index: 2; width: 264px; box-sizing: border-box; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-chip); overflow: hidden; box-shadow: var(--sh-float); }
.app .bar { font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.app .body { padding: 14px; }
.app .name { font: 500 var(--t-h3)/1.3 var(--serif); margin: 0 0 6px; }
.app .meta { font: 400 var(--t-xs) var(--sans); color: var(--muted); }
.app .by { margin-top: 12px; font: 400 12px var(--sans); }
/* still bands: nothing to open, shorter tracks; .loop-lab labels the arrow back to the first node (kit/bands.js) */
.bands.still { margin-bottom: 48px; }
.bands.still .band .track { min-height: 112px; }
.bands.still .band .st { min-height: 112px; }
.bands.still .end .track { padding-left: 32px; }
.bands.still .end .node { width: 472px; }
.bands .loop-lab { position: absolute; z-index: 2; width: 220px; box-sizing: border-box; padding: 12px 14px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-chip); font: 400 var(--t-xs)/1.45 var(--sans); color: var(--muted); }
.bands .loop-lab b { display: block; margin-bottom: 3px; font: 500 15px/1.35 var(--sans); color: var(--black); }
.fig-note { margin: 18px 0 0; padding: 0 8px; font: 400 var(--t-xs) var(--sans); color: var(--muted); }

/* ---------- a reference page: the reference nav (kit/docs.js) on the left, one call on the right ---------- */
.rx { max-width: 1248px; margin: 56px auto 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 56px; align-items: start; }
/* the browse list: one look for techne.pub's types and the techne.computer reference. A filter box (.navq),
   a count (.shown), then groups (.ng): an accent label with a count, entries in mono, the current one a black pill,
   a kind word on the right (.nk). An entry with no page yet is a .no span: same row, faint, not a link. */
.navq { display: block; width: 100%; height: 34px; box-sizing: border-box; border-radius: var(--r-pill); border: 1.5px solid var(--rule); background: var(--white); padding: 0 14px; font: 400 var(--t-xs) var(--sans); color: var(--black); outline: none; margin-bottom: 6px; }
.navq:focus { border-color: var(--black); }
.shown { font-size: 12px; color: var(--muted); margin: 0 0 14px 4px; }
.ng { margin-bottom: 20px; }
.ng .accent { color: var(--muted); margin: 0 0 6px 4px; display: flex; justify-content: space-between; }
.ng a, .ng .no { display: flex; justify-content: space-between; gap: 6px; text-decoration: none; font: 400 13px/1.25 var(--mono); padding: 5px 8px; border-radius: 7px; color: rgba(0,0,0,.78); }
.ng a:hover { background: var(--hover); }
.ng a.cur { background: var(--black); color: var(--white); }
.ng .no { color: var(--faint); cursor: default; }
.ng .nn { min-width: 0; overflow-wrap: anywhere; }
.ng .nk { flex: none; font: 500 10px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ng .no .nk { color: var(--faint); }
.ng a.cur .nk { color: rgba(255,255,255,.6); }
.rx-side { position: sticky; top: var(--head-room); max-height: calc(100vh - 140px); overflow: auto; padding-right: 8px; }
.rx-main { min-width: 0; }
.rx-main > .card, .rx-main > .tabbox { margin-top: 36px; }
.rx-title { margin: 12px 0 0; font: 500 30px/1.25 var(--mono); letter-spacing: -.01em; overflow-wrap: anywhere; }
.rx-title i { font-style: normal; color: var(--muted); }
.rx-title.prose { font: 500 36px/1.2 var(--serif); letter-spacing: -.01em; }
.rx-kind { display: inline-flex; gap: 8px; margin-top: 14px; }
.rx-kind span { font: 500 12px var(--sans); border: 1px solid var(--black); border-radius: var(--r-pill); padding: 3px 10px; }
.rx-kind span.q { background: var(--black); color: var(--white); }
.rx-lede { margin: 20px 0 0; max-width: 720px; font: 400 18px/1.55 var(--sans); }
.rx-lede2 { margin: 10px 0 0; max-width: 720px; font: 400 15px/1.55 var(--sans); color: var(--muted); }
.rx-sub { margin: 20px 0 8px; font: 500 var(--t-xs) var(--sans); }
.rx-sub code { font-size: 12.5px; }
/* "Calls pub.techne.draft.query.listRecords →" */
/* one line of running text: not a flex row, whose text runs and links each become a column (it broke in Firefox) */
.rx-calls { margin-top: 36px; padding: 18px 24px; border-radius: var(--r-card); border: 1.5px solid var(--black); font: 400 15px/1.6 var(--sans); }
.rx-calls a { font: 500 var(--t-sm) var(--mono); color: var(--black); }
.rx-calls span { color: var(--muted); font-size: var(--t-sm); }
/* parameters: name (with a required tag), type, what it is */
table.params { width: 100%; border-collapse: collapse; font: 400 var(--t-sm)/1.5 var(--sans); }
.params th { text-align: left; padding: 0 0 8px; font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.params td { padding: 11px 16px 11px 0; border-top: 1px solid var(--rule); vertical-align: baseline; }
.params td:first-child { width: 170px; }
.params td:nth-child(2) { width: 190px; color: var(--muted); font: 12.5px var(--mono); }
.params td code { font-size: 12.5px; }
/* a two-column table (name, what it does): the second column is prose, not a type */
.params.two td:first-child { width: 260px; }
.params.two td:nth-child(2) { width: auto; color: inherit; font: inherit; }
.params td:first-child code { font-size: var(--t-xs); color: var(--black); }
.params .req { margin-left: 6px; padding: 0 6px; border: 1px solid rgba(0,0,0,.4); border-radius: var(--r-pill); font: 500 10px var(--sans); letter-spacing: .04em; color: var(--muted); }

/* a disclosure's contents drop in (docs and reference navs, techne.pub's Browse): transform and opacity only */
@keyframes tx-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- small screens (pass 2, mobile): structure at 900px, finer steps at 600px ----------
   Also holds the small-screen rules for the few page-own parts (computer/index .land, docs/spaces .room,
   town .intro/.apps/.claim/.part, connect-http .http), so every responsive rule lives in the kit. */
.dx-toggle, .rx-toggle { display: none; }
@media (max-width: 900px) {
  .sdk-how { grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; }
  .under { margin-top: 56px !important; }
  .why-grid { grid-template-columns: minmax(0, 1fr); }
  .walk-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; }
  .walk { margin-top: 56px !important; }
  .wrap { padding: 0 var(--wrap-x-m, 20px); }
  /* code: scrolls sideways inside the block, never widens the page */
  .code, .code pre { white-space: pre; overflow-wrap: normal; word-break: normal; }
  .code { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 16px; max-width: 100%; box-sizing: border-box; }
  .code pre { overflow: visible; }
  /* tabs wrap */
  .tabs { flex-wrap: wrap; }
  .tabs button { height: 40px; padding: 0 16px; }
  .card.tabbox { padding: 16px; }

  /* docs: the sidebar becomes a "Docs" disclosure at the top (kit/docs.js adds the button) */
  .dx { display: block; padding: 0 16px; }
  .dx-side { position: static; max-height: none; overflow: visible; padding: 8px 0 0; }
  .dx-toggle, .rx-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 16px; box-sizing: border-box; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--white); font: 400 15px var(--sans); color: var(--black); cursor: pointer; text-align: left; }
  .dx-toggle b, .rx-toggle b { font-weight: 500; }
  .dx-toggle small, .rx-toggle small { font: 500 var(--t-label) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 8px; }
  .dx-toggle::after, .rx-toggle::after { content: ''; flex: none; width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: translateY(-2px) rotate(45deg); transition: transform var(--spring-d) var(--spring); }
  .open > .dx-toggle::after, .open > .rx-toggle::after { transform: translateY(2px) rotate(-135deg); }
  .dx-side > :not(.dx-toggle), .rx-side > :not(.rx-toggle) { display: none; }
  .dx-side.open > :not(.dx-toggle), .rx-side.open > :not(.rx-toggle) { display: block; animation: tx-drop var(--spring-d) var(--spring) both; }
  .dx-side.open > :nth-child(n+3), .rx-side.open > :nth-child(n+3) { animation-delay: 30ms; }
  .dx-side.open > :nth-child(n+5), .rx-side.open > :nth-child(n+5) { animation-delay: 60ms; }
  .dx-side.open { padding-bottom: 8px; }
  .dx-side.open > h4:first-of-type { margin-top: 18px; }
  .dx-side a, .dx-side .soon { padding: 10px 12px; }
  .dx-main { padding-top: 24px; }
  /* heads: the drawings get smaller and the head keeps room under its words for them to rise into */
  .dx-head, .phero, .rise { padding-bottom: 128px !important; margin-bottom: 32px; --lg-w: 270px; --lg-x: -48px; --sm-w: 92px; --sm-x: 200px; --script-w: 170px; --script-x: 170px; }
  .dx-head + .items { margin-top: -32px; }
  .dx-head .h1 { font-size: var(--t-h1); }
  .dx-next { margin-top: 56px; }
  .dx-next a { padding: 8px 0; }

  /* the reference: the nav becomes a "Reference" disclosure */
  .rx { display: block; margin-top: 16px; padding: 0 16px; }
  .rx-side { position: static; max-height: none; overflow: visible; padding: 0; margin-bottom: 28px; }
  .rx-side .ng a, .rx-side .ng .no { padding: 10px 8px; }
  .rx-side.open .navq { margin: 12px 0 6px; height: 44px; font-size: 16px; }
  .rx-title { font-size: 22px; }
  .rx-title i { display: block; font-size: 16px; }
  .rx-calls { padding: 16px 18px; }

  /* cards, rows, items, splits: one column */
  .card { padding: 20px 18px; border-radius: 16px; }
  .card > h2 { flex-wrap: wrap; gap: 4px 12px; }
  .row, .calls .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .row .via { text-align: left; }
  .items li { grid-template-columns: 36px minmax(0, 1fr); gap: 6px 12px; }
  .items li > :not(h2):not(span) { grid-column: 2; }
  .items.short li { grid-template-columns: 32px minmax(0, 1fr); font-size: 16px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .split + .split { margin-top: 56px; }
  .split h2 { font-size: var(--t-h2); }
  .seealso a { display: inline-block; padding: 6px 0; }

  /* parameters: a stacked row per parameter */
  table.params, .params tbody, .params tr, .params td { display: block; width: auto !important; }
  .params tr:first-child:has(th), .params thead { display: none; }
  .params tr { padding: 12px 0; border-top: 1px solid var(--rule); }
  .params td { padding: 0; border: 0; }
  .params td:nth-child(2) { display: inline; }
  .params td:first-child { display: inline; margin-right: 10px; }
  .params td:nth-child(3), .params.two td:nth-child(2) { display: block; margin-top: 6px; }

  /* the layer bands: the label above its node, the nodes in one column on a dashed line (kit/bands.js) */
  .bands .start, .bands .end, .band .hd, .band .st { display: block; }
  .bands .start .fig-lab, .bands .end .fig-lab { padding: 18px 20px 0 40px; }
  .bands .start .track, .bands .end .track, .bands.still .end .track { padding: 12px 16px 18px 40px; }
  .bands .rec, .app, .bands.still .end .node { width: 100%; max-width: 320px; }
  .band .lab { padding: 16px 16px 4px 40px; gap: 12px; align-items: flex-start; }
  .band .lab .n { font-size: 28px; width: 22px; }
  .band .lab b { font-size: 19px; }
  .band .hd, .bands.still .band .st { min-height: 0; }
  .band .track, .bands.still .band .track { min-height: 0; height: auto; padding: 10px 16px 18px 40px; background: color-mix(in srgb, var(--c) 13%, #fff); }
  .band .lab { background: color-mix(in srgb, var(--c) 13%, #fff); }
  .band { border-left: 5px solid var(--c); }
  .band .lab, .band .hd:hover .lab, .band.open .lab, .band-more { box-shadow: none; }
  .band .hd:hover .lab, .band.open .lab { background: color-mix(in srgb, var(--c) 22%, #fff); }
  .band .node { position: relative; top: auto; left: auto; transform: none; width: 100%; max-width: 320px; }
  .band .show { min-height: 28px; margin-top: 6px; }
  .band-more .in { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 22px 16px 26px 24px; }
  .band-more h3 { font-size: 22px; }
  .bands .loop-lab { position: relative; left: auto !important; top: auto !important; width: auto; margin: 0 16px 16px 40px; }

  /* landing (computer/index.html): the hero sizes down, the drawings stay below the words */
  .land { height: auto !important; min-height: 100svh !important; padding: 128px 16px 280px !important; }
  .land .act { flex-wrap: wrap; gap: 10px; max-width: 360px; margin-left: auto; margin-right: auto; }
  .land pre.npm { flex: 1 1 100%; justify-content: center; margin: 0 0 2px; height: 44px; }
  .land .act .btn { flex: 1 1 0; justify-content: center; }
  .land > .drawing:nth-child(2) { width: 380px !important; left: -130px !important; bottom: -200px !important; }
  .land > .drawing:nth-child(3) { width: 280px !important; right: -90px !important; bottom: -150px !important; }
  .land > .drawing:nth-child(4) { width: 340px !important; left: auto !important; right: -60px !important; bottom: -120px !important; }

  /* docs/spaces.html: the room diagram reflows into three stacked parts (the arrows give way to the order) */
  .fig.room { width: auto !important; height: auto !important; zoom: 1 !important; display: flex; flex-direction: column; gap: 10px; padding: 22px 18px; }
  .fig.room > svg { display: none; }
  .fig.room > * { position: relative !important; left: auto !important; right: auto !important; top: auto !important; width: auto !important; }
  .fig.room > :nth-child(2) { order: 0; } .fig.room > :nth-child(5) { order: 1; } .fig.room > :nth-child(6) { order: 2; }
  .fig.room > :nth-child(3) { order: 3; margin-top: 18px; } .fig.room > :nth-child(7) { order: 4; } .fig.room > :nth-child(8) { order: 5; align-self: flex-start; }
  .fig.room > :nth-child(9) { order: 6; } .fig.room > :nth-child(10) { order: 7; } .fig.room > :nth-child(11) { order: 8; text-align: left !important; } .fig.room > :nth-child(12) { order: 9; }
  .fig.room > :nth-child(4) { order: 10; margin-top: 18px; } .fig.room > :nth-child(13) { order: 11; } .fig.room > :nth-child(14) { order: 12; }
  .rules { grid-template-columns: minmax(0, 1fr) !important; gap: 32px !important; margin-top: 40px !important; }

  /* footers stack */
  .tx-foot { margin-top: 80px; }
  .tx-foot-row { flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 20px 72px; }
  .tx-foot .links { flex-direction: column; gap: 10px; }
  .tx-foot .links a { padding: 4px 0; }
  .tx-under { margin: -48px 20px 0; }
  .wrap > .tx-foot .tx-foot-row { padding: 28px 0 72px; }
  .tx-foot.pub { padding: 40px 20px 200px; }
  .tx-foot.pub .cols { flex-direction: column; gap: 28px; }
  .tx-foot.pub .cols a { margin: 0; padding: 7px 0; }

  /* town: app cards stack, the handle field takes the width */
  .intro { padding: 56px 0 40px !important; }
  .apps { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; gap: 16px !important; }
  .apps article { height: 320px !important; }
  .apps article .drawing { transform: translateY(100px); }
  .apps article .drawing.d-sunrise { transform: translateY(50px); }
  .handle { margin-top: 56px !important; padding: 56px 0 64px !important; }
  .claim { flex-direction: column; align-items: stretch !important; gap: 10px !important; margin: 32px auto 0 !important; max-width: 460px; }
  .claim .field { min-width: 0 !important; width: 100%; box-sizing: border-box; }
  .claim .field input { height: 100%; max-width: calc(100vw - 200px) !important; }
  .claim .btn { width: 100%; }
  .part { grid-template-columns: minmax(0, 1fr) !important; gap: 18px !important; padding: 40px 0 !important; }
  .part p { font-size: 17px !important; }
  .intro { overflow-x: clip; }
  .intro.rise { overflow: hidden; padding-bottom: 128px !important; }
  /* town releases.html: one column, one shot across so the app's text stays readable */
  .release { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; padding: 40px 0 48px !important; }
  .release .when { position: static !important; }
  .release-shots { grid-template-columns: minmax(0, 1fr) !important; max-width: 360px !important; gap: 28px !important; }

  /* connect-http.html */
  .http .wrap { padding: 0 16px !important; }
  .http .hero { padding: 40px 20px 170px !important; }
  .http .card, .calls .card { padding: 20px 18px !important; }
}
@media (max-width: 600px) {
  .diag svg.wide { display: none; }
  .diag svg.tall { display: block; }
  .diag { padding: 8px 0; }
  /* the landing headline a step under the mobile H1, so its desktop line break still makes two lines */
  .land .h1 { font-size: 36px; }
  .hero { padding: 40px 20px 150px; }
  .hero { --lg-w: 260px; --lg-x: -120px; --sm-w: 180px; --sm-x: -70px; }
  .card > h2 { font-size: 21px; }
  .band-more .in { padding-left: 20px; }
}

/* a page that describes the next techne-sdk release (scripts/build.mjs markNext) */
.next-release { margin: 12px 0 20px; padding: 10px 14px; border-radius: var(--r-pill); background: var(--beige); font: 400 14.5px/1.4 var(--sans); color: var(--black); }

/* Ask your agent (kit/ask.js): the exact words, copied in one click, and the way to connect an agent */
.ask-box { border: 1px solid var(--rule); border-radius: 14px; background: var(--white); padding: 14px 16px 12px; max-width: 640px; }
.ask-box .ask-label { font: 500 12px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ask-box .ask-copy { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 8px; margin: 0 -8px; box-sizing: content-box; border: 0; border-radius: 8px; background: none; text-align: left; font: 400 16px/1.35 var(--sans); color: var(--black); cursor: pointer; }
.ask-box .ask-copy:hover { background: var(--hover); }
.ask-box .ask-q::before { content: '\201C'; } .ask-box .ask-q::after { content: '\201D'; }
.ask-box .ask-ic { flex: none; display: inline-flex; align-items: center; height: 24px; font: 500 12px/1 var(--sans); color: var(--muted); }
.ask-box .ask-ic svg { width: 15px; height: 15px; }
.ask-box .ask-ok { display: none; }
.ask-box .is-done .ask-ok { display: inline; } .ask-box .is-done svg { display: none; }
.ask-box .ask-copy:hover .ask-ic, .ask-box .ask-copy:focus-visible .ask-ic { color: var(--black); }
.ask-box .ask-then { margin: 6px 0 0; font: 400 13px/1.4 var(--sans); color: var(--muted); }
.ask-box .ask-then a { color: var(--black); }
.ask-box .ask-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* docs pages written as prose (computer/docs/building.html and its group) */
.dx-ask { margin: 0 0 40px; }
.dx-prose { max-width: 720px; padding-bottom: 24px; }
.dx-prose p, .dx-prose li { font: 400 var(--t-p)/1.6 var(--sans); color: var(--ink-2); }
.dx-prose p { margin: 0 0 16px; }
.dx-prose ol { margin: 0 0 16px; padding-left: 22px; }
.dx-prose li { margin: 0 0 8px; }
.dx-prose .h2 { font-size: 30px; margin: 48px 0 14px; scroll-margin-top: 96px; }
.dx-prose > .h2:first-child { margin-top: 0; }
.dx-prose pre { margin: 0 0 20px; padding: 16px 18px; border-radius: 12px; background: var(--panel); font: 400 13px/1.55 var(--mono); overflow-x: auto; }
.dx-prose pre code { background: none; padding: 0; font: inherit; }
