/* Fonts: the PDF's type is outlined, so faces are matched by eye.
   Squared condensed body sans 400 -> Saira Semi Condensed 400;
   squared heading sans (headings, contact line), regular -> Saira 400;
   light geometric "User's Manual" cover line -> Saira 300.
   The "MINIMAL 1 Loop BOX" display face ships as the wordmark image. */
@import url("https://fonts.googleapis.com/css2?family=Saira:wght@300;400&family=Saira+Semi+Condensed:wght@400&display=swap");

:root {
  --ink: #1a1a1a;    /* body text */
  /* the grey number badges (#7f7f7f in print), darkened to 4.5:1 under white numerals */
  --accent: #767676;
  --rule: #c9c9c9;   /* hairlines */
  --paper: #f1f1f1;  /* tint behind callouts */
  --muted: #5e5e5e;
  --link: #1a1a1a;
  --body-font: "Saira Semi Condensed", system-ui, sans-serif;
  --head-font: "Saira", system-ui, sans-serif;
}

/* ---- structure: keep as is, restyle below the brand line ---- */

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

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--head-font); line-height: 1.2; }

main { margin-left: 20vw; padding-bottom: 3em; }
footer { margin-left: 20vw; padding: 1.6em 3em; }

a { color: var(--link); }

img { max-width: 100%; height: auto; margin-bottom: 0.75em; }
.topic > img, li > img, figure > img { display: block; }
figure { margin: 0 0 1em; }

/* NAV */
#side-nav {
  position: fixed; top: 0; left: 0;
  width: 20vw; height: 100%;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--rule);
  z-index: 5;
}
.nav-container { display: flex; flex-direction: column; margin: 1.5em 1em; }
#side-nav h4, #side-nav h5 { font-weight: 400; margin-bottom: 0.45em; }
#side-nav h4 { font-weight: 700; }
#side-nav h5 { font-size: 0.9em; margin-left: 1em; }
#side-nav a, #toc-mobile a { color: inherit; text-decoration: none; }
#side-nav a:hover, #toc-mobile a:hover { text-decoration: underline; }

/* SECTIONS */
section + section { margin-top: 3em; }
.flex-container { display: flex; padding-left: 2em; }
/* A container has no intrinsic width: a half-container sized by its
   content (width: auto) collapses to 0 unless it sets container-type: normal. */
.half-container { width: 100%; padding: 0 1em; container-type: inline-size; }
.half-container > header { column-span: all; }
.flow > * + * { margin-bottom: 1em; }

/* One .topic per heading carries the columns, so no column runs taller than
   one topic. 63rem below = the two-column threshold of `columns: 2 30rem`. */
.topic { columns: 2 30rem; column-gap: 3em; }
.no-columns { columns: auto !important; }
/* a heading stands above everything it introduces */
:not(.topic-group) > .topic > .keep-together:first-child > :is(h3, h4):first-child,
:not(.topic-group) > .topic > :is(h3, h4):first-child { column-span: all; }
/* topics the source sets on one page share its columns, each whole in one */
.topic-group { columns: 2 30rem; column-gap: 3em; }
.topic-group > .topic { columns: auto; break-inside: avoid; }
/* the right column's first heading loses its margin at the break; so does the left's */
.topic-group > .topic:first-child,
.topic-group > .topic:first-child > :is(h3, h4):first-child,
.topic-group > .topic:first-child > .keep-together:first-child > :is(h3, h4):first-child { margin-top: 0; }

/* COLUMN BREAKS. A paragraph, list item, figure, table or callout is never
   cut by the gutter. Chrome's balancer drops `break-after: avoid` when it
   gets in the way, so it is only a hint: what keeps a heading off a column's
   foot is a .keep-together holding the heading and its first block. */
p, li, figure, table, .table-scroll, .keep-together, .callout, .grid-wrapper {
  break-inside: avoid;
}
h2, h3, h4, h5, h6 { break-after: avoid; }
/* a lead-in ending in ":" stays with what it introduces */
:has(+ p > .menu-path:only-child) { break-after: avoid; }
@container (min-width: 63rem) {
  .column-end { break-after: column; }
}

/* Figure rows: the max stays indefinite, or auto-fit counts its tracks off
   it and stacks one figure per row in a narrow column. */
.grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8em, 100%), 1fr));
  gap: 1em;
}
.grid-wrapper img { width: 100%; }

/* TABLES */
.table-scroll { overflow-x: auto; margin-bottom: 1em; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.doc-table th, .doc-table td {
  padding: 0.4em 0.6em;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--rule);
}
.doc-table thead th { background: var(--accent); color: #fff; }

.callout {
  background: var(--paper);
  border-left: 4px solid var(--accent);
  padding: 0.7em 1em;
  margin-bottom: 1em;
}
.callout > :last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .flex-container { flex-direction: column; padding-left: 0; }
  .half-container { padding: 0 1em; }
  nav { display: none; }
  main, footer { margin: 0 auto; }
  footer { padding: 1.6em 1em; }
  #toc-mobile { display: block; }
  /* a diagram with small labels scrolls instead of shrinking */
  .wide-figure { overflow-x: auto; }
  .wide-figure img { min-width: 700px; }
}
/* 901, not 900: at exactly 900px both queries match and the mobile TOC
   would vanish together with the nav */
@media (min-width: 901px) { #toc-mobile { display: none; } }

/* ---- brand: masthead, heading treatment, callouts, from this manual ---- */

body { font-size: 1.05rem; }

/* MASTHEAD: the cover is white, title centred; the manual has no photo,
   so the maker's top-view shot sits beside the title */
#masthead { padding: 3em 0 1.5em; }
#masthead .flex-container { align-items: center; justify-content: center; gap: 4em; }
/* sized to the wordmark so the photo sits beside the title, not at the far edge */
#masthead .cover-title { flex: 0 1 32rem; text-align: center; }
.cover-manual {
  font-family: var(--head-font);
  font-weight: 300;
  font-size: 2.2em;
  letter-spacing: 0.04em;
  margin-bottom: 0.4em;
}
#masthead h1 { margin: 0 auto; max-width: 30rem; }
#masthead h1 img { display: block; width: 100%; margin: 0; }
#masthead .cover-photo-col {
  flex: 0 0 auto;
  width: auto;
  container-type: normal;
}
.cover-photo { display: block; height: 22rem; width: auto; margin: 0 auto; }

/* HEADINGS: plain bold sans, no rules or caps, as printed */
h1, h2, h3, h4, h5, h6, #side-nav h4 { font-weight: 400; }
h2 { font-size: 1.6em; margin-bottom: 0.6em; text-wrap: balance; }
/* printed as a lead line over the address, smaller than a section heading */
h2#contact { font-size: 1.35em; }

/* the "*" bullets of the uses list */
.star-list { list-style-type: "*\00a0"; padding-left: 1.1em; }
.star-list > li { margin-bottom: 0.8em; }

/* PANEL: diagram on the left, a legend beside it: number and name in one
   column, what the part does in the next, a hairline between parts */
.panel-layout {
  display: grid;
  grid-template-columns: minmax(14em, 20em) 1fr;
  gap: 2em 4.5em;
  align-items: start;
  container-type: inline-size;
}
.panel-layout > figure img { width: 100%; }
.parts-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 2em;
  max-width: 46em;
  margin: 0;
}
.parts-list > dt, .parts-list > dd {
  margin: 0;
  padding: 0.6em 0;
  border-top: 1px solid var(--rule);
}
.parts-list > dt { display: flex; gap: 0.9em; letter-spacing: 0.03em; }
/* the grey square number badges, one text line tall so the name and the
   description's first line share a baseline */
.part-no {
  flex: none;
  width: 1.6em;
  height: 1.6em;
  line-height: 1.6em;
  text-align: center;
  background: var(--accent);
  color: #fff;
}
/* too narrow for two columns: the description goes under the name */
@container (max-width: 52em) {
  .parts-list { grid-template-columns: minmax(0, 1fr); }
  .parts-list > dt { padding-bottom: 0.2em; }
  .parts-list > dd { border-top: 0; padding-top: 0; padding-left: 2.5em; }
}

/* SPECIFICATIONS: plain label/value lines, no rules in print */
.spec-table { border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 0.15em 1em 0.15em 0; text-align: left; vertical-align: top; }
.spec-table th { font-weight: 400; white-space: nowrap; }

.topic-group > .topic { margin-bottom: 1.5em; }
.topic-group h2 { margin-top: 0; }
.contact-lines p { margin-bottom: 0; }

#toc-mobile ul { list-style: none; padding-left: 0; }
#toc-mobile li { margin-bottom: 0.4em; }

footer { color: var(--muted); font-size: 0.85em; border-top: 1px solid var(--rule); }

@media (max-width: 900px) {
  #masthead .flex-container { gap: 1em; }
  /* in the stacked column a flex-basis would set its height */
  #masthead .cover-title { flex: none; }
  .cover-photo { height: 16rem; }
  .panel-layout { grid-template-columns: 1fr; }
  .panel-layout > figure { max-width: 20em; margin: 0 auto; }
}
