:root {
  color-scheme: light;
  --bg: #f7f6ef;
  --surface: #ffffff;
  --surface-soft: #edf3e7;
  --text: #1f2a22;
  --muted: #667166;
  --line: #d9dfd1;
  --green: #2f6f43;
  --green-dark: #224f31;
  --gold: #b5822b;
  --blue: #316a80;
  --danger: #8f4b35;
  --shadow: 0 18px 45px rgba(31, 42, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 246, 239, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.95rem;
}

.nav-links a[aria-current="page"] {
  color: var(--green-dark);
}

.button,
button {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
}

.button.secondary {
  background: #e8efe2;
  color: var(--green-dark);
}

.button.ghost {
  background: transparent;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 46px 20px 26px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 28px;
  align-items: stretch;
}

.eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 850;
}

h1,
h2,
h3 {
  line-height: 1.08;
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  max-width: 760px;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

p {
  margin: 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 720px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 1.7rem;
  color: var(--green-dark);
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.map-shell {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #dfe9d6;
  box-shadow: var(--shadow);
}

#map,
#mini-map {
  height: 100%;
  min-height: 520px;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head p {
  color: var(--muted);
  max-width: 680px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #e6eadf;
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-top h3 {
  font-size: 1.05rem;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  width: fit-content;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 850;
  background: #e4f2df;
  color: var(--green-dark);
}

.badge.muted {
  background: #f0eee6;
  color: #716b5f;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.page-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 20px 22px;
}

.page-hero .lead {
  margin-top: 14px;
}

.detail-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 44px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.fact {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fact strong {
  display: block;
}

.fact span {
  color: var(--muted);
}

.facts a.fact {
  color: inherit;
  display: block;
  text-decoration: none;
}

.facts a.fact:hover strong {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.coverage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.coverage-table th,
.coverage-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

.coverage-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.coverage-table td {
  font-weight: 650;
}

.coverage-table tr:last-child td {
  border-bottom: 0;
}

.coverage-table .number-cell {
  text-align: right;
}

.coverage-table a {
  color: var(--green-dark);
  font-weight: 850;
  text-decoration-color: rgba(47, 111, 67, 0.35);
  text-underline-offset: 3px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  color: var(--muted);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.leaflet-popup-content a {
  color: var(--green-dark);
  font-weight: 800;
}

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .about-grid,
  .stats,
  .facts {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-shell,
  #map,
  #mini-map {
    min-height: 420px;
  }
}

@media (max-width: 520px) {
  .nav-links {
    width: 100%;
  }

  .nav-links .button {
    width: 100%;
  }

  .hero {
    padding-top: 30px;
  }
}

/* ---- Map explorer ---- */
.hero-slim { grid-template-columns: 1fr; padding-bottom: 8px; }
.hero-slim .hero-copy { max-width: 860px; }
.explorer { max-width: 1400px; margin: 0 auto; padding: 8px 20px 28px; }
.map-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(110px, 1fr)) minmax(270px, 1.9fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.map-filters label { display: flex; flex-direction: column; gap: 4px; }
.map-filters input, .map-filters select {
  width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 6px;
  padding: 0 10px; font: inherit; background: #fff; color: var(--text);
}
.map-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.86rem; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .key i { width: 12px; height: 12px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.legend .key em, .legend .key-fine { color: var(--muted); font-style: normal; }
.map-big, .map-big #map { min-height: 70vh; }
.map-fine { color: var(--muted); font-size: 0.84rem; margin-top: 8px; }
.t3-marker .dot { display: block; border: 2px solid #fff; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.t3-marker .dot-hiring { box-shadow: 0 0 0 3px rgba(31,122,63,.35), 0 2px 6px rgba(0,0,0,.3); }
.t3-cluster { background: none; }
.t3-cluster .cluster {
  display: grid; place-items: center; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.t3-cluster .cluster-inner {
  display: grid; place-items: center; text-align: center; line-height: 1.05;
  width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 999px;
  background: #fff; color: var(--text); font-weight: 800; font-size: 0.82rem;
}
.t3-cluster .cluster-inner small { display: block; font-size: 0.6rem; font-weight: 700; color: #1f7a3f; }
.pop { font-size: 0.86rem; line-height: 1.4; }
.pop-name { font-size: 1rem; }
.pop-meta { color: var(--muted); margin-bottom: 6px; }
.pop-status { border-left: 4px solid var(--c); padding-left: 8px; margin: 6px 0; }
.pop-note { color: var(--muted); margin-bottom: 6px; }
.pop-note.warn { color: #8f4b35; }
.pop-guide { margin-top: 4px; }
.pop-fine { color: var(--muted); font-size: 0.78rem; }
.pop-links { margin-top: 8px; font-weight: 700; }
@media (max-width: 980px) {
  .map-filters { grid-template-columns: 1fr 1fr; }
  .map-filters .grow { grid-column: 1 / -1; }
  .map-big, .map-big #map { min-height: 62vh; }
}
@media (max-width: 520px) {
  .explorer { padding: 8px 12px 20px; }
  .map-filters { grid-template-columns: 1fr; }
}
.nav-links a.button, .nav-links a.button:visited { color: #fff; }
.map-filters .pair { display: flex; gap: 6px; }
.map-filters .pair select { min-width: 0; }
/* keep the explorer inside narrow screens */
.hero-slim { grid-template-columns: minmax(0, 1fr); }
.map-filters > label { min-width: 0; }
.map-filters input, .map-filters select { min-width: 0; text-overflow: ellipsis; }
@media (max-width: 980px) {
  .map-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .map-filters { grid-template-columns: minmax(0, 1fr); }
  .hero-slim h1 { font-size: clamp(2rem, 9vw, 2.6rem); overflow-wrap: anywhere; }
}
.detail-panel h2 { font-size: 1.05rem; margin: 22px 0 8px; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.history li span { display: inline-block; min-width: 96px; color: var(--muted); font-variant-numeric: tabular-nums; }

.t3-marker .dot-established { box-shadow: 0 0 0 3px #d4a017, 0 2px 6px rgba(0,0,0,.3); }
.t3-marker .dot-aged { box-shadow: 0 0 0 2px rgba(212,160,23,.7), 0 2px 6px rgba(0,0,0,.3); }
.legend .key i.ring { background: #fff; box-shadow: 0 0 0 3px #d4a017; }
.pop-badge { display: inline-block; margin: 2px 0 4px; padding: 2px 8px; border-radius: 999px; background: #fbf1d3; color: #7a5a00; font-weight: 800; font-size: 0.78rem; }

/* ---- Find Work Near Me ---- */
.path-steps { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.path-form { display: grid; gap: 14px; }
.path-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.path-row label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.path-row input, .path-row select { min-height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; font: inherit; background: #fff; min-width: 0; }
.path-row input[data-path='zip'] { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.06em; }
.path-tags { display: grid; gap: 8px; }
.chips, .quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 0.86rem; cursor: pointer; text-decoration: none; }
.chip[aria-pressed='true'] { background: var(--green); border-color: var(--green); color: #fff; }
.path-saved h3 { font-size: 0.95rem; margin: 14px 0 6px; }
.path-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.path-card-top { display: flex; justify-content: space-between; gap: 10px; }
.path-card h3 a { text-decoration: none; }
.star { border: none; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #b5822b; }
.status-pill { display: inline-block; border-left: 4px solid var(--c); padding: 1px 8px; background: #f5f3ec; border-radius: 4px; font-weight: 800; font-size: 0.85rem; }
@media (max-width: 860px) {
  .path-steps { grid-template-columns: minmax(0, 1fr); }
  .path-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.chip-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fcfbf7; }
.chip-group summary { cursor: pointer; list-style: revert; }
.chip-group[open] summary { margin-bottom: 8px; }

.detail-side { display: grid; gap: 14px; align-content: start; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.photo img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.photo figcaption { font-size: 0.78rem; color: var(--muted); padding: 6px 10px; }
