/* A surveyor's coverage sheet: warm paper, ink, and one ochre that marks only what a crosswalk gets wrong or leaves out. */
:root {
  --paper: #fbfaf6;
  --ink: #1f2628;
  --faint: #5d6567;
  --rule: #d9d6cc;
  --tint: #f1efe7;
  --ochre: #8a4b00;
  --ochre-wash: #f6e7d2;
  --ochre-light: #fbf1e3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181a17;
    --ink: #e8e4d8;
    --faint: #a49f92;
    --rule: #3a3a33;
    --tint: #23241f;
    --ochre: #f0a24a;
    --ochre-wash: #3d2a14;
    --ochre-light: #2c2218;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #181a17;
  --ink: #e8e4d8;
  --faint: #a49f92;
  --rule: #3a3a33;
  --tint: #23241f;
  --ochre: #f0a24a;
  --ochre-wash: #3d2a14;
  --ochre-light: #2c2218;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem / 1.5 Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
}
code,
.mono,
.slug,
select {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "Liberation Mono", monospace;
}
code {
  font-size: 0.875em;
}
::selection {
  background: var(--ochre-wash);
  color: var(--ink);
}
html {
  scrollbar-color: var(--rule) var(--paper);
}
a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.wrap {
  max-width: 1240px;
  margin: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  background: var(--paper);
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
/* Every cell is a tab stop, so a keyboard user can jump past the matrix. */
.skip-matrix:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-matrix:focus {
  display: inline-block;
  margin-bottom: 8px;
}
.slug {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  font-size: 12px;
  color: var(--faint);
  padding-block: 20px 9px;
  border-bottom: 1px dashed var(--rule);
}
.slug p {
  margin: 0;
}
.slug b {
  color: var(--ink);
}
h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 28px 0 8px;
  max-width: 28ch;
}
/* The intro and the headline figure share the first screen on a wide window; the figure drops below on a narrow one. */
.hero {
  display: grid;
  gap: 8px 48px;
  align-items: end;
}
@media (min-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
}
.score {
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
}
.score .big {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score .big span {
  font-size: 1.25rem;
  color: var(--faint);
}
.score figcaption {
  font-size: 0.9375rem;
}
/* as-is in ink, corrected and added in the two ochre washes, as in the matrix cells. */
.bar {
  display: flex;
  height: 10px;
  margin: 12px 0 10px;
  gap: 2px;
}
.bar span {
  flex-basis: 0;
}
.bar .s-as-is {
  background: var(--ink);
}
.bar .s-corrected {
  background: var(--ochre);
}
.bar .s-added {
  background: var(--ochre-wash);
  box-shadow: inset 0 0 0 1px var(--ochre);
}
/* The views: a row of tabs on one hairline, the chosen one tinted with a 2px ink bar at its foot. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 28px 0 16px;
  border-bottom: 1px solid var(--rule);
}
.tabs [role="tab"] {
  border: 0;
  padding: 8px 16px;
  color: var(--faint);
  font-size: 1.0625rem;
}
.tabs [role="tab"]:hover {
  color: var(--ink);
}
.tabs [role="tab"][aria-selected="true"] {
  color: var(--ink);
  background: var(--tint);
  box-shadow: inset 0 -2px 0 var(--ink);
}
[role="tabpanel"] > .hint:first-child {
  margin-top: 0;
}
h2 {
  font-size: 1.0625rem;
  font-weight: 400;
  margin: 0 0 10px;
}
.lede {
  max-width: 68ch;
  margin: 0;
}
.hint,
.colophon p:first-child {
  color: var(--faint);
  font-style: italic;
  font-size: 0.9375rem;
  max-width: 68ch;
}
.note {
  color: var(--ochre);
}
button,
select {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  min-height: 44px;
  cursor: pointer;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.legend-label {
  color: var(--faint);
}
#filters {
  display: flex;
  flex-wrap: wrap;
}
#filters button {
  padding: 6px 12px;
  margin: 0 -1px -1px 0;
}
#filters button[aria-pressed="true"] {
  background: var(--tint);
  box-shadow: inset 0 -2px 0 var(--ink);
}
.n {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}
.board {
  display: grid;
  gap: 24px;
}
@media (min-width: 1280px) {
  .board {
    grid-template-columns: minmax(0, 1fr) 15rem;
    align-items: start;
  }
  .detail {
    position: sticky;
    top: 16px;
  }
}
.scroll {
  /* Clips the absolutely placed visually-hidden tally text, which otherwise widens the page on a phone. */
  position: relative;
  overflow-x: auto;
  /* Room for the sticky format column on the left; on the right, Chrome otherwise stops with a focused cell half out. */
  scroll-padding: 0 3rem 0 9.5rem;
  border: 1px solid var(--rule);
}
table {
  border-collapse: collapse;
  width: 100%;
}
#matrix th,
#matrix td {
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  padding: 0;
}
#matrix thead th {
  font-weight: 400;
  color: var(--faint);
  padding: 8px 10px;
  white-space: nowrap;
}
/* A fixed width the scroll padding can match; a long crosswalk name wraps. */
#matrix tbody th {
  font-weight: 400;
  padding: 8px 12px;
  width: 9.5rem;
  min-width: 9.5rem;
  vertical-align: middle;
}
/* Term names run up the column, so seventeen columns fit beside the detail panel. */
#matrix thead th.rot {
  vertical-align: bottom;
  text-align: center;
  padding: 10px 0 8px;
}
#matrix th.rot span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
#matrix thead th.rot code {
  font-size: 12px;
  color: var(--ink);
}
#matrix .tally {
  padding: 8px 12px;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 0.875rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
#matrix td + td,
#matrix th + td {
  border-left: 1px solid var(--rule);
}
.cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 2.25rem;
  border: 0;
  padding: 0;
  font-family: Charter, Georgia, serif;
  font-size: 1.0625rem;
}
.cell:hover,
.cell[aria-current="true"] {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.s-corrected,
.s-added {
  color: var(--ochre);
}
/* The tint fills the whole table cell, edge to edge, not just the button inside it. */
#matrix td:has(.s-corrected) {
  background: var(--ochre-wash);
}
#matrix td:has(.s-added) {
  background: var(--ochre-light);
}
.s-no-field {
  color: var(--faint);
}
/* A crosswalk nobody reviewed gets no wash: its marks say only the cell's shape. Prose and unjoinable cells are ochre. */
.s-path,
.s-empty {
  color: var(--faint);
}
.s-prose,
.s-unmatched {
  color: var(--ochre);
}
/* tr.group outranks the sticky first-column rule: the label row spans the table and stays put. */
#matrix tr.group th {
  position: static;
  box-shadow: none;
  padding: 18px 12px 6px;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--faint);
  white-space: normal;
}
#matrix tbody:first-of-type tr.group th {
  padding-top: 8px;
}
/* The label spans the whole table; capped to the screen so it wraps where the reader can see it. */
#matrix tr.group > th > span {
  display: inline-block;
  position: sticky;
  left: 12px;
  max-width: min(44rem, calc(100vw - 4rem));
}
#matrix tr.group .mark {
  position: static;
  font-style: normal;
  color: var(--ink);
}
table[data-only="as-is"] td:has(.cell:not(.s-as-is)),
table[data-only="corrected"] td:has(.cell:not(.s-corrected)),
table[data-only="added"] td:has(.cell:not(.s-added)),
table[data-only="no-field"] td:has(.cell:not(.s-no-field)) {
  opacity: 0.4;
}
.detail {
  border-top: 2px solid var(--ink);
  padding-top: 10px;
}
.detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.detail-head button {
  flex: none;
  padding: 0 12px;
  font-size: 0.875rem;
}
.detail dl {
  margin: 0;
}
.detail dt {
  color: var(--faint);
  font-size: 0.875rem;
  margin-top: 10px;
}
.detail dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}
.pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 12px 0 16px;
}
.pickers select {
  margin-left: 8px;
  padding: 0 8px;
}
.route {
  list-style: none;
  padding: 0;
  margin: 0;
}
.route li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 12rem) minmax(0, 1fr);
  align-items: center;
  padding: 6px 0;
}
.route .hub {
  text-align: center;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
  z-index: 1;
}
.stop {
  overflow-wrap: anywhere;
  position: relative;
  padding: 4px 0;
}
/* The line from each end to the hub: solid when both formats have the field, ochre and dashed where it breaks. */
.stop::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 0;
  border-top: 2px solid var(--ink);
  z-index: 0;
}
.stop:first-child {
  padding-right: 12px;
  text-align: right;
}
.stop:last-child {
  padding-left: 12px;
}
.stop:first-child::after {
  right: -1px;
  width: 10px;
}
.stop:last-child::after {
  left: -1px;
  width: 10px;
}
.stop.gap {
  color: var(--ochre);
  font-style: italic;
}
.stop.gap::after {
  border-top-style: dashed;
  border-top-color: var(--ochre);
}
.changes {
  padding-left: 1.2em;
  max-width: 68ch;
}
.counts {
  width: auto;
  margin-top: 12px;
}
.counts th,
.counts td {
  text-align: left;
  padding: 4px 24px 4px 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.colophon {
  margin-top: 48px;
  padding-block: 18px 32px;
  border-top: 1px dashed var(--rule);
}
.colophon .mono {
  font-size: 12px;
  color: var(--faint);
}
@media (max-width: 1279px) and (min-height: 480px) {
  /* A chosen cell's detail stays in view at the foot of the screen until it is closed. */
  html:has(.detail dl) {
    /* Tabbing scrolls a focused cell clear of the panel, not under it. */
    scroll-padding-bottom: calc(min(30vh, 14rem) + 24px);
  }
  .detail:has(dl) {
    position: sticky;
    bottom: 0;
    z-index: 2;
    max-height: min(30vh, 14rem);
    overflow: auto;
    background: var(--paper);
    padding-bottom: 12px;
  }
}
@media (max-width: 560px) {
  .tabs [role="tab"] {
    padding-inline: 12px;
  }
  .route li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .stop:first-child,
  .stop:last-child {
    text-align: left;
    padding: 0;
  }
  .stop::after {
    display: none;
  }
  .route .hub {
    justify-self: start;
  }
  .route li {
    border-bottom: 1px solid var(--rule);
  }
}
@media (forced-colors: active) {
  .tabs [role="tab"][aria-selected="true"] {
    border-bottom: 2px solid Highlight;
  }
  /* Forced colours drop backgrounds, which are all the headline bar has. */
  .bar span {
    border: 1px solid CanvasText;
  }
  .bar .s-as-is {
    background: CanvasText;
  }
  /* Forced colours drop box-shadow, which marks the chosen cell and filter otherwise. */
  .cell[aria-current="true"],
  #filters [aria-pressed="true"] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
  .s-corrected,
  .s-added {
    color: Highlight;
  }
  .stop.gap::after,
  .stop::after {
    border-top-color: CanvasText;
  }
}
/* The format column stays put while the terms scroll sideways; the scroll padding keeps a focused cell clear of it. */
#matrix th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  box-shadow: inset -1px 0 0 var(--rule);
}
