* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font:
    16px / 1.5 Arial,
    sans-serif;
  color: #222;
}
button,
input,
summary {
  font: inherit;
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
.map-page,
#map {
  width: 100%;
  height: 100%;
  position: relative;
}
#map {
  background: #e7e9ec;
}
.hud {
  position: absolute;
  z-index: 2;
  top: 64px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.panel {
  pointer-events: auto;
  background: #fff;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px #0002;
}
.summary strong {
  display: block;
  font-size: 17px;
}
.counts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}
.focus {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.focus button {
  border: 1px solid #9467bd;
  border-radius: 6px;
  background: #fff;
  color: #633c8e;
  padding: 6px 10px;
  min-height: 40px;
}
.legend {
  position: absolute;
  z-index: 2;
  bottom: 32px;
  left: 12px;
  max-width: calc(100% - 72px);
  font-size: 14px;
}
.legend label {
  display: inline-block;
  margin: 2px 5px;
}
.swatch {
  display: inline-block;
  width: 18px;
  height: 4px;
  vertical-align: middle;
}

.popup-text {
  width: 100%;
  max-width: 336px;
  position: relative;
  padding-top: 4px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.popup-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #f1f3f5;
  font:
    24px / 1 Arial,
    sans-serif;
  cursor: pointer;
}
.popup-text table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.5;
}
.popup-text th,
.popup-text td {
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}
.popup-text th {
  width: 32%;
}
.popup-text tr:first-child td {
  padding-right: 36px;
  font-weight: bold;
}
.popup-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  white-space: normal;
}
.popup-title {
  white-space: nowrap;
}
.popup-time {
  min-width: 0;
  overflow-wrap: normal;
}
#map-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 600px) {
  .hud {
    top: 62px;
    left: 8px;
    right: 8px;
    flex-direction: column;
    gap: 6px;
  }
  .summary {
    padding: 6px 10px;
  }
  .summary strong {
    font-size: 15px;
  }
  .counts {
    gap: 8px;
    font-size: 13px;
  }
  .focus {
    padding: 5px;
    gap: 4px;
  }
  .focus button {
    font-size: 14px;
    padding: 4px 8px;
    min-height: 36px;
  }
  .legend {
    left: 8px;
    bottom: 32px;
    font-size: 12px;
    padding: 6px;
    max-width: calc(100% - 64px);
  }

  .popup-text table {
    font-size: 15px;
  }
}
