.app-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  opacity: 0;
  transition: opacity 120ms ease;
}

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

.app-popup-close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 2002;
}

.app-popup-layer {
  position: fixed;
  inset: 0;
  z-index: 2001;
  overflow: hidden;
  opacity: 0;
  transition: opacity 120ms ease;
}

.app-popup-panel {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  overflow-y: auto;
  padding: 56px 16px 20px;
}

.app-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
}

.uni-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.uni-popup-nav {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.uni-popup-nav svg {
  width: 18px;
  height: 18px;
  display: block;
}

.uni-popup-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.uni-popup-name {
  margin: 0;
  line-height: 1.05;
  font-size: 2.2rem;
}

.uni-popup-camping {
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.85;
}

.area-popup-header {
  text-align: center;
  margin: 0 0 10px;
}

.area-popup-name {
  font-size: 2.2rem; /* match .uni-popup-name for consistency */
}

.area-popup-subtitle {
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.85;
}

.app-popup-body {
  font-size: 1rem;
  line-height: 1.55;
}

.app-popup-richtext p {
  margin: 0 0 12px;
}

.app-popup-richtext h3 {
  margin: 16px 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-popup-richtext h4 {
  margin: 14px 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-popup-richtext ul,
.app-popup-richtext ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.app-popup-richtext li {
  margin: 0 0 6px;
}

.app-tooltip-popup .maplibregl-popup-content {
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  box-shadow: none;
}

.maplibregl-popup.app-tooltip-popup {
  opacity: 0;
}

.maplibregl-popup.app-tooltip-popup.app-tooltip-open {
  opacity: 1;
  transition: opacity 300ms ease;
}

.maplibregl-popup.app-tooltip-popup.app-tooltip-closing {
  opacity: 0;
  transition-duration: 120ms;
}

.maplibregl-popup.app-tooltip-popup .maplibregl-popup-tip {
  border-width: 7px !important;
  margin: 0 !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: rgba(0, 0, 0, 0.8) !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: rgba(0, 0, 0, 0.8) !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: rgba(0, 0, 0, 0.8) !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: rgba(0, 0, 0, 0.8) !important;
}

.app-tooltip-content {
  font-size: 0.9rem;
  line-height: 1.35;
}

.app-tooltip-content p:last-child,
.app-tooltip-content ul:last-child,
.app-tooltip-content ol:last-child {
  margin-bottom: 0;
}

body.app-popup-open {
  overflow: hidden;
}

#app-popup-root.is-open .app-popup-overlay,
#app-popup-root.is-open .app-popup-layer {
  opacity: 1;
  transition-duration: 300ms;
}

#app-popup-root.is-closing .app-popup-overlay,
#app-popup-root.is-closing .app-popup-layer {
  opacity: 0;
  transition-duration: 120ms;
}

@media (min-width: 1024px) {
  .app-popup-layer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
  }

  .app-popup-panel {
    width: min(840px, 100%);
    height: auto;
    max-height: calc(100vh - 64px);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 28px 30px;
  }
}
