/* Layout idea: a drafting sheet. One reading column for rules, wide grids for computed cross-sections. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2");
}
:root {
  --paper: #f3f5f7;
  --sheet: #ffffff;
  --ink: #17212b;
  --muted: #5b6875;
  --rule: #d5dbe1;
  --accent: #1d5fd1;
  --c-base: #aeb8c2;
  --c-spacer: #e3e7eb;
  --c-conv: #6f9be8;
  --c-floor: #cfd5db;
  --c-out: #f0a800;
  --ok: #1a7f4e;
  --warn: #b5560a;
  --plate: transparent;
  --page: 85rem;
  --col: 52rem;
  --step--2: 0.694rem;
  --step--1: 0.833rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.44rem;
  --step-3: 1.728rem;
  --step-4: 2.074rem;
  --step-5: 2.488rem;
  --step-6: 2.986rem;
  --step-7: 3.583rem;
  --sp-05: 0.25rem;
  --sp-1: 0.5rem;
  --sp-15: 0.75rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2.5rem;
  --sp-5: 4rem;
  --sp-6: 6rem;
  --gutter: 1.25rem;
  --gap: var(--sp-3);
  --gap-wide: var(--sp-4);
  --row: var(--sp-5);
  --lh-display: 1.05;
  --lh-heading: 1.2;
  --lh-compact: 1.45;
  --lh-body: 1.55;
  --lh-cjk: 1.8;
  --track-caps: 0.04em;
  --track-caps-lg: 0.02em;
  --track-display: 0.01em;
  --f-display: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10161c;
    --sheet: #18212a;
    --ink: #e6ecf2;
    --muted: #97a4b1;
    --rule: #2c3945;
    --accent: #7fb0ff;
    --c-base: #5d6b79;
    --c-spacer: #2e3b47;
    --c-conv: #3f73cf;
    --c-floor: #3a4753;
    --c-out: #ffbf2e;
    --ok: #5fd39a;
    --warn: #f0a15a;
    --plate: #e4e9ee;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10161c;
  --sheet: #18212a;
  --ink: #e6ecf2;
  --muted: #97a4b1;
  --rule: #2c3945;
  --accent: #7fb0ff;
  --c-base: #5d6b79;
  --c-spacer: #2e3b47;
  --c-conv: #3f73cf;
  --c-floor: #3a4753;
  --c-out: #ffbf2e;
  --ok: #5fd39a;
  --warn: #f0a15a;
  --plate: #e4e9ee;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  font-kerning: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
a {
  color: var(--accent);
  text-decoration-thickness: 0.0625em;
  text-underline-offset: 0.2em;
}
strong,
b,
th {
  font-weight: 600;
}
p,
li,
dd,
td,
figcaption {
  text-wrap: pretty;
}
table,
dl,
.count,
.lab-result,
.solver ol {
  font-variant-numeric: lining-nums tabular-nums;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-head {
  padding: var(--sp-6) 0 var(--sp-4);
  text-align: center;
}
.site-head h1 {
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--accent);
  font-size: clamp(var(--step-5), 6vw, var(--step-7));
  line-height: var(--lh-display);
  margin: 0 0 var(--sp-15);
  text-transform: uppercase;
  letter-spacing: var(--track-caps-lg);
}
.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-15);
  margin: 0 0 var(--sp-15);
}
.brand h1 {
  margin: 0;
}
.logo {
  flex: none;
  width: clamp(48px, 9vw, 72px);
  height: auto;
}
.logo .l-a {
  fill: var(--accent);
}
.logo .l-b {
  fill: var(--c-out);
}
.tagline {
  margin: 0 auto var(--sp-2);
  font-size: var(--step-1);
  color: var(--muted);
}
.lede {
  max-width: var(--col);
  margin: 0 auto;
  color: var(--muted);
}
.lede strong {
  color: var(--ink);
  font-weight: 600;
}
.toc {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.toc .wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--gutter);
  min-height: 52px;
}
.toc-brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.toc-brand .logo {
  width: 34px;
}
#toc-list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-05) var(--sp-4);
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: var(--sp-15) 0;
}
#toc-list a {
  font-family: var(--f-display);
  font-size: var(--step-0);
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  letter-spacing: var(--track-caps);
}
#toc-list a:hover,
#toc-list a[aria-current] {
  color: var(--accent);
}
.toc-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0 calc(-1 * var(--sp-1)) 0 0;
  padding: var(--sp-1);
  background: none;
  color: var(--ink);
  border: 0;
  cursor: pointer;
}
html:has(.mega:not([hidden])) {
  overflow: hidden;
}
.mega {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  max-height: calc(100vh - 53px);
  max-height: calc(100dvh - 53px);
  overflow-y: auto;
  padding: var(--sp-4) 0 var(--sp-5);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.mega .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-4) var(--sp-5);
  min-height: 0;
}
.mega section {
  flex: 1 1 12rem;
}
.mega section:first-child {
  flex: 6 1 36rem;
}
.mega h2 {
  margin: 0 0 var(--sp-2);
  font-size: var(--step-0);
  color: var(--accent);
}
.mega ol,
.mega ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mega ol {
  columns: 14rem 3;
  column-gap: var(--sp-4);
}
.mega ol > li {
  break-inside: avoid;
  padding-bottom: var(--sp-2);
}
.mega a {
  display: block;
  padding: 0.2rem 0;
  font-family: var(--f-body);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  color: var(--muted);
}
.mega h2 a,
.mega ol > li > a,
.mega section:not(:first-child) li a {
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--ink);
}
.mega h2 a {
  font-family: var(--f-display);
  color: var(--accent);
}
.mega a:hover,
.mega a:focus-visible,
.mega a[aria-current] {
  color: var(--accent);
}
.mega b {
  display: inline-block;
  min-width: 1.6em;
  font-weight: 600;
  color: var(--muted);
}
@media (max-width: 700px) {
  #toc-list {
    display: none;
  }
  .toc-toggle {
    margin-left: auto;
  }
}
.page-head {
  padding: var(--sp-6) 0 var(--sp-2);
}
.page-head + main > section > :first-child {
  margin-top: 0;
}
.page-head h1 {
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--accent);
  font-size: clamp(var(--step-4), 4.5vw, var(--step-6));
  line-height: var(--lh-display);
  text-transform: uppercase;
  text-wrap: balance;
  max-width: var(--col);
  margin: 0 auto;
  letter-spacing: var(--track-caps-lg);
}
.jp-credit {
  max-width: var(--col);
  margin: var(--sp-3) auto 0;
  text-align: left;
}
.jp-credit p {
  margin: 0;
  max-width: none;
}
.jp-credit [lang="ja"] {
  font-size: var(--step-2);
  line-height: var(--lh-cjk);
  margin-bottom: var(--sp-2);
}
.jp-credit .en {
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
.start {
  margin: var(--sp-2) auto 0;
  font-size: var(--step-1);
}
.index {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  padding: 0;
  margin: var(--sp-4) 0;
  gap: var(--gap);
}
.index a {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  height: 100%;
  padding: var(--sp-15);
  background: var(--sheet);
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step--1);
  line-height: var(--lh-compact);
}
.index a:hover {
  border-color: var(--accent);
}
.pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  background: var(--paper);
}
.pic img.iso {
  max-height: 110px;
  width: auto;
}
.index strong {
  font-family: var(--f-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  color: var(--accent);
  font-size: var(--step-2);
}
.index span {
  color: var(--muted);
}
main section {
  padding: var(--sp-3) 0 var(--sp-5);
}
h2 {
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--accent);
  text-wrap: balance;
  letter-spacing: var(--track-display);
  font-size: var(--step-4);
  line-height: var(--lh-heading);
  margin: var(--sp-6) 0 var(--sp-3);
}
h3 {
  font-family: var(--f-display);
  font-weight: 600;
  text-wrap: balance;
  letter-spacing: var(--track-display);
  line-height: var(--lh-heading);
  font-size: var(--step-3);
  margin: var(--sp-5) 0 var(--sp-2);
}
h4 {
  font-size: var(--step--1);
  font-weight: 600;
  line-height: var(--lh-heading);
  margin: 0;
}
p,
.prose li {
  max-width: 68ch;
}
.prose > p {
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.lead {
  color: var(--accent);
  font-size: var(--step-1);
  line-height: var(--lh-compact);
}
.prose ul:not([class]) {
  padding-left: 1.1em;
}
.prose > h2,
.prose > h3,
.prose > p,
.prose > .eq,
.prose > .eq-where,
.prose > .duo,
.prose > .eqs,
.prose > .credit,
.prose > .solver,
.prose > .lab,
.prose > .thread,
.prose > .tools,
.prose > .words,
.prose > .key,
.prose > .bridge,
.prose > .legend,
.prose > .filters,
.prose > .figs,
.prose > .tablewrap,
.prose > .src,
.prose > .index,
.prose > .pit,
.prose > .fam,
.prose > .grid,
.prose > ul:not([class]) {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}
.eq {
  margin: var(--sp-4) 0;
  text-align: center;
}
math {
  color: var(--accent);
}
thead th.n {
  font-family: var(--f-display);
}
.eq math {
  font-size: var(--step-2);
}
@media (max-width: 520px) {
  .eq math {
    font-size: var(--step-0);
  }
}
.duo,
.eqs {
  display: grid;
  gap: var(--gap-wide);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.duo {
  align-items: start;
  grid-template-columns: 2fr 1fr;
}
.eqs {
  grid-template-columns: repeat(3, 1fr);
}
.eqs.two {
  grid-template-columns: repeat(2, 1fr);
}
.duo .tablewrap {
  margin: 0;
}
.duo table {
  min-width: 0;
}
.duo .tfig,
.eqs .tfig {
  max-width: none;
  align-items: center;
  justify-content: space-between;
}
.duo .tfig svg.sec {
  width: 100%;
  max-width: 18rem;
}
.eqs .eq {
  margin: 0;
}
.eqs {
  container-type: inline-size;
}
.eqs .eq math {
  font-size: min(var(--step-1), 2.1cqi);
}
.eqs figcaption {
  text-align: center;
}
.eqs .tfig {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  justify-items: center;
  gap: var(--sp-2);
}
.eqs .eq {
  align-self: end;
  height: 2rem;
}
.eqs figcaption {
  align-self: start;
}
@media (max-width: 760px) {
  .figs,
  .figs:has(> :nth-child(3):last-child) {
    grid-template-columns: 1fr;
  }
  .duo,
  .eqs,
  .eqs.two {
    grid-template-columns: 1fr;
  }
  .eqs .eq math {
    font-size: var(--step-1);
  }
}
.eq-where {
  color: var(--muted);
  font-size: var(--step--1);
  text-align: center;
  line-height: var(--lh-compact);
}
code,
.n,
small {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
code {
  font-size: inherit;
}
small {
  color: var(--muted);
  font-size: var(--step--2);
}
.tablewrap {
  overflow-x: auto;
  margin: var(--sp-4) 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--step--1);
  min-width: 520px;
  line-height: var(--lh-compact);
}
caption {
  caption-side: top;
  text-align: left;
  color: var(--muted);
  font-size: var(--step--1);
  padding: 0 0 var(--sp-1);
  line-height: var(--lh-compact);
}
th,
td {
  padding: var(--sp-15) var(--sp-3) var(--sp-15) 0;
  text-align: left;
  vertical-align: middle;
}
th:last-child,
td:last-child {
  padding-right: 0;
}
thead th {
  font-family: var(--f-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  font-size: var(--step--1);
  color: var(--muted);
  vertical-align: bottom;
}
td.n,
th.n {
  text-align: right;
}
tbody th {
  white-space: nowrap;
  font-family: var(--f-mono);
  font-weight: 500;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: var(--sp-4) 0;
  gap: var(--row) var(--gap-wide);
}
.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.card[hidden] {
  display: none;
}
.card header {
  display: flex;
  gap: var(--sp-1);
  align-items: baseline;
}
.id {
  font-family: var(--f-mono);
  font-size: var(--step--2);
  color: var(--accent);
  white-space: nowrap;
}
.card figure,
.tfig {
  margin: 0;
}
.card figure,
.plate {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
}
.plate {
  align-self: stretch;
  max-width: 100%;
}
.tfig {
  flex: 0 1 24rem;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-start;
  display: flex;
  min-width: 0;
  max-width: 100%;
}
.tfig figcaption {
  font-size: var(--step--1);
  color: var(--muted);
  max-width: 46ch;
  line-height: var(--lh-compact);
  align-self: center;
  text-align: center;
  text-wrap: balance;
}
.figs > .tfig:has(> figcaption:nth-child(2)) {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  justify-items: center;
  row-gap: var(--sp-2);
}
.figs > .tfig:has(> figcaption:nth-child(2)) > :first-child {
  align-self: center;
}
.figs > .tfig:has(> figcaption:nth-child(2)) > figcaption {
  align-self: start;
}
.figs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: stretch;
  margin: var(--sp-4) 0;
  gap: var(--row) var(--gap-wide);
}
.figs .plate {
  flex: 1 1 auto;
}
.figs:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 760px) {
  .figs:has(> :nth-child(3):last-child) {
    grid-template-columns: 1fr;
  }
}
svg.sec {
  max-width: 100%;
  height: auto;
  flex: none;
}
.pair,
#chains figure {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-15);
  align-items: center;
  justify-items: center;
  width: 100%;
}
.pair {
  gap: var(--gap);
}
.pair svg.sec,
#chains figure svg.sec {
  max-height: 190px;
  width: auto;
}
img.iso {
  max-width: 100%;
  height: auto;
  background: var(--plate);
}
.pair img.iso,
#chains figure img.iso {
  max-height: 190px;
  width: auto;
}
.stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  width: 100%;
}
.stack svg.sec,
.stack img.iso {
  flex: 0 1 auto;
  max-width: 100%;
  height: auto;
}
.tps {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-right: var(--sp-1);
  vertical-align: middle;
}
th .tps,
td .tps {
  justify-content: center;
  min-width: 6.5rem;
}
th:has(> .tps),
td:has(> .tps),
td.nw {
  white-space: nowrap;
}
img.tp {
  max-height: 2.5rem;
  width: auto;
}
td.th {
  padding: var(--sp-05) var(--sp-1);
  text-align: center;
  vertical-align: middle;
}
td.th svg.sec {
  display: block;
  max-height: 4.5rem;
  width: auto;
  margin: 0 auto;
}
td.th img.iso {
  display: block;
  max-height: 60px;
  width: auto;
  margin: 0 auto;
}
.iso path {
  stroke: var(--ink);
  stroke-width: 0.9;
  stroke-linejoin: round;
}
.iso .ft,
.iso .fc {
  filter: brightness(1.12);
}
.iso .fr,
.iso .fs {
  filter: brightness(0.82);
}
.sec .d.ld {
  stroke: var(--muted);
  stroke-width: 0.4;
}
.sec .x {
  fill: var(--warn);
  fill-opacity: 0.6;
  stroke: var(--warn);
  stroke-width: 0.8;
}
.sec .t {
  font-family: var(--f-mono);
  font-size: 5px;
  fill: var(--muted);
}
.sec .b,
.sec .st {
  stroke: var(--ink);
  stroke-width: 0.6;
  stroke-linejoin: round;
}
.sec .r-base {
  fill: var(--c-base);
}
.sec .r-spacer {
  fill: var(--c-spacer);
}
.sec .r-conv {
  fill: var(--c-conv);
}
.sec .r-floor {
  fill: var(--c-floor);
}
.sec .r-out {
  fill: var(--c-out);
}
.sec .r-ghost,
.sec .gh {
  fill: none;
  stroke: var(--muted);
  stroke-width: 0.6;
  stroke-dasharray: 2 1.5;
}
.sec .g {
  stroke: var(--muted);
  stroke-width: 0.35;
  stroke-dasharray: 1.6 1.6;
  opacity: 0.7;
}
.sec .d {
  stroke: var(--accent);
  stroke-width: 1.4;
}
.sec .dq {
  stroke: var(--c-out);
  stroke-width: 1.6;
}
.sec .arm {
  stroke: var(--ink);
  stroke-width: 2;
}
.sec .pv {
  fill: var(--c-out);
  stroke: var(--ink);
  stroke-width: 0.6;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.chip {
  font-family: var(--f-mono);
  font-size: var(--step--2);
  color: var(--muted);
}
.chip:not(:last-child)::after {
  content: "·";
  margin-left: var(--sp-1);
  color: var(--muted);
}
.chip.on {
  color: var(--ok);
}
.chip.half {
  color: var(--warn);
}
.chip.dir {
  color: var(--ink);
}
dl {
  margin: 0;
  display: grid;
  gap: var(--sp-05);
  font-size: var(--step--1);
  line-height: var(--lh-compact);
}
dl div {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  gap: var(--sp-1);
}
.card.part dl div {
  grid-template-columns: 7.5em 1fr;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: var(--sp-5) 0 var(--sp-4);
  gap: var(--gap);
}
.filters fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  border: 0;
  margin: 0;
  padding: 0;
}
.filters legend {
  width: 100%;
  padding: 0;
  margin-bottom: var(--sp-1);
  font-family: var(--f-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
}
.filters fieldset button {
  display: grid;
  grid-template-rows: 2.5rem auto;
  justify-items: center;
  align-items: center;
  gap: var(--sp-05);
  min-width: 4.5rem;
  padding: var(--sp-1);
  background: var(--sheet);
  border: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: var(--step--2);
  line-height: var(--lh-heading);
  color: var(--muted);
  cursor: pointer;
}
.filters fieldset button img.tp {
  max-height: 2.5rem;
  width: auto;
}
.sym {
  font-family: var(--f-display);
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}
.sym.ok {
  color: var(--ok);
}
.sym.warn {
  color: var(--warn);
}
.filters fieldset button:hover {
  border-color: var(--accent);
}
.filters fieldset button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}
.filters .count {
  flex-basis: 100%;
}
.count {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--muted);
}
.legend {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  list-style: none;
  padding: 0;
  margin: var(--sp-3) 0;
  font-size: var(--step--1);
  color: var(--muted);
  line-height: var(--lh-compact);
}
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  vertical-align: -2px;
  margin-right: var(--sp-05);
}
.solver .lab-stage {
  margin-top: var(--sp-15);
}
.solver {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: var(--sp-2);
}
.solver ol {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  padding-left: 1.6em;
  margin: var(--sp-15) 0 0;
}
.pit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  margin: var(--sp-4) 0;
  list-style: none;
  gap: var(--row) var(--gap-wide);
}
.pit li {
  font-size: var(--step--1);
  line-height: var(--lh-compact);
}
.pit strong {
  display: block;
  margin-bottom: var(--sp-05);
  font-family: var(--f-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  font-size: var(--step-2);
}
.pn {
  display: block;
  margin-bottom: var(--sp-05);
  font-family: var(--f-mono);
  font-size: var(--step--2);
  color: var(--accent);
}
.pitfig {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 150px;
  margin-bottom: var(--sp-2);
  justify-content: flex-start;
}
.pitfig img.iso {
  max-height: 130px;
  min-width: 0;
  width: auto;
}
.fam {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  margin: var(--sp-4) 0;
  list-style: none;
  gap: var(--row) var(--gap-wide);
}
.fam li {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-size: var(--step--1);
  line-height: var(--lh-compact);
}
.parts .used {
  color: var(--muted);
}
.index .num {
  margin-right: var(--sp-1);
  color: var(--muted);
  font-weight: 500;
}
.people {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  max-width: var(--col);
  margin: var(--sp-4) auto var(--sp-6);
  padding: 0;
  list-style: none;
}
.people > li {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--sp-1) var(--gap-wide);
  align-items: start;
}
.people .who strong {
  display: block;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--step-4);
  line-height: var(--lh-display);
  text-wrap: balance;
}
.people .who span {
  display: block;
  margin-top: var(--sp-1);
  font-size: var(--step-1);
  color: var(--muted);
}
.people .what > * {
  margin: 0 0 var(--sp-15);
  max-width: none;
}
.people .what > :last-child {
  margin-bottom: 0;
}
.people .what [lang="ja"] {
  font-size: var(--step-1);
  line-height: var(--lh-cjk);
}
.people .what ul {
  padding-left: 1.2em;
}
.note {
  font-size: var(--step--1);
  line-height: var(--lh-compact);
  color: var(--muted);
}
.thanks {
  gap: var(--sp-3);
}
.thanks .who strong {
  font-size: var(--step-2);
  line-height: var(--lh-heading);
}
.thanks .what {
  color: var(--muted);
}
@media (max-width: 760px) {
  .people > li {
    grid-template-columns: 1fr;
  }
}
.parts {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.parts strong {
  font-size: var(--step-1);
}
.fam strong {
  display: block;
  font-family: var(--f-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  font-size: var(--step-2);
}
.m-ok {
  color: var(--ok);
}
.m-part {
  color: var(--warn);
}
.m-no {
  color: var(--muted);
}
.lab {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: var(--sp-3);
  margin: var(--sp-4) 0;
}
.lab-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-15) var(--gap);
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
#angle-tool .stepper {
  flex-wrap: wrap;
}
#angle-tool .stepper span {
  flex: 1 0 100%;
}
#angle-stage svg {
  width: auto;
  max-width: 100%;
  height: 14rem;
}
#angle-stage .t {
  font-size: 13px;
}
.stepper span {
  min-width: 6.5em;
}
.stepper output {
  font-family: var(--f-mono);
  min-width: 1.6em;
  text-align: center;
}
.solver .stepper output {
  min-width: 5.5em;
}
.lab button,
.solver button {
  font: inherit;
  font-size: var(--step--1);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: var(--sp-05) var(--sp-15);
  cursor: pointer;
}
.stepper button {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  font-family: var(--f-mono);
  font-size: var(--step-1);
  touch-action: manipulation;
}
.lab-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-15);
  font-size: var(--step--1);
  color: var(--muted);
}
.lab-stage {
  overflow-x: auto;
  margin-top: var(--sp-15);
}
.lab-stage svg {
  display: block;
  width: 100%;
  min-width: 360px;
  height: auto;
}
.lab .lab-stage svg {
  margin-inline: 0;
}
.lab-stage text {
  font-family: var(--f-mono);
  font-size: 5px;
  fill: var(--muted);
}
.lab-stage .k-brick {
  fill: var(--c-base);
}
.lab-stage .k-plate {
  fill: var(--c-spacer);
}
.lab-stage .k-half {
  fill: var(--c-conv);
}
.lab-stage .k-quarter {
  fill: var(--c-out);
}
.lab-stage .k-col {
  fill: var(--c-floor);
}
.lab-stage .k-rest {
  fill: var(--warn);
  fill-opacity: 0.35;
  stroke: var(--warn);
}
.lab-stage rect {
  stroke: var(--ink);
  stroke-width: 0.5;
}
.lab-stage line {
  stroke: var(--muted);
  stroke-width: 0.35;
  stroke-dasharray: 1.6 1.6;
}
.lab-result {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  margin: var(--sp-15) 0 0;
  max-width: none;
}
.lab-result.hit {
  color: var(--ok);
}
.lab-result.miss {
  color: var(--warn);
}
.credit {
  background: var(--sheet);
  border-left: 3px solid var(--accent);
  padding: var(--sp-15) var(--sp-15);
  max-width: 68ch;
}
.credit p {
  margin: 0 0 var(--sp-1);
}
.credit + .credit {
  margin-top: var(--sp-2);
}
.credit p:last-child {
  margin: 0;
}
.src li {
  margin-bottom: var(--sp-1);
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin-top: var(--sp-6);
  gap: var(--gap);
}
.pager a {
  display: block;
  padding: var(--sp-3);
  background: var(--sheet);
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover,
.pager a:focus-visible {
  border-color: var(--accent);
}
.pager-next {
  grid-column: 2;
  text-align: right;
}
.pager span,
.pager em {
  display: block;
  font-size: var(--step--1);
  font-style: normal;
  color: var(--muted);
  line-height: var(--lh-compact);
}
.pager strong {
  display: block;
  color: var(--accent);
  font-family: var(--f-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  font-size: var(--step-2);
}
.crumb {
  max-width: var(--col);
  margin: 0 auto var(--sp-1);
  font-family: var(--f-display);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}
.crumb a {
  margin-right: 0.4em;
  text-decoration: none;
}
.crumb a::after,
.crumb span:not(:last-child)::after {
  content: " /";
  color: var(--muted);
}
.crumb span {
  margin-right: 0.4em;
  color: var(--muted);
}
.tfig > .eq {
  align-self: center;
}
.concept {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: var(--col);
  margin: var(--row) auto;
  gap: var(--gap-wide);
}
.concept .plate {
  justify-content: center;
}
.concept > div > :first-child {
  margin-top: 0;
}
.concept h3 {
  margin: 0 0 var(--sp-2);
}
.concept .tfig {
  max-width: none;
}
.ask {
  max-width: var(--col);
  margin: var(--sp-1) auto 0;
  font-size: var(--step-2);
  line-height: var(--lh-heading);
  color: var(--muted);
}
.tools {
  margin-top: var(--sp-2);
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  font-size: var(--step--1);
}
.tools button {
  padding: var(--sp-05) var(--sp-15);
  background: var(--sheet);
  border: 1px solid var(--rule);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.tools button,
.tools a,
.lab-presets button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  touch-action: manipulation;
}
.tools button:hover {
  border-color: var(--accent);
}
:fullscreen {
  padding: var(--sp-4);
  background: var(--paper);
  overflow: auto;
}
.words {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  list-style: none;
  padding: 0;
}
.gloss {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: var(--col);
  margin: var(--sp-4) auto;
  gap: var(--row) var(--gap-wide);
}
.gloss > div {
  display: block;
}
.gloss dt {
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  margin: var(--sp-1) 0 var(--sp-05);
  font-size: var(--step-2);
}
.gloss dd {
  margin: 0;
  font-size: var(--step-0);
}
.gloss .pic {
  height: 200px;
  background: none;
  justify-content: center;
  align-items: center;
}
.gloss .pic img,
.gloss .pic svg {
  min-width: 0;
  max-width: 50%;
  max-height: 200px;
  width: auto;
  height: auto;
}
.gloss .pic > :only-child {
  max-width: 100%;
}
.gloss .pic img {
  object-fit: contain;
  object-position: center;
}
.lessons {
  list-style: none;
  counter-reset: step;
  padding: 0;
}
@media (max-width: 760px) {
  .concept,
  .gloss {
    grid-template-columns: 1fr;
  }
}
.thread img {
  flex: none;
  width: 5rem;
  height: 4rem;
  object-fit: contain;
}
.hero-pic {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--gap-wide);
  margin: 0 auto var(--sp-4);
}
.hero-pic img {
  height: auto;
  max-width: 100%;
}
@media (max-width: 900px) {
  .hero-pic .side {
    display: none;
  }
}
.key {
  padding-left: var(--sp-2);
  border-left: 3px solid var(--accent);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: var(--lh-compact);
}
.prose > .key {
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.prose > .bridge {
  color: var(--muted);
  margin-top: var(--sp-6);
}
.thread {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: var(--sp-3) auto var(--sp-5);
}
.thread[start="0"] {
  counter-reset: step -1;
}
.thread li {
  counter-increment: step;
  display: grid;
  align-items: baseline;
  max-width: none;
  padding: var(--sp-2) 0;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-05) var(--gap);
}
.thread a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  font-size: var(--step-2);
}
.thread a::before {
  content: counter(step);
  display: inline-block;
  min-width: 2rem;
  color: var(--muted);
}
@media (max-width: 520px) {
  .thread li {
    grid-template-columns: 1fr;
  }
  .thread span {
    padding-left: 2rem;
  }
}
footer {
  margin-top: var(--sp-6);
  padding: var(--sp-5) 0;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: var(--lh-compact);
}
footer p {
  max-width: none;
  margin: 0 0 var(--sp-1);
}
.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.foot-top ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot-top a {
  color: var(--ink);
  text-decoration: none;
}
.foot-top a:hover,
.foot-top a:focus-visible {
  color: var(--accent);
}
.foot-brand .logo {
  width: 1.75rem;
  height: 1.75rem;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--step-0);
}
.grid.cat {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 760px) {
  .index,
  .pit,
  .fam,
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid.cat {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .index,
  .pit,
  .fam,
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
.sec .gd {
  fill: var(--muted);
  opacity: 0.5;
}
.sec .gd2 {
  fill: var(--sheet);
  stroke: var(--ink);
  stroke-width: 0.5;
}
.sec .mv,
.sec .mvg {
  stroke: var(--c-conv);
  stroke-width: 4;
  stroke-linecap: round;
}
.sec .mvg {
  opacity: 0.3;
}
.sec .ar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.7;
}
.sec .t.big {
  font-size: 6.5px;
  font-weight: 500;
  fill: var(--accent);
}
.sec .floorband {
  fill: var(--c-floor);
  opacity: 0.45;
}
.sec .ad {
  fill: var(--accent);
}
.sec .g.gl {
  stroke-dasharray: none;
  opacity: 0.35;
}
.figs.many {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 760px) {
  .figs.many {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .figs.many,
  .figs.ladder {
    grid-template-columns: 1fr;
  }
}
.solver button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--sheet);
}
.tols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-15);
}
.tols span {
  min-width: 6.5em;
}
#arrow-tool .stepper,
.finder .stepper {
  flex-wrap: wrap;
}
#arrow-tool .stepper span,
.finder .stepper span {
  flex: 1 0 100%;
}
#arrow-stage svg {
  display: block;
  width: 100%;
  max-width: 32rem;
  height: auto;
  max-height: 14rem;
  min-width: 0;
}
#arrow-stage .t {
  font-size: 13px;
}
.prose > .finder {
  max-width: var(--col);
  margin: var(--sp-4) auto;
}
.finder .solver + .solver {
  margin-top: var(--sp-15);
}
.fopts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-15);
}
.fopts span {
  min-width: 6.5em;
  font-size: var(--step--1);
  color: var(--muted);
}
.fno {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-15);
  font-size: var(--step--1);
}
.fno input {
  width: 6em;
  font: inherit;
  padding: var(--sp-05) var(--sp-1);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}
#finder-strip {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--sp-2);
  cursor: pointer;
  touch-action: manipulation;
}
.sec .tk {
  stroke: var(--c-floor);
  stroke-width: 1.4;
}
.sec .tk.on {
  stroke: var(--accent);
}
.sec .mk {
  fill: var(--c-out);
  stroke: var(--ink);
  stroke-width: 0.6;
}
.sec .hit {
  fill: transparent;
}
#finder-strip .t {
  font-size: 9px;
}
#finder-sum {
  font-size: var(--step--1);
  color: var(--muted);
}
#finder-detail h4 {
  font-family: var(--f-display);
  font-size: var(--step-2);
  color: var(--accent);
  margin-top: var(--sp-4);
}
.fviews {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  margin: var(--sp-2) 0;
}
.fviews canvas,
canvas.fthumb {
  max-width: 100%;
  background: var(--plate);
}
.flist {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: var(--sp-3);
}
.fcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-15) var(--sp-1);
  background: var(--sheet);
  border: 1px solid var(--rule);
  color: var(--ink);
  font: inherit;
  font-size: var(--step--1);
  line-height: var(--lh-compact);
  text-align: center;
  cursor: pointer;
}
.fcard:hover,
.fcard.on {
  border-color: var(--accent);
}
.fcard strong {
  color: var(--accent);
}
.chipb {
  font: inherit;
  font-size: var(--step--1);
  font-family: var(--f-mono);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: var(--sp-05) var(--sp-1);
  cursor: pointer;
}
#finder-more {
  margin-top: var(--sp-2);
}
@media (max-width: 760px) {
  .flist {
    grid-template-columns: repeat(2, 1fr);
  }
}
.sec .t.halo {
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 2.4px;
  stroke-linejoin: round;
}
#arrow-stage .dq {
  stroke: var(--c-out);
  stroke-width: 3;
  stroke-dasharray: none;
}
#arrow-stage .gh {
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
}
#arrow-stage .g {
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
#arrow-stage .pv,
#arrow-stage .gd2 {
  stroke-width: 1.2;
}
.prose > .wide {
  max-width: var(--col);
  margin: var(--sp-4) auto;
}
.wide svg.sec {
  width: 100%;
  height: auto;
}
.tfig figcaption .ang {
  display: block;
  font-family: var(--f-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: var(--lh-heading);
  color: var(--accent);
}
.sec .ar.ar2 {
  stroke-width: 1;
}
.fcard .ang {
  display: block;
  font-family: var(--f-display);
  font-size: var(--step-1);
  font-weight: 600;
}
.sec .ink {
  stroke: var(--ink);
  stroke-width: 1.2;
}
.m3d-box {
  position: relative;
  display: block;
  max-width: 100%;
  line-height: 0;
}
.m3d-box > img,
.m3d-box > canvas:first-child {
  display: block;
  cursor: pointer;
}
.m3d-live {
  display: block;
  touch-action: none;
  cursor: grab;
  background: var(--plate);
}
.m3d-box > [hidden],
.m3d-box > canvas[hidden] {
  display: none;
}
.m3d-live:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.m3d-live:active {
  cursor: grabbing;
}
.m3d-btn {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #c3ccd5;
  color: #5b6875;
  cursor: pointer;
  touch-action: manipulation;
}
.m3d-btn::before {
  content: "";
  position: absolute;
  inset: -8px -2px -2px -8px;
}
.m3d-btn:hover,
.m3d-btn[aria-pressed="true"] {
  border-color: #1d5fd1;
  color: #1d5fd1;
}
.m3d-btn[aria-pressed="true"] {
  background: #ffffff;
}
.m3d-btn:disabled {
  cursor: progress;
}
/* i18n: language switch and Japanese text */
.lang-switch {
  display: flex;
  flex: none;
  gap: var(--sp-15);
  margin: 0;
  font-family: var(--f-display);
  font-size: var(--step--1);
  font-weight: 600;
}
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a:hover,
.lang-switch a[aria-current] {
  color: var(--accent);
}
@media (max-width: 750px) {
  html[lang="en"] #toc-list {
    display: none;
  }
  html[lang="en"] .lang-switch {
    margin-left: auto;
  }
}
@media (max-width: 850px) {
  html[lang="it"] #toc-list {
    display: none;
  }
  html[lang="it"] .lang-switch {
    margin-left: auto;
  }
}
@media (max-width: 800px) {
  html[lang="ja"] #toc-list {
    display: none;
  }
  html[lang="ja"] .lang-switch {
    margin-left: auto;
  }
}
.lang-switch + .toc-toggle {
  margin-left: 0;
}
html[lang="ja"] {
  --f-display: "Figtree", "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-body: "IBM Plex Sans", "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}
html[lang="ja"] main :is(p, li, dd, figcaption, td) {
  line-height: var(--lh-cjk);
}
html[lang="ja"] body {
  line-break: strict;
}
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3 {
  word-break: auto-phrase;
}
html[lang="ja"] em {
  font-style: normal;
  font-weight: 600;
}
/* Pass 4: Try it questions */
.prose > details {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}
details.answer summary {
  display: inline-block;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
details.answer summary::-webkit-details-marker {
  display: none;
}
details.answer summary::before {
  content: "+ ";
}
details.answer[open] summary::before {
  content: "− ";
}
details.answer p {
  margin-top: var(--sp-1);
}
/* LEGO Grammar UI library: components and patterns (see ui.html).
   Two sizes in a tool: --ui-fs for everything, --ui-fs-value for the one value that matters.
   One row height: --ui-h. One grid: a label column, then the content column. */

:root {
  --ui-h: 2.75rem;
  --ui-fs: var(--step--1);
  --ui-fs-value: var(--step-4);
  --ui-label: 9rem;
  --ui-gap: var(--sp-1);
  --ui-row: var(--sp-2);
  --ui-sel: #e8f0fd;
  --ui-hover: #f6f8fa;
  --ui-top: 52px;
  --ui-wide: 72rem;
  --ui-r: 2px;
  --ui-shadow: 0 1px 2px rgba(23, 33, 43, 0.08), 0 1px 1px rgba(23, 33, 43, 0.04);
}

/* ---------- pattern: tool band ---------- */
.c-band {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) 0 var(--sp-5);
  font-size: var(--ui-fs);
  line-height: 1.4;
  background: var(--sheet);
  box-shadow: 0 0 0 100vmax var(--sheet);
  clip-path: inset(0 -100vmax);
}
.c-band {
  padding-inline: max(0px, calc((100% - var(--ui-wide)) / 2));
}
.c-band {
  scroll-margin-top: 3.5rem;
}
.c-band > .c-title {
  margin: 0 0 var(--sp-1);
}
.c-band > .c-intro {
  max-width: var(--col);
  margin: 0 0 var(--sp-3);
  font-size: var(--step-0);
  line-height: 1.5;
}
.c-band.filters {
  display: block;
}
.c-band.filters .count {
  display: block;
  margin-top: var(--sp-3);
}
.c-band > .grid {
  max-width: var(--col);
  font-size: var(--step-0);
  line-height: var(--lh-body);
}

/* ---------- pattern: controls, groups side by side, each label above its control ---------- */
.c-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3) var(--sp-4);
}
.c-group {
  display: grid;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  border: 0;
}
.c-group > .c-label {
  padding: 0;
}
.c-overview {
  margin-top: var(--sp-4);
}
.c-overview .c-count {
  margin: var(--sp-1) 0 0;
}

/* ---------- pattern: rows, label column then content ---------- */
.c-grid {
  display: grid;
  grid-template-columns: var(--ui-label) minmax(0, 1fr);
  column-gap: var(--sp-2);
  row-gap: var(--ui-row);
  align-items: center;
}
.c-grid > .c-label {
  min-height: var(--ui-h);
  display: flex;
  align-items: center;
}
.c-grid > .c-label.top {
  align-self: start;
}
.c-label {
  color: var(--muted);
}
@media (max-width: 640px) {
  .c-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--sp-05);
  }
  .c-grid > .c-label {
    min-height: 0;
    margin-top: var(--sp-15);
  }
}

/* ---------- component: button ---------- */
.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ui-h);
  height: var(--ui-h);
  padding: 0 var(--sp-2);
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
  cursor: pointer;
  touch-action: manipulation;
}
.c-btn:hover {
  border-color: var(--accent);
}
.c-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--ui-sel);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.c-btn.primary {
  color: var(--sheet);
  background: var(--accent);
  border-color: var(--accent);
}
.c-btn.text {
  min-width: 0;
  height: auto;
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.c-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}
.c-btn:focus-visible,
.c-tile:focus-visible,
.c-table tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- component: choice, a row of buttons, one pressed ---------- */
.c-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-gap);
}

/* ---------- component: picture tile, a choice between parts ---------- */
.c-tile {
  display: grid;
  grid-template-rows: 3rem auto;
  justify-items: center;
  align-items: end;
  row-gap: var(--sp-1);
  width: 6.5rem;
  padding: var(--sp-15) var(--sp-1) var(--sp-1);
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
  cursor: pointer;
}
.c-tile img {
  max-width: 100%;
  max-height: 3rem;
  width: auto;
  height: auto;
}
.c-tile:hover {
  border-color: var(--accent);
}
.c-tile[aria-pressed="true"] {
  color: var(--accent);
  background: var(--ui-sel);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- component: stepper ---------- */
.c-stepper {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
}
.c-value {
  font-family: var(--f-display);
  font-size: var(--ui-fs-value);
  font-weight: 600;
  line-height: var(--ui-h);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.c-stepper .c-value {
  min-width: 3.2ch;
  padding: 0 var(--sp-1);
  text-align: center;
}

/* ---------- component: number field ---------- */
.c-field {
  display: flex;
  gap: var(--ui-gap);
}
.c-field input {
  width: 6rem;
  height: var(--ui-h);
  padding: 0 var(--sp-15);
  font: inherit;
  font-family: var(--f-mono);
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: inset 0 1px 2px rgba(23, 33, 43, 0.06);
  -moz-appearance: textfield;
}
.c-field input:focus {
  border-color: var(--accent);
  outline: none;
}
.c-field input::-webkit-outer-spin-button,
.c-field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* ---------- component: histogram ---------- */
.c-strip {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: manipulation;
}
.c-strip .hit {
  fill: transparent;
}
.c-strip .bin {
  fill: var(--c-floor);
}
.c-strip .bin.on {
  fill: var(--accent);
}
.c-strip .mk {
  stroke: var(--ink);
  stroke-width: 1;
}
.c-strip .t {
  font-family: var(--f-mono);
  font-size: 11px;
  fill: var(--muted);
}

/* ---------- component: result table ---------- */
.c-table {
  width: 100%;
  min-width: 0;
  line-height: inherit;
  border-collapse: separate;
  border-spacing: 0;
  font-size: inherit;
}
.c-table th,
.c-table td {
  padding: 0 var(--sp-15) 0 0;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.c-table th {
  position: sticky;
  top: var(--ui-top);
  z-index: 1;
  height: var(--ui-h);
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
  background: var(--sheet);
}
.c-table th button {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.c-table th[aria-sort] {
  color: var(--ink);
}
.c-table th[aria-sort="ascending"] button::after {
  content: " ↑";
}
.c-table .n {
  text-align: right;
}
.c-table td.n {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.c-table td {
  height: 4rem;
  border-bottom: 1px solid var(--rule);
}
.c-table th {
  border-bottom: 1px solid var(--rule);
}
.c-table td.thumb {
  width: 6.5rem;
  padding-left: var(--sp-1);
}
.c-table td.thumb canvas {
  display: block;
}
.c-table tbody tr {
  cursor: pointer;
}
.c-table tbody tr:hover td {
  background: var(--ui-hover);
}
.c-table tbody tr[aria-selected="true"] td {
  color: var(--accent);
  background: var(--ui-sel);
}
.c-table tbody tr[aria-selected="true"] td:first-child {
  border-radius: var(--ui-r) 0 0 var(--ui-r);
  box-shadow: inset 3px 0 0 var(--accent);
}
.c-table tbody tr td:last-child {
  border-radius: 0 var(--ui-r) var(--ui-r) 0;
}
.c-table tr.c-expand td {
  height: auto;
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  white-space: normal;
  background: var(--ui-sel);
  cursor: default;
}
@media (max-width: 600px) {
  .c-table .opt {
    display: none;
  }
}

/* ---------- pattern: detail of the chosen result ---------- */
.c-detail .head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--sp-2);
}
.c-detail .head h3 {
  margin: 0;
}
.c-detail .head p {
  margin: 0;
  color: var(--muted);
}
.c-detail .iso {
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(70vw, 22rem);
  margin: var(--sp-2) 0;
}
.c-detail .side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 13rem;
  margin: var(--sp-2) 0 0;
}
.c-detail .hl {
  margin: var(--sp-1) auto 0;
  text-align: center;
  color: var(--muted);
}
.c-facts {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--sp-05) var(--sp-2);
  margin: var(--sp-2) 0 0;
}
.c-facts dt {
  color: var(--muted);
}
.c-facts dd {
  margin: 0;
}
.c-facts .c-num,
.c-detail .c-num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.c-warn {
  margin: var(--sp-2) 0 0;
  padding-left: var(--sp-15);
  border-left: 3px solid var(--warn);
}
.c-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

/* prototype: where the detail goes */
.c-results {
  margin-top: var(--sp-4);
}
@media (min-width: 1100px) {
  .c-results[data-place="beside"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--gap-wide);
    align-items: start;
  }
  .c-results[data-place="beside"] .c-detail {
    position: sticky;
    top: calc(var(--ui-top) + var(--sp-2));
  }
}
.c-results[data-place="above"] {
  display: flex;
  flex-direction: column;
}
.c-results[data-place="above"] .c-detail {
  order: -1;
  margin-bottom: var(--sp-4);
}
@media (min-width: 900px) {
  .c-results[data-place="above"] .c-detail {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    column-gap: var(--gap-wide);
    align-items: start;
  }
  .c-results[data-place="above"] .c-detail .head {
    grid-column: 1 / -1;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.prose > .c-band {
  max-width: none;
  margin: var(--sp-5) 0;
}
.c-more-row {
  margin: var(--sp-2) 0 0;
}
.c-detail .c-table.parts {
  margin-top: var(--sp-4);
}
.c-detail .c-table.parts td {
  height: auto;
  padding-top: var(--sp-05);
  padding-bottom: var(--sp-05);
  white-space: normal;
}
.c-detail .c-table.parts th {
  position: static;
}
.c-detail .c-table.parts caption {
  padding-bottom: var(--sp-1);
  text-align: left;
  color: var(--muted);
}
.c-detail .vars {
  margin-top: var(--sp-1);
}
.c-detail > .c-label {
  margin: var(--sp-3) 0 0;
}
/* the older tool rules (.solver, .lab, .filters, .stepper) are more specific than the components: inside a band the components win */
.c-band {
  border: 0;
}
.c-band .c-btn {
  min-width: var(--ui-h);
  width: auto;
  height: var(--ui-h);
  padding: 0 var(--sp-2);
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
}
.c-band .c-btn:hover {
  border-color: var(--accent);
}
.c-band .c-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--ui-sel);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.c-band .c-btn.primary {
  color: var(--sheet);
  background: var(--accent);
  border-color: var(--accent);
}
.c-band .c-btn.text {
  height: auto;
  min-width: 0;
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  box-shadow: none;
}
.c-band .c-stepper .c-btn {
  padding: 0 var(--sp-1);
}
.c-band .c-stepper .c-value {
  min-width: 3.2ch;
  padding: 0 var(--sp-1);
  font-family: var(--f-display);
  font-size: var(--ui-fs-value);
  font-weight: 600;
  line-height: var(--ui-h);
  color: var(--accent);
  white-space: nowrap;
}
.c-band .c-label {
  min-width: 0;
  flex: none;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
}
.c-band .lab-stage {
  margin-top: var(--sp-4);
}
.c-band > .c-table {
  margin-top: var(--sp-3);
}
.c-band > .c-group {
  margin-top: var(--sp-3);
}
.c-band .lab-result {
  margin-top: var(--sp-2);
}
fieldset.c-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-gap);
  min-width: 0;
}
fieldset.c-group > legend {
  margin-bottom: var(--sp-1);
  padding: 0;
}
.c-band .c-tile {
  display: grid;
  grid-template-rows: 3rem auto;
  justify-items: center;
  align-items: end;
  row-gap: var(--sp-1);
  width: auto;
  min-width: 6.5rem;
  height: auto;
  padding: var(--sp-15) var(--sp-15) var(--sp-1);
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
}
.c-band .c-tile:hover {
  border-color: var(--accent);
}
.c-band .c-tile[aria-pressed="true"] {
  color: var(--accent);
  background: var(--ui-sel);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.c-band .c-tile img {
  max-height: 3rem;
  width: auto;
}
.c-band .c-tile .sym {
  font-size: var(--step-3);
  line-height: 1;
}
.c-band .c-table td {
  height: auto;
  padding-top: var(--sp-15);
  padding-bottom: var(--sp-15);
  white-space: normal;
}
.c-band .c-table td.thumb {
  height: 4rem;
  padding-top: 0;
  padding-bottom: 0;
}
.c-table th:first-child,
.c-table td:first-child {
  padding-left: var(--sp-15);
}
.c-table td.thumb:first-child {
  padding-left: var(--sp-1);
}
.c-table td[colspan] {
  color: var(--muted);
  cursor: default;
}
/* pass 7: the shared bits on the components */
.tools {
  flex-wrap: wrap;
  gap: var(--sp-1);
  font-size: var(--ui-fs);
}
.tools button,
.tools a {
  height: var(--ui-h);
  min-height: 0;
  padding: 0 var(--sp-2);
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
  cursor: pointer;
}
.tools button:hover,
.tools a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.m3d-btn {
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
}
.m3d-btn:hover,
.m3d-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.m3d-btn[aria-pressed="true"] {
  background: var(--ui-sel);
}
/* content tables: the result-table type, a rule under each row, sticky header where the table fits */
thead th {
  font-family: inherit;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
  color: var(--muted);
  background: var(--paper);
}
thead th.n {
  font-family: inherit;
}
.tablewrap th,
.tablewrap td {
  border-bottom: 1px solid var(--rule);
}
.tablewrap.fits {
  overflow: visible;
}
.tablewrap.fits thead th {
  position: sticky;
  top: var(--ui-top);
  z-index: 1;
}
.c-band .c-table th {
  white-space: normal;
  line-height: var(--lh-compact);
}
/* the chosen build sits on one centre line: drawings, caption, facts, actions */
.c-detail .c-facts {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
/* pass 8: the chosen build as a titled panel with tabs; the side view as a blueprint */
.d-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
}
.d-head h3 {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 400;
}
.d-head .c-value {
  font-family: var(--f-display);
  font-size: var(--step-5);
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  letter-spacing: var(--track-display);
}
.d-sub {
  margin-top: var(--sp-1);
  font-size: var(--ui-fs);
  color: var(--muted);
}
.d-head .c-actions {
  margin: 0;
}
.c-tabs {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.c-tab {
  height: var(--ui-h);
  margin-bottom: -1px;
  padding: 0;
  font: inherit;
  font-size: var(--ui-fs);
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.c-tab:hover {
  color: var(--ink);
}
.c-tab[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.c-tab .c-num {
  margin-left: var(--sp-05);
  color: var(--muted);
}
.d-pane[hidden] {
  display: none;
}
.c-detail figure.side {
  flex-direction: column;
  height: auto;
  margin: var(--sp-2) 0 0;
  padding: 0;
}
.c-detail figure.side canvas {
  display: block;
  border: 1px solid rgba(29, 95, 209, 0.25);
  border-radius: var(--ui-r);
}
.c-detail figure.side .hl {
  max-width: 34rem;
  margin: var(--sp-1) auto 0;
  font-size: var(--ui-fs);
}
.c-detail .d-pane .c-table.parts {
  margin-top: var(--sp-2);
}
@media (min-width: 1100px) {
  .c-results[data-place="beside"] .f-list {
    overflow-y: auto;
  }
  .c-results[data-place="beside"] .f-list .c-table th {
    top: 0;
  }
}
/* prev and next with arrows */
.pager a {
  position: relative;
  border-radius: var(--ui-r);
  box-shadow: var(--ui-shadow);
}
.pager a.pager-prev {
  padding-left: calc(var(--sp-3) + 2.25rem);
}
.pager a.pager-next {
  padding-right: calc(var(--sp-3) + 2.25rem);
}
.pager a::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: -0.75rem;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s ease-out;
}
.pager-prev::before {
  left: var(--sp-3);
  transform: scaleX(-1);
}
.pager-next::before {
  right: var(--sp-3);
}
.pager-prev:hover::before,
.pager-prev:focus-visible::before {
  transform: scaleX(-1) translateX(4px);
}
.pager-next:hover::before,
.pager-next:focus-visible::before {
  transform: translateX(4px);
}
/* footer on the same width as the tools, with room at the sides */
footer .wrap {
  max-width: calc(var(--ui-wide) + 2 * var(--foot-g));
  padding-inline: var(--foot-g);
  --foot-g: clamp(1.5rem, 5vw, 4rem);
}
.d-head + .c-warn {
  margin-top: var(--sp-2);
}
.c-detail .d-pane .iso {
  height: min(80vw, 26rem);
  margin: var(--sp-3) 0 0;
}
.c-detail .d-pane .c-facts {
  margin-top: var(--sp-3);
}
.c-table tr.c-expand td {
  background: var(--sheet);
  box-shadow: inset 3px 0 0 var(--accent);
}
@media (max-width: 600px) {
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-next {
    grid-column: 1;
  }
}
.c-table tbody tr.c-expand:hover td {
  background: var(--sheet);
}
.c-detail .c-table.parts td.thumb {
  width: 4.5rem;
  height: 3.5rem;
  padding: var(--sp-05) var(--sp-1) var(--sp-05) 0;
}
.c-detail .c-table.parts td.thumb canvas {
  display: block;
  margin: 0 auto;
}
.c-table tr.c-expand .c-table td {
  height: auto;
  padding: var(--sp-1) var(--sp-15) var(--sp-1) 0;
  background: none;
  box-shadow: none;
}
.c-table tr.c-expand .c-table td.thumb {
  padding: var(--sp-05) var(--sp-1) var(--sp-05) 0;
}
/* top bar: menu on the left, logo in the middle, languages on the right; the menu opens full screen */
.toc > .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
#toc-list {
  display: none;
}
.toc-toggle {
  grid-row: 1;
  grid-column: 1;
  justify-self: start;
  margin: 0 0 0 calc(-1 * var(--sp-1));
}
.lang-switch + .toc-toggle {
  margin-left: calc(-1 * var(--sp-1));
}
.toc-brand {
  grid-row: 1;
  grid-column: 2;
}
.lang-switch {
  grid-row: 1;
  grid-column: 3;
  justify-self: end;
  gap: var(--sp-2);
  font-size: var(--step-0);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}
html[lang] .lang-switch {
  margin-left: 0;
}
.mega {
  position: fixed;
  top: 53px;
  bottom: 0;
  max-height: none;
  border-bottom: 0;
}
/* geometry: caption and facts take the drawing's width, with a small inset */
.d-pane[data-pane="geo"] > * {
  width: var(--geo-w, auto);
  max-width: 100%;
  margin-inline: auto;
}
.d-pane[data-pane="geo"] figure.side {
  align-items: stretch;
}
.d-pane[data-pane="geo"] figure.side .hl {
  max-width: none;
  margin: var(--sp-1) 0 0;
  padding-inline: var(--sp-15);
  text-align: left;
}
.d-pane[data-pane="geo"] .c-facts {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp-05) var(--sp-3);
  padding-inline: var(--sp-15);
  margin-top: var(--sp-2);
}
/* parts: the pieces first, as pictures with their count */
.d-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: var(--sp-2) var(--sp-1);
  margin: var(--sp-3) 0 0;
  padding: 0;
  list-style: none;
}
.d-parts li {
  position: relative;
  display: grid;
  place-items: center;
  height: 4.5rem;
}
.d-count {
  position: absolute;
  right: var(--sp-05);
  bottom: 0;
  padding: 0 0.35em;
  font-family: var(--f-mono);
  font-size: var(--step--2);
  line-height: 1.5;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.d-pane[data-pane="parts"] .c-table.parts {
  margin-top: var(--sp-3);
}
/* logo and logotype in the middle of the bar */
.toc-brand {
  gap: var(--sp-1);
  color: var(--ink);
  text-decoration: none;
}
.toc-brand::after {
  content: "LEGO Grammar";
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--step-0);
  white-space: nowrap;
}
.c-detail .d-pane[data-pane="geo"] figure.side {
  margin: var(--sp-2) auto 0;
}
.toc > .wrap {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
@media (max-width: 420px) {
  .lang-switch {
    gap: var(--sp-1);
  }
}
.c-table tr.c-expand .c-table td:first-child,
.c-table tr.c-expand .c-table th:first-child {
  padding-left: var(--sp-1);
}
/* parts: pictures or list */
.d-parts-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-2);
  margin-top: var(--sp-2);
}
.d-parts-top p {
  margin: 0;
  font-size: var(--ui-fs);
  color: var(--muted);
}
.d-view .c-btn {
  height: 2.25rem;
  font-size: var(--ui-fs);
}
.d-parts[hidden],
.c-table.parts[hidden] {
  display: none;
}
.d-pane[data-pane="parts"] .d-parts {
  margin-top: var(--sp-2);
}
.d-pane[data-pane="parts"] .c-table.parts {
  margin-top: var(--sp-1);
}
/* pictures or list: small tabs on the right of the parts caption */
.d-view {
  gap: var(--sp-2);
  align-self: stretch;
}
.c-band .d-view .c-btn {
  height: 2rem;
  min-width: 0;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
}
.c-band .d-view .c-btn:hover {
  color: var(--ink);
}
.c-band .d-view .c-btn[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.d-parts-top {
  border-bottom: 1px solid var(--rule);
}
.d-parts-top p {
  padding-bottom: var(--sp-05);
}
/* the number of parts on the tab, as a small count */
.c-tab .c-num {
  display: inline-block;
  min-width: 1.5em;
  margin-left: var(--sp-05);
  padding: 0 0.4em;
  font-family: var(--f-mono);
  font-size: var(--step--2);
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
  border-radius: 999px;
}
.c-tab[aria-selected="true"] .c-num {
  color: var(--accent);
  background: var(--ui-sel);
}
/* step through the same build with other parts, beside its number */
.d-sub {
  display: flex;
  align-items: center;
  gap: var(--sp-05);
}
.d-step {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 calc(-1 * var(--sp-05));
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--ui-r);
  cursor: pointer;
}
.d-step::before {
  content: "";
  width: 0.9rem;
  height: 0.9rem;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.d-step.prev::before {
  transform: scaleX(-1);
}
.d-step:hover {
  background: var(--ui-hover);
}
.d-step:hover::before,
.d-step:focus-visible::before {
  background: var(--accent);
}
.d-head .d-sub {
  margin-left: calc(-1 * var(--sp-05));
}
/* buttons: 4px corners; the build's actions stacked */
.c-btn,
.c-band .c-btn,
.c-band .c-tile,
.c-tile,
.tools button,
.tools a,
.m3d-btn {
  border-radius: 4px;
}
.c-band .d-view .c-btn {
  border-radius: 0;
}
.d-head .c-actions {
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-1);
  text-align: center;
}
.d-head .c-actions .c-btn.text {
  align-self: center;
}
/* a hint of depth: the lower half of each button a touch darker */
.c-btn,
.c-band .c-btn,
.c-band .c-tile,
.c-tile,
.tools button,
.tools a,
.m3d-btn {
  background-image: linear-gradient(to bottom, rgba(23, 33, 43, 0) 45%, rgba(23, 33, 43, 0.045));
}
.c-band .c-btn.primary,
.c-btn.primary {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.12));
}
.c-btn.text,
.c-band .c-btn.text,
.c-band .d-view .c-btn {
  background-image: none;
}
