:root {
  color-scheme: light;
  --ink: #0e1a2e;
  --muted: #4a5568;
  --paper: #f2f4f8;
  --line: #dde2ea;
  --action: #1d4ed8;
  --good: #166534;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    1rem/1.6 'DM Sans',
    system-ui,
    sans-serif;
}
a {
  color: var(--action);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid #a15c07;
  outline-offset: 3px;
}
.skip {
  position: absolute;
  top: -5rem;
  left: 1rem;
  padding: 0.7rem;
  background: white;
  z-index: 3;
}
.skip:focus {
  top: 0.5rem;
}
.shell {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}
.site-header {
  background: white;
  border-bottom: 1px solid var(--line);
}
.header-inner,
.header-inner nav,
.brand,
.actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.header-inner {
  justify-content: space-between;
  padding-block: 1rem;
}
.brand {
  gap: 0.6rem;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 750;
  text-decoration: none;
}
.brand span span {
  color: var(--action);
}
nav a {
  padding-block: 0.4rem;
}
.intro {
  padding-block: 2.5rem 1.75rem;
  max-width: 790px;
}
.intro p {
  color: var(--muted);
  max-width: 69ch;
}
.intro .privacy {
  color: var(--good);
  font-weight: 600;
}
h1 {
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1.13;
  letter-spacing: -0.035em;
  margin: 0.8rem 0 1.25rem;
  text-wrap: balance;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.1rem;
}
.calculator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0 0 1.5rem;
  min-width: 0;
}
fieldset + fieldset {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
legend {
  font-weight: 700;
  font-size: 1.15rem;
  padding-top: 0.5rem;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.field {
  min-width: 0;
  margin-top: 0.9rem;
}
label {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
input,
select {
  font: inherit;
  color: var(--ink);
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.7rem;
  background: white;
  border: 1px solid #8994a6;
  border-radius: 6px;
}
input[aria-invalid] {
  border: 2px solid #a42020;
}
.hint,
.field-error {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}
.hint {
  color: var(--muted);
}
.field-error,
#errors {
  color: #a42020;
}
#errors {
  padding: 1rem;
  border: 2px solid #a42020;
  border-radius: 6px;
  margin-bottom: 1rem;
}
#errors p {
  margin: 0.5rem 0;
}
#errors a {
  color: inherit;
}
button,
.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--action);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
button[type='submit'],
.button {
  background: var(--action);
  color: white;
}
button {
  background: white;
  color: var(--action);
}
button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
.actions {
  gap: 0.75rem;
}
.estimate {
  position: sticky;
  top: 1.5rem;
}
#result-status {
  margin: 0 0 1rem;
  color: var(--muted);
}
.headline-result {
  padding: 1.5rem;
  background: #e8eefc;
  border-radius: 12px;
}
.headline-result h2 {
  margin: 0;
  font-size: 1rem;
}
.headline-result strong {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.3;
  margin: 0.6rem 0;
  overflow-wrap: anywhere;
}
.headline-result p {
  font-size: 0.9rem;
  margin-bottom: 0;
}
.yields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-block: 1.5rem;
}
.yields dt {
  font-size: 0.94rem;
}
.yields dd {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0.3rem 0;
  overflow-wrap: anywhere;
}
.yields small {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  display: block;
}
dl {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.ledger > div {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.ledger dt {
  max-width: 65%;
}
.ledger dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.ledger .total {
  font-weight: 700;
  border-top: 2px solid var(--ink);
}
.estimate > button {
  margin-top: 1rem;
}
.explanation {
  margin-block: 3rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  max-width: 78ch;
}
.explanation p {
  color: var(--muted);
}
.article {
  background: white;
  max-width: 80ch;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 3rem;
}
.article h2 {
  margin-top: 2.5rem;
}
.article h2:first-child {
  margin-top: 0;
}
.article p,
.article li {
  max-width: 70ch;
}
.article pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 1rem;
  background: var(--paper);
}
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.article th,
.article td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.article blockquote {
  margin-inline: 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--action);
  background: #e8eefc;
}
footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .shell {
    width: calc(100% - 2rem);
  }
  .header-inner {
    gap: 0.5rem;
  }
  .header-inner nav {
    gap: 1rem;
    font-size: 0.9rem;
  }
  .calculator {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .estimate {
    position: static;
  }
  .intro {
    padding-top: 1.5rem;
  }
  form,
  .article {
    padding: 1.1rem;
  }
  .article {
    width: 100%;
  }
}
@media (max-width: 380px) {
  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .yields {
    gap: 0.5rem;
  }
}
@media print {
  .site-header,
  footer,
  .actions,
  #export {
    display: none;
  }
  .calculator {
    display: block;
  }
  .estimate {
    position: static;
  }
}

.worksheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.draft-panel {
  min-width: 0;
}
.draft-panel h2 {
  margin-top: 0;
}
textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.65rem;
  border: 1px solid #8994a6;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
textarea[aria-invalid] {
  border: 2px solid #a42020;
}
#listing-draft {
  min-height: 34rem;
}
.draft-panel .actions {
  margin-top: 1rem;
}
.draft-example,
#print-draft {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
.draft-example {
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#blank-checklist {
  margin-block: 2.5rem;
  max-width: 78ch;
}
.blank-items {
  list-style: none;
  padding: 0;
}
.blank-items li {
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.blank-items span {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.6rem;
  border: 1px solid currentColor;
}
.blank-items small {
  display: block;
  color: var(--muted);
}
.print-only {
  display: none;
}
@media (max-width: 850px) {
  .worksheet-layout {
    grid-template-columns: 1fr;
  }
}
@media print {
  body {
    background: white;
    color: black;
  }
  .intro,
  .worksheet-layout,
  .explanation,
  .next-step,
  .skip {
    display: none !important;
  }
  #blank-checklist {
    margin: 0;
    max-width: none;
  }
  .blank-items li {
    padding-bottom: 2rem;
    break-inside: avoid;
  }
  .print-draft #blank-checklist {
    display: none;
  }
  .print-draft .print-only {
    display: block;
  }
}
