/* Sheet of Pipes. Square corners everywhere; the paper is always white with ink. */
* { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 24px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--ink);
}
.mark { display: block; height: 30px; width: 132px; color: var(--c-earth); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { color: var(--c-cream); } }
[data-theme="dark"] .mark { color: var(--c-cream); }
.fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 3px; width: 136px; }
.field.wide { width: 176px; }
.field > span, .msg { font-size: 11px; letter-spacing: 0.02em; color: var(--ink-soft); }
.msg { color: var(--error); min-height: 14px; }
.field input, .field select {
  font: inherit;
  font-size: 14px;
  height: 32px;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
}
.field select option { color: #1A1A1A; background: #FFFFFF; }
.field input:focus-visible, .field select:focus-visible, .print:focus-visible { outline: 2px solid var(--c-brick); outline-offset: 1px; }
.print {
  align-self: flex-start;
  margin-top: 17px;
  height: 32px;
  padding: 0 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-fg);
  background: var(--accent);
  border: 1px solid var(--accent-fg);
  cursor: pointer;
}
.print:disabled { opacity: 0.45; cursor: default; }
.hint { margin: 12px 24px 0; font-size: 13px; }

.sheets { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; padding: 20px 24px 48px; }
.nothing { max-width: 60ch; font-size: 15px; line-height: 1.5; margin: 8px 0; }

/* The paper. Fixed mm boxes, white, ink, never themed. */
.sheet { display: block; flex: none; background: #FFFFFF; color: #1A1A1A; outline: 1px solid #1A1A1A; }
.instr {
  position: relative;
  padding: 10mm;
  font-size: 8.5pt;
  line-height: 1.35;
  overflow: hidden;
}
.instr h1 { font-family: var(--font-display); font-size: 20pt; margin: 0; letter-spacing: -0.01em; }
.instr h2 {
  font-size: 7pt;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.12em;
  margin: 5mm 0 1.5mm;
  padding-bottom: 0.8mm;
  border-bottom: 0.2mm solid #1A1A1A;
}
.instr p { margin: 0 0 1.2mm; }
.title { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 0.3mm solid #1A1A1A; padding-bottom: 3mm; }
.sub { font-size: 8pt; }
.issue { text-align: right; }
.issue p { font-size: 11pt; font-weight: 700; margin: 1.5mm 0 0; }
.kitmark { display: block; height: 7mm; width: auto; margin-left: auto; }
.cols { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8mm; }
.set { border-collapse: collapse; width: 100%; }
.set th, .set td { text-align: left; padding: 0.6mm 0; border-bottom: 0.1mm solid #1A1A1A; font-weight: 400; }
.set th { width: 40%; }
.steps { margin: 0; padding-left: 5mm; }
.steps li { margin-bottom: 1.2mm; }
.plain { margin: 0; padding: 0; list-style: none; }
.plain li { margin-bottom: 1mm; }
.cut { border-collapse: collapse; width: 100%; }
.cut th, .cut td { text-align: left; padding: 1mm 1.5mm 1mm 0; border-bottom: 0.1mm solid #1A1A1A; vertical-align: top; }
.cut th { font-size: 7pt; font-weight: 700; }
.cut th.heard { width: 48mm; }
.cut th.heard span { font-weight: 400; }
.cut td { height: 7.5mm; }
.cut td.heard { border-left: 0.1mm solid #1A1A1A; }
.foot { position: absolute; left: 10mm; right: 10mm; bottom: 10mm; font-size: 6.5pt; line-height: 1.3; }
.foot p { margin: 0; }

@media screen and (max-width: 859px) {
  .bar { padding: 14px 16px 10px; }
  .fields { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .field, .field.wide { width: auto; min-width: 0; }
  .print { grid-column: 1 / -1; margin-top: 0; }
  .hint { margin: 10px 16px 0; }
  .sheets { padding: 16px 16px 40px; gap: 12px; }
  .sheet { zoom: 0.45; }
}

@media print {
  html, body { background: #FFFFFF; }
  .bar, .hint, .nothing { display: none; }
  .sheets { display: block; padding: 0; gap: 0; }
  .sheet { outline: none; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
