:root {
  --green: #2f4a2e;
  --green2: #3f6140;
  --cream: #f6f1e7;
  --red: #c8472b;
  --red-hover: #ad3a21;
  --ink: #212326;
  --muted: #5f6370;
  --line: #e5e7eb;
  --gray: #f6f7f8;
  --white: #ffffff;
  --radius: 22px;
  --radius-lg: 28px;
  --radius-sm: 18px;
  --head: 'Libre Baskerville', Georgia, serif;
  --body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mark: 'Chelsea Market', var(--body);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 18px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--head); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 4.6vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
button { font: inherit; }

.topbar { background: var(--green); padding: 14px 16px; text-align: center; }
.wordmark { font-family: var(--mark); color: #fff; font-size: 1.3rem; letter-spacing: .5px; }
.noscript { padding: 24px 16px; text-align: center; }

/* ---------- Quiz ---------- */
.quiz { background: var(--green); color: #fff; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); padding: 18px 16px 40px; }
.quiz-inner { max-width: 620px; margin: 0 auto; }
.quiz h1 { color: #fff; margin: 10px 0 18px; }
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.progress .label { font-size: .9rem; color: #dfe8d9; white-space: nowrap; }
.progress .bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.progress .fill { height: 100%; background: var(--cream); border-radius: 99px; transition: width .35s ease; }
.back { background: none; border: 0; color: #dfe8d9; padding: 6px 0; cursor: pointer; font-size: .95rem; text-decoration: underline; text-underline-offset: 3px; }
.back[hidden] { display: none; }
.qcard { background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 22px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.qcard h2 { margin-bottom: .3em; }
.qcard .hint { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.options { display: grid; gap: 10px; }
.opt { display: block; width: 100%; text-align: left; background: var(--gray); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 1.05rem; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover, .opt:focus-visible { border-color: var(--green2); outline: none; }
.opt.selected { border-color: var(--green); background: #eaf1e6; font-weight: 600; }
.subq + .subq { margin-top: 18px; }
.subq h3 { font-family: var(--body); font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.city-wrap { position: relative; }
.input { width: 100%; font: inherit; font-size: 1.05rem; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
.input:focus { outline: none; border-color: var(--green2); }
.suggest { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.suggest li button { width: 100%; text-align: left; background: var(--gray); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 1rem; cursor: pointer; color: var(--ink); }
.suggest li button:hover, .suggest li button:focus-visible, .suggest li button.active { border-color: var(--green2); outline: none; }
.suggest .dim { color: var(--muted); font-size: .9rem; }

.frost { display: grid; gap: 14px; }
.frost label { font-weight: 700; display: block; margin-bottom: 6px; }
.frost select { font: inherit; font-size: 1.05rem; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; width: 100%; color: var(--ink); }
.season-note { background: var(--cream); border-radius: 12px; padding: 10px 14px; font-size: .98rem; }

.btn { display: inline-block; background: var(--red); color: #fff; border: 0; border-radius: 999px; padding: 15px 28px; font-weight: 700; font-size: 1.08rem; text-decoration: none; cursor: pointer; text-align: center; transition: background .15s, transform .05s; }
.btn:hover, .btn:focus-visible { background: var(--red-hover); outline: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.next-row { margin-top: 18px; }

/* ---------- Gate ---------- */
.gate-wrap { position: relative; }
.blurred { filter: blur(7px); pointer-events: none; user-select: none; max-height: 120vh; overflow: hidden; }
.gate { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; background: linear-gradient(180deg, rgba(246,241,231,.35), rgba(246,241,231,.85) 40%); }
.gate-card { width: 100%; max-width: 480px; background: #fff; border-radius: var(--radius-lg); padding: 24px 20px; box-shadow: 0 18px 50px rgba(0,0,0,.2); position: sticky; top: 16px; }
.gate-card .big { font-family: var(--head); font-size: clamp(1.8rem, 8vw, 2.4rem); color: var(--green); margin: 4px 0 2px; }
.gate-card .small { color: var(--muted); font-size: .95rem; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .98rem; }
.field .err { color: var(--red); font-size: .9rem; margin-top: 4px; display: none; }
.field.invalid .input { border-color: var(--red); }
.field.invalid .err { display: block; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin: 6px 0 14px; }
.consent input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); flex: none; }
.consent.invalid { color: var(--red); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.form-err { color: var(--red); font-size: .95rem; margin-top: 10px; }

/* ---------- Result ---------- */
.hero { background: var(--green); color: #fff; padding: 28px 16px 34px; }
.hero h1 { color: #fff; }
.hero p { color: #e4ecdf; font-size: 1.08rem; }
.wrap { max-width: 760px; margin: 0 auto; }
.section { padding: 26px 16px; }
.section.cream { background: var(--cream); }
.section.white { background: #fff; }
.card { background: #fff; border-radius: var(--radius); padding: 20px 18px; box-shadow: 0 2px 0 var(--line); border: 1px solid var(--line); }
.cream .card { border: 0; box-shadow: 0 6px 20px rgba(47,74,46,.08); }
.card + .card { margin-top: 14px; }
.kicker { text-transform: uppercase; letter-spacing: 1.2px; font-size: .78rem; font-weight: 700; color: var(--green2); margin-bottom: 6px; }
.years { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .years { grid-template-columns: repeat(3, 1fr); } }
.year { background: #fff; border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--line); }
.year .amt { font-family: var(--head); font-size: 1.7rem; color: var(--green); }
.year .meta { color: var(--muted); font-size: .95rem; }
.year.first { border: 2px solid var(--green); }
.note { color: var(--muted); font-size: .95rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.tag.ver { background: #e3efe0; color: var(--green); }
.tag.est { background: #f6e7d9; color: #8a4a1d; }
.facts { list-style: none; padding: 0; margin: 10px 0 0; }
.facts li { padding: 8px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts .src { color: var(--muted); font-size: .85rem; display: block; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.15), rgba(255,255,255,.3), rgba(255,255,255,.15)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; height: 1.2em; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

.layout-svg { width: 100%; height: auto; display: block; background: var(--gray); border-radius: var(--radius-sm); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .9rem; color: var(--muted); margin-top: 10px; }
.legend span::before { content: ''; display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.legend .l1::before { background: var(--green2); }
.legend .l3::before { background: #fff; border: 2px dashed #9bb59a; }
.legend .lf::before { background: none; border: 2px dashed var(--red); }
.legend .lw::before { background: #3b82c4; border-radius: 50%; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: var(--gray); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.15rem; }
.stat span { color: var(--muted); font-size: .88rem; }

.beds { list-style: none; padding: 0; margin: 0; }
.beds li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.beds li:first-child { border-top: 0; }
.beds .num { background: var(--green); color: #fff; border-radius: 10px; font-weight: 700; font-size: .85rem; padding: 3px 8px; min-width: 52px; text-align: center; }
.beds .crops { font-size: 1rem; }
.beds .crops small { display: block; color: var(--muted); font-size: .85rem; }
.beds .val { font-weight: 700; white-space: nowrap; }
.total-row { display: flex; justify-content: space-between; font-weight: 700; padding-top: 12px; border-top: 2px solid var(--ink); margin-top: 6px; font-size: 1.05rem; }

.cost-range { font-family: var(--head); font-size: 1.5rem; color: var(--green); }
.cost-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: .97rem; }
.cost-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.cost-list li span:last-child { white-space: nowrap; font-weight: 600; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 14px 48px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; display: grid; place-items: center; }
.steps .done { color: var(--green2); font-weight: 700; }
.story { font-family: var(--head); font-style: italic; font-size: 1.15rem; text-align: center; }
.cta { background: var(--green); color: #fff; text-align: center; padding: 34px 16px 40px; }
.cta h2 { color: #fff; }
.cta p { color: #e4ecdf; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px 16px 30px; }
@media (max-width: 420px) { body { font-size: 17px; } .qcard { padding: 20px 16px; } }
