/* Race. The accent marks one thing only: an ordering that loses an update,
   which is the whole subject. Everything else stays in the neutral instrument
   greys so the marked rows are the only thing that pulls the eye. */

:root { --accent: #ff9944; }

/* The reading column, and the box model.
 *
 * Leaving these out is invisible in a screenshot: the browser paints a dark
 * canvas from color-scheme, so the page looks right while its column runs the
 * full width of a desktop window against the measure every other machine
 * holds. There is a gate for it, and it caught all five of these at once. */
* { margin: 0; padding: 0; box-sizing: border-box; }

main.nibble {
  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.nibble p, main.nibble ul, main.nibble ol, main.nibble dl,
main.nibble h1, main.nibble h2 { max-width: none; }

/* Leaving this out is invisible: the browser paints a dark canvas from
   color-scheme, so the page LOOKS right in a screenshot while having no
   background colour at all, and a contrast checker then measures against
   white and is correct to fail it. Seventy-nine violations per page, on
   five pages, from one missing declaration. */
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;
}


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

.rc-steplabel {
  margin: var(--la-space-5) 0 var(--la-space-2);
  font-weight: 600;
  color: var(--la-ink);
}

.rc-stepno {
  display: inline-block;
  min-width: 1.6rem;
  margin-right: 0.5rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--la-hairline-strong);
  border-radius: 999px;
  font-family: var(--la-font-mono);
  font-size: var(--la-text-xs);
  color: var(--la-ink-dim);
  text-align: center;
}

.rc-hint {
  margin: 0 0 var(--la-space-3);
  color: var(--la-ink-dim);
}

.rc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--la-space-2);
  margin: var(--la-space-3) 0;
}

.rc-btn {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius-sm, 4px);
  background: var(--la-raised);
  color: var(--la-ink);
  font-family: var(--la-font-mono);
  font-size: var(--la-text-sm);
  cursor: pointer;
}

.rc-btn:hover { border-color: var(--accent); }
.rc-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.rc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- the tables --------------------------------------------------------- */

.rc-orders,
.rc-trace {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--la-text-sm);
}

.rc-orders th,
.rc-orders td,
.rc-trace th,
.rc-trace td {
  text-align: left;
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--la-hairline);
}

.rc-orders thead th,
.rc-trace thead th {
  font-size: var(--la-text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--la-ink-dim);
  font-weight: 600;
}

.rc-orders tbody th,
.rc-orders td,
.rc-trace tbody th,
.rc-trace td {
  font-family: var(--la-font-mono);
  font-size: 0.8rem;
  color: var(--la-ink-dim);
  font-weight: 400;
}

.rc-order { letter-spacing: 0.22em; }

/* An ordering that loses an update. Carried by the word in the last column and
   by a rule down the side as well as by colour, so it survives forced colours
   and a monochrome print. */
.rc-orders tr[data-lost="yes"] td:last-child { color: var(--accent); }
.rc-orders tr[data-lost="yes"] th {
  border-left: 3px solid var(--accent);
  padding-left: 0.45rem;
}
.rc-orders tr[data-chosen="yes"] { background: var(--la-raised); }

.rc-pick {
  min-width: 2.2rem;
  min-height: 1.9rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius-sm, 4px);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.rc-pick:hover { border-color: var(--accent); }
.rc-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rc-trace tr[data-thread="B"] td,
.rc-trace tr[data-thread="B"] th { color: var(--la-ink); }

/* ---- the readout -------------------------------------------------------- */

.rc-readout { margin: var(--la-space-4) 0 0; }

.rc-row {
  display: flex;
  justify-content: space-between;
  gap: var(--la-space-3);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--la-hairline);
}

.rc-row dt { color: var(--la-ink-dim); font-size: var(--la-text-sm); }
.rc-num { font-family: var(--la-font-mono); color: var(--la-ink); margin: 0; }
.rc-row.rc-strong dd { color: var(--accent); }

.rc-verdict {
  margin: var(--la-space-3) 0 0;
  color: var(--la-ink-dim);
  font-size: var(--la-text-sm);
}
.rc-verdict[data-lost="yes"] {
  border-left: 3px solid var(--accent);
  padding-left: 0.7rem;
}

/* ---- the drawing -------------------------------------------------------- */

.dia .rc-instr {
  fill: var(--la-ink);
  font-size: 13px;
  text-anchor: middle;
}
.dia .rc-thread { fill: var(--la-ink-dim); font-size: 12px; }
.dia .dia-lede { fill: var(--la-ink); font-size: 16px; }
