:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #19251d;
  background: #f7f5ee;
  --line: #d9dcd2;
  --green: #254a35;
  --muted: #4f5c52;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }

.page-header {
  max-width: 72rem;
  margin-inline: auto;
  padding: 1.35rem clamp(1rem, 5vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.wordmark { font-weight: 750; }
nav a { color: var(--green); text-underline-offset: .25em; }

main {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(2.75rem, 9vw, 7rem) clamp(1rem, 5vw, 4rem);
}

.intro { margin-bottom: 2rem; }
h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.intro p { margin: 1rem 0 0; color: var(--muted); }

form {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  background: #fffdf8;
}

.fields, .summary { padding: clamp(1.25rem, 4vw, 2.5rem); }
.fields { display: grid; align-content: start; gap: 1.5rem; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field label, .summary label { display: block; font-weight: 650; }

input, select, button { font: inherit; }
input, select {
  width: 100%;
  min-height: 3rem;
  margin-top: .45rem;
  padding: .6rem .75rem;
  border: 1px solid #909b90;
  border-radius: .5rem;
  background: #fff;
  color: inherit;
}
small { display: block; margin-top: .4rem; color: var(--muted); }
[aria-invalid="true"] { border-color: #9c3427; }
:focus-visible { outline: 2px solid #356b4b; outline-offset: 3px; }

.summary { background: #e8eee2; border-left: 1px solid var(--line); }
#total {
  display: block;
  margin-top: .4rem;
  font-size: clamp(1.85rem, 4vw, 3.5rem);
  font-weight: 750;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#rule { margin: .65rem 0 1.5rem; color: var(--muted); }
button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .85rem 1rem;
  border: 0;
  border-radius: .5rem;
  background: var(--green);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}
button:hover:enabled { background: #1b3928; }
button:disabled { opacity: .65; cursor: wait; }
#receipt { margin: 0; overflow-wrap: anywhere; }
#receipt:not(:empty) { margin-top: .8rem; }

@media (max-width: 44rem) {
  form { grid-template-columns: minmax(0, 1fr); }
  .summary { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 24rem) {
  .field-pair { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  :root, form, .summary { background: #fff; color: #000; }
  nav, button { display: none; }
  main { padding: 1rem 0; }
  form { break-inside: avoid; }
}
