:root {
  --paper: #EDF2EA;
  --ink: #13362B;
  --muted: #557263;
  --rule: #9DB5A6;
  --box: #FFFFFF;
  --hi: #F3E36B;
  --late: #A23B2A;
  --measure: 40rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { max-width: var(--measure); margin: 0 auto; padding: 3.5rem 1.25rem 4rem; }
h1 {
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 1rem;
}
h2 { font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.015em; margin: 3.25rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
a { color: var(--ink); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 3px;
}

/* The form is laid out like a paper tax return: numbered boxes, a label, and a pounds field. */
form { margin-top: 2.5rem; border-top: 2px solid var(--ink); }
.field {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0 0.9rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.boxno {
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.field label { font-weight: 650; display: block; }
.hint { color: var(--muted); font-size: 0.93rem; margin: 0.1rem 0 0.6rem; }
.pounds { display: flex; align-items: stretch; max-width: 17rem; }
.pounds span {
  display: grid; place-items: center; padding: 0 0.7rem;
  border: 1.5px solid var(--ink); border-right: 0; background: var(--paper); font-weight: 700;
}
input, select {
  font: inherit; color: var(--ink);
  width: 100%; padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--ink); border-radius: 0; background: var(--box);
  font-variant-numeric: tabular-nums;
}
select { max-width: 17rem; appearance: auto; }
.actions { padding-top: 1.4rem; }
button {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--ink); color: var(--paper);
  border: 0; padding: 0.8rem 1.4rem;
}
button:hover { background: #0B261E; }
.error { color: var(--late); font-weight: 600; margin-top: 0.75rem; }

/* Result */
#result { margin-top: 2.25rem; }
#result[hidden] { display: none; }
.verdict { font-size: clamp(1.6rem, 4.6vw, 2.2rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 0.8rem; }
/* The one loud moment on the page: the start date gets a highlighter stroke, like marking a calendar. */
.mark {
  background: linear-gradient(transparent 12%, var(--hi) 12%, var(--hi) 88%, transparent 88%) no-repeat;
  background-size: 100% 100%;
  padding: 0 0.15em; margin: 0 -0.05em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) {
  .mark.animate { animation: swipe 650ms cubic-bezier(.2,.7,.2,1) 120ms both; }
  @keyframes swipe { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
}
.sum { color: var(--muted); }
.sum strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.late { color: var(--late); font-weight: 650; }

ol.timeline { list-style: none; margin: 1.25rem 0 0; padding: 0; border-left: 2px solid var(--ink); }
ol.timeline li { position: relative; padding: 0 0 1.1rem 1.25rem; }
ol.timeline li::before {
  content: ""; position: absolute; left: -0.45rem; top: 0.45rem;
  width: 0.8rem; height: 0.8rem; background: var(--paper); border: 2px solid var(--ink);
}
ol.timeline li.final::before { background: var(--ink); }
.when { font-weight: 750; font-variant-numeric: tabular-nums; display: block; }
.what { color: var(--muted); font-size: 0.95rem; }

.offer {
  margin-top: 2.5rem; padding: 1.4rem 1.4rem 1.5rem;
  border: 2px solid var(--ink); background: var(--box);
}
.offer h2 { margin-top: 0; }
.offer ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.button-link {
  display: inline-block; text-decoration: none; font-weight: 700;
  background: var(--ink); color: var(--paper); padding: 0.8rem 1.4rem;
}
.button-link:hover { background: #0B261E; }

details { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
details:first-of-type { border-top: 2px solid var(--ink); }
summary { cursor: pointer; font-weight: 700; list-style-position: outside; }
details p, details ul { margin: 0.7rem 0 0.2rem; color: #24493C; }
details ul { padding-left: 1.2rem; }

footer { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 3rem; color: var(--muted); font-size: 0.88rem; }
footer p { margin: 0 0 0.5rem; }

/* Site bar: brand on the left, the free tools on the right. */
.site {
  max-width: var(--measure); margin: 0 auto; padding: 1rem 1.25rem 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem;
  font-size: 0.95rem;
}
.site .brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; text-decoration: none; margin-right: auto; }
.site .brand img { width: 1.75rem; height: 1.75rem; border-radius: 50%; }
.site nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.site nav a { color: var(--muted); text-decoration: none; }
.site nav a:hover { color: var(--ink); text-decoration: underline; }
.site nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* Calculator result: a ledger of figures, the amounts right-aligned like a tax form. */
.figures { width: 100%; border-collapse: collapse; margin: 1rem 0 0.5rem; font-variant-numeric: tabular-nums; }
.figures th, .figures td { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; }
.figures td { text-align: right; white-space: nowrap; padding-left: 1rem; }
.figures tr.total th, .figures tr.total td { font-weight: 800; border-bottom: 2px solid var(--ink); }
.pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.5rem 0 0.5rem; }
.pay div { border: 2px solid var(--ink); background: var(--box); padding: 1rem 1.1rem; }
.pay .label { display: block; color: var(--muted); font-size: 0.93rem; }
.pay .amount { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.choice { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.choice label { font-weight: 400; display: flex; align-items: center; gap: 0.45rem; }
.choice input { width: auto; }
.note { color: var(--muted); font-size: 0.93rem; }

@media (max-width: 420px) {
  main { padding-top: 2.25rem; }
  .field { grid-template-columns: 1fr; }
  .boxno { margin-bottom: 0.6rem; }
}
