:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

body {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #222;
}

.map-header {
  box-sizing: border-box;
  min-height: 72px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #ddd;
}

.title-block h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.title-block p {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: #666;
}

.map-actions {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.select-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #555;
}

.layer-toggle {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  white-space: nowrap;
  font-size: 0.9rem;
}

.layer-toggle input {
  width: 17px;
  height: 17px;
}

.map-actions select,
.map-actions button {
  box-sizing: border-box;
  min-height: 36px;
  border: 1px solid #bbb;
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
  color: #222;
  font: inherit;
}

.map-actions select {
  min-width: 170px;
}

.map-actions button {
  cursor: pointer;
}

.map-actions button:hover {
  background: #f3f3f3;
}

main {
  flex: 1;
  min-height: 0;
}

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

.maplibregl-popup-content {
  min-width: 180px;
}

.maplibregl-popup-content h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.maplibregl-popup-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.maplibregl-ctrl-attrib {
  font-size: 11px;
}

@media (max-width: 800px) {
  .map-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .map-actions {
    width: 100%;
    align-items: stretch;
  }

  .select-control {
    flex: 1;
  }

  .map-actions select {
    width: 100%;
    min-width: 0;
  }
}
