:root {
  --bg: #efefef;
  --surface: #f7f7f7;
  --surface-2: #ffffff;
  --ink: #111111;
  --muted: #555555;
  --line: #dddddd;
  --brand: #2f43f2;
  --brand-deep: #2318d8;
  --brand-soft: #dce0ff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.page-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 500px) minmax(0, 1fr);
  align-items: stretch;
  min-height: 280px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 0 0 36px 36px;
  background: #f3f3f3;
  overflow: hidden;
}

.hero-art {
  position: relative;
  overflow: hidden;
  background: var(--brand);
  border-bottom-right-radius: 240px;
}

.pattern-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.pattern-grid span {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.08) 0 34%, transparent 35%),
    radial-gradient(circle at 100% 0%, rgba(0, 0, 0, 0.12) 0 34%, transparent 35%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.08) 0 34%, transparent 35%),
    radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.1) 0 34%, transparent 35%);
  opacity: 0.95;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: center;
  padding: 32px 36px;
}

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

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #505050;
}

.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.6rem, 4.2vw, 4.3rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.lede {
  margin: 14px 0 0;
  max-width: 16ch;
  font-size: clamp(1.25rem, 1.9vw, 2rem);
  line-height: 1.15;
  font-weight: 800;
}

.lede span {
  color: var(--brand);
}

.hero-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.primary-link {
  width: fit-content;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.hero-note {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-self: stretch;
}

.stat-card {
  padding: 16px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid #e7e7e7;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.intro-panel {
  display: grid;
  grid-template-columns: 1.2fr minmax(240px, 420px);
  gap: 18px;
  align-items: end;
  padding: 30px 32px 16px;
}

.intro-copy {
  max-width: 980px;
}

.intro-kicker {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #3a3633;
}

.intro-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.1vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  max-width: 18ch;
}

.intro-copy mark {
  background: #eee5cf;
  padding: 0 4px;
}

.intro-copy p {
  margin: 0 0 14px;
  max-width: 70ch;
  color: #454545;
  font-size: 1.02rem;
  line-height: 1.65;
}

.cta-strip {
  align-self: end;
  display: grid;
  place-items: center;
  min-height: 68px;
  border-radius: 20px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 12px 30px rgba(47, 67, 242, 0.28);
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1.35fr) 340px;
  grid-template-areas:
    "controls map detail"
    "list list list";
  gap: 18px;
  padding: 18px 18px 40px;
}

.controls-panel,
.map-panel,
.list-panel,
.detail-panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: #f8f8f8;
  border: 1px solid #e2e2e2;
}

.controls-panel {
  grid-area: controls;
}

.map-panel {
  grid-area: map;
}

.detail-panel {
  grid-area: detail;
}

.list-panel {
  grid-area: list;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-button {
  border: 1px solid #d6d6d6;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid #d8d8d8;
  background: #fff;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--ink);
}

.results-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 6px;
}

.results-meta div {
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e2e2e2;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

#map {
  min-height: 720px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #dddddd;
}

.detail-card {
  min-height: 320px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e2e2e2;
}

.detail-panel.is-collapsed .detail-card {
  min-height: 148px;
}

.detail-card.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.detail-card.collapsed {
  gap: 8px;
  text-align: center;
  background: #fdfdfd;
}

.detail-card.collapsed strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
}

.detail-card.collapsed span {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-card h3,
.result-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.detail-card p {
  color: var(--muted);
  line-height: 1.6;
}

.detail-meta {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.detail-meta div {
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

.detail-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.detail-meta strong,
.detail-meta a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.results-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.result-item {
  padding: 16px;
  border: 1px solid #e2e2e2;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.result-item:hover,
.result-item.active {
  transform: translateY(-2px);
  border-color: rgba(47, 67, 242, 0.4);
  box-shadow: 0 14px 32px rgba(47, 67, 242, 0.12);
}

.result-item > div:not(.chip-row) {
  color: var(--muted);
  line-height: 1.55;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fff;
}

.popup-content {
  font-family: "Manrope", sans-serif;
}

.popup-content strong {
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 1240px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-content {
    grid-template-columns: 1fr;
    padding: 24px 20px 28px;
  }

  .hero-art {
    min-height: 260px;
    border-bottom-right-radius: 160px;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "map"
      "detail"
      "list";
  }

  .intro-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero-copy,
  .intro-panel,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .layout {
    padding-bottom: 28px;
  }

  #map {
    min-height: 460px;
  }

  .results-list {
    grid-template-columns: 1fr;
  }
}
