:root {
  color-scheme: light;
  --ink: #17201f;
  --muted: #62706c;
  --line: #dce7e2;
  --surface: #ffffff;
  --soft: #f4f8f6;
  --deep: #064c48;
  --green: #0b8f64;
  --gold: #d79b31;
  --blue: #315b8c;
  --shadow: 0 24px 70px rgba(15, 47, 43, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

html.qoreid-active,
body.qoreid-active {
  background: #fff;
}

html.qoreid-active {
  scroll-behavior: auto;
}

html.qoreid-active .topbar,
body.qoreid-active .topbar,
html.qoreid-active footer,
body.qoreid-active footer {
  display: none !important;
  visibility: hidden !important;
}

html.qoreid-active body,
body.qoreid-active main {
  min-height: 100dvh;
  background: #fff;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(220, 231, 226, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  gap: 18px;
}

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

.primary-action,
.secondary-action,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-action {
  padding: 0 18px;
  background: var(--deep);
  color: white;
  box-shadow: 0 12px 24px rgba(6, 76, 72, 0.2);
}

.secondary-action {
  padding: 0 18px;
  background: white;
  color: var(--deep);
  border: 1px solid var(--line);
}

.large {
  min-height: 50px;
  padding-inline: 22px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(26px, 4vw, 44px);
  align-items: start;
  min-height: auto;
  padding: clamp(34px, 6vw, 66px) clamp(18px, 4vw, 54px) 38px;
}

.hero-copy {
  max-width: 940px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 20px;
  font-size: clamp(2.9rem, 5vw, 5.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 3.4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.02rem;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.28rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.finder {
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(11, 143, 100, 0.11);
}

textarea {
  min-height: 132px;
  padding-block: 12px;
  resize: vertical;
}

.map-and-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  height: clamp(520px, 62vh, 720px);
  min-height: 520px;
}

.map-wrap {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 520px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: #dfe9e5;
}

.map-status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 600;
  max-width: calc(100% - 32px);
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--deep);
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(19, 48, 45, 0.14);
}

.results-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-left: 1px solid var(--line);
  background: #fbfdfc;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.results-header span,
.results-header strong {
  display: block;
}

.results-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.icon-button {
  display: grid;
  width: 42px;
  place-items: center;
  background: var(--soft);
  color: var(--deep);
  border: 1px solid var(--line);
}

.artisan-list {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.artisan-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.artisan-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.artisan-card h3 {
  margin: 0 0 4px;
}

.artisan-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef8f3;
  color: var(--deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.badge.gold {
  background: #fff5df;
  color: #86601b;
}

.rating {
  white-space: nowrap;
  color: var(--gold);
  font-weight: 900;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-actions button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fbfa;
  color: var(--deep);
  font-weight: 900;
}

.state-strip,
.category-section,
.trust-band,
.plans-section,
.join-section {
  padding: 72px clamp(18px, 4vw, 54px);
}

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

.state-grid,
.category-grid,
.trust-grid,
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.state-card,
.category-card,
.trust-grid article,
.plan {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.state-card button {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--deep);
  font-weight: 900;
}

.state-card p,
.category-card p,
.trust-grid p,
.plan p,
.join-section p {
  color: var(--muted);
  line-height: 1.6;
}

.category-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 8px;
  background: #ecf7f2;
  color: var(--deep);
  font-weight: 900;
}

.trust-band {
  background: #102f2d;
  color: white;
}

.trust-band .eyebrow {
  color: #88dfbd;
}

.trust-grid article {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.trust-grid span {
  color: #88dfbd;
  font-weight: 900;
}

.trust-grid p {
  color: rgba(255, 255, 255, 0.74);
}

.plan.featured {
  border-color: rgba(11, 143, 100, 0.45);
  box-shadow: 0 18px 48px rgba(11, 143, 100, 0.14);
}

.price {
  margin-bottom: 12px;
  color: var(--deep) !important;
  font-size: 1.7rem;
  font-weight: 950;
}

.join-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  background: white;
}

.join-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.join-form button {
  grid-column: 1 / -1;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #f3faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.consent-row input {
  width: auto;
  margin-top: 4px;
}

.consent-row span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 54px);
  color: white;
  background: #071d1b;
}

.modal-open {
  overflow: hidden;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(7, 29, 27, 0.58);
}

.modal-shell.is-open {
  display: flex;
}

.modal-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: clamp(20px, 3vw, 34px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quote-panel {
  width: min(760px, 100%);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--deep);
  font-weight: 900;
  z-index: 2;
}

.profile-hero {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 20px;
  align-items: center;
  padding-right: 72px;
}

.profile-avatar {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  font-size: 1.8rem;
  font-weight: 950;
}

.profile-hero h2,
.quote-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.profile-hero p,
.quote-heading p,
.form-note {
  color: var(--muted);
  line-height: 1.6;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.profile-metrics.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 12px;
}

.profile-metrics span {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-metrics strong {
  display: block;
  color: var(--deep);
  font-size: 1.35rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-grid section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list span {
  padding: 9px 10px;
  background: #eef8f3;
  border-radius: 8px;
  color: var(--deep);
  font-weight: 800;
}

.portfolio-grid {
  display: grid;
  gap: 9px;
}

.portfolio-grid article {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.portfolio-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quote-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full-span,
.quote-form button,
.form-note {
  grid-column: 1 / -1;
}

.form-note {
  margin: 0;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.success-note {
  color: var(--deep);
  background: #eef8f3;
  border-color: rgba(11, 143, 100, 0.32);
  font-weight: 800;
}

.error-note {
  color: #8a2c1b;
  background: #fff1ed;
  border-color: rgba(194, 82, 48, 0.32);
  font-weight: 800;
}

.status-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 10px 14px;
  width: fit-content;
  border: 0;
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.status-action-link:hover {
  background: var(--accent);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border-radius: 8px;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  touch-action: pan-x pan-y;
}

.leaflet-pane,
.leaflet-map-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-container img {
  max-width: none !important;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 900;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-zoom a {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: white;
  border-bottom: 1px solid var(--line);
  color: var(--deep);
  font-weight: 900;
  text-decoration: none;
}

.leaflet-control-attribution {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
}

.map-pin {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 3px solid white;
  border-radius: 999px;
  background: var(--deep);
  color: white;
  box-shadow: 0 8px 18px rgba(6, 76, 72, 0.3);
}

.map-pin::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
}

.popup-title {
  display: block;
  margin-bottom: 4px;
  color: var(--deep);
  font-weight: 950;
}

@media (max-width: 1120px) {
  .join-section {
    grid-template-columns: 1fr;
  }

  .search-panel,
  .state-grid,
  .category-grid,
  .trust-grid,
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: start;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .map-and-results {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-wrap,
  #map {
    min-height: 430px;
    height: 430px;
  }

  .results-panel {
    min-height: auto;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .artisan-list {
    max-height: 520px;
  }

  .profile-hero,
  .profile-metrics,
  .profile-metrics.compact,
  .profile-grid,
  .quote-form {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    padding-right: 0;
  }
}

@media (max-width: 620px) {
  .topbar .primary-action {
    width: 100%;
  }

  .search-panel,
  .state-grid,
  .category-grid,
  .trust-grid,
  .plans-grid,
  .join-form {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .hero-actions button,
  .card-actions,
  footer {
    width: 100%;
  }

  .hero-actions button {
    flex: 1 1 100%;
  }

  .map-wrap,
  #map {
    min-height: 360px;
    height: 360px;
  }

  footer {
    flex-direction: column;
  }
}
