:root {
  --bg: #f4f1e8;
  --panel: rgba(255, 252, 245, 0.95);
  --panel-border: rgba(71, 59, 45, 0.16);
  --text: #2e241d;
  --muted: #756454;
  --accent: #c05a2b;
  --accent-soft: rgba(192, 90, 43, 0.12);
  --line: #d6c7b6;
  --shadow: 0 18px 45px rgba(40, 28, 18, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #efe8da 0%, #f8f4ec 100%);
  color: var(--text);
}

body {
  display: grid;
  grid-template-columns: 360px 1fr;
}

.sidebar {
  padding: 24px 20px;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  overflow-y: auto;
  z-index: 1000;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: "Bitter", Georgia, serif;
  font-size: 1.8rem;
  line-height: 1.1;
}

.intro,
.hint,
.meta {
  color: var(--muted);
  line-height: 1.5;
}

.hint {
  margin-top: 8px;
  font-size: 0.92rem;
}

.meta {
  margin-top: 16px;
  font-size: 0.85rem;
}

.section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
}

.checkbox-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

label {
  font-weight: 600;
}

select,
button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: #fffdf9;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(192, 90, 43, 0.2);
}

.button-row {
  display: grid;
  gap: 10px;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

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

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

.leaflet-popup-content {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.4;
}

.leaflet-control-attribution {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    max-height: 48vh;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }

  #map {
    height: 52vh;
  }
}
