/* The page frame, which every machine here declares for itself. Without it the
   column runs the full width of a desktop window against the 640px the rest
   hold, and the lede measures past WCAG 1.4.8's 80 characters. */
* { margin: 0; padding: 0; box-sizing: border-box; }

main.bit {
  max-width: var(--la-measure);
  margin: 0 auto;
  padding: 3rem 1.25rem 3rem;
}

/* The measure belongs to the column, not to every block inside it. */
main.bit p, main.bit ul, main.bit ol, main.bit dl,
main.bit h1, main.bit h2 { max-width: none; }

/* Without this the browser paints a dark canvas from color-scheme, so the page
   LOOKS right in a screenshot while having no background colour at all. */
body {
  font-family: var(--la-font-ui);
  background: var(--la-page);
  color: var(--la-ink);
  line-height: var(--la-leading-body);
  -webkit-font-smoothing: antialiased;
}

/* Bresenham. The grid is the machine, so it is drawn at real proportions:
   one square per mesh point, square, with the chosen ones filled. */
.br-step, .br-wrap { margin: var(--la-space-3) 0; }

.br-grid {
  display: grid;
  grid-template-columns: repeat(var(--br-cols, 18), minmax(0, 1fr));
  gap: 1px;
  margin: var(--la-space-3) 0;
  max-width: 32rem;
}

.br-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--la-hairline);
  border-radius: 1px;
}

.br-cell[data-on="flat"] { background: var(--br-accent, #5cb8b0); border-color: var(--br-accent, #5cb8b0); }
/* A step up is the decision the error term made, so it is marked differently
   from a step along: the two are the only choices the algorithm ever has. */
.br-cell[data-on="up"] { background: var(--la-ink); border-color: var(--la-ink); }

.br-controls { display: flex; gap: var(--la-space-3); align-items: center; flex-wrap: wrap; }
.br-label { color: var(--la-ink-dim); }

.br-controls input[type="number"] {
  font-family: ui-monospace, "DejaVu Sans Mono", monospace;
  min-height: 2.75rem;
  min-width: 5rem;
  padding: 0 var(--la-space-2);
  background: var(--la-surface, transparent);
  color: var(--la-ink);
  border: 1px solid var(--la-hairline-strong, var(--la-hairline));
  border-radius: var(--la-radius, 4px);
}

.br-read { color: var(--la-ink-dim); min-height: 2.6em; }
.br-wrap [hidden] { display: none !important; }

/* The verification table. Every machine here prints what it claimed and what
   it measured; these five shipped computing their claims and displaying none
   of them, because the engines had verify() and the pages had no table with
   data-la-verify for the shared component to fill. la-verify.js was loaded,
   found nothing to attach to, and did nothing, quietly. */
.br-checks { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

.br-checks th, .br-checks td {
  text-align: left;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--la-hairline);
  vertical-align: top;
}

.br-checks th[scope="row"] { font-weight: 400; color: var(--la-ink-dim); }

.br-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
