html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
}
#container {
  display: grid;
  height: 100vh;
  width: 100vw;
}
#container[data-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
#container[data-count="2"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}
#container[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
#container[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
#container[data-count="9"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.map-wrapper {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.map-wrapper.hidden {
  display: none;
}
.map {
  height: 100%;
  width: 100%;
}
.selector {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  padding: 6px;
  border-radius: 4px;
  font-size: 14px;
}
.layout-selector {
  position: fixed;
  top: auto;
  bottom: 10px;
}
.layer-selector {
  padding: 0;
  min-width: 190px;
}
.layer-selector-button {
  width: 100%;
  max-width: 280px;
  border: 0;
  background: transparent;
  padding: 6px 24px 6px 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-selector-button::after {
  content: "▾";
  position: absolute;
  right: 8px;
}
.layer-selector-menu {
  display: none;
  min-width: 260px;
  max-width: 360px;
  max-height: 65vh;
  overflow: auto;
  border-top: 1px solid rgba(0,0,0,0.15);
}
.layer-selector.open .layer-selector-menu {
  display: block;
}
.layer-group-title {
  padding: 8px 8px 4px;
  font-weight: bold;
  color: #555;
}
.layer-option,
.layer-overlay-option {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px 8px 5px 18px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.layer-option:hover,
.layer-overlay-option:hover {
  background: rgba(0,0,0,0.08);
}
.layer-option.active {
  font-weight: bold;
}
.layer-overlay-option input {
  margin-right: 6px;
}

.crosshair {
  position: absolute;
  display: none;
  width: 24px;
  height: 24px;
  z-index: 999;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: #000;
}
.crosshair::before {
  left: 11px;
  top: 0;
  width: 2px;
  height: 24px;
}
.crosshair::after {
  left: 0;
  top: 11px;
  width: 24px;
  height: 2px;
}
