:root {
  --ink: #17211f;
  --muted: #63716e;
  --paper: #f7f4ed;
  --surface: #ffffff;
  --line: #d8ddd6;
  --green: #247a5c;
  --blue: #1f6fb2;
  --red: #c94a3d;
  --yellow: #d39c24;
  --violet: #7b5ea7;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  min-height: 100vh;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: block;
  width: min(100%, 255px);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.masthead {
  display: grid;
  gap: 8px;
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
}

.masthead p,
.maker-notes p,
.sources,
.map-info,
.results-list {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.stats div {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.stats strong {
  display: block;
  font-size: 24px;
}

.stats span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: grid;
  gap: 12px;
}

.map-info summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.map-info summary::-webkit-details-marker {
  display: none;
}

.map-info summary::after {
  content: "+";
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.map-info[open] summary::after {
  content: "-";
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

button {
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

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

.near-actions button {
  min-width: 0;
  font-size: 13px;
}

.near-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend span,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.maker-notes,
.sources {
  display: grid;
  gap: 8px;
}

.sources ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.map-area {
  position: relative;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100vh;
  background: #dfe6df;
}

.map-info {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 500;
  width: min(380px, calc(100% - 36px));
  max-height: min(74vh, 680px);
  overflow: auto;
  border: 1px solid rgba(216, 221, 214, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.map-info[open] {
  padding-bottom: 14px;
}

.map-info section {
  display: grid;
  gap: 9px;
  padding: 0 14px 14px;
}

.map-info section + section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.park-marker {
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.park-marker,
.location-marker {
  border-radius: 50%;
  filter: drop-shadow(0 5px 9px rgba(23, 33, 31, 0.28));
}

.park-marker span,
.location-marker span {
  display: block;
  border: 3px solid #fff;
  border-radius: 50%;
}

.park-marker span {
  width: 22px;
  height: 22px;
}

.location-marker span {
  width: 26px;
  height: 26px;
  border-color: #17211f;
  background: #ffffff;
  box-shadow: inset 0 0 0 6px #247a5c;
}

.park-marker:hover span,
.park-marker:focus-visible span {
  outline: 3px solid rgba(23, 33, 31, 0.18);
  outline-offset: 3px;
}

.maplibregl-popup-content {
  max-width: min(320px, calc(100vw - 48px));
  padding: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.maplibregl-ctrl button {
  border-radius: 8px;
}

.results {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  width: min(420px, calc(100% - 36px));
  max-height: min(58vh, 560px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(216, 221, 214, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

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

.results-head button {
  min-height: 34px;
  font-size: 12px;
}

.results-list {
  overflow: auto;
}

.result-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.result-card:last-child {
  border-bottom: 0;
}

.result-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.result-card-body {
  display: grid;
  gap: 7px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.park-photo {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.park-photo img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1ec;
}

.park-photo figcaption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.result-photo {
  margin-bottom: 2px;
}

.popup {
  width: 100%;
  min-width: 0;
  max-width: 300px;
  overflow-wrap: anywhere;
}

.popup-photo {
  margin-bottom: 10px;
}

.popup h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.popup p {
  margin: 5px 0;
  color: var(--muted);
}

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

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    width: min(100%, 230px);
  }

  h1 {
    max-width: 14ch;
    font-size: 32px;
  }

  #map {
    height: 72vh;
  }

  .results {
    position: static;
    width: 100%;
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
  }

  .map-info {
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    max-height: 46vh;
  }
}
