html,
body {
  height: 100%;
  margin: 0;
}
body {
  font:
    15px/1.4 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #1b1b1b;
  background: #111;
}
#map {
  position: absolute;
  inset: 0;
}

.fab {
  position: absolute;
  z-index: 5;
  top: calc(10px + env(safe-area-inset-top));
  padding: 10px 14px;
  border: 0;
  border-radius: 22px;
  font: inherit;
  font-weight: 600;
  background: #fff;
  color: #1b1b1b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.fab-left {
  left: 10px;
}
.fab-right {
  right: 60px;
}

#panel {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  overflow-y: auto;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
  padding: calc(12px + env(safe-area-inset-top)) 16px 16px;
}
#panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
#panel header button {
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  padding: 0 4px;
}
#panel label {
  display: block;
  margin: 6px 0;
}
#panel input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
  font: inherit;
}
#panel hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 14px 0;
}
#panel .row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
#panel button:not(header button) {
  padding: 8px 10px;
  font: inherit;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #f4f4f4;
}
#panel button.primary {
  width: 100%;
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}
#panel .layer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.layer input {
  width: 20px;
  height: 20px;
}
.layer .count {
  margin-left: auto;
  color: #666;
  font-size: 13px;
}
.swatch {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  display: inline-block;
}
.layer-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Landmark pin: its My Maps icon, centred on the spot */
.landmark {
  transform-origin: center;
}
.landmark img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}
.landmark .dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff5252;
  border: 2px solid #fff;
}
.muted {
  color: #666;
  font-size: 13px;
}

/* House pin: 1MISSION house icon with a label underneath */
/* The pin box is only as big as the icon, so it doesn't take taps meant for pins beside it;
   the label hangs below, outside the box. */
.pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pin span.house-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  pointer-events: none;
}
.pin img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}
.pin span {
  margin-top: 1px;
  max-width: 120px;
  padding: 1px 3px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* House label: project number on top, team name below */
.pin span.house-label {
  max-width: 74px;
  text-align: center;
  line-height: 1.2;
  padding: 1px 3px;
  white-space: normal;
}
.house-label b,
.house-label i {
  display: block;
  font-style: normal;
  overflow-wrap: break-word;
}
.house-label i {
  font-weight: 500;
  font-size: 7.5px;
}

.popup h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.popup dl {
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
}
.popup dt {
  color: #666;
}
.popup dd {
  margin: 0;
}
.popup a.go {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.popup p.then {
  margin: 6px 0;
  font-size: 13px;
}
.popup a.go-direct {
  font-size: 13px;
  color: #1a73e8;
}

#error {
  position: absolute;
  z-index: 10;
  left: 10px;
  right: 10px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  padding: 12px;
  border-radius: 8px;
  background: #b71c1c;
  color: #fff;
}
