/* Hallmark · macrostructure: Map / Diagram · tone: instruction booklet · theme: Cobalt adapted to wood and paper · nav: N1a · footer: Ft2
 * Audience: curious builders · use: interactive assembly · motion: assembly interpolation only
 * Pre-emit critique: Philosophy 4 · Hierarchy 4 · Execution 4 · Specificity 5 · Restraint 5 · Variety 4 */
@import url('tokens.css');
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  overflow-x: clip;
}
:root {
  --step-footer-space: 104px;
}
html {
  scroll-padding-bottom: calc(
    var(--step-footer-space) + env(safe-area-inset-bottom, 0px)
  );
}
body {
  padding-bottom: calc(
    var(--step-footer-space) + env(safe-area-inset-bottom, 0px)
  );
  color: var(--color-ink);
  background: var(--color-paper);
  font: 16px/1.55 var(--font-body);
}
button,
input {
  font: inherit;
}
button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
summary,
input[type='checkbox'],
input[type='range'] {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1,
h2 {
  font-family: var(--font-display);
  font-style: normal;
  line-height: 1.12;
  letter-spacing: -0.045em;
  min-width: 0;
  overflow-wrap: anywhere;
}
.site-header {
  min-height: 84px;
  max-width: 1440px;
  margin: auto;
  padding: 20px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--color-rule);
}
.site-header a {
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
}
.site-header .wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.8px;
}
.brand-mark {
  color: var(--color-accent);
  font-size: 36px;
  line-height: 1;
}
.header-note {
  display: none;
  color: var(--color-muted);
  font-size: 14px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  font-weight: 500;
  line-height: 1.5;
}
.index-main,
.assembly-main {
  max-width: 1320px;
  margin: auto;
  padding: 48px 24px 24px;
}
.intro {
  padding: 20px 0 48px;
}
.intro h1 {
  font-size: clamp(48px, 7vw, 88px);
  margin: 16px 0 20px;
}
.intro > p:last-child {
  color: var(--color-muted);
  font-size: 20px;
  line-height: 1.5;
}
.demo-entry {
  display: grid;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--color-rule);
}
.demo-art {
  min-width: 0;
  position: relative;
  min-height: 350px;
  background: var(--color-white);
}
.demo-art canvas {
  width: 100%;
  height: 390px;
  display: block;
}
.art-caption {
  position: absolute;
  bottom: 24px;
  inset-inline: 24px;
  text-align: center;
  font: 10px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--color-muted);
}
.demo-copy {
  padding: 32px;
  border-top: 1px solid var(--color-rule);
}
.demo-copy h2 {
  font-size: 40px;
  margin: 24px 0 20px;
}
.demo-copy > p {
  max-width: 32ch;
  color: var(--color-muted);
}
.demo-facts {
  display: flex;
  gap: 36px;
  margin: 32px 0;
}
.demo-facts dt {
  font-size: 12px;
  color: var(--color-muted);
}
.demo-facts dd {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 600;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.secondary {
  background: var(--color-white);
  color: var(--color-ink);
  border-color: var(--color-rule);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
@media (hover: hover) {
  .button:hover:not(:disabled) {
    filter: brightness(0.94);
  }
  .site-header a:hover,
  .text-button:hover {
    text-decoration: underline;
  }
  .demo-entry:hover .demo-copy h2 {
    color: var(--color-accent);
  }
}
.collection-note {
  font-size: 14px;
  color: var(--color-muted);
  padding: 28px 0;
}
.page-heading {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}
.page-heading h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin: 12px 0;
}
.name-heading button {
  display: grid;
  perspective: 600px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: start;
  max-width: 100%;
}
.name-heading button {
  inline-size: min(100%, 12ch);
  min-block-size: 1.12em;
  position: relative;
}
.name-heading button span {
  grid-area: 1 / 1;
  transition:
    transform 650ms var(--ease-in-out),
    opacity 650ms var(--ease-in-out);
  backface-visibility: hidden;
}
.name-english {
  opacity: 0;
  transform: rotateX(-80deg) translateY(8px);
}
[data-translated='true'] .name-english {
  opacity: 1;
  transform: rotateX(0) translateY(0);
}
[data-translated='true'] .name-swedish {
  opacity: 0;
  transform: rotateX(80deg) translateY(-8px);
}
.page-heading p:not(.eyebrow) {
  color: var(--color-muted);
}
.progress-summary {
  width: 190px;
  flex-shrink: 0;
  color: var(--color-muted);
  font-size: 13px;
}
progress {
  display: block;
  appearance: none;
  border: 0;
  height: 4px;
  width: 100%;
  margin-top: 12px;
  background: var(--color-rule);
}
progress::-webkit-progress-bar {
  background: var(--color-rule);
}
progress::-webkit-progress-value {
  background: var(--color-accent);
}
progress::-moz-progress-bar {
  background: var(--color-accent);
}
.workbench {
  border: 1px solid var(--color-rule);
  display: grid;
}
.drawing-panel {
  background: var(--color-white);
  min-width: 0;
}
.drawing-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  gap: 8px;
  color: var(--color-muted);
  font-size: 12px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}
.scene-wrap {
  position: relative;
  height: 585px;
}
#assembly {
  display: block;
  width: 100%;
  height: 100%;
  view-transition-name: assembly-drawing;
}
.part-label {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 166px;
  height: 64px;
  padding: 8px;
  background: var(--color-wood);
  color: var(--color-ink);
  border: 1px solid var(--color-wood-dark);
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}
.part-label strong {
  display: block;
  font-size: 13px;
  font-weight: inherit;
}
.part-label small {
  display: block;
  color: var(--color-muted);
  font-size: 11px;
}
.part-label,
.part-label * {
  text-decoration: none;
}
/* The renderer outlines the whole piece for native and fallback controls. */
.part-label:has(:focus-visible),
.cam-turn:focus-visible {
  outline: none;
}
.canvas-group {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.tabletop-label {
  width: 64px;
  height: 56px;
  padding: 8px 12px;
  gap: 0;
  justify-content: center;
}
.tabletop-label strong {
  font-size: 27px;
}
.tabletop-label small {
  font-size: 18px;
}
.tabletop-label input[type='checkbox'] {
  width: 30px;
  height: 30px;
}
.leg-label {
  width: 124px;
  height: 46px;
  padding: 4px;
  gap: 8px;
  flex-direction: row;
  justify-content: center;
  background: var(--color-wood-side);
  font-size: 17px;
}
.leg-label small {
  display: none;
}
.hardware-label[id^='label-stud-'] {
  width: 56px;
  height: 32px;
  flex-direction: row;
  padding: 0;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
}
[id^='label-stud-'] input[type='checkbox'] {
  width: 14px;
  height: 14px;
}
.leg-label strong {
  font-size: 29px;
  line-height: 1;
}
.leg-label small {
  font-size: 12px;
}
.leg-label input[type='checkbox'] {
  width: 24px;
  height: 24px;
}
.hardware-label {
  width: 24px;
  height: 38px;
  padding: 2px;
  gap: 0;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: 0;
  font-size: 11px;
}
[id^='label-cam-'] {
  width: 56px;
  height: 32px;
  padding: 0;
  gap: 0;
  flex-direction: row;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  background: transparent;
}
[id^='label-cam-'] input[type='checkbox'] {
  width: 10px;
  height: 10px;
}
.parts-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  padding: 0 16px 8px;
  font-size: 12px;
  color: var(--color-muted);
}
.scene-description {
  min-height: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
  padding: 8px 20px;
}
.assembly-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--color-rule);
  margin: 16px 24px 0;
  padding-top: 20px;
}
.scrubber {
  flex: 1;
  min-width: 140px;
}
.scrubber input {
  display: block;
  width: 100%;
  accent-color: var(--color-accent);
  height: 28px;
  margin: 0;
}
.scrubber > div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-muted);
}
.scrubber output {
  font-family: var(--font-mono);
}
.preview-note {
  text-align: center;
  font-size: 11px;
  color: var(--color-muted);
  padding: 18px 12px;
}
.guide {
  padding: 28px;
  border-top: 1px solid var(--color-rule);
  display: flex;
  flex-direction: column;
}
.step-nav {
  display: flex;
  align-items: center;
  margin: 0 0 40px;
}
.step-nav button {
  background: none;
  border: 1px solid var(--color-rule);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 14px;
}
.step-nav button[aria-current='step'] {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}
.step-nav button[data-done='true']:not([aria-current]) {
  background: var(--color-tint);
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.step-nav span {
  height: 1px;
  background: var(--color-rule);
  flex: 1;
  margin: 0 6px;
}
.step-content {
  flex: 1;
}
.step-content h2 {
  font-size: 30px;
  margin: 12px 0 16px;
}
#step-description {
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.7;
}
.instruction-note {
  margin: 24px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-block: 1px solid var(--color-rule);
  color: var(--color-ink);
  font-size: 13px;
}
.instruction-note > span {
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
}
.needed {
  margin: 20px 0 32px;
}
.needed p {
  margin-top: 8px;
  font-size: 13px;
}
.packing-list {
  margin: 0;
  padding: 24px;
  border-bottom: 1px solid var(--color-rule);
}
.packing-list h2 {
  margin: 8px 0 16px;
  font-size: 26px;
}
.packing-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.packing-list > p {
  font-size: 12px;
  color: var(--color-muted);
}
.packing-list table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.packing-list th,
.packing-list td {
  border-bottom: 1px solid var(--color-rule);
  padding: 20px 12px;
  text-align: end;
}
.packing-list th:first-child {
  text-align: start;
}
.packing-list thead {
  font-size: 11px;
  color: var(--color-muted);
}
.packing-list tbody th {
  font-weight: 500;
}
.packing-list tr[data-complete='true'] {
  color: var(--color-success);
}
.packing-list tr[data-complete='true'] output {
  font-weight: 700;
}
.packing-list #inventory-status {
  margin-top: 12px;
  min-height: 60px;
}
.packing-list[data-ready='true'] #inventory-status {
  color: var(--color-success);
  font-weight: 700;
}
.packing-list #assemble-legs,
.packing-list #manual-assembly {
  margin-top: 12px;
  width: 100%;
}
.packing-list table {
  table-layout: fixed;
}
.packing-list th:first-child {
  width: 50%;
}
.packing-list th:nth-child(2) {
  width: 18%;
}
.packing-list th:nth-child(3) {
  width: 32%;
}
.packing-list td,
.packing-list output {
  white-space: nowrap;
}
.cam-turn {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.cam-turn:disabled {
  opacity: 1;
}
.orbit-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 0;
}
.orbit-controls label {
  font-size: 12px;
}
.orbit-controls input {
  flex: 1;
  min-width: 100px;
  accent-color: var(--color-accent);
}
.orbit-controls button {
  padding: 8px 12px;
}
.manual-controls {
  margin: 20px 24px;
  padding: 20px;
  border: 1px solid var(--color-rule);
}
.manual-controls p {
  font-size: 13px;
  margin-bottom: 12px;
}
.joint-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-block: 12px;
}
.joint-selector button {
  min-height: 44px;
  padding: 8px 12px;
  background: var(--color-white);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-sm);
}
.joint-selector button[aria-pressed='true'] {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
#assembly {
  touch-action: none;
}
#assembly[data-manipulating='true'],
#assembly[data-manipulating='true'] * {
  user-select: none;
  -webkit-user-select: none;
}
.packing-list tbody th small {
  display: block;
  min-block-size: 1.5em;
  font-weight: 400;
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 4px;
}
.part-symbol {
  display: block;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--color-ink);
}
.packing-list tr[data-assembly='active'] {
  background: var(--color-tint);
  color: var(--color-accent);
}
.packing-list tr[data-assembly='connected'] {
  background: var(--color-tint);
}
.packing-list tr[data-assembly='connected'] th small {
  color: var(--color-accent);
  font-weight: 650;
}
.packing-list tr[data-assembly='connected'] th small::before {
  content: '✓ ';
}
.legend-key {
  border-top: 1px solid var(--color-rule);
  margin-top: 24px;
  padding-top: 16px;
}
.legend-key p {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  margin-bottom: 12px;
}
.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border: 1px solid var(--color-rule);
}
.legend-swatch.found {
  background: var(--color-success);
}
.legend-swatch.connecting {
  background: var(--color-accent);
}
.packing-help {
  margin-top: 20px;
}
.step-actions {
  display: flex;
  gap: 12px;
}
.step-actions > * {
  flex: 1;
  padding-inline: 12px;
}
.saved-note {
  text-align: center;
  font-size: 11px;
  margin-top: 20px;
  color: var(--color-muted);
}
.below-workbench {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 20px 0 28px;
}
.below-workbench p {
  flex: 1;
  min-width: 200px;
  font-size: 12px;
  color: var(--color-muted);
}
.text-button {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.how-it-works {
  font-size: 13px;
  border-top: 1px solid var(--color-rule);
  padding-top: 20px;
  color: var(--color-muted);
}
.how-it-works summary {
  width: fit-content;
  min-height: 44px;
}
.how-it-works p {
  max-width: 75ch;
  margin: 8px 0 16px;
}
.support-note {
  padding: 16px 20px;
  border: 1px solid var(--color-rule);
  margin-bottom: 24px;
  font-size: 14px;
}
.support-note code {
  overflow-wrap: anywhere;
}
.finished {
  padding: 28px;
  margin-top: 24px;
  background: var(--color-tint);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.finished h2 {
  font-size: 28px;
  margin: 12px 0;
}
.finished p {
  font-size: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (min-width: 640px) {
  .index-main,
  .assembly-main {
    padding-inline: 40px;
  }
  .header-note {
    display: block;
  }
  .demo-entry {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
  .demo-copy {
    border-top: 0;
    border-left: 1px solid var(--color-rule);
    padding: 44px;
  }
  .demo-art canvas {
    height: 100%;
    min-height: 450px;
  }
  .scene-wrap {
    height: 690px;
  }
  .page-heading {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
@media (min-width: 1000px) {
  .workbench {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .inventory-panel {
    grid-column: 1;
    grid-row: 1;
    border-bottom: 0;
    border-right: 1px solid var(--color-rule);
    padding: 24px 16px;
  }
  .drawing-panel {
    grid-column: 2;
    grid-row: 1;
  }
  .guide {
    grid-column: 1 / -1;
    border-top: 1px solid var(--color-rule);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    column-gap: 48px;
    align-items: start;
  }
  .step-nav {
    grid-column: 1 / -1;
    max-width: 320px;
    width: 100%;
    margin-bottom: 28px;
  }
  .step-content {
    grid-column: 1;
    grid-row: 2 / 6;
  }
  .step-actions,
  .saved-note {
    grid-column: 2;
  }
  .step-content h2 {
    margin-top: 8px;
  }
  .instruction-note {
    margin-block: 16px;
  }
  .needed {
    margin-block: 16px 0;
  }
  .scene-wrap {
    height: 780px;
  }
  .intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: end;
  }
  .intro .eyebrow {
    grid-column: 1 / -1;
  }
  .intro h1 {
    margin-bottom: 0;
  }
}
@media (max-width: 380px) {
  .site-header {
    padding-inline: 16px;
    gap: 12px;
  }
  .site-header .wordmark {
    font-size: 19px;
  }
  .site-header a {
    font-size: 12px;
  }
  .assembly-main,
  .index-main {
    padding-inline: 16px;
  }
  .guide {
    padding: 20px;
  }
  .assembly-controls {
    gap: 12px;
    margin-inline: 16px;
  }
  .scene-wrap {
    height: 525px;
  }
  .demo-copy {
    padding: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Completion changes paint, never the size or position of a packing-list row. */
.packing-list tr {
  transition:
    background-color 450ms ease,
    color 450ms ease;
}
.packing-list tr[data-complete='true'] {
  background: color-mix(in oklch, var(--color-success) 10%, transparent);
}
.packing-list tr[data-complete='true'] th {
  font-weight: 700;
}
.name-heading button span {
  white-space: nowrap;
}

/* Native controls keep their semantics; their complete 3D piece shows focus. */
#assembly[data-native='true'] .part-label:focus-within,
#assembly[data-native='true'] :focus-visible {
  outline: none;
}
.packing-list tr[data-complete='true'] {
  box-shadow: inset 0 0 0 1px
    color-mix(in oklch, var(--color-success) 65%, transparent);
  animation: group-ready 800ms ease-out;
}
@keyframes group-ready {
  from {
    box-shadow:
      inset 0 0 0 2px var(--color-success),
      0 0 16px color-mix(in oklch, var(--color-success) 25%, transparent);
  }
  to {
    box-shadow: inset 0 0 0 1px
      color-mix(in oklch, var(--color-success) 65%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .packing-list tr[data-complete='true'] {
    animation: none;
  }
}

/* Keep the drawing and its controls together within the available viewport. */
.site-header {
  min-height: 48px;
  padding: 8px 20px;
}
.site-header .wordmark {
  font-size: 19px;
}
.brand-mark {
  font-size: 26px;
}
.assembly-main {
  max-width: 1720px;
  padding: 12px 16px 24px;
  container: lab / inline-size;
}
.page-heading {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.page-heading h1 {
  font-size: clamp(26px, 3vw, 36px);
  margin: 4px 0;
}
.page-heading p:not(.eyebrow) {
  font-size: 12px;
}
.progress-summary {
  width: 150px;
  font-size: 11px;
}
.progress-summary progress {
  margin-top: 6px;
}
.workbench {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}
.drawing-panel {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: max(
    440px,
    calc(
      100dvh - 164px - var(--step-footer-space) -
        env(safe-area-inset-bottom, 0px)
    )
  );
  container: drawing / inline-size;
}
.scene-wrap {
  flex: 1 1 0;
  height: auto;
  min-height: 60px;
}
.drawing-toolbar {
  padding: 6px 12px;
  gap: 4px 12px;
  flex-wrap: wrap;
}
.drawing-toolbar > span {
  flex: 1 1 180px;
}
.drawing-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px 16px;
  padding: 0 12px 10px;
  font-size: 12px;
  color: var(--color-muted);
}
.drawing-options .toggle {
  white-space: nowrap;
  min-height: 30px;
  cursor: pointer;
}
.drawing-option-icon {
  display: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.all-checked-mark,
.some-checked-mark {
  display: none;
}
#check-all:checked + svg .all-checked-mark,
#check-all:indeterminate + svg .some-checked-mark {
  display: initial;
}
.drawing-panel > .scene-description,
.preview-note {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.parts-key {
  padding: 4px 12px;
  min-height: 26px;
}
.assembly-controls {
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0 12px;
  padding-top: 8px;
}
.assembly-controls .button,
.orbit-controls .button {
  min-height: 36px;
  padding: 6px 12px;
}
.scrubber {
  min-width: 80px;
}
.orbit-controls {
  display: grid;
  grid-template-columns: auto auto auto minmax(60px, 1fr) auto;
  gap: 8px;
  padding: 8px 12px 10px;
}
.orbit-controls input {
  min-width: 0;
  width: 100%;
}
.orbit-controls label {
  white-space: nowrap;
}
.manual-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 12px 10px;
  padding: 8px;
}
.manual-controls p {
  margin: 0;
  font-size: 11px;
}
.manual-controls > p:first-child {
  grid-column: 1 / -1;
}
.manual-controls > p:nth-child(2) {
  display: none;
}
.joint-selector {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.joint-selector button,
.manual-controls .button,
.manual-controls .text-button {
  min-height: 36px;
  padding: 6px;
  font-size: 11px;
  white-space: normal;
}
.inventory-panel {
  grid-column: auto;
  grid-row: auto;
  padding: 16px;
  border-right: 0;
  border-bottom: 1px solid var(--color-rule);
}
.packing-list h2 {
  margin: 4px 0 8px;
  font-size: 22px;
}
.packing-list th,
.packing-list td {
  padding: 8px 4px;
}
.packing-list th:first-child,
.packing-list td:first-child {
  padding-inline: 12px 6px;
}
.packing-list th:last-child,
.packing-list td:last-child {
  padding-inline: 6px 12px;
}
.packing-list th:first-child {
  width: 52%;
}
.packing-list th:nth-child(2) {
  width: 14%;
}
.packing-list th:nth-child(3) {
  width: 34%;
}
.packing-list .part-symbol {
  display: inline;
  font-size: 16px;
  margin-right: 6px;
}
.packing-list tbody th small {
  font-size: 10px;
  margin-top: 2px;
}
.packing-list #inventory-status {
  min-height: 38px;
  margin-top: 8px;
}
.packing-list #assemble-legs,
.packing-list #manual-assembly {
  min-height: 36px;
  margin-top: 8px;
  padding: 6px 10px;
}
.legend-key {
  margin-top: 12px;
  padding-top: 8px;
}
.legend-key p {
  margin-bottom: 4px;
}
.packing-help {
  margin-top: 8px;
}
.guide {
  grid-column: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px;
}
.step-nav {
  width: 100%;
  margin-bottom: 12px;
}
.step-nav button {
  width: 32px;
  height: 32px;
}
.step-content {
  min-height: 0;
}
.step-content h2 {
  font-size: 23px;
  margin: 6px 0 10px;
}
#step-title {
  scroll-margin-block: 8px;
}
#step-description {
  font-size: 13px;
  line-height: 1.5;
}
.instruction-note {
  margin: 12px 0;
  padding: 10px 0;
  font-size: 12px;
}
.needed {
  margin: 12px 0;
}
.needed p {
  font-size: 12px;
  margin-top: 4px;
}
.step-actions {
  gap: 8px;
}
.step-actions .button {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12px;
}
.saved-note {
  font-size: 10px;
  margin-top: 8px;
}
/* A body-level bar avoids the workbench container trapping fixed positioning. */
.step-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--color-paper);
  border-top: 1px solid var(--color-rule);
}
.step-footer .step-actions {
  max-width: 420px;
  margin-inline: auto 0;
}
.step-footer .step-actions .button {
  min-height: 44px;
  font-size: 14px;
}
.step-footer .saved-note {
  margin: 8px 0 0;
  font-size: 11px;
  text-align: right;
}
.screwdriver-label {
  width: 42px;
  height: 18px;
  padding: 1px 2px;
  gap: 3px;
  background: var(--color-metal-light);
  border: 0;
  font-size: 18px;
  line-height: 1;
}
.screwdriver-label input[type='checkbox'] {
  width: 12px;
  height: 12px;
}
/* Keep native checkbox semantics and keyboard focus without a visible box. */
.part-label input[type='checkbox'] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@container lab (min-width: 650px) and (max-width: 1049px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .drawing-panel {
    grid-column: 1 / -1;
  }
  .inventory-panel {
    grid-column: 1;
    grid-row: 2;
    border-bottom: 0;
    border-right: 1px solid var(--color-rule);
  }
  .guide {
    grid-column: 2;
    grid-row: 2;
    border-top: 0;
  }
}
@container lab (min-width: 1050px) {
  .workbench {
    grid-template-columns: 220px minmax(0, 1fr) 248px;
    height: max(
      440px,
      calc(
        100dvh - 164px - var(--step-footer-space) -
          env(safe-area-inset-bottom, 0px)
      )
    );
  }
  .drawing-panel {
    grid-column: 2;
    grid-row: 1;
    height: auto;
  }
  .inventory-panel {
    grid-column: 1;
    grid-row: 1;
    border-bottom: 0;
    border-right: 1px solid var(--color-rule);
    overflow-y: auto;
  }
  .inventory-panel .legend-key,
  .inventory-panel .packing-help {
    display: none;
  }
  .guide {
    grid-column: 3;
    grid-row: 1;
    border-top: 0;
    border-left: 1px solid var(--color-rule);
  }
  .guide .step-content {
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-right: 4px;
  }
}
@container drawing (max-width: 580px) {
  .drawing-options {
    gap: 8px;
  }
  .drawing-options .toggle {
    position: relative;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid var(--color-rule);
  }
  .drawing-option-icon {
    display: block;
  }
  /* Keep the real checkbox and its label in the accessibility tree. */
  .drawing-options input,
  .drawing-option-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .drawing-options .toggle:has(input:checked),
  .drawing-options .toggle:has(input:indeterminate) {
    color: var(--color-accent);
    background: var(--color-tint);
    border-color: var(--color-accent);
  }
  .drawing-options .toggle:has(input:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }
  .orbit-controls {
    grid-template-columns: auto minmax(60px, 1fr) auto auto;
  }
  .orbit-controls label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #rotate-left {
    grid-column: 1;
    grid-row: 1;
  }
  #rotation-range {
    grid-column: 2;
    grid-row: 1;
  }
  #rotate-right {
    grid-column: 3;
    grid-row: 1;
  }
  #zoom-view {
    grid-column: 4;
    grid-row: 1;
  }
}
@media (max-width: 540px) {
  .assembly-main {
    padding: 8px;
  }
  .site-header {
    padding-inline: 12px;
  }
  .page-heading {
    padding-inline: 4px;
  }
  .page-heading p:not(.eyebrow) {
    display: none;
  }
  .progress-summary {
    width: 110px;
    font-size: 10px;
  }
  .drawing-panel {
    height: max(
      410px,
      calc(
        100dvh - 140px - var(--step-footer-space) -
          env(safe-area-inset-bottom, 0px)
      )
    );
  }
  .drawing-toolbar {
    font-size: 11px;
  }
}

/* Fade checked outlines into the unchecked drawing before assembly starts. */
::view-transition-old(root),
::view-transition-new(root),
::view-transition-old(assembly-drawing),
::view-transition-new(assembly-drawing) {
  animation-duration: 240ms;
}

.sequence-comparison {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 12px 0;
  font-size: 12px;
}
.sequence-comparison [aria-current='page'] {
  font-weight: 700;
  text-decoration-thickness: 2px;
}
