:root {
  --blue: #2563eb;
  --blue-d: #1d4ed8;
  --green: #22c55e;
  --green-d: #16a34a;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f7f9fc;
  --ok: #22c55e;
  --warn: #eab308;
  --bad: #ef4444;
  --none: #9ca3af;
  --radius: 14px;
  --font: "Inter", Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--font); color: var(--ink); background: #fff; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.08rem; font-weight: 700; }
.lead { font-size: 1.08rem; color: #4b5563; max-width: 60ch; margin: 14px 0 0; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.eyebrow.light { color: #86efac; }
.small { font-size: 0.88rem; }
.light { color: #d1d5db; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 1000; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; letter-spacing: 0.02em; }
nav { display: flex; gap: 18px; align-items: center; }
nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
nav a.nav-cta { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 8px; }
@media (max-width: 520px) { nav a:not(.nav-cta) { display: none; } }

/* Hero */
.hero { background: linear-gradient(180deg, var(--soft), #fff); padding: 56px 0 64px; }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .hero-in { grid-template-columns: 1fr; gap: 28px; } .hero { padding-top: 36px; } }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); font-weight: 500; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.ticks.light li { color: #e5e7eb; }

/* Tool panel */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px rgba(17, 24, 39, 0.08); padding: 26px; min-width: 0; }
.step { display: flex; flex-direction: column; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step-head h2 { font-size: 1.25rem; }
label { font-weight: 600; font-size: 0.92rem; margin: 12px 0 6px; color: var(--ink); }
input, select { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(37, 99, 235, 0.25); border-color: var(--blue); }
.hint { font-size: 0.86rem; color: var(--muted); margin: 8px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; background: var(--blue); color: #fff; border: 0; border-radius: 9px; padding: 15px 22px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue-d); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn:focus-visible, .btn-link:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.4); outline-offset: 2px; }
.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-d); }
.btn-link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; padding: 10px 0; margin-top: 6px; align-self: flex-start; }
.msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #fef2f2; color: #991b1b; font-size: 0.92rem; }
.msg.ok { background: #f0fdf4; color: #166534; }

.matches { display: grid; gap: 10px; }
.match { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; margin: 0; font-weight: 400; }
.match:hover { border-color: #93c5fd; }
.match input { width: auto; margin-top: 4px; accent-color: var(--blue); }
.match b { display: block; font-size: 0.98rem; }
.match small { display: block; color: var(--muted); font-size: 0.85rem; }
.match:has(input:checked) { border-color: var(--blue); background: #eff6ff; }
.turnstile:empty { display: none; }
.turnstile { margin-top: 14px; }

.run-kw { margin: 0 0 12px; color: var(--ink-2); }
.bar { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width 0.3s ease; }

/* Results */
.results { padding: 56px 0 24px; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.res-head { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.res-copy { flex: 1 1 320px; min-width: 0; }
.res-copy .lead { margin-top: 10px; }
.score { position: relative; width: 132px; height: 132px; flex: none; }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #eef2f7; stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--blue); stroke-width: 11; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 0.9s ease; }
@media (prefers-reduced-motion: reduce) { .ring-fg, .bar span { transition: none; } }
.score-num { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 44px; gap: 2px; }
.score-num b { font-size: 2.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-num span { color: var(--muted); font-weight: 600; }

.res-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; margin-bottom: 22px; }
@media (max-width: 900px) { .res-grid { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; margin-bottom: 22px; }
.res-grid .card { margin-bottom: 0; }
.card h3 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chip { font-size: 0.8rem; font-weight: 600; background: #eff6ff; color: var(--blue-d); border-radius: 999px; padding: 3px 10px; }
.map { height: 340px; border-radius: 10px; border: 1px solid var(--line); background: #eef2f7; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.82rem; color: #4b5563; margin-top: 12px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend span:last-child::before { display: none; }
.lg-g::before { background: var(--ok); } .lg-y::before { background: var(--warn); } .lg-r::before { background: var(--bad); } .lg-n::before { background: var(--none); }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 220px; margin-top: 14px; }
.dot { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.95rem; border: 2px solid; font-variant-numeric: tabular-nums; }
.dot.g { background: #dcfce7; border-color: var(--ok); color: #14532d; }
.dot.y { background: #fef9c3; border-color: var(--warn); color: #713f12; }
.dot.r { background: #fee2e2; border-color: var(--bad); color: #7f1d1d; }
.dot.n { background: #f3f4f6; border-color: var(--none); color: #374151; font-size: 0.8rem; }
.dot.p { background: #fff; border-color: #d1d5db; color: #9ca3af; }
.pin { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 13px/1 var(--font); border: 2.5px solid; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.pin.g { background: #dcfce7; border-color: var(--ok); color: #14532d; }
.pin.y { background: #fef9c3; border-color: var(--warn); color: #713f12; }
.pin.r { background: #fee2e2; border-color: var(--bad); color: #7f1d1d; }
.pin.n { background: #f3f4f6; border-color: var(--none); color: #374151; font-size: 11px; }
.pin.p { background: #fff; border-color: #d1d5db; color: #9ca3af; }
.star { font-size: 22px; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.94rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.me td { background: #eff6ff; font-weight: 700; }
.tbl td small { display: block; color: var(--muted); font-weight: 400; }
.note { font-size: 0.85rem; color: var(--muted); margin: 12px 0 0; }

.unlock { background: var(--ink); color: #fff; border-radius: 18px; padding: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; margin-top: 8px; }
@media (max-width: 900px) { .unlock { grid-template-columns: 1fr; padding: 24px; } }
.unlock h2 { color: #fff; }
.lead-form { background: #fff; color: var(--ink); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.lead-form label { margin-top: 10px; }
.lead-form label:first-of-type { margin-top: 0; }
.hp { position: absolute; left: -9999px; }
.thanks { background: #fff; color: var(--ink); border-radius: 14px; padding: 24px; }
.thanks p { color: #4b5563; }
.again { text-align: center; margin: 22px 0 0; }

.how { padding: 56px 0; background: var(--soft); margin-top: 40px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 22px; }
@media (max-width: 800px) { .cols3 { grid-template-columns: 1fr; } }
.cols3 > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.cols3 p { color: #4b5563; margin: 8px 0 0; }

.foot { border-top: 1px solid var(--line); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); font-size: 0.86rem; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.leaflet-container { font-family: var(--font); }
#comps td:first-child { min-width: 170px; }
.pdf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 14px; }
.pdf-row .btn { margin-top: 0; padding: 12px 18px; }
.btn-pdf { background: var(--ink); }
.btn-pdf:hover { background: #1f2937; }
