/* Bench-mode readability tuning for iPad viewing */
.md-typeset {
  font-size: 1.05rem;
  line-height: 1.6;
}

.md-typeset table:not([class]) {
  font-size: 1rem;
}

.md-typeset h1 { font-size: 2rem; }
.md-typeset h2 { font-size: 1.6rem; }
.md-typeset h3 { font-size: 1.3rem; }

/* R5 F3 — callouts carry the safety + kit-deviation content, never smaller than body. */
.md-typeset .admonition,
.md-typeset details            { font-size: 0.95rem; }
.md-typeset .admonition-title,
.md-typeset summary            { font-size: 1rem; }

/* R5 F1/F2/F6 — wide tables: fit more, keep the row label, show there's more to the right. */
.md-typeset__table                              { padding: 0 .4rem; }
.md-typeset table:not([class])                  { font-size: 0.85rem; }
.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td               { padding: .5em .6em; }
.md-typeset table:not([class]) tbody td:first-child { position: sticky; left: 0; z-index: 1;
                                                      background: var(--md-default-bg-color); }
.md-typeset table:not([class]) thead th:first-child { position: sticky; left: 0; z-index: 2;
                                                      background: var(--md-default-bg-color); }
.md-typeset__scrollwrap {
  background:
    linear-gradient(to right, var(--md-default-bg-color) 30%, transparent) left  / 40px 100% no-repeat local,
    linear-gradient(to left,  var(--md-default-bg-color) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%,   rgba(0,0,0,.28), transparent) left  / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.28), transparent) right / 14px 100% no-repeat scroll;
}

/* R5 F11 — manual-page renders are white; stop them glaring in dark mode. */
[data-md-color-scheme="slate"] .md-typeset a.glightbox img { filter: brightness(.82) contrast(1.06); }
[data-md-color-scheme="slate"] .md-typeset a.glightbox img:hover,
[data-md-color-scheme="slate"] .md-typeset a.glightbox img:focus { filter: none; }

/* R5 F14 — 44 pt tap targets on the most-used header/footer controls. */
.md-header__button, .md-top { min-width: 44px; min-height: 44px; padding: .55rem; }

/* R5 F17 — fit more config per line in portrait without wrapping (config reads as lines, not prose). */
@media (max-width: 76.1875em) { .md-typeset pre > code { font-size: .72rem; } }

/* R6 CONVENTIONS "Source lines" — muted caption, tap it to compare with the original. */
.md-typeset p.src {
  font-size: .8rem;
  color: var(--md-default-fg-color--light);
  margin: .35rem 0 1.1rem;
}
.md-typeset p.src::before { content: "🔗 "; }

/* R6 B2 — per-step progress + resume. */
.progress-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0 0 1.2rem;
  padding: .5rem .8rem;
  border-radius: .4rem;
  background: var(--md-code-bg-color);
}
.progress-summary { font-weight: 600; font-size: .85rem; }
.progress-resume, .progress-reset {
  min-height: 44px;
  min-width: 44px;
  padding: .3rem .9rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  cursor: pointer;
}
.step-done-toggle {
  width: 22px;
  height: 22px;
  margin: 0 .6rem 0 0;
  vertical-align: middle;
}
h3.step-done { opacity: .6; text-decoration: line-through; }
.progress-badge { font-size: .8rem; opacity: .75; margin-left: .3rem; white-space: nowrap; }

/* Tabs on the iPad. Material hides .md-tabs below 76.234375em (1220px), which
 * is wider than every iPad in landscape except the 12.9" (1024, 1080, 1180 CSS
 * px) — the five-tab IA would be invisible on the bench device. Show the tab row
 * from 48em (768px) so both iPad orientations get it; phones keep the hamburger
 * drawer, where five drill-down rows are the better shape. Only the one Material
 * rule `@media screen and (max-width:76.234375em){.md-tabs{display:none}}` is
 * being overridden; the sidebar stays a drawer below 76.25em as before.
 *
 * --md-header-height is ours, not Material's (which never defines it, hence the
 * 2.4rem fallback used by .jump-bar and .step-crumbs below). Wherever the sticky
 * tab row is showing, the pinned area is header + tabs = 4.8rem — the same value
 * Material uses for .md-sidebar when the header is lifted. */
@media screen and (min-width: 48em) {
  .md-tabs { display: block; }
  :root { --md-header-height: 4.8rem; }
}

/* Pages deliberately kept out of the nav — the generated step pages and the
 * whole-chapter NN-*.md pages — mark no tab active, and Material's lifted
 * sidebar (`.md-nav--lifted` shows only the active tab's subtree) would then
 * render an empty column beside them. Drop it and let the page use the width;
 * those pages navigate by their own breadcrumb and prev/next bar. Scoped to
 * >=76.25em because below that the same element is the hamburger drawer and
 * must stay. `:has()` is Safari 15.4+/Chrome 105+; where it is missing the
 * rule is skipped and the column is merely empty, as before. */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary:not(:has(.md-nav__item--active)) { display: none; }
}

/* R6 B9 — sticky section jump bar. */
.jump-bar {
  position: sticky;
  top: var(--md-header-height, 2.4rem);
  z-index: 5;
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding: .4rem .2rem;
  margin: 0 0 1.2rem;
  background: var(--md-default-bg-color);
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  -webkit-overflow-scrolling: touch;
}
.jump-bar__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .3rem .9rem;
  border-radius: 999px;
  background: var(--md-code-bg-color);
  color: var(--md-default-fg-color);
  font-size: .8rem;
  text-decoration: none;
  white-space: nowrap;
}
.jump-bar__chip--active {
  background: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
}

/* ==========================================================================
   Step pages (generated by scripts/build_steps.py) — Prusa-style one page
   per step: big picture, short text, prev/next always reachable.
   ========================================================================== */

/* Slim sticky breadcrumb; replaces the jump bar on a step page. */
.md-typeset .step-crumbs {
  position: sticky;
  top: var(--md-header-height, 2.4rem);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .4rem;
  padding: .35rem .1rem;
  font-size: .75rem;
  color: var(--md-default-fg-color--light);
  background: var(--md-default-bg-color);
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.md-typeset .step-crumbs a { font-weight: 600; }
.md-typeset .step-crumbs__section { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-typeset .step-crumbs__counter { margin-left: auto; white-space: nowrap; }

.md-typeset .step-page h1,
.md-typeset .step-crumbs + h1 { font-size: 1.55rem; line-height: 1.2; margin: .2rem 0 .4rem; }
.md-typeset .step-counter {
  margin: 0 0 .9rem;
  font-size: .78rem;
  color: var(--md-default-fg-color--light);
}
.md-typeset .step-page-h1,
.md-typeset .step-body + * { clear: both; }

/* Figure column: the manual page first and large, everything else after. */
.md-typeset .step-figure { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.md-typeset .step-figure > p { margin: 0; flex: 0 0 calc(50% - .2rem); }
.md-typeset .step-figure > p:first-of-type { flex: 1 0 100%; }
.md-typeset .step-figure img { display: block; width: 100%; height: auto; border-radius: .2rem; }
.md-typeset img.step-figure__main { max-height: 68vh; width: auto; max-width: 100%; margin: 0 auto; }
.md-typeset img.step-figure__extra { width: 100%; max-height: 30vh; object-fit: contain; object-position: center top; }
/* A panel crop (build_steps, `{ crop="…" }`): the crop is the figure, and the
   page it was cut from stays one tap away (glightbox, zoomable). */
.md-typeset .step-figure > p:has(> a.step-figure__full) { position: relative; }
.md-typeset a.step-figure__full {
  position: absolute;
  top: .4rem;
  right: .4rem;
  padding: .45rem .8rem;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 1rem;
  background: var(--md-default-bg-color);
  box-shadow: 0 0 0 1px var(--md-default-fg-color--lightest), 0 1px 4px rgba(0, 0, 0, .15);
}
.md-typeset .step-figure__none {
  flex: 1 0 100%;
  margin: 0;
  padding: 1.6rem .8rem;
  text-align: center;
  font-size: .8rem;
  color: var(--md-default-fg-color--light);
  background: var(--md-code-bg-color);
  border: 1px dashed var(--md-default-fg-color--lighter);
  border-radius: .3rem;
}

/* Parts, as a compact list. */
.md-typeset .step-parts { margin: 0 0 .9rem; }
.md-typeset .step-parts p { margin: 0 0 .2rem; }
.md-typeset .step-parts ul { margin: 0 0 0 .2rem; padding-left: 1.1rem; }
.md-typeset .step-parts li { margin: 0; line-height: 1.45; }
/* Where a Parts / Gather item comes from (kit box, bin, hand-set source, tool),
   written by scripts/build_steps.py from scripts/parts.py; muted, never wraps
   mid-label on the iPad. */
.md-typeset .step-parts__src {
  color: var(--md-default-fg-color--light);
  font-size: .85em;
  white-space: nowrap;
}

/* "Tap to enlarge" under the manual page / panel crop (build_steps): glightbox
   opens every figure image zoomable, and nothing else says so. */
.md-typeset .step-figure > p.step-figure__hint {
  flex: 1 0 100%;
  margin: -.15rem 0 0;
  font-size: .68rem;
  line-height: 1.3;
  text-align: center;
  color: var(--md-default-fg-color--light);
}

/* Landscape / wide: text left, picture right and sticky — Prusa's split. */
@media (min-width: 50em) and (min-aspect-ratio: 1/1) {
  .md-typeset .step-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 1.4rem;
    align-items: start;
  }
  /* Clears the sticky header — plus the sticky tab row where it shows. */
  .md-typeset .step-figure { order: 2; position: sticky;
                             top: calc(var(--md-header-height, 2.4rem) + .6rem); }
  .md-typeset .step-text { order: 1; }
  .md-typeset img.step-figure__main { max-height: 56vh; }
  /* A step with a long config block (build_steps, WIDE_CODE_*): stacked, the
     picture on top and shorter, so Do, Check and the code run full width. */
  .md-typeset .step-body--wide { display: block; }
  .md-typeset .step-body--wide .step-figure { position: static; }
  .md-typeset .step-body--wide img.step-figure__main { max-height: 40vh; }
}

/* Prev / next — sticky to the bottom of the viewport, 44 pt tap targets. */
.md-typeset .step-nav {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  gap: .4rem;
  margin: 1.2rem 0 0;
  padding: .35rem 0 .5rem;
  background: var(--md-default-bg-color);
  border-top: 1px solid var(--md-default-fg-color--lightest);
}
.md-typeset .step-nav > p { flex: 1 1 0; min-width: 0; margin: 0; }
.md-typeset a.step-nav__link,
.md-typeset .step-nav__link--off {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  height: 100%;
  padding: .4rem .7rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .35rem;
  background: var(--md-code-bg-color);
  color: var(--md-default-fg-color);
  text-decoration: none;
}
.md-typeset .step-nav__link--off { opacity: .35; }
.md-typeset .step-nav__next { text-align: right; }
.md-typeset .step-nav__dir { font-size: .72rem; font-weight: 700; opacity: .8; }
.md-typeset .step-nav__label {
  font-size: .8rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Done toggle sits just above the prev/next bar. */
.md-typeset .step-done-bar { margin: 1rem 0 .2rem; }
.md-typeset .step-done-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .3rem .9rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 999px;
  background: var(--md-default-bg-color);
  cursor: pointer;
  font-size: .85rem;
}
body.step-is-done .md-typeset .step-done-label {
  background: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
  border-color: transparent;
}

/* Chapter overview. */
.md-typeset h1 + .chapter-meta { margin-top: -1.1rem; }
.md-typeset .chapter-meta { margin: 0 0 .5rem; font-size: .85rem; }
.md-typeset .chapter-actions { margin: 0 0 1.2rem; font-size: .85rem; }
.md-typeset .chapter-nav { margin: 1.4rem 0 0; font-size: .85rem; }
.md-typeset .step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: .55rem;
}
.md-typeset .step-grid > p { margin: 0; }
.md-typeset a.step-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: .4rem .45rem .5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .35rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  text-decoration: none;
  position: relative;
}
.md-typeset a.step-card:hover { border-color: var(--md-accent-fg-color); }
.md-typeset .step-card img.step-card__thumb,
.md-typeset .step-card__thumb--none {
  display: block;
  width: 100%;
  height: 6rem;
  object-fit: cover;
  object-position: center 42%;
  margin: 0 0 .3rem;
  background: var(--md-code-bg-color);
  border-radius: .2rem;
}
.md-typeset .step-card__id { font-size: .72rem; font-weight: 700; opacity: .75; }
.md-typeset .step-card__title { font-size: .8rem; line-height: 1.25; }
.md-typeset .step-card--meta { background: var(--md-code-bg-color); }
.md-typeset .step-card__tick {
  position: absolute;
  top: .3rem;
  right: .35rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 1px solid var(--md-default-fg-color--lighter);
  background: var(--md-default-bg-color);
}
.md-typeset .step-card--done { opacity: .62; }
.md-typeset .step-card--done .step-card__tick {
  background: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}
.md-typeset .step-card--done .step-card__tick::after {
  content: "✓";
  display: block;
  line-height: 1.05rem;
  text-align: center;
  font-size: .72rem;
  color: var(--md-accent-bg-color);
}

/* Plate plans: one card per plate, reusing the .step-grid rhythm at 2 columns. */
.md-typeset .plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: .75rem;
  margin: 0 0 1.2rem;
}
.md-typeset .plate-card {
  padding: .5rem .6rem .6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .35rem;
  background: var(--md-default-bg-color);
}
.md-typeset .plate-card img { border-radius: .2rem; }
.md-typeset .plate-card p { margin: .4rem 0 0; font-size: .8rem; }

/* Tonight: a segment is a link to the first step page of that segment. */
.md-typeset a.tonight-seg { color: inherit; }
.md-typeset .step-figure__note {
  flex: 1 0 100%;
  margin: .2rem 0 0;
  font-size: .75rem;
  color: var(--md-default-fg-color--light);
}

/* Action-first step pages (2026-09-06): the Do line leads, the description
   collapses under it. See docs/manual/CONVENTIONS.md § "Action-first steps
   and word budgets". Colours are theme variables, so slate follows. */
.md-typeset .step-do { margin: 0 0 .9rem; }
.md-typeset .step-do > p { font-size: 1.05rem; line-height: 1.5; margin: 0 0 .4rem; }
.md-typeset .step-do > p:last-child,
.md-typeset .step-do > ol:last-child,
.md-typeset .step-do > ul:last-child { margin-bottom: 0; }
.md-typeset .step-do > p:first-child > strong:first-child { color: var(--md-accent-fg-color); }
.md-typeset .step-do ol,
.md-typeset .step-do ul { margin: .3rem 0 .4rem; padding-left: 1.2rem; font-size: 1.05rem; }
.md-typeset .step-do li { margin: 0 0 .25rem; line-height: 1.5; }

/* Part render beside the Parts item that names its STL. */
.md-typeset img.step-parts__thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: .4rem;
  border-radius: .2rem;
  background: var(--md-code-bg-color);
}

/* "What you're looking at" — orientation only, muted and folded away. */
.md-typeset .step-text > details { margin: 0 0 .9rem; font-size: .74rem; }
.md-typeset .step-text > details,
.md-typeset .step-text > details > summary {
  border-color: var(--md-default-fg-color--lightest);
}
.md-typeset .step-text > details > summary {
  font-size: .7rem;
  font-weight: 600;
  color: var(--md-default-fg-color--light);
  background-color: var(--md-default-fg-color--lightest);
}
.md-typeset .step-text > details > summary::before {
  background-color: var(--md-default-fg-color--light);
}

/* Chapter progress (2026-09-06): the "What this chapter builds" before/after
   pair on a chapter overview, and the same after-image on that chapter's
   Checkpoint page. Images come from scripts/cad_render/render_steps.py
   --chapters. Two-up from tablet width, stacked on a phone. */
.md-typeset figure.chapter-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .5rem;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.2rem;
  text-align: left;
}
.md-typeset .chapter-progress__shot { flex: 1 1 14rem; min-width: 0; }
.md-typeset .chapter-progress p { margin: 0; }
.md-typeset .chapter-progress img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .2rem;
  background: var(--md-default-bg-color);
}
.md-typeset .chapter-progress__cap {
  display: block;
  margin-top: .2rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--md-default-fg-color--light);
}
.md-typeset .chapter-progress > figcaption {
  flex: 1 0 100%;
  margin: .1rem 0 0;
  font-size: .72rem;
  line-height: 1.4;
  text-align: left;
  color: var(--md-default-fg-color--light);
}
/* A figure with a single image (Ch 01's overview, every Checkpoint page): the
   image is a direct child, full row, capped so it does not fill a desktop. */
.md-typeset .chapter-progress > p { flex: 1 1 100%; }
.md-typeset .chapter-progress > p img { max-width: 22rem; margin: 0 auto; }

@media screen and (max-width: 44.98em) {
  .md-typeset .chapter-progress__shot { flex: 1 1 100%; }
}

/* ===========================================================================
 * R7 — the three bench widgets. All colours come from Material's palette
 * variables, so light/dark follow the theme toggle; every tap target is 44 px.
 * =========================================================================== */

/* --------------------------------------------------------- gate calculators */

.md-typeset .gate-calc {
  margin: 1.2rem 0;
  padding: .8rem .9rem 1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-left: .3rem solid var(--md-default-fg-color--lighter);
  border-radius: .4rem;
  background: var(--md-code-bg-color);
}
.md-typeset .gate-calc--pass { border-left-color: #2e7d32; }
.md-typeset .gate-calc--fail { border-left-color: #c62828; }

.gate-calc__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .6rem;
}
.gate-calc__title { font-weight: 700; font-size: .95rem; }
.gate-calc__badge {
  padding: .1rem .5rem;
  border-radius: .2rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
}
.gate-calc__badge--pass { background: #2e7d32; }
.gate-calc__badge--fail { background: #c62828; }

/* The `derive:` value (14.18's PA), beside the badge rather than in a row. */
.gate-calc__derived {
  padding: .1rem .5rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .2rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: .78rem;
  font-weight: 700;
}

/* Flex, not grid, so the control drops under the label in the narrow text
 * column of a generated step page and sits beside it on the chapter page. */
.gate-calc__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem .8rem;
  padding: .45rem 0;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}
.gate-calc__labels { flex: 1 1 11rem; min-width: 0; display: flex; flex-direction: column; }
.gate-calc__label { font-size: .88rem; }
.gate-calc__hint { font-size: .75rem; color: var(--md-default-fg-color--light); }
.gate-calc__input {
  width: 6.5rem;
  min-height: 44px;
  padding: .3rem .5rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: 1rem;
  text-align: right;
}
.gate-calc__yesno { display: flex; gap: .3rem; }
.gate-calc__yn {
  min-width: 56px;
  min-height: 44px;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  cursor: pointer;
}
.gate-calc__yn[aria-pressed="true"] {
  background: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 700;
}
/* Per-row `why?` disclosure. Material @extends .admonition onto every bare
 * <details> and .admonition-title onto its <summary>, so the box, the icon and
 * the chevron all have to be unset here to leave a plain one-line toggle. */
.md-typeset .gate-calc__why {
  flex: 1 1 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: inherit;
}
.md-typeset .gate-calc__why > summary {
  display: flex;
  align-items: center;
  min-height: 44px;                 /* same tap target as the inputs and buttons */
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--md-default-fg-color--light);
  font-size: .78rem;
  font-weight: 400;
  text-decoration: underline dotted;
  text-underline-offset: .2rem;
  cursor: pointer;
  list-style: none;
}
.md-typeset .gate-calc__why > summary::before,
.md-typeset .gate-calc__why > summary::after { content: none; display: none; }
.md-typeset .gate-calc__why > summary::-webkit-details-marker { display: none; }
.md-typeset .gate-calc__why[open] > summary { color: var(--md-default-fg-color); }
.md-typeset .gate-calc__why-text {
  margin: 0 0 .5rem;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

.md-typeset .gate-calc__advice {
  flex: 1 1 100%;
  margin: .2rem 0 0;
  font-size: .8rem;
  color: var(--md-default-fg-color);
}
.gate-calc__row--fail .gate-calc__label { font-weight: 700; }
.gate-calc__row--fail .gate-calc__input { border-color: #c62828; }
.gate-calc__row:not(.gate-calc__row--fail) .gate-calc__advice { display: none; }

.gate-calc__actions {
  display: flex;
  gap: .5rem;
  margin-top: .7rem;
  padding-top: .6rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}
.gate-calc__check, .gate-calc__clear {
  min-height: 44px;
  padding: .3rem 1.1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  cursor: pointer;
}
.gate-calc__check {
  background: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 700;
}
.md-typeset .gate-calc__note,
.md-typeset .gate-calc__nojs {
  margin: .6rem 0 0;
  font-size: .82rem;
  color: var(--md-default-fg-color--light);
}
.md-typeset .gate-calc__note:empty { display: none; }

/* ----------------------------------------------- troubleshooting tap-through */

.md-typeset .tap-tree {
  margin: 1.2rem 0 1.6rem;
  padding: .8rem .9rem 1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .4rem;
  background: var(--md-code-bg-color);
}
/* The rendered list stays in the DOM (search indexes it, and it is the no-JS
 * fallback); taptree.js hides it only once the cards are up. The selector has
 * to out-specify Material's own `.md-typeset ul:not([hidden])`, which is (0,2,1). */
.md-typeset .tap-tree ul.tap-tree__source,
.md-typeset .tap-tree ol.tap-tree__source { display: none; }

.tap-tree__crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .7rem;
  font-size: .8rem;
}
.tap-tree__crumb {
  min-height: 34px;
  padding: .15rem .45rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: var(--md-typeset-a-color);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tap-tree__crumb:last-of-type { color: var(--md-default-fg-color); font-weight: 700; }
.tap-tree__sep { color: var(--md-default-fg-color--light); }
.tap-tree__back {
  min-height: 34px;
  margin-left: auto;
  padding: .15rem .7rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .25rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  cursor: pointer;
}

.tap-tree__cards { display: flex; flex-direction: column; gap: .4rem; }
.tap-card {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 48px;
  padding: .55rem .8rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .35rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: .92rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.tap-card:hover, .tap-card:focus { border-color: var(--md-primary-fg-color); }
.tap-card__label { flex: 1; }
.tap-card__more { color: var(--md-default-fg-color--light); font-size: 1.2rem; }

.md-typeset .tap-tree__leaf {
  margin-top: .3rem;
  padding: .7rem .9rem;
  border-left: .25rem solid var(--md-primary-fg-color);
  border-radius: .25rem;
  background: var(--md-default-bg-color);
}
.md-typeset .tap-tree__leaf > :first-child { margin-top: 0; }
.md-typeset .tap-tree__leaf > :last-child { margin-bottom: 0; }

/* ------------------------------------------------- Home: the printer that grows */

.md-typeset .build-progress {
  margin: 1rem 0 1.4rem;
  padding: .8rem .9rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .4rem;
  background: var(--md-code-bg-color);
}
.md-typeset .build-progress__img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin: 0 auto .5rem;
  border-radius: .3rem;
}
.md-typeset .build-progress__caption {
  margin: 0;
  font-size: .88rem;
  font-weight: 700;
  text-align: center;
}
.md-typeset .build-progress__counts {
  margin: .25rem 0 0;
  font-size: .8rem;
  color: var(--md-default-fg-color--light);
  text-align: center;
}
.md-typeset .build-progress__counts:empty { display: none; }

/* ------------------------------------------------------------- plate board */

.plate-board__head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .5rem 0 .6rem;
  background: var(--md-default-bg-color);
}
.md-typeset .plate-board__summary {
  margin: 0;
  font-size: .9rem;
  font-weight: 700;
}
.plate-board__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .7rem;
}
.plate-tile {
  display: flex;
  gap: .6rem;
  padding: .55rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .4rem;
  background: var(--md-default-bg-color);
}
.plate-tile--next { border-color: var(--md-primary-fg-color); border-width: 2px; }
.plate-tile--next .plate-tile__id::after {
  content: " next";
  color: var(--md-primary-fg-color);
  font-weight: 700;
}
.plate-tile--printed .plate-tile__thumb,
.plate-tile--printed .plate-tile__body > :not(.plate-tile__milestone) { opacity: .62; }  /* the milestone stays full strength */
.plate-tile__thumb { flex: 0 0 72px; }
.md-typeset .plate-tile__thumb img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: .25rem;
  background: #fff;
}
.plate-tile__body { flex: 1; min-width: 0; }
.plate-tile__head { display: flex; align-items: center; gap: .4rem; }
.plate-tile__id { font-weight: 700; font-size: .9rem; }
.plate-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 50%;
}
.plate-swatch--black { background: #2b2b2b; }
.plate-swatch--blue  { background: #2f6fd0; }
/* B11, Jet Black PETG V0: a ring so it reads apart from Galaxy Black ASA at tile size */
.plate-swatch--petg  { background: #1a1a1a; box-shadow: inset 0 0 0 2px #e0a100; }
.plate-tile__slot {
  margin-left: auto;
  padding: .05rem .4rem;
  border-radius: .2rem;
  background: var(--md-code-bg-color);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.plate-tile__slot--overnight { color: var(--md-primary-fg-color); font-weight: 700; }
.md-typeset .plate-tile__batch { display: block; font-size: .8rem; }
.md-typeset .plate-tile__meta,
.md-typeset .plate-tile__note {
  margin: .15rem 0 0;
  font-size: .76rem;
  color: var(--md-default-fg-color--light);
}
.plate-tile__toggles { display: flex; gap: .35rem; margin-top: .4rem; }
.plate-tile__toggle {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: .3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.plate-tile__toggle[aria-pressed="true"] {
  background: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 700;
}

/* Helper track (with a helper) — 2026-09-14 */
.md-typeset .step-helper {
  margin: .4rem 0 .6rem;
  padding: .35rem .6rem;
  border-left: 3px solid var(--md-accent-fg-color);
  background: var(--md-code-bg-color);
  border-radius: .15rem;
  font-size: .85rem;
}
.md-typeset .step-helper__label {
  font-weight: 700;
  margin-right: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .7rem;
  color: var(--md-accent-fg-color);
}
.md-typeset .step-helper-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: 0 .45rem;
  border-radius: .6rem;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.5;
  background: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
  vertical-align: middle;
}
.md-typeset .step-card--helper { outline: 2px solid var(--md-accent-fg-color); outline-offset: -2px; }
/* Tile badges (build_steps.render_overview), top left, clear of the tick. */
.md-typeset .step-card__badges {
  position: absolute; top: .3rem; left: .3rem;
  max-width: calc(100% - 2.2rem);
  display: flex; flex-wrap: wrap; gap: .2rem;
}
.md-typeset .step-card__helper,
.md-typeset .step-card__prekit {
  padding: 0 .35rem; border-radius: .5rem;
  font-size: .62rem; font-weight: 600;
  background: var(--md-accent-fg-color); color: var(--md-accent-bg-color);
}
/* pre-kit: work that needs no Voron part, from the `(pre-kit)` Pause tags.
   Outlined, so it never reads as the helper badge. */
.md-typeset .step-card__prekit,
.md-typeset .step-prekit-badge {
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  box-shadow: inset 0 0 0 1px var(--md-default-fg-color--light);
}
.md-typeset .step-prekit-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: 0 .45rem;
  border-radius: .6rem;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
}
.md-typeset .step-helper-list { font-size: .85rem; color: var(--md-default-fg-color--light); }

/* ==========================================================================
 * The raven (docs/manual/assets/mascot/STYLE.md)
 *
 * Sizing lives here and nowhere else: no inline width/height styling, no CSS
 * filters, no re-colouring. The files are square 512s, so every <img> carries
 * matching width/height attributes and nothing shifts as they load. All of them
 * reference the SVG (never the preview PNG) through <img>, which still runs the
 * animations inside the file.
 * ========================================================================== */

/* Inline badge — an admonition TITLE row, a generated Helper line, a heading.
 * Never inside a budgeted Do / Check / Tip / ⚠ text run. */
.md-typeset img.mascot-badge {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin: 0 .3rem 0 0;
  vertical-align: middle;
  flex: 0 0 auto;
}

/* Where a badge is present it *replaces* Material's pictogram rather than
 * standing beside it. Browsers without :has() simply show both — redundant,
 * never broken. */
.md-typeset .admonition-title:has(> img.mascot-badge),
.md-typeset summary:has(> img.mascot-badge) { padding-left: .6rem; }
.md-typeset .admonition-title:has(> img.mascot-badge)::before,
.md-typeset summary:has(> img.mascot-badge)::before { display: none; }

/* Panel — the gate verdicts, the plate-board header, the printable sheets. */
.md-typeset img.mascot-panel {
  display: block;
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
}

/* Scene — a captioned figure; floats beside the text on a wide screen and
 * stacks on a phone. 220 px is the ceiling STYLE.md's detail survives. */
.md-typeset .mascot-scene {
  max-width: 220px;
  margin: .6rem auto 1rem;
  text-align: center;
}
.md-typeset .mascot-scene img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}
.md-typeset .mascot-scene figcaption {
  margin: .3rem 0 0;
  font-size: .8rem;
  line-height: 1.35;
  color: var(--md-default-fg-color--light);
}

@media screen and (min-width: 45em) {
  .md-typeset .mascot-scene--right { float: right; clear: right; margin: .2rem 0 .9rem 1.2rem; }
  .md-typeset .mascot-scene--left  { float: left;  clear: left;  margin: .2rem 1.2rem .9rem 0; }
  /* A float must not run past the section it illustrates, nor out of the step
   * text column (which is already its own formatting context in the two-column
   * step layout, but not in the stacked one). */
  .md-typeset .mascot-scene ~ h2,
  .md-typeset .mascot-scene ~ h3,
  .md-typeset .mascot-scene ~ hr,
  .md-typeset .mascot-scene ~ .step-nav,
  .md-typeset .mascot-scene ~ .chapter-nav { clear: both; }
  .md-typeset .step-text:has(> .mascot-scene),
  .md-typeset .step-do:has(> .mascot-scene) { display: flow-root; }
}

/* Checkpoint reward (build_steps + mascot.reward_html): the pass scene,
 * centred under the checklist, never floated beside it. */
.md-typeset .checkpoint-reward { clear: both; margin: 1.4rem 0 .8rem; }
.md-typeset .checkpoint-reward .mascot-scene { float: none; max-width: 24rem; margin: 0 auto; }
.md-typeset .checkpoint-reward .mascot-scene img { width: 220px; max-width: 100%; }
.md-typeset .checkpoint-reward figcaption,
.md-typeset .checkpoint-reward--text {
  font-size: .85rem;
  font-weight: 600;
  color: var(--md-default-fg-color);
  text-align: center;
}

/* Home: the front-view bird beside the title. boards.js swaps the <img> for the
 * same file inlined with `.wave` so it says hello once; until then, and without
 * JS, the <img> stands and idles. */
.md-typeset .mascot-hero-wrap {
  float: right;
  margin: 0 0 .6rem 1.2rem;
  line-height: 0;
}
.md-typeset .mascot-hero-wrap > svg,
.md-typeset img.mascot-hero {
  display: block;
  width: 200px;
  height: auto;
}
.md-typeset .mascot-hero-wrap + h1 { clear: none; }
@media screen and (max-width: 44.99em) {
  .md-typeset .mascot-hero-wrap { float: none; margin: 0 auto .4rem; width: 128px; }
  .md-typeset .mascot-hero-wrap > svg,
  .md-typeset img.mascot-hero { width: 128px; }
}

/* Gate verdicts — nothing until the calculator has one. */
.gate-calc__head img.gate-calc__mascot { margin-left: auto; }

/* Home's growing printer, before anything is ticked. */
.md-typeset img.build-progress__img--mascot { width: 140px; height: auto; max-height: none; }

/* Plate board: the bird in the sticky header, a badge on the next plate. */
.plate-board__head { display: flex; align-items: center; gap: .6rem; }
/* 72, not the panel's 96: this header is `position: sticky`, and a 96 px bird
 * eats a sixth of an iPad's viewport on every scroll. */
.plate-board__head img.plate-board__mascot { width: 72px; height: 72px; }
.plate-tile__head img.plate-tile__mascot { width: 28px; height: 28px; margin-right: .2rem; }

/* Print: the bird never costs ink. print.css hides every image by default, but
 * the sheets that matter (bin labels, plate plans) are printed with
 * `.print-images` on so their QR codes and plate diagrams survive — and that
 * rule would bring the raven back with them. !important, because print.css may
 * load after this file. */
@media print {
  .md-typeset img.mascot-badge,
  .md-typeset img.mascot-panel,
  .md-typeset img.mascot-hero,
  .md-typeset .mascot-scene,
  .md-typeset .mascot-hero-wrap { display: none !important; }
}

/* Bin labels (docs/print/bin-labels.md, scripts/build_printables.py _label_html). On screen: one
 * card per bin. On paper: two labels per US Letter sheet (`.bin-sheet`, its own named page with no
 * margin), each a 5.5 × 8.5 in half with a dashed cut line between them, and inside each half a
 * 200 × 130 mm frame (`.bin-label__frame`) that is the trim line: trimmed, it slides into an A5
 * mesh bag (148 × 210 mm). Everything on the label sits inside that frame. */
.md-typeset .bin-sheet { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.md-typeset .bin-sheet__cut { display: none; }
.md-typeset .bin-label { scroll-margin-top: 4rem; }
.md-typeset .bin-label__frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "id qr" "bag qr" "what qr" "contents contents";
  gap: .35rem 1rem;
  padding: .7rem .9rem .8rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-left: .5rem solid var(--bin-colour, #888);
  border-radius: .2rem;
}
.md-typeset .bin-label p { margin: 0; }
.md-typeset .bin-label__id {
  grid-area: id; font-size: 1.9rem; font-weight: 800; line-height: 1.05;
  letter-spacing: -.01em; overflow-wrap: anywhere;
}
.md-typeset .bin-label__bag { grid-area: bag; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; }
.md-typeset .bin-label__bag strong {
  font-size: 1rem; text-transform: uppercase; letter-spacing: .03em;
  border: 2px solid currentColor; border-radius: .25rem; padding: .05rem .45rem;
}
.md-typeset .bin-label__bag--box strong { background: var(--md-default-fg-color); color: var(--md-default-bg-color); border-color: var(--md-default-fg-color); }
.md-typeset .bin-label__bag span,
.md-typeset .bin-label__steps,
.md-typeset .bin-label__from,
.md-typeset .bin-label__note { color: var(--md-default-fg-color--light); }
.md-typeset .bin-label__bag span { font-size: .68rem; }
.md-typeset .bin-label__what { grid-area: what; }
.md-typeset .bin-label__name { font-weight: 700; font-size: .9rem; }
.md-typeset .bin-label__steps { font-size: .7rem; }
.md-typeset .bin-label__qr { grid-area: qr; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .6rem; }
/* White ground under the black modules, so the code still scans in the dark scheme. */
.md-typeset img.bin-label__qr-img { width: 6.5rem; height: 6.5rem; background: #fff; padding: .2rem; border-radius: .15rem; }
.md-typeset .bin-label__contents { grid-area: contents; min-width: 0; }
.md-typeset .bin-label__contains { font-size: .72rem; margin-bottom: .15rem; }
/* Parts as tiles: a picture (scripts/render_label_thumbs.py) beside the name, ×qty and plate id. */
.md-typeset ul.bin-label__parts {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .4rem .8rem;
}
.md-typeset ul.bin-label__parts li { margin: 0; display: flex; gap: .45rem; align-items: center; min-width: 0; }
.md-typeset img.bin-label__part-img {
  flex: none; width: 3.2rem; height: 3.2rem; max-width: none; object-fit: contain; background: #fff;
  border: 1px solid var(--md-default-fg-color--lightest); border-radius: .2rem; padding: .1rem;
}
.md-typeset .bin-label__part-text { display: flex; flex-direction: column; min-width: 0; font-size: .68rem; line-height: 1.25; }
.md-typeset .bin-label__part-name { overflow-wrap: anywhere; font-weight: 600; }
.md-typeset .bin-label__part-name code { font-family: inherit; font-size: 1em; padding: 0; background: none; font-weight: inherit; }
.md-typeset .bin-label__note { font-style: italic; }
/* Fallback parts (slicer/bins.py FALLBACK_PARTS): a dashed picture frame and a sentence under the
 * tiles; bought parts (BOUGHT_PARTS): one line, no picture. Neither counts as a piece. */
.md-typeset ul.bin-label__parts li.bin-label__part--cond img.bin-label__part-img { border-style: dashed; opacity: .8; }
.md-typeset .bin-label__cond,
.md-typeset .bin-label__bought { font-size: .68rem; line-height: 1.3; margin-top: .4rem; }
.md-typeset .bin-label__cond { font-style: italic; }
.md-typeset .bin-label__cond code, .md-typeset .bin-label__bought code { font-family: inherit; font-size: 1em; padding: 0; background: none; font-style: normal; font-weight: 600; }
.md-typeset .bag-index__extra { display: block; font-size: .62rem; line-height: 1.2; color: var(--md-default-fg-color--light); }
@media screen and (max-width: 44.99em) {
  .md-typeset .bin-label__frame { padding: .6rem .7rem; gap: .3rem .7rem; }
  .md-typeset .bin-label__id { font-size: 1.5rem; }
  .md-typeset img.bin-label__qr-img { width: 4.5rem; height: 4.5rem; }
  .md-typeset ul.bin-label__parts { grid-template-columns: 1fr; }
}

/* The bag and box index (docs/print/bin-labels.md, build_printables.py build_bag_index_markdown).
 * One row per container. The table scrolls inside its own wrapper on a phone. The chips differ in
 * shape and fill, not only colour: A5 outlined, B5 solid, BOX dashed with square corners. */
.md-typeset .bag-index__scroll { overflow-x: auto; max-width: 100%; margin: 1rem 0; }
.md-typeset table.bag-index__table { display: table; width: 100%; min-width: 36rem; margin: 0; font-size: .72rem;
  border-collapse: collapse; table-layout: fixed; }
.md-typeset .bag-index__table th { white-space: nowrap; font-size: .66rem; text-align: left; padding: .45rem .3rem; }
.md-typeset .bag-index__table td { padding: .4rem .3rem; vertical-align: middle; }
.md-typeset .bag-index__table th:nth-child(1), .md-typeset .bag-index__table th:nth-child(2) { text-align: center; width: 2rem; }
.md-typeset .bag-index__table th:nth-child(3) { width: 7.2rem; }
.md-typeset .bag-index__table th:nth-child(4) { width: 2.9rem; }
.md-typeset .bag-index__table th:nth-child(5) { width: 10.8rem; }
.md-typeset .bag-index__table th:nth-child(6) { width: 4.3rem; }
.md-typeset .bag-index__table th:nth-child(7) { width: 5.4rem; }
.md-typeset .bag-index__table th:nth-child(8) { width: 2.1rem; text-align: right; }
.md-typeset .bag-index__tick { text-align: center; }
.md-typeset .bag-index__intro { font-size: .8rem; }
.md-typeset .bag-index__box { display: inline-block; vertical-align: middle; width: 1.1rem; height: 1.1rem;
  border: 2px solid var(--md-default-fg-color--light); border-radius: .15rem; }
.md-typeset .bag-index__id a { font-weight: 700; font-size: .78rem; border-bottom: 3px solid var(--bin-colour); }
.md-typeset .bag-index__of { display: block; font-weight: 600; font-size: .68rem; }
.md-typeset .bag-index__name { display: block; color: var(--md-default-fg-color--light); font-size: .66rem; line-height: 1.25; }
.md-typeset .bag-index__chip { display: inline-block; min-width: 2.6rem; text-align: center; font-weight: 800; font-size: .72rem;
  letter-spacing: .03em; padding: .1rem .35rem; border: 2px solid var(--md-default-fg-color); border-radius: .6rem; }
.md-typeset .bag-index__chip--b5 { background: var(--md-default-fg-color); color: var(--md-default-bg-color); }
.md-typeset .bag-index__chip--box { border-style: dashed; border-radius: 0; border-width: 3px; }
.md-typeset .bag-index__chip--other { border-style: dotted; border-radius: .2rem; font-size: .62rem; min-width: 0; }
.md-typeset .bag-index__pics { display: flex; align-items: center; gap: .1rem; flex-wrap: nowrap; }
.md-typeset .bag-index__pics img { height: 7mm; width: auto; max-width: 9mm; object-fit: contain; flex: none; background: #fff; border-radius: .1rem; }
.md-typeset .bag-index__more { font-size: .64rem; color: var(--md-default-fg-color--light); white-space: nowrap; margin-left: .15rem; }
.md-typeset .bag-index__n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.md-typeset .bag-index__pagepad, .md-typeset .bag-index__rehead { display: none; }
.md-typeset .bag-index__other ul { list-style: none; margin: 0; padding: 0; }
.md-typeset .bag-index__other li { margin: .35rem 0; }
.md-typeset .bag-index__other h3 { margin: 1rem 0 .3rem; }

@media print {
  @page bin-labels { size: 8.5in 11in; margin: 0; }
  /* The map and the gauge after the labels. The document is laid out at the first page's
   * width (the label sheets' full 8.5 in), so these get their own page with known margins and a
   * width that fits inside them, or their right edge is cut off. */
  /* Chromium lays the whole document out at the narrowest page's content width, so a margin here
   * would shrink the 8.5 in label sheets to fit it (to 88 %). The map and gauge pages therefore also
   * have no page margin; their 0.5 in inset is padding on the content instead. */
  @page bin-labels-rest { size: 8.5in 11in; margin: 0; }
  .md-content__inner:has(.bin-sheet) > :not(.bin-sheet) {
    page: bin-labels-rest; box-sizing: border-box; max-width: none; padding-inline: .5in;
  }
  .md-content__inner:has(.bin-sheet) > h2 { padding-top: .5in; }

  /* The label page prints edge to edge: no content padding, no title, no intro, and none of
   * Material's zero-height body children, which would otherwise open a blank first page before
   * the first named `bin-labels` page. */
  body:has(.bin-sheet) > :not(.md-container) { display: none !important; }
  .md-content__inner:has(.bin-sheet) { margin: 0 !important; padding: 0 !important; }
  .md-content__inner:has(.bin-sheet)::before { display: none !important; }
  .md-content__inner:has(.bin-sheet) > h1,
  .md-typeset .bin-labels-intro { display: none !important; }

  .md-typeset .bin-sheet {
    page: bin-labels;
    display: block; position: relative;
    width: 8.5in; height: 11in; margin: 0; overflow: hidden;
    break-after: page; page-break-after: always; break-inside: avoid;
  }
  .md-typeset .bin-label {
    position: absolute; left: 0; width: 8.5in; height: 5.5in;
    display: flex; align-items: center; justify-content: center;
  }
  .md-typeset .bin-label:first-child { top: 0; }
  .md-typeset .bin-sheet__cut + .bin-label { top: 5.5in; }
  .md-typeset .bin-sheet__cut {
    display: block; position: absolute; left: 0; right: 0; top: 5.5in; height: 0;
    border-top: .3mm dashed #000;
  }
  .md-typeset .bin-sheet__cut span {
    position: absolute; left: 6mm; top: -2mm; padding: 0 1.5mm;
    background: #fff; color: #000; font-size: 3mm; line-height: 4mm;
  }
  .md-typeset .bin-label__frame {
    box-sizing: border-box; width: 200mm; height: 130mm; overflow: hidden;
    grid-template-columns: minmax(0, 1fr) 36mm;
    grid-template-rows: auto auto auto 1fr;
    gap: 2.2mm 5mm; padding: 5mm 6mm 4mm 7mm;
    border: .3mm solid #888; border-left: 4mm solid var(--bin-colour, #888); border-radius: 0;
    color: #000; background: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .md-typeset .bin-label__id { font-size: 15mm; }
  .md-typeset .bin-label__bag { gap: 1mm 3mm; }
  .md-typeset .bin-label__bag strong { font-size: 6.5mm; border-width: .6mm; border-radius: 1.2mm; padding: .4mm 2.2mm; }
  .md-typeset .bin-label__bag--box strong { background: #000; color: #fff; border-color: #000; }
  .md-typeset .bin-label__bag span { font-size: 3mm; }
  .md-typeset .bin-label__name { font-size: 5.6mm; line-height: 1.2; }
  .md-typeset .bin-label__steps { font-size: 3.5mm; line-height: 1.25; }
  .md-typeset .bin-label__bag span,
  .md-typeset .bin-label__steps,
  .md-typeset .bin-label__from,
  .md-typeset .bin-label__note { color: #333; }
  .md-typeset .bin-label__qr { font-size: 2.6mm; gap: .8mm; align-self: start; }
  /* print.css hides every image unless .print-images is on; the QR is the label's link. */
  .md-typeset img.bin-label__qr-img {
    display: block !important; width: 34mm !important; height: 34mm !important;
    max-width: none !important; padding: 0; background: #fff;
  }
  .md-typeset .bin-label__contents { align-self: start; }
  .md-typeset .bin-label__contains { font-size: 4mm; margin-bottom: 1mm; }
  /* Part tiles: picture + name/qty/plate. Four size tiers by tile count (build_printables._tier):
   * 14 / 12 / 10 / 8 mm pictures in 3 / 3 / 4 / 5 columns; the frame is 182 mm of content wide. */
  .md-typeset ul.bin-label__parts {
    display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--rgap) 3mm;
  }
  .md-typeset ul.bin-label__parts li { gap: 1.6mm; }
  /* print.css hides every image unless .print-images is on; these are the label's content. */
  .md-typeset img.bin-label__part-img {
    display: block !important; width: var(--pic) !important; height: var(--pic) !important;
    max-width: none !important; padding: 0; border: .2mm solid #bbb; border-radius: .6mm; background: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .md-typeset .bin-label__part-text { font-size: var(--fs); line-height: 1.2; }
  .md-typeset .bin-label__part-name { font-weight: 700; }
  .md-typeset .bin-label__part-name code { font-family: inherit; font-weight: inherit; }
  .md-typeset .bin-label__note { font-size: .9em; }
  .md-typeset ul.bin-label__parts--t1 { --cols: 3; --pic: 20mm; --fs: 3.6mm; --rgap: 2.4mm; }
  .md-typeset ul.bin-label__parts--t2 { --cols: 3; --pic: 15mm; --fs: 3.4mm; --rgap: 1.8mm; }
  .md-typeset ul.bin-label__parts--t3 { --cols: 4; --pic: 12mm; --fs: 2.9mm; --rgap: 1.6mm; }
  .md-typeset ul.bin-label__parts--t4 { --cols: 5; --pic: 10mm; --fs: 2.6mm; --rgap: 1.2mm; }
  .md-typeset .bin-label code { font-size: 1em; padding: 0; background: none; color: #000; }
  .md-typeset ul.bin-label__parts li.bin-label__part--cond img.bin-label__part-img { border: .4mm dashed #555 !important; }
  .md-typeset .bin-label__cond,
  .md-typeset .bin-label__bought { font-size: 3.3mm; line-height: 1.25; margin-top: 2mm; color: #000; }

  /* The bag and box index: up to two pages after the labels, one row per container. */
  .md-typeset .bag-index__scroll { margin: 0; overflow: visible; }
  .md-typeset .bag-index__intro { font-size: 8.5pt; line-height: 1.3; }
  .md-typeset .bag-index__intro p { margin: 0 0 2mm; }
  /* The table must fit the 7.5 in content width, or Chromium shrinks the whole document (the label
   * sheets with it) to fit: no screen min-width, and the columns in mm (190 mm in all). */
  .md-typeset table.bag-index__table { display: table; width: 100%; min-width: 0; font-size: 10pt;
    break-inside: auto; page-break-inside: auto; border: 0;
    box-shadow: none; table-layout: fixed; }
  .md-typeset .bag-index__table th { font-size: 8.5pt; color: #000; background: #fff; border-bottom: .4mm solid #000;
    padding: 1.2mm 1.2mm; text-align: left; }
  .md-typeset .bag-index__table td { padding: .35mm 1.2mm; color: #000; border-top: .2mm solid #777; }
  .md-typeset .bag-index__table thead { display: table-row-group; }   /* no repeat: the pagepad row insets page 2 */
  .md-typeset .bag-index__table th:nth-child(1), .md-typeset .bag-index__table th:nth-child(2) { width: 10mm; }
  .md-typeset .bag-index__table th:nth-child(3) { width: 40mm; }
  .md-typeset .bag-index__table th:nth-child(4) { width: 14mm; }
  .md-typeset .bag-index__table th:nth-child(5) { width: 53mm; }
  .md-typeset .bag-index__table th:nth-child(6) { width: 24mm; }
  .md-typeset .bag-index__table th:nth-child(7) { width: 25mm; }
  .md-typeset .bag-index__table th:nth-child(8) { width: 12mm; }
  .md-typeset .bag-index__table th, .md-typeset .bag-index__table td { padding-inline: 1mm; }
  .md-typeset .bag-index__row { break-inside: avoid; }
  .md-typeset .bag-index__row td:nth-child(7) { white-space: nowrap; }
  .md-typeset .bag-index__pagepad { display: table-row; break-before: page; page-break-before: always; }
  .md-typeset .bag-index__pagepad td { height: .5in; padding: 0; border: 0; }
  .md-typeset .bag-index__rehead { display: table-row; }
  .md-typeset .bag-index__box { width: 5mm; height: 5mm; border: .5mm solid #000; }
  .md-typeset .bag-index__id a { color: #000; }
  .md-typeset .bag-index__name, .md-typeset .bag-index__of { color: #222; font-size: 6.8pt; line-height: 1.15; }
  .md-typeset .bag-index__of { display: inline; margin-left: 1.5mm; }
  .md-typeset .bag-index__id a { border-bottom-width: 2px; line-height: 1.2; }
  /* print.css hides every image unless .print-images is on; the part pictures are the point here. */
  .md-typeset .bag-index__pics img { display: block !important; height: 7mm; width: auto; max-width: 7.5mm;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .md-typeset .bag-index__pics { gap: .4mm; }
  .md-typeset .bag-index__more { margin-left: .5mm; }
  .md-typeset .bag-index__more { font-size: 8pt; color: #000; }
  .md-typeset .bag-index__extra { font-size: 6.8pt; color: #222; margin-top: .3mm; }
  .md-typeset .bag-index__chip { border-width: .5mm; font-size: 10pt; min-width: 11mm; }
  .md-typeset .bag-index__chip--b5 { background: #000; color: #fff; border-color: #000; }
  .md-typeset .bag-index__other { padding-bottom: .3in; break-inside: avoid; }
  .md-typeset .bag-index__other h3 { margin: 3mm 0 1.5mm; }
  .md-typeset .bag-index__other li { margin: .8mm 0; }
  .md-typeset .bag-index__other li { font-size: 8.5pt; line-height: 1.3; }
  .md-typeset .bag-index__chip--other { background: #fff; color: #000; margin: 0 1mm; padding: .3mm 1.5mm; }
}
}
