/* Layout: one 1120px column; results split into map + findings on wide screens; report is a single printable sheet. */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #16231d;
  --muted: #56645c;
  --line: #d9ded7;
  --forest: #1e5b45;
  --forest-soft: #e3eee8;
  --orange: #c2410c;
  --orange-soft: #fbe9df;
  --good: #1e7a4c;
  --warn: #9a6a00;
  --display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101814; --surface: #17221c; --ink: #e6ede8; --muted: #9db0a5; --line: #2b3a32;
    --forest: #5fbf94; --forest-soft: #1d3329; --orange: #f08a52; --orange-soft: #3a2418;
    --good: #5fbf94; --warn: #e0b04a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101814; --surface: #17221c; --ink: #e6ede8; --muted: #9db0a5; --line: #2b3a32;
  --forest: #5fbf94; --forest-soft: #1d3329; --orange: #f08a52; --orange-soft: #3a2418;
  --good: #5fbf94; --warn: #e0b04a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--forest); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85em; letter-spacing: 0.01em; }
.eyebrow { font: 600 0.75rem/1 var(--body); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* independence notice + header */
.indep { margin: 0; background: var(--ink); color: var(--bg); font-size: 0.8rem; text-align: center; padding: 7px max(16px, env(safe-area-inset-right, 0px)) 7px max(16px, env(safe-area-inset-left, 0px)); }
.brand b { color: var(--forest); font-weight: 700; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.1rem var(--display); }
.mark { color: var(--ink); flex: none; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }

main { padding-block: 36px 64px; display: grid; gap: 40px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 0.95rem var(--body); padding: 12px 18px; border-radius: 6px; border: 1.5px solid var(--forest); background: var(--forest); color: var(--surface); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.alt { background: transparent; color: var(--forest); }
.btn.hot { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: wait; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 6px; padding: 12px 14px; width: 100%; }
label { font-weight: 600; font-size: 0.9rem; display: grid; gap: 6px; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 12px; }
.hero p.lede { font-size: 1.1rem; color: var(--muted); max-width: 56ch; margin-top: 14px; }
.search { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: grid; gap: 14px; box-shadow: 0 1px 0 var(--line); }
.search .row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 10px; }
.search small { color: var(--muted); }
.plat { aspect-ratio: 1; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.path { border: 1px solid var(--line); border-radius: 10px; padding: 22px; background: var(--surface); display: grid; gap: 10px; align-content: start; }
.path .price { font: 700 1.6rem var(--display); }
.path.records { border-color: var(--orange); }
.coverage { display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--forest-soft); color: var(--forest); white-space: nowrap; }
.chip.orange { background: var(--orange-soft); color: var(--orange); }
.chip.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* address matches */
.matches { display: grid; gap: 8px; }
.match { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.match:hover { border-color: var(--forest); }
.notice { padding: 14px 16px; border-radius: 8px; background: var(--orange-soft); color: var(--ink); }
.notice.ok { background: var(--forest-soft); }

/* results */
.res-head { display: grid; gap: 8px; }
.trs { font-family: var(--mono); font-size: 0.9rem; color: var(--forest); }
.res-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
#map, .map { height: 460px; border-radius: 10px; border: 1px solid var(--line); z-index: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 2px solid; }
.sw.you { border-color: var(--orange); background: var(--orange-soft); }
.sw.has { border-color: var(--good); background: var(--forest-soft); }
.sw.none { border-color: #8a958f; background: transparent; }
.big { font: 700 2.4rem/1 var(--display); color: var(--forest); }
.verdict { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 12px; }
.nlist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nlist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 6px; background: var(--bg); font-size: 0.92rem; }
.nlist li .n { font-weight: 600; white-space: nowrap; }
.nlist li.has .n { color: var(--good); }
.nlist li.none .n { color: var(--muted); font-weight: 500; }
.cta-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* firms */
.why { background: var(--forest-soft); border-radius: 10px; padding: 18px 20px; display: grid; gap: 8px; }
.firms { display: grid; gap: 12px; }
.firm { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.firm.top { border-color: var(--forest); }
.rank { font: 700 1.3rem var(--display); color: var(--forest); }
.firm h3 a { color: var(--ink); text-decoration: none; }
.firm h3 a:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.dist { text-align: right; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.dist b { display: block; font: 700 1.1rem var(--display); color: var(--ink); }
.stars { color: var(--orange); letter-spacing: 1px; }
.filter { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 10px; }

/* profile & reviews */
.profile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 12px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 0.93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.review { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 4px; }
.rate { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-size: 1.8rem; color: var(--line); cursor: pointer; font-weight: 400; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--orange); }
.rate input:focus-visible + label { outline: 3px solid var(--orange); }
.hp { position: absolute; left: -9999px; }

/* report */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 32px; display: grid; gap: 22px; }
.rep-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td { font-variant-numeric: tabular-nums; }
.disclaimer { font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }

.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--forest); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { padding-block: 24px; display: grid; gap: 8px; font-size: 0.85rem; max-width: 1120px; }

@media (max-width: 860px) {
  .hero, .res-grid, .profile, .paths, .cta-row { grid-template-columns: minmax(0, 1fr); }
  .plat { display: none; }
  #map, .map { height: 340px; }
}
@media (max-width: 520px) {
  .search .row, .filter { grid-template-columns: minmax(0, 1fr); }
  .firm { grid-template-columns: minmax(0, 1fr); }
  .rank { display: none; }
  .dist { text-align: left; }
  .report { padding: 18px; }
  .nav { gap: 14px; }
}

@media print {
  .top, .foot, .toolbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { padding: 0; }
  .report { border: 0; padding: 0; }
  .map { height: 380px; break-inside: avoid; }
  a { color: #000; }
  .tbl-wrap { overflow: visible; }
  tr { break-inside: avoid; }
}

/* guide dog (placeholder art) */
.guide { display: flex; align-items: flex-end; gap: 12px; margin-top: 22px; }
.guide svg { flex: none; width: 84px; height: 84px; }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; padding: 10px 14px; font: 600 1rem/1.35 var(--display); max-width: 34ch; margin-bottom: 30px; }
.bubble::before { content: ""; position: absolute; left: -11px; bottom: 12px; border: 10px solid transparent; border-right-color: var(--ink); border-left: 0; }
.bubble::after { content: ""; position: absolute; left: -7px; bottom: 14px; border: 8px solid transparent; border-right-color: var(--surface); border-left: 0; }
.bubble span { display: block; font: 400 0.9rem/1.45 var(--body); color: var(--muted); margin-top: 2px; }

/* fence planner */
.fence-cta { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--forest-soft); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-top: 24px; }
.fence-cta > div { display: grid; gap: 6px; max-width: 62ch; min-width: 0; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 18px 0 14px; counter-reset: st; }
.steps li { counter-increment: st; font: 600 .85rem var(--body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.steps li::before { content: counter(st) ". "; }
.steps li.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.fence-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 40px; }
.fence-map-col, .fence-side { display: grid; gap: 12px; min-width: 0; }
#fmap { position: relative; z-index: 0; isolation: isolate; height: min(68vh, 620px); min-height: 380px; border-radius: 14px; border: 1px solid var(--line); cursor: crosshair; }
.guide.small { margin-top: 0; }
.guide.small svg { width: 64px; height: 64px; }
.guide.small .bubble { margin-bottom: 18px; font-size: .95rem; font-weight: 500; }
.btn.sm { padding: 8px 12px; font-size: .88rem; min-height: 0; }
.btn[aria-pressed="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }
.fine { font-size: .86rem; line-height: 1.5; }
.len-label, .gate-label { background: rgba(22,35,29,.85); color: #fff; font: 600 12px/1 var(--body); padding: 4px 6px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -50%); }
.gate-label { background: #c2410c; }
.big-num { font: 700 2.4rem/1 var(--display); }
.big-num span { font: 500 1rem var(--body); color: var(--muted); }
.issues { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 8px; }
.issues li { padding: 10px 12px; border-radius: 10px; font-size: .9rem; border-left: 4px solid var(--warn); background: var(--orange-soft); }
.issues li.bad { border-left-color: #b42318; }
.issues li.info { border-left-color: var(--forest); background: var(--forest-soft); }
.stack { display: grid; gap: 12px; }
.stack label, .gates label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.stack input, .stack select, .stack textarea, .gates input { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.seg legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.seg label, .check { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.check input, .seg input { width: auto; margin-top: 4px; }
.gates { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.permit-line { font-weight: 600; margin: 6px 0 10px; }
.permit-line.ok { color: var(--good); }
.desc { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .92rem; }
.sendbox { display: grid; gap: 10px; margin-top: 8px; }
#panel h3 { margin-top: 12px; }
#panel, #rulecard { display: grid; gap: 8px; }
@media (max-width: 860px) { .fence-grid { grid-template-columns: minmax(0, 1fr); } #fmap { height: 60vh; } }

.howto{font-size:1rem;margin:14px 0 6px}
.filing{padding-left:1.2em;margin:0 0 8px}
.filing li{margin:3px 0}

/* Static guide pages */
.guide-page{padding-block:8px 48px;max-width:860px}
.guide-page h1{font-size:clamp(1.7rem,4vw,2.5rem);text-wrap:balance}
.guide-page h2{font-size:1.25rem;margin:28px 0 10px}
.guide-page section.card h2{margin-top:0}
.guide-page .lede{font-size:1.08rem;max-width:65ch}
.guide-page article>section,.guide-page>section{margin-block:18px}
.crumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:6px;padding:0;margin:14px 0 4px;font-size:.88rem}
.crumbs li+li::before{content:"›";margin-right:6px;color:var(--muted,#6b7a72)}
.crumbs a{color:inherit}
.guide-page details{border-top:1px solid var(--line,#d9ded8);padding:10px 0}
.guide-page details summary{cursor:pointer;font-weight:600}
.guide-page details p{margin:8px 0 0}
.guide-page .sources{word-break:break-word}
.rules-tbl{width:100%;border-collapse:collapse;font-size:.95rem}
.rules-tbl th,.rules-tbl td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line,#d9ded8);vertical-align:top}
.county-list{list-style:none;padding:0;display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.nearby .chips{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.guide-page .cta-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-block:18px}
.guide-page .cta-row .fine{flex:1 1 260px;min-width:0}

.corr-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.correction .hp{position:absolute;left:-9999px}

.service-line{max-width:65ch;margin:6px 0 0;padding:10px 14px;border-left:3px solid var(--orange);background:var(--surface);border-radius:0 8px 8px 0}
.guide-page a.src{font-size:.75rem;color:var(--muted);margin-left:4px;white-space:nowrap}
