:root {
  color-scheme: light dark;
  --fg: #16181d;
  --muted: #5b6472;
  --bg: #ffffff;
  --line: #d8dde5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8ebf0;
    --muted: #98a2b3;
    --bg: #14161a;
    --line: #2c313a;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.shell {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

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

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

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

/* A cell whose text is Arabic carries dir="auto"; the browser then needs the
   alignment to follow the resolved direction rather than the page's. */
[dir="auto"] {
  text-align: start;
}

thead th {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

tfoot th,
tfoot td {
  font-weight: 700;
}

.analysis-table h2 {
  font-size: 1.05rem;
  margin: 2rem 0 0;
}

.analysis-opening p {
  margin: 0.35rem 0;
}

.analysis-opening p:last-child {
  font-weight: 700;
}

.analysis-closing {
  margin-top: 1.75rem;
}

/* Notes are for disagreements between the stored score and the arithmetic on
   this page. They must look like a warning, not like part of the report. */
.analysis-notes {
  margin-top: 2rem;
  border-inline-start: 3px solid var(--line);
  padding-inline-start: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* The three tables can outgrow a phone; the page must not scroll sideways. */
.analysis-table {
  overflow-x: auto;
}
