/* One file, on purpose - four screens don't need a design system. */

:root {
  color-scheme: light;
  --text: #1a1a1a;
  --bg: #ffffff;
  --border: #666666;
  --rule: #e2e2e6;
  --panel: #ffffff;
  --page: #f5f6f8;
  --muted: #5a5f66;
  --notice-bg: #f4f6f8;
  --error-bg: #fdecea;
  --error-text: #611a15;
  --focus: #0b5fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
}

header {
  padding: 0.5rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

header .brand {
  /* Padding, not just line-height: the bare text box was under the 44px
     minimum tap target on a phone. */
  display: inline-block;
  padding: 0.6rem 0.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 1.25rem;
}

main {
  max-width: 40rem;
  margin: 2rem auto;
  /* The content sits in a panel rather than floating on the page. A record
     is something held FOR someone; unbounded text on white reads as a draft,
     and this screen is the product's entire first impression. */
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 2rem;
}

@media (max-width: 40rem) {
  main {
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 1.25rem 1rem 2.5rem;
  }
}

h1 {
  font-size: 1.75rem;
  margin-top: 0;
}

h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

/* The counted number is the headline fact of the record screen, and it read
   as body text identical to everything around it. */
.count {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
}

.count strong {
  font-size: 1.5rem;
}

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

.documents {
  list-style: none;
  margin: 0;
  padding: 0;
}

.documents li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}

.documents li:last-child {
  border-bottom: 0;
}

.doc-title {
  font-weight: 600;
}

.doc-meta {
  color: var(--muted);
  font-size: 0.9375rem;
}

.choices {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.choices li {
  margin-bottom: 1rem;
}

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

.actions {
  margin-top: 2rem;
}

.button,
button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  font-size: 1.125rem;
  border: 2px solid var(--focus);
  border-radius: 0.25rem;
  background: var(--focus);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-text);
  border-radius: 0.25rem;
  padding: 1rem;
  margin: 1rem 0;
}

/* Same shape as .error, deliberately quieter. "There is more than fits here"
   is information, not a failure, and colouring it like one would teach people
   to dismiss it. */
.notice {
  background: var(--notice-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 1rem;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th,
td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

label {
  display: block;
  margin: 1rem 0 0.5rem;
  font-weight: 600;
}

/* The record's sections. `.documents` was the one list on this screen; there
   are six now, and they share a shape: a title line, optional codes, a muted
   meta line, and the attribution. */
.rows {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.rows li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}

.rows li:last-child {
  border-bottom: 0;
}

.rows p {
  margin: 0.15rem 0 0;
}

/* A result's value is the thing the eye goes to, so it is not muted meta text
   sitting between two other muted lines. */
.value {
  display: block;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

/* The code is what makes a row lookup-able by anyone. Small, monospaced so
   digits line up down the column, and never competing with the label. */
.codes {
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* Attribution reads as a fact about the row, not as an error. */
.source {
  color: var(--muted);
}
