:root {
  color-scheme: light;
  --paper: #f4f1e8;
  --card: #fffdf7;
  --ink: #202732;
  --muted: #505b6b;
  --line: #627084;
  --accent: #294f79;
  --button: #294f79;
  --button-ink: #ffffff;
  --wash: #e7edf1;
  --shade: #101820;
  --diagram-paper: #ece6d6;
  --diagram-frame: #8f8a7c;
  --diagram-faint: #948e80;
  --diagram-white: #ffffff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161c25;
  --card: #202936;
  --ink: #f4f1e8;
  --muted: #c0cad6;
  --line: #a7b5c6;
  --accent: #b1cde9;
  --button: #b1cde9;
  --button-ink: #172633;
  --wash: #2b394c;
  --shade: #101820;
  --diagram-paper: #b9b2a2;
  --diagram-frame: #6b7a8f;
  --diagram-faint: #706b5e;
  --diagram-white: #e4e1d9;
}
*, *::before, *::after {
  box-sizing: border-box;
}
html {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
}
[hidden] {
  display: none !important;
}
button, input, select, textarea {
  font: inherit;
}
:where(button) {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: .25rem;
  padding: .55rem .85rem;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
a {
  color: var(--accent);
  text-underline-offset: .2em;
}
p {
  margin: 0 0 1rem;
}
.external-link-icon {
  font-size: 1.1em;
  line-height: 1;
}
.related-tool-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  min-height: 44px;
  max-width: 100%;
  margin: .2rem 0 1rem;
  border: 1px solid var(--accent);
  border-radius: .25rem;
  padding: .55rem .85rem;
  background: var(--card);
  font-weight: 600;
  overflow-wrap: anywhere;
}
h1, h2, h3 {
  line-height: 1.35;
  overflow-wrap: anywhere;
}
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 3.25rem);
  letter-spacing: -.045em;
  text-align: center;
}
h1 span {
  color: var(--accent);
}
h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -.02em;
}
h3 {
  margin: 0 0 .6rem;
  font-size: 1.1rem;
}
.skip-link {
  position: absolute;
  top: -10rem;
  z-index: 10;
  padding: .75rem;
  background: var(--card);
}
.skip-link:focus {
  top: .5rem;
}
.page-header {
  padding: 0 0 1.25rem;
}
.masthead {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1rem;
  padding: 0 0 1.25rem;
  border-bottom: 2px solid var(--ink);
}
.brand {
  min-width: 0;
  max-width: 100%;
  text-align: center;
}
.tagline {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .9375rem;
}
.header-tools {
  display: flex;
  align-self: flex-end;
  gap: .5rem;
}
.icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  font-weight: 700;
}
.privacy {
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  margin-bottom: 1.25rem;
}
.tabs button {
  min-width: 0;
  padding: .65rem .35rem;
  font-size: .875rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.tabs button[aria-selected="true"] {
  border-color: var(--button);
  background: var(--button);
  color: var(--button-ink);
  font-weight: 700;
}
.panel {
  position: relative;
  min-width: 0;
  padding: 1.25rem 1rem;
  border: 1px solid var(--line);
  background: var(--card);
}
.panel::before, .panel::after {
  position: absolute;
  width: .65rem;
  height: .65rem;
  border: solid var(--ink);
  content: "";
  pointer-events: none;
}
.panel::before {
  top: -.35rem;
  left: -.35rem;
  border-width: 1px 0 0 1px;
}
.panel::after {
  right: -.35rem;
  bottom: -.35rem;
  border-width: 0 1px 1px 0;
}
.panel-heading {
  max-width: 46rem;
}
.eyebrow {
  margin: 0 0 .6rem;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .045em;
}
.lead {
  max-width: 65ch;
}
.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.steps li {
  min-width: 0;
  font-size: .875rem;
  font-weight: 600;
}
.steps a {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  gap: .5rem;
  color: var(--ink);
  text-decoration: none;
}
.steps a:hover .step-label {
  text-decoration: underline;
}
.step-label {
  min-width: 0;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}
.steps a[aria-current="step"] {
  font-weight: 700;
}
.steps a[aria-current="step"] .step-number {
  border-color: var(--button);
  background: var(--button);
  color: var(--button-ink);
}
.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 1.8rem;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  font-family: ui-monospace, monospace;
  color: var(--accent);
}
.preparation-grid {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.preparation {
  min-width: 0;
}
.preparation p {
  margin-bottom: 0;
  color: var(--muted);
}
.start-grid {
  margin-bottom: 0;
}
.notice {
  margin: 1.5rem 0 0;
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background: var(--wash);
  overflow-wrap: anywhere;
}
.note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .875rem;
}
.reading-list {
  display: grid;
  gap: 1rem;
  padding-left: 1.5rem;
}
.work-section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.work-section:last-of-type {
  padding-bottom: 0;
}
.form-grid {
  display: grid;
  align-items: start;
  gap: 1rem;
}
.form-grid > *, .stack {
  min-width: 0;
}
.form-grid label:not(.choice), .stack {
  display: grid;
  gap: .45rem;
  font-weight: 600;
}
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: .2rem;
  padding: .6rem;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
}
textarea {
  resize: vertical;
}
.threshold-choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.threshold-choice legend {
  margin-bottom: .25rem;
  padding: 0;
  font-weight: 600;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  min-height: 44px;
  padding: .5rem 0;
  cursor: pointer;
}
.choice input:is([type="radio"], [type="checkbox"]) {
  flex: 0 0 1.125rem;
  width: 1.125rem;
  height: 1.125rem;
  margin: .2rem 0 0;
  accent-color: var(--accent);
}
.choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}
summary {
  min-height: 44px;
  padding: .6rem 0;
  color: var(--accent);
  cursor: pointer;
}
details .note {
  margin-top: .4rem;
}
.settings-grid {
  margin-top: 1.5rem;
}
.button-primary {
  border-color: var(--button);
  background: var(--button);
  color: var(--button-ink);
  font-weight: 700;
}
.button-secondary {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
button:disabled {
  border-style: dashed;
  cursor: not-allowed;
}
/* A notice about what to do next: accent color and a frame, not the gray of supplementary notes, and never red. */
.requirement {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: .75rem 0 0;
  padding: .7rem .85rem;
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: .25rem;
  background: var(--wash);
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.requirement-icon {
  display: grid;
  flex: 0 0 1.4rem;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: .1rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 700 .85rem/1 Georgia, "Times New Roman", serif;
}
.requirement a {
  color: var(--accent);
}
.button-primary:disabled {
  border-color: var(--line);
  background: var(--card);
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.test-confirm {
  margin-top: .75rem;
}
.sheet-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.test-group {
  margin-top: 1.25rem;
}
.test-group-title {
  margin: 0;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.test-group .sheet-cards {
  margin-top: .75rem;
}
.sheet-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow-wrap: anywhere;
}
.sheet-symbol {
  margin: 0 0 .3rem;
  color: var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 2.5rem;
  line-height: 1.1;
}
.sheet-title {
  margin-bottom: .5rem;
  font-weight: 700;
}
.sheet-card .note {
  margin: .4rem 0 .8rem;
}
.sheet-card button {
  width: 100%;
}
.test-value {
  font-size: .875rem;
  font-family: ui-monospace, monospace;
}
.input-error {
  color: var(--ink);
  font-weight: 700;
}
.print-checks {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
}
.print-guidance {
  margin-top: 1.5rem;
}
.camera-actions {
  margin-top: 1.5rem;
}
.reader-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.reader-section > summary {
  min-height: 44px;
  padding: .85rem 0;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}
.reader-section > summary::marker {
  color: var(--accent);
}
.reader-section[open] > summary {
  margin-bottom: 1rem;
}
.overlay-steps li {
  padding-left: .25rem;
  margin-bottom: 1.25rem;
}
.overlay-steps strong {
  display: block;
  line-height: 1.6;
}
.overlay-steps p {
  margin: .35rem 0 0;
}
.step-figure {
  max-width: 38rem;
  margin-top: .9rem;
}
.step-figure:empty {
  display: none;
}
.step-figure figcaption p {
  margin: 0;
}
.step-figure figcaption strong {
  margin-bottom: .6rem;
}
/* The step list's item spacing must not leak into a diagram's legend inside a step. */
.overlay-steps .diagram-legend li {
  margin-bottom: 0;
  padding-left: 0;
}
/* Navigation (another tab or another place on the page) looks like a link with an arrow, not like an action button. */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-link > span:first-child {
  text-decoration: underline;
  text-underline-offset: .2em;
}
.nav-link:hover > span:first-child {
  text-decoration-thickness: 2px;
}
.diagram-legend {
  margin: .8rem 0 0;
  padding-left: 1.4rem;
}
.diagram-legend li + li {
  margin-top: .6rem;
}
.camera-view {
  max-width: 48rem;
  margin: 1rem 0;
  border: 1px solid var(--line);
  background: var(--shade);
}
video {
  display: block;
  width: 100%;
  max-height: 65dvh;
  object-fit: contain;
}
.magnifier {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}
.magnifier canvas {
  flex: 0 0 160px;
  width: 160px;
  height: 160px;
  border: 1px solid var(--line);
}
.magnifier p {
  flex: 1 1 12rem;
  min-width: 0;
}
#manual-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  touch-action: manipulation;
  cursor: crosshair;
}
.read-result, .diagnostic {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
}
.read-mask {
  font-size: 1.8rem;
  letter-spacing: .2em;
}
pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  padding: 1rem;
  border: 1px solid var(--line);
}
.diagnostic p {
  overflow-wrap: anywhere;
}
.diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
/* One inner spacing for every diagram frame: the same padding on all four sides and the same gap
   between the diagram and its caption, whether they are stacked or side by side. */
.instruction-figure {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
}
/* Diagrams sit on a slightly muted paper-colored mat with a thin frame in both themes.
   Only the mat uses that color; white inside the drawn samples is white (slightly dimmed in the dark theme). */
.instruction-figure svg {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  margin: 0 auto;
  padding: .5rem;
  border: 1px solid var(--diagram-frame);
  border-radius: .25rem;
  background: var(--diagram-paper);
}
.paper {
  fill: var(--diagram-paper);
}
.sample-white {
  fill: var(--diagram-white);
}
.sample-white-stroke {
  stroke: var(--diagram-white);
}
.faint {
  fill: var(--diagram-faint);
}
/* Adjacent black cells must not show a hairline seam of paper between them. */
.instruction-figure rect, .six-patterns rect {
  shape-rendering: crispEdges;
}
figcaption {
  min-width: 0;
}
figcaption strong {
  display: block;
  margin-bottom: .6rem;
}
figcaption p {
  margin: 0;
}
.six-patterns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  max-width: 24rem;
  padding: .75rem;
  border: 1px solid var(--diagram-frame);
  border-radius: .25rem;
  background: var(--diagram-paper);
}
.six-patterns svg {
  max-width: 100%;
  height: auto;
}
.table-frame {
  max-width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
}
th, td {
  padding: .75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
thead {
  background: var(--wash);
}
progress {
  width: 100%;
  accent-color: var(--accent);
}
[role="status"]:empty, .sheet-cards:empty, .test-groups:empty {
  display: none;
}
#print-root {
  display: none;
}
.print-sheet {
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}
.print-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.page-footer {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.5rem 0 .5rem;
  color: var(--muted);
  font-size: .875rem;
}
.page-footer p {
  margin: 0;
}
.page-footer a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
}
dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop {
  background: var(--shade);
  opacity: .75;
}
.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.help-header h2 {
  min-width: 0;
  margin: 0;
  font-size: 1.35rem;
}
.help-header button {
  flex-shrink: 0;
}
.help-content {
  max-height: calc(100dvh - 9rem);
  overflow-y: auto;
  padding: 1rem;
}
.help-content .help-intro-term {
  white-space: nowrap;
}
.help-content h3 {
  margin-top: 1.5rem;
}
.help-content li + li {
  margin-top: .75rem;
}
@media (min-width: 40rem) {
  body {
    padding: 1.5rem 2rem;
  }
  .panel {
    padding: 2rem;
  }
  .tabs button {
    font-size: 1rem;
  }
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .preparation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .diagram-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .step-figure .instruction-figure, .alignment-figure {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    align-items: center;
  }
  .alignment-figure {
    grid-column: 1 / -1;
  }
  .page-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
@media (min-width: 60rem) {
  .masthead {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
  }
  .masthead .brand {
    grid-column: 2;
  }
  .header-tools {
    justify-self: end;
    align-self: center;
  }
}
@media (hover: hover) {
  :where(button:hover) {
    background: var(--wash);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@page {
  size: A4;
  margin: 0;
}
@media print {
  html, body {
    width: 210mm;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
  }
  body > :not(#print-root) {
    display: none !important;
  }
  #print-root {
    display: block;
    width: 210mm;
    margin: 0;
    padding: 0;
  }
  .print-sheet {
    display: none;
    margin: 0;
    padding: 0;
    border: 0;
  }
  body[data-print-sheet] .print-sheet[data-selected="true"] {
    display: block;
  }
}
