/* Misregister. Page chrome on the house tokens; the label is built in millimetres. */

:root {
  --r-button: 0;
  --r-card: 0;
  --r-input: 0;
  --r-menu: 0;
  --r-control: 0;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
}

[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
}

.page { max-width: 920px; margin: 0 auto; padding: 32px 16px 72px; box-sizing: border-box; }

.masthead .wordmark { display: block; height: 36px; width: auto; margin-left: -1px; }
.masthead h1 { font-size: 26px; line-height: 1.2; font-weight: 700; margin: 20px 0 24px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }

.small-label { display: block; font-size: 14px; margin: 16px 0 6px; }
.fine { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; }

.drop {
  position: relative;
  display: block;
  border: 1px solid var(--ink);
  border-radius: var(--r-card);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
}
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; }
.drop:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.drop.over { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.drop.off { opacity: 0.4; cursor: not-allowed; }

textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  font: 15px/1.4 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--r-input);
  padding: 8px 10px;
  resize: vertical;
}
textarea.mono { font-family: var(--mono); }
textarea:disabled { opacity: 0.4; cursor: not-allowed; }
textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.status { min-height: 1.45em; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.refusal { border: 1px solid var(--error); color: var(--error); padding: 12px 14px; margin: 0 0 16px; }

#sealed { margin-top: 28px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
button {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--r-button);
  padding: 9px 16px;
  cursor: pointer;
}
button:hover, button:focus-visible { background: var(--ink); color: var(--bg); outline: none; }

.stage { position: relative; margin: 20px 0 0; overflow: hidden; }
/* Screen hairline sits outside the zoom, so it is always 1 px. */
.stage::after { content: ""; position: absolute; inset: 0; border: 1px solid #1A1A1A; pointer-events: none; }
.zoom { width: 105mm; transform-origin: 0 0; }

.compare { margin-top: 40px; }
.result { min-height: 1.45em; margin: 12px 0 0; }
.result[data-kind="match"] { color: var(--success); }
.result[data-kind="mismatch"] { color: var(--error); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.pair figure { margin: 0; }
.pair figcaption { font-size: 14px; margin-bottom: 6px; }
.mini svg { display: block; width: 100%; height: auto; border: 1px solid #1A1A1A; box-sizing: border-box; }
.offsets { border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.offsets th, .offsets td { text-align: left; padding: 3px 14px 3px 0; font-weight: 400; }
.offsets thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.offsets td { font-family: var(--mono); }
.diff { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) {
  .masthead h1 { font-size: 22px; }
  .pair { grid-template-columns: 1fr; }
}

/* The label: A6 portrait, 6 mm margins, a 93 by 136 mm content box in eight fixed blocks. */
.label {
  --key: #1A1A1A;
  position: relative;
  box-sizing: border-box;
  width: 105mm;
  height: 148mm;
  padding: 6mm;
  background: #ffffff;
  color: var(--key);
  font-family: var(--sans);
  font-size: 7.5pt;
  line-height: 1.1;
  display: grid;
  grid-template-rows: 8mm 46mm 23mm 10mm 14mm 10mm 6mm 8mm;
  grid-template-columns: 93mm;
  row-gap: calc(11mm / 7);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.label p { margin: 0; }
.block { box-sizing: border-box; min-height: 0; }
.cap { font-size: 6pt; line-height: 2.4mm; text-transform: uppercase; letter-spacing: 0.06em; }

.head { display: flex; justify-content: space-between; align-items: center; border-bottom: 0.3mm solid var(--key); }
.head img { height: 6.4mm; width: auto; display: block; margin-left: -0.3mm; }
.form { font-size: 9pt; font-weight: 700; letter-spacing: 0.04em; }

.field { position: relative; }
.field svg { display: block; width: 93mm; height: 46mm; }
.reg { position: absolute; left: 9.5mm; bottom: 0; width: 21mm; line-height: 1.15; white-space: nowrap; }

.fields { border-top: 0.15mm solid var(--key); display: grid; grid-template-rows: 2.4mm 15mm 5.3mm; }
.contents { height: 15mm; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 7.5pt; line-height: 1.1; }
.contents.small { font-size: 6pt; line-height: 1; }
.row3 { display: grid; grid-template-columns: 45mm 24mm 24mm; }
.val { font-size: 7.5pt; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }

.hash { border-top: 0.15mm solid var(--key); }
.hash .cap { line-height: 2.2mm; }
.groups { display: grid; grid-template-columns: repeat(4, 1fr); font-family: var(--mono); font-size: 9pt; line-height: 1.2; }
.grp { white-space: nowrap; }
.grp .n { font-family: var(--sans); font-size: 6pt; margin-right: 0.6mm; }

.plates table { width: 93mm; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.c-plate { width: 10mm; } .c-ink { width: 19mm; } .c-bytes { width: 13mm; } .c-x { width: 12mm; } .c-y { width: 12mm; } .c-meas { width: 27mm; }
.plates th, .plates td { box-sizing: border-box; height: 3.3mm; padding: 0 0 0.2mm; text-align: left; vertical-align: bottom; }
.plates th { font-size: 6pt; font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; border-top: 0.15mm solid var(--key); border-bottom: 0.15mm solid var(--key); }
.plates td { font-size: 7.5pt; line-height: 1.1; }
.plates td.m { font-family: var(--mono); }
.plates td.measured { border-bottom: 0.15mm solid var(--key); }
.sw { display: inline-block; width: 2mm; height: 2mm; margin-right: 1mm; vertical-align: -0.2mm; }

.rule { border-top: 0.15mm solid var(--key); padding-top: 0.15mm; }
.rule p { font-size: 6pt; line-height: 1.15; }

.scale { display: flex; align-items: center; gap: 3mm; }
.scale svg { display: block; flex: none; width: 20mm; height: 5mm; overflow: visible; }
.scale p { font-size: 6pt; line-height: 1.15; }

.copies { display: grid; grid-template-rows: 4mm 4mm; }
.copyrow { display: flex; align-items: center; }
.copyrow .cap { margin-right: 2mm; }
.box-n { font-size: 6pt; margin: 0 0.8mm 0 1.6mm; }
.box { width: 3mm; height: 3mm; box-sizing: border-box; border: 0.15mm solid var(--key); }
.note { display: flex; align-items: flex-end; }
.note .cap { line-height: 1; margin-right: 2mm; }
.note .line { flex: 1; border-bottom: 0.15mm solid var(--key); }

/* Hairline and trim marks for the A4 or Letter sheet: one SVG, lengths in mm, no viewBox, so nothing is rescaled
   when Chromium snaps the box to whole pixels. Marks are two 3 mm strokes per corner, 2 mm outside the hairline. */
.sheetmarks { display: none; position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }

@media print {
  html, body { background: #ffffff; margin: 0; padding: 0; }
  .chrome, noscript { display: none !important; }
  #sealed { margin: 0; }
  .page { max-width: none; margin: 0; padding: 0; }
  .stage { width: auto !important; height: auto !important; margin: 0 !important; overflow: visible !important; }
  .zoom { transform: none !important; }
  .stage::after { display: none; }
}
