:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #252128;
  background: #f5f5f9;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 980px; margin: 0 auto; padding: 36px 20px 48px; }
.back { color: #914006; text-decoration: none; }
.back:hover { text-decoration: underline; }
h1 { margin: 22px 0 24px; font-size: clamp(26px, 4.2vw, 36px); }
h2 { margin: 0 0 18px; font-size: 19px; }
h2 span, label span { color: #605a61; font-size: 13px; font-weight: 400; }

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.card {
  background: white;
  border: 1px solid #e8e4e9;
  border-radius: 16px;
  padding: 24px;
}

.inputs, .dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dates { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 650; }
input, button { font: inherit; }
input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #cfc9d1;
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: inherit;
}

.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.choices button {
  min-width: 38px;
  min-height: 30px;
  border: 1px solid #e5c5ac;
  border-radius: 7px;
  background: #fff7ef;
  color: #793504;
  cursor: pointer;
}

.choices button[aria-pressed="true"] { border-color: #ab5518; background: #ffe3c9; }
:is(a, button, input):focus-visible { outline: 2px solid #a84b0b; outline-offset: 2px; }
.help, .status { margin: 16px 0 0; font-size: 13px; line-height: 1.65; }
.help { color: #605a61; }
.status { margin-top: 6px; color: #914006; }
.status:empty { margin: 0; }

.results { border-color: #eddaa9; background: #fff8dc; }
dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 11px 12px;
  margin: 0;
  font-size: 14px;
}

dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.totals {
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  margin-top: 17px;
  border-top: 1px solid #eddaa9;
  padding-top: 15px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  main { padding-inline: 12px; }
  .card { padding: 16px; }
  .dates { grid-template-columns: 1fr; }
}
