:root {
  --ink: #16231e;
  --muted: #65736c;
  --cream: #f4f1e8;
  --paper: #fffdf8;
  --green: #1e5944;
  --green-dark: #123d2e;
  --frost: #dceff0;
  --ice: #a9d3d7;
  --line: #d9ddd5;
  --amber: #d08a3c;
  --shadow: 0 22px 60px rgba(26, 53, 42, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  max-width: 1240px;
  margin: 0 auto;
  padding: 25px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { color: var(--ink); text-decoration: none; font: 700 21px/1 "Fraunces", serif; }
.brand span { color: var(--green); }
.research-tag {
  padding: 7px 11px;
  border: 1px solid rgba(30, 89, 68, .25);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255,255,255,.4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

main { overflow: hidden; }
.hero {
  position: relative;
  max-width: 1000px;
  margin: 64px auto 78px;
  padding: 0 28px;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  left: 50%;
  top: -210px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(169,211,215,.48), rgba(169,211,215,0) 68%);
  pointer-events: none;
}
.eyebrow {
  position: relative;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  position: relative;
  margin: 18px 0 22px;
  font: 700 clamp(44px, 7vw, 76px)/.99 "Fraunces", serif;
  letter-spacing: -.045em;
}
h1 em { color: var(--green); font-style: normal; }
.hero-copy {
  position: relative;
  max-width: 710px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.search-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
  text-align: left;
  background: var(--paper);
  border: 1px solid rgba(30, 89, 68, .14);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.search-card label { display: block; margin: 0 0 8px 3px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, button { font: inherit; }
input {
  width: 100%;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,89,68,.1); }
.search-row button {
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
  cursor: pointer;
}
.search-row button:hover { background: var(--green-dark); }
.search-options { display: flex; gap: 10px; padding: 11px 3px 0; color: var(--muted); font-size: 13px; }
.privacy-note { margin: 7px 3px 0; color: var(--muted); font-size: 11px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); font-weight: 700; cursor: pointer; }
.status { min-height: 0; margin: 8px 3px 0; color: #9b3f2c; font-size: 13px; }
.status:empty { display: none; }

.workspace {
  max-width: 1240px;
  min-height: 620px;
  margin: 0 auto 110px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .8fr);
  gap: 18px;
}
.map-wrap, .result-panel { border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.map-wrap { position: relative; min-height: 620px; background: #d9e5df; }
#map { position: absolute; inset: 0; }
.map-key {
  position: absolute;
  z-index: 500;
  left: 16px;
  bottom: 16px;
  max-width: 330px;
  padding: 11px 14px;
  background: rgba(255,253,248,.95);
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
}
.map-key b { font-weight: 700; }
.result-panel { background: var(--paper); }
.empty-state { height: 100%; min-height: 620px; padding: 50px; display: grid; place-content: center; text-align: center; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-content: center; border-radius: 50%; background: var(--frost); color: var(--green); font-size: 30px; }
.empty-state h2 { margin-bottom: 8px; font: 700 28px/1.2 "Fraunces", serif; }
.empty-state p { color: var(--muted); line-height: 1.55; }
.result-content { padding: 28px; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-heading h2 { margin: 6px 0 0; font: 700 25px/1.15 "Fraunces", serif; }
.risk-badge { flex: none; padding: 7px 10px; border-radius: 999px; background: var(--frost); color: var(--green-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.risk-badge.high { background: #f6dec7; color: #8a471c; }
.headline-metric { margin: 24px 0 16px; padding: 22px; border-radius: 16px; background: var(--green-dark); color: #fff; }
.metric-label, .metric-note { display: block; color: rgba(255,255,255,.72); font-size: 12px; }
.headline-metric strong { display: block; margin: 5px 0 7px; font: 700 44px/1 "Fraunces", serif; }
.headline-metric #gap-value { font-size: clamp(31px, 5vw, 44px); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.metric-grid div { padding: 15px; background: var(--paper); }
.metric-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.metric-grid strong { font-size: 14px; }
.forecast-card { margin-top: 16px; padding: 17px; border-radius: 14px; background: var(--frost); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.forecast-card span { display: block; color: var(--muted); font-size: 11px; }
.forecast-card strong { display: block; margin-top: 3px; font: 700 25px/1 "Fraunces", serif; }
.forecast-card p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.forecast-card.error { background: #f2eee4; }
.interpretation { padding: 22px 2px 6px; }
.interpretation h3, .cta h3 { margin-bottom: 7px; font: 700 17px/1.2 "Fraunces", serif; }
.interpretation p, .cta p, details p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.cta { padding: 19px; border: 1px solid rgba(30,89,68,.2); border-radius: 14px; background: #f7f7ef; }
.cta p { margin-bottom: 10px; }
.cta a { color: var(--green); font-size: 13px; font-weight: 800; text-decoration: none; }
.validation-card { margin: 16px 0; padding: 18px; border: 1px solid rgba(30,89,68,.18); border-radius: 14px; background: #edf4ef; }
.validation-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.validation-heading span, .validation-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.validation-heading strong { display: block; margin-top: 3px; color: var(--green-dark); font-size: 15px; }
.validation-radius { flex: none; padding-top: 2px; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.validation-grid strong { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; }
.validation-card > p { margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
details { margin-top: 16px; color: var(--muted); font-size: 12px; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 10px 0 0; }

.proof { max-width: 1080px; margin: 0 auto 110px; padding: 0 28px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; }
.proof h2 { margin-top: 12px; font: 700 42px/1.05 "Fraunces", serif; letter-spacing: -.03em; }
.proof-copy > p { color: var(--ink); font-size: 17px; line-height: 1.7; }
.proof-copy .source-note { color: var(--muted); font-size: 12px; }
.methodology { max-width: 1080px; margin: -35px auto 100px; padding: 0 28px; }
.method-intro { max-width: 720px; }
.method-intro h2 { margin: 10px 0 8px; font: 700 38px/1.08 "Fraunces", serif; }
.method-intro > p { color: var(--muted); }
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0 18px; }
.method-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf9; }
.method-grid strong { display: block; color: var(--green-dark); font: 700 27px/1 "Fraunces", serif; }
.method-grid span { display: block; margin: 7px 0 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.method-grid p, .method-details li { color: var(--muted); font-size: 12px; line-height: 1.55; }
.method-details { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf9; }
.method-details ol { margin: 14px 0 0 20px; }
.method-details li + li { margin-top: 7px; }
footer { max-width: 1240px; margin: 0 auto; padding: 24px 28px 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.leaflet-container { font-family: "DM Sans", sans-serif; }
.leaflet-control-attribution { font-size: 9px; }

@media (max-width: 880px) {
  .hero { margin-top: 40px; }
  .workspace { grid-template-columns: 1fr; }
  .map-wrap { min-height: 430px; }
  .result-panel, .empty-state { min-height: auto; }
  .proof { grid-template-columns: 1fr; gap: 20px; }
  .method-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .site-header { align-items: flex-start; }
  .research-tag { max-width: 150px; text-align: center; }
  h1 { font-size: 44px; }
  .hero-copy { font-size: 16px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row button { padding: 14px; }
  .search-options { flex-wrap: wrap; }
  .workspace { padding: 0 14px; }
  .result-content { padding: 22px 18px; }
  .proof h2 { font-size: 34px; }
  .method-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 8px; }
}

/* --- frost-pocket legend dots + plain-English how-it-works --- */
.map-key .dot, .dot {
  display:inline-block; width:11px; height:11px; border-radius:50%;
  vertical-align:middle; margin:0 1px 0 7px; border:1px solid rgba(0,0,0,.15);
}
.how-grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin:26px 0 8px;
}
.how-grid article {
  background:#fff; border:1px solid #e4e9e5; border-radius:14px; padding:20px 20px 18px;
}
.how-num {
  width:30px; height:30px; border-radius:50%; background:#1e5944; color:#fff;
  font-weight:700; display:flex; align-items:center; justify-content:center;
  font-family:"Fraunces",serif; margin-bottom:12px;
}
.how-grid h3 { margin:0 0 7px; font-size:1.05rem; }
.how-grid p { margin:0; font-size:.94rem; color:#41504a; line-height:1.5; }
.proof-line {
  margin:14px 0 30px; padding:16px 20px; border-left:4px solid #c0392b;
  background:#fbf1ee; border-radius:0 10px 10px 0; font-size:1rem; color:#3a2e2b;
}
.proof-line p { margin:0; }
.glossary { margin:6px 0 0; padding-left:0; list-style:none; }
.glossary li { padding:7px 0; border-bottom:1px solid #eef1ef; font-size:.93rem; color:#41504a; line-height:1.5; }
.glossary li:last-child { border-bottom:none; }
@media(max-width:760px){ .how-grid{ grid-template-columns:1fr; gap:14px; } }
