.map-popup {
  width: min(320px, calc(100vw - 64px));
  max-height: 320px;
  overflow-y: auto;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.map-popup [hidden] {
  display: none;
}

.map-popup-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.35rem;
  color: var(--text-primary);
}

.map-popup-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.map-popup-icon.is-loading {
  border-radius: 50%;
  background: var(--hover);
}

.map-popup-title {
  margin: 0 0 4px;
  padding: 0 2rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.map-popup-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0 0 4px;
}

.map-popup-pills:empty {
  display: none;
}

.map-popup-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--accent-contrast);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.map-popup-description {
  display: -webkit-box;
  max-height: calc(1.4em * 3);
  margin: 0.55rem 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.map-popup-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.5rem;
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
}

.map-popup-meta dt {
  color: var(--muted);
  white-space: nowrap;
}

.map-popup-meta dd {
  margin: 0;
}

.map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.map-popup-actions .map-popup-action {
  margin: 0;
}

.map-popup-action {
  display: block;
  width: fit-content;
  margin: 10px auto 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.map-popup-action:hover {
  opacity: 0.9;
  text-decoration: none;
}

.map-popup-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
