:root {
  --bg-top: #f6f6f2;
  --bg-bottom: #d6eadf;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(21, 63, 46, 0.15);
  --text: #183226;
  --muted: #4c675b;
  --accent: #0a7a47;
  --accent-2: #f07f34;
  --shadow: 0 20px 40px rgba(26, 59, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, var(--bg-top), var(--bg-bottom));
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 15% 20%, rgba(240, 127, 52, 0.18), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(10, 122, 71, 0.15), transparent 35%);
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 16px;
  padding: 16px;
  min-height: 100vh;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.controls-panel {
  padding: 20px;
  overflow: auto;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.7rem;
  margin: 0;
}

.subtitle {
  margin: 6px 0 16px;
  color: var(--muted);
}

.controls {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 9px 10px;
  border: 1px solid rgba(24, 50, 38, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: linear-gradient(125deg, var(--accent), #138a55);
  color: white;
  font-weight: 600;
}

button.ghost {
  background: rgba(10, 122, 71, 0.1);
  color: var(--accent);
}

.status {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

.results {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  padding-right: 6px;
}

.result-item {
  border: 1px solid rgba(24, 50, 38, 0.15);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transform: translateY(6px);
  opacity: 0;
  animation: rise 250ms ease forwards;
}

.result-title {
  font-weight: 700;
}

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

.map-panel {
  overflow: hidden;
}

#map {
  width: 100%;
  height: calc(100vh - 32px);
  border-radius: 16px;
}

.popup-link {
  display: inline-block;
  margin-top: 6px;
  color: #075fb8;
  text-decoration: none;
}

.popup-link:hover {
  text-decoration: underline;
}

@keyframes rise {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .results {
    max-height: 34vh;
  }

  #map {
    height: 58vh;
  }
}
