:root {
  --paper: #efe8dc;
  --sheet: #faf6ee;
  --ink: #1c1915;
  --muted: #6d655c;
  --line: #ddd4c6;
  --copper: #b8612e;
  --under: #1c6b45;
  --over: #9a3412;
  --shadow: 0 18px 50px rgba(48, 36, 22, 0.08);
  color: var(--ink);
  background: var(--paper);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(184, 97, 46, 0.16), transparent 32rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--copper);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.figure,
.money {
  font-family: "Instrument Serif", "Iowan Old Style", Palatino, serif;
  font-weight: 400;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 8vw, 5.4rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 38rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 32px;
}

.sheet,
.verdict,
.plan,
.fine {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.sheet {
  padding: 22px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.sheet-head h2,
.plan h3,
.fine h3 {
  margin: 0;
  font-size: 1.8rem;
}

.sheet-head p,
.hint,
.plan p,
.fine p,
.checklist li,
.skipped li {
  color: var(--muted);
}

.sheet-head p {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.preset {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.preset[aria-pressed="true"],
.preset:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--sheet);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.field span,
.checks legend {
  font-size: 0.82rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

input:focus,
select:focus,
.preset:focus-visible,
.reset:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.reset {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  color: var(--copper);
}

.reset:hover {
  border-color: var(--copper);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.84rem;
}

.is-hidden {
  display: none;
}

.need-count {
  margin: 0 0 8px 28px;
}

.stepper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.stepper .field {
  flex: 1;
  margin-top: 0;
}

.stepper button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.stepper button:disabled {
  cursor: default;
  color: var(--muted);
}

.checks {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.checks legend {
  padding: 0;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  font-size: 0.95rem;
}

.check input {
  width: auto;
  margin-top: 3px;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verdict {
  padding: 26px 26px 22px;
}

.verdict.under {
  background: #1c1915;
  color: #f6f1e7;
  border-color: #1c1915;
}

.verdict.over {
  background: #fff8f4;
}

.verdict .kicker {
  color: var(--copper);
}

.figure {
  margin: 6px 0 0;
  font-size: clamp(3.2rem, 6vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.caption {
  margin: 10px 0 0;
  max-width: 36rem;
}

.verdict h2 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.verdict.under .caption,
.verdict.under .section-label {
  color: #ddd4c6;
}

.verdict.under .waterfall li,
.verdict.under .account li,
.verdict.under .includes li {
  color: #f6f1e7;
  border-color: rgba(246, 241, 231, 0.16);
}

.verdict.under .includes li {
  border-color: rgba(246, 241, 231, 0.28);
}

.waterfall,
.account,
.checklist,
.skipped,
.includes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.waterfall {
  margin-top: 18px;
  border-top: 1px solid rgba(221, 212, 198, 0.35);
}

.verdict:not(.under) .waterfall {
  border-top-color: var(--line);
}

.waterfall li,
.account li,
.skipped li,
.checklist li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(221, 212, 198, 0.35);
}

.verdict:not(.under) .waterfall li,
.account li,
.checklist li,
.skipped li {
  border-bottom-color: var(--line);
}

.waterfall li:last-child,
.account li:last-child {
  border-bottom: 0;
  font-weight: 600;
}

.account li.tax-heading {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.money {
  font-size: 1.2rem;
  white-space: nowrap;
}

.credit {
  color: var(--under);
}

.verdict.under .credit {
  color: #8dcea8;
}

.plan,
.fine {
  padding: 20px 22px;
}

.plan-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.other-plans {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.other-plans > h3 {
  margin: 4px 0 0;
  font-size: 1.6rem;
}

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #efe4d4;
}

.plan.alt {
  background: transparent;
  box-shadow: none;
}

.includes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.includes li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
}

.section-label {
  margin: 18px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checklist li,
.skipped li {
  display: block;
  font-size: 0.92rem;
}

.warnings {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1e6;
  color: var(--over);
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}

.sources a {
  color: var(--ink);
}

@media (max-width: 840px) {
  .layout,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .sheet {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .shell {
    width: min(1120px, calc(100% - 24px));
    padding-top: 24px;
  }
}
