:root {
  --paper: #e9dfca;
  --ink: #23201b;
  --red: #a3261d;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
.frame { width: min(100% - 2rem, 57rem); margin-inline: auto; }
.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .6rem 1rem;
  padding-block: 1.2rem;
  border-bottom: 1px solid currentColor;
  font: .875rem/1.4 ui-monospace, monospace;
}

.masthead a { font-weight: 700; }
a { color: inherit; }
main { margin-top: clamp(3rem, 13vh, 8rem); padding-bottom: 3rem; }
h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--red);
  font: 900 clamp(3.25rem, 11vw, 9rem)/.87 system-ui, sans-serif;
  letter-spacing: -.085em;
}

form, .receipt { max-width: 43rem; }
label { display: block; margin: 0 0 .5rem; font: 700 .875rem/1.4 ui-monospace, monospace; }
.result-row { display: flex; gap: .5rem; }
input, button {
  min-height: 3.25rem;
  border: 1px solid var(--ink);
  border-radius: .14rem;
  font: inherit;
}

input {
  flex: 1;
  min-width: 0;
  padding: .65rem .8rem;
  color: var(--ink);
  background: #fff9eb;
  font-family: ui-monospace, monospace;
}

button {
  padding: .65rem 1rem;
  color: #fff9eb;
  background: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

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

.receipt {
  margin-block: 1.75rem;
  padding: 1rem;
  border: 1px dashed var(--ink);
  background: #f2ead8;
}

.receipt [role="status"]:empty { display: none; }
.error { color: var(--red); }

@media (max-width: 32rem) {
  form .result-row { flex-direction: column; }
}
