/* ==========================================================================
   1. POPUPS
   ========================================================================== */

.maplibregl-popup { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }

.maplibregl-popup-content {
  position: relative; padding: 8px 34px 8px 10px; border-radius: 12px;
  background: var(--popup-bg); border: 1px solid rgba(0, 0, 0, .10);
  box-shadow: var(--popup-shadow); backdrop-filter: blur(6px);
  color: var(--popup-text); font-size: 13px; line-height: 1.2; max-width: 240px;
}

.maplibregl-popup-content strong, .maplibregl-popup-content small { display: block; }

.maplibregl-popup-content strong { margin: 0 0 2px; font-weight: 700; font-size: 13px; color: var(--popup-title); }
.maplibregl-popup-content small { margin: 0; font-size: 12px; color: var(--popup-muted); }
.maplibregl-popup-content br { display: none; }

.maplibregl-popup-close-button {
  top: 4px; right: 4px; width: 22px; height: 22px; line-height: 20px; border-radius: 7px;
  z-index: 2; color: var(--popup-muted); font-size: 18px;
}
.maplibregl-popup-close-button:hover { background: rgba(17, 24, 39, .06); color: var(--popup-title); }

.maplibregl-popup-tip {
  width: 0 !important; height: 0 !important; background: transparent !important;
  border-style: solid !important; border-width: 8px !important; border-color: transparent !important;
  filter: none !important; box-shadow: none !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--popup-bg) !important; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--popup-bg) !important; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--popup-bg) !important; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--popup-bg) !important; }

/* ==========================================================================
   2. SCALE & ATTRIBUTION
   ========================================================================== */

.maplibregl-ctrl-bottom-right {
  display: flex !important; flex-direction: column !important; align-items: flex-end !important;
  gap: 8px !important; margin: 0 8px 5px 0 !important;
}

.maplibregl-ctrl-scale {
  background: transparent !important; color: #fff !important; font-weight: 700 !important;
  font-size: 11px !important; line-height: 1.2 !important; text-align: center !important;
  padding: 0 0 7px 0 !important; margin: 0 !important; position: relative !important; border: none !important;
  background-image: linear-gradient(#fff, #fff) !important; background-repeat: no-repeat !important;
  background-size: 100% 3px !important; background-position: left bottom !important;
}

.maplibregl-ctrl-scale::before, .maplibregl-ctrl-scale::after {
  content: ""; position: absolute; bottom: 0; height: 11px;
}
.maplibregl-ctrl-scale::before { left: 0; border-left: 3px solid #fff; }
.maplibregl-ctrl-scale::after { right: 0; border-right: 3px solid #fff; }

.maplibregl-ctrl-attrib {
  background: transparent !important; color: rgba(255, 255, 255, 0.5) !important;
  font-size: 10px !important; margin: 0 !important; padding: 0 !important; line-height: 1 !important; display: block !important;
}

.maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.5) !important; text-decoration: none; }
.maplibregl-ctrl-attrib a:hover { color: #fff !important; }

.attrib-sep { padding: 0 4px; color: rgba(255, 255, 255, 0.3); pointer-events: none; }

.maplibregl-ctrl-attrib-inner > *::after,
.maplibregl-ctrl-attrib-inner .maplibregl-ctrl-attrib-sep,
.maplibregl-ctrl-attrib-inner .maplibregl-ctrl-attrib-separator { display: none !important; }