/* Ledger-paper look: sage paper, navy ink, ruled statement for the payment. No web fonts. */
:root {
  color-scheme: light;
  --paper: #eef2ea;
  --sheet: #fbfcfa;
  --ink: #16233a;
  --ink-soft: #4a5a6e;
  --rule: #a9bba9;
  --rule-soft: #d3ddd0;
  --green: #0d6b4d;
  --green-ink: #08503a;
  --ochre: #b8791a;
  --blue: #3a6a9a;
  --serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
[hidden] { display: none !important; }
a { color: var(--green-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
  justify-content: space-between; padding-top: 14px; padding-bottom: 14px;
}
.brand { font: 700 1.2rem/1.2 var(--serif); color: var(--ink); text-decoration: none; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-head nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-head nav a:hover { text-decoration: underline; }

/* Type */
h1, h2, h3 { font-family: var(--serif); color: var(--ink); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4.8vw, 3.1rem); letter-spacing: -0.01em; max-width: 22ch; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.crumbs { padding-top: 16px; font-size: 0.875rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.hero { padding: 24px 0 20px; }
.lede { max-width: 62ch; color: var(--ink-soft); font-size: 1.075rem; margin: 14px 0 0; }

/* Calculator layout */
.tool { display: grid; gap: 28px; margin: 8px 0 48px; }
@media (min-width: 860px) {
  .tool { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; gap: 40px; }
}

.calc { border-top: 3px solid var(--ink); padding-top: 16px; }
.calc .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.9rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field small { font-weight: 400; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.35; }
.affix {
  display: flex; align-items: center; background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 3px;
}
.affix:focus-within { border-color: var(--ink); }
.affix input {
  border: 0; background: transparent; color: inherit; width: 100%; min-width: 0;
  padding: 11px 10px; font: inherit; font-weight: 500; font-variant-numeric: tabular-nums;
}
.affix .pre, .affix .suf { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.affix .pre { padding-left: 10px; }
.affix .suf { padding-right: 10px; }
.affix .pre + input { padding-left: 4px; }
.field select {
  font: inherit; font-weight: 500; padding: 11px 10px; color: inherit;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px;
}
.calc-msg { margin: 14px 0 0; color: #8a2b1a; font-weight: 600; }
.linkbtn {
  margin-top: 16px; padding: 0; border: 0; background: none; color: var(--green-ink);
  font: inherit; text-decoration: underline; cursor: pointer;
}

/* The statement: the memorable bit */
.statement {
  background: var(--sheet); border: 1px solid var(--ink); padding: 20px 22px 18px;
  box-shadow: 6px 6px 0 var(--rule);
}
.statement h2 { font-size: 1.2rem; margin-bottom: 14px; }
.bar { display: flex; height: 16px; border: 1px solid var(--ink); margin-bottom: 14px; background: var(--sheet); }
.seg { display: block; flex-basis: 0; min-width: 0; transition: flex-grow 0.35s; }
.k-pi { background: var(--ink); }
.k-tax { background: var(--green); }
.k-ins { background: var(--ochre); }
.k-pmi { background: var(--blue); }
.k-hoa { background: var(--rule); }
.rows {
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 31px, var(--rule-soft) 31px, var(--rule-soft) 32px
  );
}
.line { display: flex; align-items: center; height: 32px; }
.line .key { flex: none; width: 10px; height: 10px; margin-right: 10px; }
.line .lbl { white-space: nowrap; }
.line .dots {
  flex: 1; min-width: 14px; margin: 0 8px 7px; align-self: flex-end;
  border-bottom: 2px dotted #7f957f;
}
.line .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.line.total { height: 54px; margin-top: 2px; border-top: 2px solid var(--ink); font-weight: 700; }
.line.total .dots { margin-bottom: 14px; }
.line.total .lbl { font-family: var(--serif); font-size: 1.15rem; }
.line.total .amt { font-family: var(--serif); font-size: 1.9rem; }
.facts {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 16px 0 0;
  padding-top: 14px; border-top: 1px solid var(--rule); font-size: 0.95rem;
}
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.note { margin: 14px 0 0; font-size: 0.82rem; color: var(--ink-soft); line-height: 1.45; }
.trust { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-soft); font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; }
.trust p { margin: 0 0 6px; }
.trust strong { color: var(--ink); }

/* Content blocks */
.block { margin: 0 0 48px; max-width: 72ch; }
.block.wide { max-width: none; }
.block h2 { margin-bottom: 14px; }
.block h3 { margin: 24px 0 6px; }
.tablewrap { overflow-x: auto; margin: 0 0 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
th { border-bottom: 2px solid var(--ink); font-weight: 600; }
td.num, th.num { text-align: right; }
.plain { list-style: none; padding: 0; margin: 0 0 8px; }
.plain li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); }
.plain .val { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.split { display: grid; gap: 28px; }
@media (min-width: 720px) { .split { grid-template-columns: 1fr 1fr; gap: 40px; } }
.split h3 { margin-top: 0; }
.filter { max-width: 340px; margin-bottom: 14px; }
.prose p, .prose li { max-width: 68ch; }
.prose h2 { margin: 36px 0 10px; font-size: 1.4rem; }
.prose ul { padding-left: 1.2em; }

/* Footer */
.site-foot { border-top: 2px solid var(--ink); margin-top: 56px; padding: 28px 0 44px; font-size: 0.9rem; color: var(--ink-soft); }
.site-foot h2 { font-size: 1rem; margin-bottom: 10px; }
.statelinks { columns: 4 150px; column-gap: 20px; list-style: none; padding: 0; margin: 0 0 28px; }
.statelinks li { break-inside: avoid; padding: 2px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 16px; }
.site-foot p { max-width: 80ch; }

@media (max-width: 420px) {
  .calc .grid { grid-template-columns: 1fr; }
  .line .lbl { white-space: normal; line-height: 1.2; }
  .line.total .amt { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .seg { transition: none; }
}
