:root {
  --paper: #edf0e7;
  --sheet: #fafbf6;
  --ink: #1e2b24;
  --ink-soft: #4d5a52;
  --contour: #8c5e34;
  --water: #23627f;
  --moss: #c9d8c2;
  --amber: #a8690c;
  --amber-bg: #f6ead2;
  --rule: rgba(30, 43, 36, 0.16);
  --radius: 6px;
  --font: "Barlow", system-ui, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--water); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--sheet); padding: 0.5rem 1rem; z-index: 10; }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }

/* Header: the one place the contour motif appears */
.site-head {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='120' viewBox='0 0 480 120'%3E%3Cg fill='none' stroke='%23edf0e7' stroke-opacity='.09' stroke-width='1.2'%3E%3Cpath d='M-10 90c60-40 110 10 170-20s90-60 160-30 120 30 170 0'/%3E%3Cpath d='M-10 70c60-40 110 10 170-20s90-60 160-30 120 30 170 0'/%3E%3Cpath d='M-10 50c60-40 110 10 170-20s90-60 160-30 120 30 170 0'/%3E%3Cpath d='M-10 110c60-40 110 10 170-20s90-60 160-30 120 30 170 0'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--paper);
}
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--paper); text-decoration: none; font: 700 1.25rem/1 var(--font-head); }
.brand svg { width: 1.6rem; height: 1.6rem; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-head nav a { color: var(--moss); text-decoration: none; font-weight: 500; font-size: 0.97rem; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--paper); text-decoration: underline; text-decoration-color: var(--contour); text-decoration-thickness: 2px; }

main { padding-block: 2.5rem 4rem; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 700; margin: 0 0 0.6rem; max-width: 22ch; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.6rem 0 0.4rem; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 56ch; margin: 0 0 1.5rem; }
.prose { max-width: 44rem; }
.prose p, .prose li { max-width: 68ch; }
.count { font: 500 1rem var(--font); color: var(--ink-soft); }
.crumbs { margin: 0 0 0.5rem; font-size: 0.95rem; }

/* Calculator layout */
.calc { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: 3rem; }
@media (min-width: 60rem) {
  .calc { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .results { position: sticky; top: 1rem; }
}
.calc-form fieldset { border: 0; border-top: 2px solid var(--ink); margin: 0 0 1.75rem; padding: 0.9rem 0 0; }
.calc-form legend { font: 700 1.25rem var(--font-head); padding: 0 0.5rem 0 0; }
label { font-weight: 500; }
input, select, button { font: inherit; color: inherit; }
input[type="number"], input[type="date"], input[list], select, input[type="month"] {
  background: var(--sheet); border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 0.5rem 0.6rem; min-height: 2.75rem;
}
input:focus, select:focus { border-color: var(--water); }
.park-add { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: end; }
.park-add label { grid-column: 1 / -1; }
.park-add input { width: 100%; }
button { cursor: pointer; border-radius: var(--radius); min-height: 2.75rem; padding: 0.5rem 1.1rem; border: 0; background: var(--water); color: #fff; font-weight: 600; }
button:hover { background: var(--ink); }
button.ghost { background: transparent; color: var(--water); border: 1.5px solid currentColor; }
button.ghost:hover { color: var(--ink); background: transparent; }
button.icon { background: transparent; color: var(--ink-soft); font-size: 1.5rem; line-height: 1; padding: 0 0.6rem; }
button.icon:hover { color: var(--amber); }
.button { display: inline-block; background: var(--water); color: #fff; padding: 0.65rem 1.1rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.button:hover { background: var(--ink); color: #fff; }

.visits, .people { list-style: none; padding: 0; margin: 0.75rem 0; display: grid; gap: 0.6rem; }
.visits li, .people li { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: end; padding: 0.7rem 0.8rem; background: var(--sheet); border-left: 3px solid var(--contour); border-radius: 0 var(--radius) var(--radius) 0; }
.visit-name { flex: 1 0 100%; font-weight: 600; }
.visits label, .people label { display: grid; gap: 0.2rem; font-size: 0.9rem; color: var(--ink-soft); }
.visits input[type="number"], .people input[type="number"] { width: 5rem; }
.visits li button.icon, .people li button.icon { margin-left: auto; align-self: center; }
.radio { display: flex; gap: 0.6rem; align-items: center; min-height: 2.5rem; font-weight: 400; }
.radio input { width: 1.15rem; height: 1.15rem; accent-color: var(--water); }
.inline-num { display: flex; align-items: center; gap: 0.6rem; margin: 0.2rem 0 0.4rem 1.75rem; font-weight: 400; }
.inline-num input { width: 4.5rem; }
.inline-num[hidden] { display: none; }
.report { margin: 0 0 0.6rem; }
.verified { border-left: 3px solid var(--water); padding-left: 0.8rem; font-size: 0.95rem; }
.hint { font-size: 0.95rem; color: var(--ink-soft); margin: 0.5rem 0 0; }
.empty { padding: 2rem 1.25rem; border: 2px dashed var(--rule); border-radius: var(--radius); color: var(--ink-soft); }

/* The receipt: the one bold element */
.receipt {
  --tooth: 10px;
  background: var(--sheet);
  padding: 1.6rem 1.5rem 1.4rem;
  position: relative;
  filter: drop-shadow(0 1px 0 var(--rule)) drop-shadow(0 6px 14px rgba(30, 43, 36, 0.08));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x;
}
.receipt header { border-bottom: 2px dashed var(--rule); padding-bottom: 0.75rem; margin-bottom: 0.5rem; }
.r-kicker { margin: 0; color: var(--contour); font-weight: 600; }
.receipt h2 { margin: 0.15rem 0 0; font-size: 1.55rem; }
.r-lines { list-style: none; margin: 0; padding: 0; }
.r-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dotted var(--rule); }
.l-label small { display: block; color: var(--ink-soft); font-size: 0.88rem; }
.l-amt { font-weight: 600; white-space: nowrap; }
.r-total { display: flex; justify-content: space-between; margin: 0.9rem 0 0; font: 700 2.4rem/1 var(--font-head); }
.r-total span:first-child { font-size: 1.25rem; align-self: end; }
.mark { color: var(--amber); font-weight: 700; padding-left: 0.1em; }
.r-alt { margin: 0.9rem 0 0; padding-top: 0.7rem; border-top: 2px dashed var(--rule); color: var(--ink-soft); font-size: 0.95rem; }
.others-h { margin-top: 1.75rem; }
.others { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.others > li { border-bottom: 1px solid var(--rule); }
.others summary { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0.25rem; cursor: pointer; font-weight: 500; }
.others summary::-webkit-details-marker { display: none; }
.others summary::before { content: "+"; color: var(--contour); font-weight: 700; margin-right: 0.5rem; }
.others details[open] summary::before { content: "−"; }
.others summary > span:first-child { flex: 1; }
.o-amt { white-space: nowrap; font-weight: 600; }
.o-amt small { color: var(--ink-soft); font-weight: 400; }
.others .r-lines { padding: 0 0.25rem 0.75rem 1.4rem; }
.r-notes { margin-top: 1.25rem; padding: 0.9rem 1rem; background: var(--amber-bg); border-radius: var(--radius); font-size: 0.95rem; }
.r-notes p { margin: 0.3rem 0; }
.r-actions { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Facts and sources */
.fact { border-left: 3px solid var(--moss); padding: 0.2rem 0 0.2rem 1rem; margin: 0.9rem 0; }
.fact p { margin: 0.25rem 0; }
.fact-open { border-left-color: var(--amber); }
.fact-meta { font-size: 0.9rem; color: var(--ink-soft); }
.tag-open { display: inline-block; background: var(--amber-bg); color: var(--amber); font-weight: 600; font-size: 0.85rem; padding: 0.05rem 0.45rem; border-radius: 3px; }
.src { color: var(--ink-soft); }
.nps-quote { margin: 1rem 0; padding: 0.9rem 1.1rem; background: var(--sheet); border-left: 3px solid var(--water); }
.nps-quote p { margin: 0.3rem 0; }
.nps-quote footer { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; }

/* Tables and lists */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--sheet); font-size: 0.97rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 600; border-bottom: 2px solid var(--ink); }
.num { text-align: right; white-space: nowrap; }
.examples th[scope="row"] { font-weight: 400; }
.park-list { list-style: none; padding: 0; margin: 0; columns: 1; }
.park-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.park-list li span:nth-child(2) { grid-row: 2; color: var(--ink-soft); font-size: 0.9rem; }
.park-list li .num { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
@media (min-width: 52rem) { .park-list { columns: 2; column-gap: 3rem; } }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; margin: 1rem 0 1.5rem; border-top: 2px solid var(--ink); }
.facts-grid div { padding: 0.8rem 1rem 0.8rem 0; border-bottom: 1px solid var(--rule); }
.facts-grid dt { color: var(--ink-soft); font-size: 0.92rem; }
.facts-grid dd { margin: 0.1rem 0 0; font: 600 1.3rem var(--font-head); }

.resq fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.resq legend { font: 700 1.25rem var(--font-head); margin-bottom: 0.4rem; }
.answer:empty { display: none; }
.answer { background: var(--sheet); border-left: 4px solid var(--water); padding: 1rem 1.2rem; max-width: 44rem; }
.answer-main { font: 700 1.35rem var(--font-head); margin: 0 0 0.3rem; }
.checklist { list-style: none; padding: 0; max-width: 44rem; }
.checklist li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.checklist label { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400; }
.checklist input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; accent-color: var(--water); flex: none; }
.checklist input:checked + * { color: var(--ink-soft); }
.validity { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin: 0.75rem 0; }
.validity output { font-weight: 600; }
.noscript { background: var(--amber-bg); padding: 0.8rem 1rem; }

.site-foot { border-top: 1px solid var(--rule); padding-block: 1.5rem 2.5rem; color: var(--ink-soft); font-size: 0.93rem; }
.site-foot a { margin-right: 1rem; }

.mobile-total { display: none; }
@media (max-width: 59.99rem) {
  .mobile-total:not([hidden]) { display: block; position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--ink); padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); transition: transform 0.2s ease; }
  .receipt-visible .mobile-total { transform: translateY(110%); }
  .mobile-total a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--paper); text-decoration: none; }
  .mobile-total span { font-size: 0.95rem; color: var(--moss); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-total strong { font: 700 1.6rem var(--font-head); }
  .site-head nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 0.25rem; scrollbar-width: none; }
  .site-head nav a { white-space: nowrap; }
  main { padding-bottom: 5rem; }
}
@media (max-width: 30rem) {
  .receipt { padding-inline: 1rem; }
  .r-total { font-size: 2rem; }
  th, td { padding: 0.5rem; }
}
@media print {
  .site-head nav, .site-foot, button, .r-actions { display: none; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
