/* The results page: one document, no script, readable from a phone up. */

:root {
  color-scheme: light dark;
  --text: #1c1d1f;
  --muted: #5b5f66;
  --line: #d9dbe0;
  --panel: #f5f6f8;
  --ours: #eef4ff;
  --right: #1d6b3a;
  --wrong: #b4261b;
  --nothing: #5b5f66;
  --warn: #fff4d6;
  --link: #1f5bd1;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: Canvas;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e7ea;
    --muted: #a3a7af;
    --line: #3a3d44;
    --panel: #1f2126;
    --ours: #1b2740;
    --right: #6fd394;
    --wrong: #ff8a80;
    --nothing: #a3a7af;
    --warn: #3d3311;
    --link: #8fb4ff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 72rem;
  padding: 1.5rem 1rem 4rem;
}

a {
  color: var(--link);
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

h2 {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

h3 {
  margin-top: 2rem;
}

p,
li {
  max-width: 48rem;
}

.lede {
  font-size: 1.1rem;
}

.warning {
  background: var(--warn);
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.run {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 1rem 0;
}

.run dt {
  color: var(--muted);
}

.run dd {
  margin: 0;
}

pre {
  background: var(--panel);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

nav {
  margin: 1.5rem 0;
  line-height: 2;
}

.who {
  color: var(--muted);
}

.ours-summary {
  background: var(--ours);
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.legend,
.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.note {
  border-left: 3px solid var(--line);
  padding-left: 0.75rem;
}

/* Wide tables scroll inside their box, so the page itself never does. */
.scroll {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  border-collapse: collapse;
  font-size: 0.9rem;
  width: 100%;
}

th,
td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--panel);
  font-weight: 600;
  white-space: nowrap;
}

thead th.span {
  text-align: center;
  white-space: normal;
}

tbody th {
  font-weight: 500;
  min-width: 12rem;
}

/* Each row keeps its name in view while a wide table scrolls under it. */
tbody th,
thead tr:first-child th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: Canvas;
}

thead tr:first-child th:first-child {
  background: var(--panel);
}

tr.ours > th {
  background: var(--ours);
}

tbody tr:last-child > * {
  border-bottom: 0;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.counts thead th.num {
  white-space: normal;
  min-width: 7rem;
}

td.num {
  white-space: nowrap;
}

.v {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ours,
tr.ours > * {
  background: var(--ours);
}

tr.product > * {
  font-style: italic;
}

.r {
  color: var(--right);
}

.w {
  color: var(--wrong);
}

.n {
  color: var(--nothing);
}

small {
  color: var(--muted);
}

.list td:first-child {
  min-width: 16rem;
}

.list td:last-child {
  white-space: nowrap;
}

ul.misses {
  margin-top: 0.25rem;
}

details {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 1rem;
}

details[open] {
  padding-bottom: 1rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

.group details {
  border-style: dashed;
}

footer {
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 40rem) {
  body {
    padding: 1rem 0.75rem 3rem;
  }

  tbody th {
    min-width: 7.5rem;
  }

  details {
    padding: 0.5rem 0.75rem;
  }
}
