:root {
  --green: #118a4f;
  --deep-green: #075f38;
  --flag-blue: #012169;
  --flag-red: #c8102e;
  --sun-yellow: #ffcc00;
  --paper: #f7f8f3;
  --ink: #132117;
  --muted: #617067;
  --line: #dce6dc;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(13, 45, 27, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(17, 138, 79, 0.16), transparent 28rem),
    linear-gradient(135deg, #f4f7ef 0%, #edf5ed 45%, #f7faf5 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  gap: 18px;
  padding: 18px;
}

.control-panel,
.map-panel {
  border: 1px solid rgba(17, 138, 79, 0.16);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.control-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 36px);
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-radius: 8px;
  padding: 22px;
}

.brand-block {
  display: grid;
  gap: 14px;
  position: sticky;
  top: -22px;
  z-index: 20;
  margin: -22px -22px 18px;
  border-bottom: 1px solid rgba(17, 138, 79, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    #ffffff;
  padding: 22px 22px 16px;
  backdrop-filter: blur(12px);
}

.logo-mark {
  width: fit-content;
  border: 3px solid var(--deep-green);
  box-shadow: 8px 8px 0 var(--sun-yellow);
  background: var(--white);
  padding: 10px 13px 9px;
  line-height: 0.88;
  transform: rotate(-1deg);
}

.logo-main,
.logo-sub {
  display: block;
  font-family:
    Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Heavy", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo-main {
  color: var(--green);
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  -webkit-text-stroke: 1px var(--deep-green);
}

.logo-sub {
  width: fit-content;
  margin-top: 5px;
  padding: 4px 9px 5px;
  background:
    linear-gradient(90deg, var(--flag-blue) 0 37%, var(--sun-yellow) 37% 49%, var(--flag-red) 49% 100%);
  color: var(--white);
  font-size: clamp(1rem, 4vw, 1.38rem);
  letter-spacing: 0.16em;
}

.intro {
  margin: 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.notice {
  margin: 20px 0 16px;
  border-left: 4px solid var(--green);
  background: #edf7ef;
  color: #245238;
  padding: 12px 13px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--deep-green);
  font-weight: 800;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(17, 138, 79, 0.12);
}

.filter-group {
  display: grid;
  gap: 9px;
  margin-bottom: 15px;
}

.filter-group p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: #294436;
  cursor: pointer;
  padding: 8px 11px;
  font-size: 0.9rem;
  font-weight: 750;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.active {
  border-color: var(--deep-green);
  background: var(--deep-green);
  color: var(--white);
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
  color: var(--muted);
}

.results-head span {
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 900;
}

.results-head strong {
  font-size: 0.9rem;
}

#resetButton {
  border: 0;
  border-radius: 8px;
  background: #e7eee8;
  color: var(--deep-green);
  cursor: pointer;
  font-weight: 850;
  padding: 9px 12px;
}

.place-list {
  display: grid;
  gap: 10px;
  overflow: visible;
  padding-right: 3px;
}

.place-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  padding: 14px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.place-card:hover,
.place-card.active {
  border-color: rgba(17, 138, 79, 0.48);
  box-shadow: 0 12px 26px rgba(12, 70, 38, 0.12);
  transform: translateY(-2px);
}

.place-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.place-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.place-meta span {
  border-radius: 999px;
  background: #eef4ee;
  color: #315341;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.place-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.place-card .place-detail {
  margin-bottom: 7px;
  color: #40594b;
  font-size: 0.84rem;
}

.place-detail strong {
  color: var(--deep-green);
}

.actions {
  display: flex;
  gap: 8px;
}

.actions a {
  border-radius: 7px;
  color: var(--deep-green);
  background: #eaf6ee;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 850;
}

.map-panel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  height: calc(100vh - 36px);
  min-height: 0;
}

.map-toolbar {
  position: absolute;
  z-index: 800;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 36px rgba(16, 54, 31, 0.14);
  padding: 12px 14px;
}

.map-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill {
  border-radius: 999px;
  background: var(--deep-green);
  color: var(--white);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-fallback {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(17, 138, 79, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(17, 138, 79, 0.12) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(255, 204, 0, 0.18), transparent 20rem),
    #edf5ed;
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto;
  color: var(--deep-green);
}

.map-fallback div {
  max-width: 28rem;
  border: 1px solid rgba(17, 138, 79, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  padding: 20px;
}

.map-fallback strong,
.map-fallback span {
  display: block;
}

.map-fallback span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.custom-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid var(--white);
  border-radius: 8px;
  background: var(--deep-green);
  color: var(--white);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  font-size: 1rem;
}

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

.popup-title {
  margin: 0 0 5px;
  color: var(--ink);
  font-weight: 900;
}

.popup-copy {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  border: 1px dashed #b7cdbd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  padding: 18px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px;
    overflow: visible;
  }

  .control-panel {
    order: 2;
    height: auto;
    overflow: visible;
  }

  .brand-block {
    position: static;
    margin: 0;
    border-bottom: 0;
    background: transparent;
    padding: 0;
    backdrop-filter: none;
  }

  .map-panel {
    order: 1;
    height: 55vh;
    min-height: 55vh;
  }

  #map {
    height: 100%;
    min-height: 55vh;
  }
}

@media (max-width: 560px) {
  .app-shell {
    gap: 10px;
  }

  .control-panel {
    padding: 16px;
  }

  .logo-mark {
    box-shadow: 6px 6px 0 var(--sun-yellow);
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .actions {
    flex-wrap: wrap;
  }
}
