:root {
  color-scheme: light;
  --ink: #172b28;
  --muted: #495f56;
  --page: #f6f4eb;
  --paper: #fffcf4;
  --line: #cbcfc0;
  --green: #185744;
  --green-bg: #dcead7;
  --rust: #883a26;
  --rust-bg: #f5e0d4;
  --field-border: #828f80;
  font: 1rem/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
main { max-width: 82rem; margin: auto; padding: 2.25rem clamp(1rem, 4vw, 4rem) 3.5rem; }
a { color: var(--green); text-underline-offset: 3px; }
.brand { display: inline-block; font-weight: 800; }
.brand span { font-weight: 500; }
header { border-bottom: 1px solid var(--line); padding: 1.8rem 0 2rem; margin-bottom: 1.5rem; }
h1 { margin: 0; font: 500 clamp(2.45rem, 6.4vw, 5.65rem)/.96 Georgia, serif; letter-spacing: -.065em; }
header p { font-size: clamp(1rem, 1.7vw, 1.18rem); max-width: 40ch; margin: 1rem 0 0; }
h2 { font: 500 1.85rem/1.1 Georgia, serif; letter-spacing: -.035em; margin: 0 0 .55rem; }
h3 { margin: 0 0 .45rem; font-size: 1.02rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.2rem; align-items: start; }
form, .results { border: 1px solid var(--line); border-radius: 12px; padding: clamp(.85rem, 2.4vw, 1.55rem); background: var(--paper); }
.results { background: #ebeee2; }
.detail { color: var(--muted); font-size: .9rem; margin: 0; }
.periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: 1rem; }
fieldset { min-width: 0; border: 0; border-top: 1px solid var(--line); padding: .6rem 0 0; margin: 0; }
legend { padding: 0 .35rem 0 0; font-weight: 800; font-size: .95rem; }
label { display: flex; align-items: end; min-height: 2.4em; line-height: 1.2; font-size: .82rem; font-weight: 650; }
input, button { min-height: 2.75rem; border-radius: 6px; font: inherit; }
input { display: block; width: 100%; padding: .35rem .65rem; margin: .28rem 0 .45rem; background: #fffefa; color: var(--ink); border: 1px solid var(--field-border); font-variant-numeric: tabular-nums; }
button { color: var(--green); background: transparent; border: 1px solid var(--green); padding: .3rem .75rem; font-size: .86rem; font-weight: 700; cursor: pointer; }
button:hover { background: var(--green-bg); }
:where(input, button, a):focus-visible { outline: 3px solid #926020; outline-offset: 3px; }
.form-footer { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-top: .75rem; }
.feedback { border-left: 3px solid var(--rust); padding-left: .55rem; margin: .75rem 0 0; color: var(--rust); }
.table-key, .metric-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.table-key { font-size: .78rem; color: var(--muted); padding-top: .35rem; padding-bottom: .45rem; }
.metric { border-top: 1px solid var(--line); padding: .9rem 0; }
.metric-values { align-items: center; margin: .2rem 0 .35rem; }
.metric-value { font: 500 clamp(1.22rem, 3.1vw, 2.45rem)/1.12 Georgia, serif; font-variant-numeric: tabular-nums; }
.change { font-weight: 750; font-size: .81rem; justify-self: start; padding: .23rem .5rem; border-radius: 5px; background: var(--page); white-space: nowrap; }
.change.up { background: var(--green-bg); color: var(--green); }
.change.down { background: var(--rust-bg); color: var(--rust); }
#reading { border-top: 1px solid var(--line); margin: 0; padding-top: .85rem; font-weight: 650; }
.method { max-width: 67ch; margin-top: 1.7rem; }
.method p { margin: .6rem 0; }
.sr-only { width: 1px; height: 1px; overflow: hidden; position: absolute; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 54rem) {
  .workspace { grid-template-columns: 1fr; }
  .wide-break { display: none; }
}
@media (max-width: 32rem) {
  main { padding-top: 1.1rem; }
  header { padding: 1.2rem 0 1rem; margin-bottom: .9rem; }
  .periods { gap: .65rem; }
}
