:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #eef0ed;
}

.fallback-map {
  position: relative;
  display: grid;
  place-items: center;
  padding: 64px 24px 24px;
  background:
    linear-gradient(rgba(52, 78, 66, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 78, 66, 0.08) 1px, transparent 1px),
    #edf1ec;
  background-size: 40px 40px;
}

.fallback-svg {
  width: min(100%, 980px);
  max-height: calc(100vh - 120px);
  filter: drop-shadow(0 16px 30px rgba(38, 49, 43, 0.18));
}

.fallback-bg {
  fill: #f9fbf8;
  stroke: rgba(42, 52, 47, 0.2);
  stroke-width: 1;
}

.fallback-dot {
  fill: #d93f2f;
  stroke: #7f2118;
  stroke-width: 0.8;
  cursor: pointer;
}

.fallback-dot:hover {
  fill: #2f5e54;
}

.fallback-label {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 5px 8px;
  border: 1px solid rgba(30, 38, 34, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: #59665f;
  font-size: 12px;
}

.fallback-popup {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  width: min(340px, calc(100vw - 36px));
  border: 1px solid rgba(30, 38, 34, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(24, 32, 28, 0.22);
}

.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  max-width: calc(100vw - 28px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 38, 34, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(35, 42, 38, 0.14);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  color: #1f2824;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: 0;
}

.topbar p {
  margin: 1px 0 0;
  color: #65716a;
  font-size: 12px;
}

.search {
  display: flex;
  gap: 6px;
  width: min(220px, 38vw);
}

.search input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #b9c2bd;
  border-radius: 6px;
  background: #fff;
  color: #1f2824;
  font-size: 13px;
}

.search button {
  height: 30px;
  padding: 0 11px;
  border: 1px solid #2f5e54;
  border-radius: 6px;
  background: #2f5e54;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.maplibregl-popup-content {
  min-width: 280px;
  max-width: 340px;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(24, 32, 28, 0.22);
}

.popup {
  padding: 12px;
}

.popup h2 {
  margin: 0;
  color: #1d2824;
  font-size: 18px;
  letter-spacing: 0;
}

.popup .desc {
  margin: 2px 0 10px;
  color: #59665f;
  font-size: 12px;
}

.popup dl {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
  font-size: 12px;
}

.popup dt {
  color: #68756f;
}

.popup dd {
  margin: 0;
  color: #1f2824;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .topbar {
    left: 10px;
    right: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    width: auto;
  }
}

/* Base-imagery year switcher (OrthoYearControl) */
.ortho-year {
  display: flex;
  overflow: hidden;
}
.ortho-year button {
  display: block;
  width: auto;
  padding: 0 10px;
  height: 29px;
  border: 0;
  background: #fff;
  color: #26342f;
  font: 600 12px/29px system-ui, sans-serif;
  cursor: pointer;
}
.ortho-year button + button {
  border-left: 1px solid #d7ddda;
}
.ortho-year button.active {
  background: #26342f;
  color: #fff;
}
