:root {
  color-scheme: light;
  font: 100%/1.5 system-ui, sans-serif;
  color: #1b2d37;
  background: #eef2f3;
  --paper: #fff;
  --ink: #15333f;
  --muted: #435863;
  --rule: #bdcbd0;
  --wash: #edf4f4;
  --active: #205f65;
  --focus: #974019;
}

* { box-sizing: border-box; }
[hidden] { display: none; }
body { margin: 0; }
::selection { background: #bcdddc; color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.shell { max-width: 76rem; margin-inline: auto; padding: clamp(1rem, 3vw, 2.5rem); }
.masthead { color: var(--paper); background: var(--ink); padding: clamp(1.25rem, 4vw, 2.75rem); }
.masthead a { color: var(--paper); }
.masthead p { margin: 0; max-width: 62ch; color: #e0edee; }
h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0 0 .5rem; font-size: 2.5rem; font-weight: 650; letter-spacing: -.025em; }
h2 { margin: 0 0 1rem; font-size: 1.375rem; }
h3 { margin: 1.5rem 0 .5rem; font-size: 1.0625rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; margin-block-start: 1rem; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--rule); padding: clamp(1rem, 2.5vw, 1.75rem); }
.muted, dt { color: var(--muted); }
.muted, .status { margin-block: .625rem; }
.status:empty { margin: 0; }
label { display: block; margin-block-end: .25rem; font-weight: 600; }
select, button, textarea { font: inherit; color: inherit; }
select, button, summary, footer a { min-height: 2.75rem; }
select, button, textarea { border: 1px solid #788d95; border-radius: .25rem; background: var(--paper); }
select, textarea { width: 100%; padding: .5rem .625rem; }
textarea { display: block; margin-block: .25rem .75rem; font: .875rem/1.5 ui-monospace, monospace; }
button { padding: .5rem .875rem; cursor: pointer; font-weight: 600; }
button:hover { background: var(--wash); border-color: var(--active); }
.primary { color: var(--paper); background: var(--ink); border-color: var(--ink); margin-block-start: .5rem; }
.primary:hover { background: var(--active); }
summary { padding-block: .625rem; cursor: pointer; font-weight: 600; }
.history { border-top: 1px solid var(--rule); margin-block-start: 1rem; padding-block-start: 1rem; }
.history button, #export { margin-block-start: .75rem; }

.sample-totals, .result-totals { display: grid; gap: .75rem; padding: .75rem; margin-block: 1rem; background: var(--wash); }
.sample-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
dt { font-size: .875rem; }
dd { margin: 0; font-weight: 650; }
dd, td { font-variant-numeric: tabular-nums; }
.result-name { margin: 0; color: var(--muted); }
.exceptions { margin: 0; padding-inline-start: 1.25rem; }
.exceptions li + li { margin-block-start: .25rem; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { border-bottom: 1px solid var(--rule); padding: .5rem .375rem; }
th { color: var(--muted); font-size: .875rem; }
th:not(:first-child), td:not(:first-child) { text-align: right; }
footer { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-block-start: .625rem; }
footer a { display: inline-flex; align-items: center; color: var(--ink); text-underline-offset: .16em; }
footer a:hover { color: var(--active); }
.sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }

@media (max-width: 48rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 2rem; }
}

@media (max-width: 30rem) {
  .result-totals { grid-template-columns: minmax(0, 1fr); }
  .result-totals > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .result-totals dd { text-align: right; }
}
