:root {
  --bg: #f4f1ea;
  --ink: #1c2416;
  --muted: #5c6654;
  --card: #fffcf6;
  --line: #d9d2c4;
  --pine: #2f5d3a;
  --pine-deep: #1e3d28;
  --ember: #c45c26;
  --soft: #e7efe6;
  --shadow: 0 12px 40px rgba(28, 36, 22, 0.08);
  --radius: 18px;
  --font: "Source Sans 3", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #e7efd8 0%, transparent 50%),
    radial-gradient(900px 500px at 100% 0%, #f0e0d0 0%, transparent 45%),
    var(--bg);
  line-height: 1.55;
}
a { color: var(--pine-deep); }
.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(244, 241, 234, 0.88);
  border-bottom: 1px solid rgba(217, 210, 196, 0.8);
}
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; gap: 1rem; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--ink); }
.brand span { color: var(--pine); }
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
nav a:hover { color: var(--pine-deep); }

.hero { padding: 3.2rem 0 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--ember); margin: 0 0 0.75rem; }
.hero h1 { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.12; margin: 0 0 1rem; max-width: 18ch; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; margin: 0 0 1.5rem; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 0.75rem 1.2rem; font-weight: 700;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit;
}
.btn.primary { background: var(--pine); color: #fff; }
.btn.primary:hover { background: var(--pine-deep); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.panel { padding: 2rem 0 2.5rem; }
.panel.soft { background: var(--soft); border-radius: var(--radius); padding: 2rem 1.25rem; margin: 1rem auto 2rem; width: min(1120px, calc(100% - 2rem)); }
.panel-head h2 { font-family: var(--display); font-size: 1.8rem; margin: 0 0 0.4rem; }
.panel-head p { color: var(--muted); margin: 0 0 1.25rem; max-width: 70ch; }

.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; }
.grid-2.tight { gap: 0.75rem; }
@media (max-width: 880px) {
  .grid-2 { grid-template-columns: 1fr; }
  nav { display: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}
.form h3 { margin: 1.1rem 0 0.65rem; font-size: 1rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--pine-deep); }
.form h3:first-child { margin-top: 0; }
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.75rem; }
input, select, textarea {
  width: 100%; margin-top: 0.35rem; padding: 0.65rem 0.7rem;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit;
}
label.check { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.6rem; align-items: center; }
label.check input[type="checkbox"] { width: auto; margin: 0; }
label.check input[type="number"] { grid-column: 1 / -1; }
.hint, .fineprint, .muted { color: var(--muted); font-weight: 400; font-size: 0.86rem; }
.fineprint { margin-top: 0.75rem; }

.results h3 { font-family: var(--display); margin-top: 0; }
.metric {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0; border-bottom: 1px dashed var(--line);
}
.metric b { font-variant-numeric: tabular-nums; }
.metric.total { border-bottom: 0; margin-top: 0.4rem; font-size: 1.05rem; }
.pill {
  display: inline-block; background: var(--soft); color: var(--pine-deep);
  border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.78rem; font-weight: 700;
}
.callout {
  margin-top: 1rem; padding: 0.85rem 1rem; border-radius: 14px;
  background: linear-gradient(135deg, #eef6ea, #f8f3e8); border: 1px solid var(--line);
}
.share-box { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .cards-3 { grid-template-columns: 1fr; } }
.town-card h3 { margin: 0 0 0.25rem; font-family: var(--display); }
.town-card .rate { color: var(--ember); font-weight: 700; }
.town-card ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.town-card li { margin: 0.2rem 0; }

.linklist { columns: 2; gap: 2rem; padding-left: 1.1rem; }
@media (max-width: 700px) { .linklist { columns: 1; } }
.linklist li { margin: 0.45rem 0; }

.site-footer { padding: 2rem 0 3rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 1rem; }

.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.seg-item {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.75rem;
  font-size: 0.88rem; font-weight: 600; background: #fff; cursor: pointer;
}
.seg-item:has(input:checked) { background: var(--soft); border-color: var(--pine); color: var(--pine-deep); }
.seg-item input { margin-right: 0.35rem; }
.ex-list { display: flex; flex-direction: column; gap: 0.65rem; margin: 0.5rem 0 1rem; max-height: 420px; overflow: auto; padding-right: 0.25rem; }
.ex-item {
  display: grid; grid-template-columns: auto 1fr; gap: 0.55rem; align-items: start;
  padding: 0.65rem 0.7rem; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  font-weight: 400;
}
.ex-item input[type="checkbox"] { width: auto; margin-top: 0.2rem; }
.ex-ask { display: block; font-weight: 600; color: var(--pine-deep); margin: 0.2rem 0; font-size: 0.9rem; }
.inline-amt { display: block; margin-top: 0.35rem; font-size: 0.88rem; }
.inline-amt input { width: 140px; display: inline-block; margin-left: 0.35rem; }
.callout.mini { margin: 0.5rem 0 0.75rem; padding: 0.7rem 0.85rem; }
.sticky-ish { position: sticky; top: 4.5rem; }
select#town { width: 100%; margin-top: 0.35rem; padding: 0.4rem; border-radius: 12px; border: 1px solid var(--line); font: inherit; background: #fff; }
#townSearch { margin-bottom: 0.35rem; }
