/* ═══════════════════════════════════════════════════════════
   DISTRICT MODAL — atlas creative sheet (single popup)
   ═══════════════════════════════════════════════════════════ */

.mg-dmodal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mg-dmodal[hidden] {
  display: none !important;
}

.mg-dmodal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  overscroll-behavior: contain;
}

.mg-dmodal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(62, 224, 208, 0.12) 0%, transparent 55%),
    rgba(1, 6, 14, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  cursor: pointer;
}

.mg-dmodal__sheet {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100%;
  max-height: none;
  margin: 0;
  border-radius: 0;
  background: linear-gradient(165deg,
    rgba(8, 42, 58, 0.98) 0%,
    rgba(4, 16, 28, 0.99) 48%,
    rgba(2, 8, 16, 1) 100%);
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  /* Head/nav stay put; only active pane scrolls */
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  box-sizing: border-box;
  transform: translateY(10px);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}

.mg-dmodal__photo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--mg-guide-modal-photo, none);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.35s ease;
}

.mg-dmodal__photo-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: linear-gradient(
    180deg,
    rgba(4, 16, 28, 0.42) 0%,
    rgba(4, 16, 28, 0.82) 38%,
    rgba(4, 16, 28, 0.96) 100%
  );
}

.mg-dmodal__sheet--has-photo .mg-dmodal__photo-bg,
.mg-dmodal__sheet--has-photo .mg-dmodal__photo-scrim {
  opacity: 1;
}

.mg-dmodal__sheet--has-photo {
  background: #041018 !important;
}

.mg-dmodal__sheet--has-photo .mg-dmodal__aurora,
.mg-dmodal__sheet--has-photo .mg-dmodal__grain {
  opacity: 0.35;
}

.mg-dmodal__sheet--has-photo .mg-dmodal__svc-card,
.mg-dmodal__sheet--has-photo .mg-dmodal__deal-card,
.mg-dmodal__sheet--has-photo .mg-dmodal__place-row,
.mg-dmodal__sheet--has-photo .mg-dmodal__meta-chip {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mg-dmodal__head,
.mg-dmodal__district-viz,
.mg-dmodal__desc,
.mg-dmodal__nav,
.mg-dmodal__body,
.mg-dmodal__places-cats {
  position: relative;
  z-index: 2;
}

.mg-dmodal.is-open .mg-dmodal__sheet {
  transform: translateY(0);
  opacity: 1;
}

.mg-dmodal__sheet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--mg-dmodal-accent, #3ee0d0) 35%,
    #5ec4ff 65%,
    transparent 100%);
  opacity: 0.95;
  z-index: 3;
}

.mg-dmodal__aurora {
  position: absolute;
  inset: -20% -10% auto;
  height: 55%;
  background:
    radial-gradient(ellipse 70% 80% at 20% 40%, rgba(62, 224, 208, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 80% 30%, rgba(94, 196, 255, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 50% 80%, rgba(255, 179, 138, 0.08) 0%, transparent 45%);
  pointer-events: none;
  animation: mg-dmodal-aurora 8s ease-in-out infinite alternate;
}

.mg-dmodal__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

@keyframes mg-dmodal-aurora {
  0% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate(2%, -3%) scale(1.04); opacity: 1; }
}

.mg-dmodal__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 1.15rem 1rem 0.55rem;
  flex-shrink: 0;
}

.mg-dmodal__head::after {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.mg-dmodal__badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  position: relative;
}

.mg-dmodal__halo {
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  pointer-events: none;
  animation: mg-dmodal-pulse 2.8s ease-in-out infinite;
}

@keyframes mg-dmodal-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.7; }
  50% { transform: translateY(-50%) scale(1.12); opacity: 1; }
}

.mg-dmodal__dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3ee0d0;
  box-shadow: 0 0 16px var(--mg-dmodal-accent, #3ee0d0);
}

.mg-dmodal__meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.mg-dmodal__kicker {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(62, 224, 208, 0.88);
}

.mg-dmodal__name {
  margin: 0;
  font-size: clamp(1.15rem, 5vw, 1.45rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.mg-dmodal__region {
  margin: 0;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.48);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mg-dmodal__head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.mg-dmodal__close {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 110, 110, 0.42);
  background: rgba(255, 110, 110, 0.14);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.mg-dmodal__close:hover,
.mg-dmodal__close:focus-visible {
  background: rgba(255, 110, 110, 0.3);
  border-color: rgba(255, 110, 110, 0.65);
  outline: none;
}

/* Secondary tabs — the same button becomes a teal back arrow. */
.mg-dmodal__close.mg-dmodal__close--back {
  background: rgba(62, 224, 208, 0.14);
  border-color: rgba(62, 224, 208, 0.4);
}

.mg-dmodal__close.mg-dmodal__close--back:hover,
.mg-dmodal__close.mg-dmodal__close--back:focus-visible {
  background: rgba(62, 224, 208, 0.28);
  border-color: rgba(62, 224, 208, 0.6);
}

.mg-dmodal__close:active {
  transform: scale(0.94);
}

.mg-dmodal__close span {
  display: block;
  line-height: 1;
  font-weight: 400;
  transform: translateY(-1px);
}

/* District preview — map viewbox + meta chips */
.mg-dmodal__district-viz {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0 1rem 0.75rem;
  align-items: stretch;
}

.mg-dmodal__district-map-wrap {
  position: relative;
  height: clamp(132px, 18dvh, 180px);
  min-height: clamp(132px, 18dvh, 180px);
  max-height: clamp(132px, 18dvh, 180px);
  border-radius: 18px;
  border: 1px solid rgba(62, 224, 208, 0.28);
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mg-dmodal__district-map-wrap--design {
  background:
    radial-gradient(ellipse 75% 65% at 50% 38%, #1a5b6e 0%, #0a2d36 55%, #061820 100%);
  border-color: rgba(62, 224, 208, 0.28);
}

.mg-dmodal__district-map-wrap:not(.mg-dmodal__district-map-wrap--design) {
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, rgba(62, 224, 208, 0.14) 0%, transparent 65%),
    linear-gradient(160deg, rgba(4, 22, 34, 0.95) 0%, rgba(2, 10, 18, 0.98) 100%);
}

.mg-dmodal__district-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 0;
  overflow: hidden;
}

.mg-dmodal__district-map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background:
    radial-gradient(ellipse 75% 65% at 50% 38%, #1a5b6e 0%, #0a2d36 55%, #061820 100%);
}

.mg-dmodal__district-map-stage--svg-only,
.mg-district-svg-host .mg-dmodal__district-map-stage--svg-only {
  background:
    radial-gradient(ellipse 80% 70% at 50% 42%, rgba(26, 91, 110, 0.55) 0%, rgba(6, 24, 32, 0.92) 72%, #041018 100%);
}

.mg-dmodal__district-map-wrap--svg-only .mg-dmodal__district-svg-layer {
  z-index: 1;
}

.mg-dmodal__district-leaflet-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: pan-y pinch-zoom;
}

.mg-dmodal__district-leaflet-layer.leaflet-container,
.mg-dmodal__district-leaflet-layer .leaflet-container {
  width: 100% !important;
  height: 100% !important;
  background: #dceaf2;
}

.mg-dmodal__district-svg-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0.28rem;
  pointer-events: none;
}

.mg-dmodal__district-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(6, 24, 32, 0.45));
}

.mg-dmodal__district-svg .mg-district-path--modal {
  fill-opacity: 0.22 !important;
  opacity: 1 !important;
  vector-effect: non-scaling-stroke;
}

.mg-dmodal__district-svg .mg-map-district.is-preview-clone {
  pointer-events: none;
}

.mg-dmodal__district-fallback {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--district-color, #3ee0d0);
  text-align: center;
  padding: 1rem;
}

.mg-dmodal__district-map-label {
  position: absolute;
  z-index: 700;
  left: 0.5rem;
  bottom: 0.45rem;
  padding: 0.22rem 0.5rem;
  border-radius: 8px;
  background: rgba(2, 10, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
}

.mg-dmodal__district-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-content: flex-start;
  align-self: stretch;
  max-height: clamp(132px, 18dvh, 180px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem 0;
  -webkit-overflow-scrolling: touch;
}

.mg-dmodal__meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.25;
}

.mg-dmodal__meta-chip--emoji {
  font-size: 0.95rem;
  padding: 0.28rem 0.5rem;
}

.mg-dmodal__meta-chip--accent {
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.mg-dmodal__meta-chip--muted {
  flex: 1 1 100%;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.48);
  font-weight: 500;
}

@media (max-width: 420px) {
  .mg-dmodal__district-viz {
    grid-template-columns: 1fr;
  }
}

.mg-dmodal__desc {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin: 0;
  padding: 0 1rem 0.75rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Explore Map tab: free vertical space (header map is redundant) */
.mg-dmodal:has(#mgDModalPaneExplore.is-active:not([hidden])) .mg-dmodal__district-viz,
.mg-dmodal:has(#mgDModalPaneExplore.is-active:not([hidden])) .mg-dmodal__desc {
  display: none;
}

.mg-dmodal__nav {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 0.35rem;
  padding: 0 0.85rem 0.65rem;
  flex-shrink: 0;
}

.mg-dmodal__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.mg-dmodal__tab svg {
  opacity: 0.65;
  flex-shrink: 0;
}

.mg-dmodal__tab.is-active {
  color: #ffffff;
  border-color: rgba(62, 224, 208, 0.45);
  background: linear-gradient(135deg, rgba(62, 224, 208, 0.22) 0%, rgba(94, 196, 255, 0.1) 100%);
  box-shadow: 0 4px 18px rgba(62, 224, 208, 0.15);
}

.mg-dmodal__tab.is-active svg {
  opacity: 1;
  stroke: #3ee0d0;
}

.mg-dmodal__tab:hover:not(.is-active) {
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.14);
}

.mg-dmodal__body {
  position: relative;
  z-index: 4;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mg-dmodal__pane {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mg-dmodal__pane[hidden] {
  display: none !important;
  visibility: hidden;
}

.mg-dmodal__pane.is-active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.mg-dmodal__pane[hidden].is-active {
  display: none !important;
}

.mg-dmodal:not(.is-open) .mg-dmodal__pane {
  pointer-events: none;
}

/* Explore — sticky map, scrolling place list */
.mg-dmodal__pane#mgDModalPaneExplore.is-active:not([hidden]) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
}

.mg-dmodal__explore-viz {
  flex-shrink: 0;
  padding: 0 1rem 0.55rem;
}

.mg-dmodal__district-map-wrap--explore {
  height: clamp(180px, 28dvh, 260px);
  min-height: clamp(180px, 28dvh, 260px);
  max-height: clamp(180px, 28dvh, 260px);
}

.mg-dmodal__explore-hint {
  flex-shrink: 0;
}

.mg-dmodal__places-cats {
  flex-shrink: 0;
}

.mg-dmodal__place-focus {
  flex-shrink: 0;
}

.mg-dmodal__pane#mgDModalPaneExplore .mg-dmodal__places-list {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.35rem 1rem 1.25rem;
  visibility: visible;
  opacity: 1;
}

.mg-dmodal__pane::-webkit-scrollbar { width: 4px; }
.mg-dmodal__pane::-webkit-scrollbar-thumb {
  background: rgba(62, 224, 208, 0.35);
  border-radius: 999px;
}

/* Services */
.mg-dmodal__services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.5rem 1rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 560px) {
  .mg-dmodal__services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    padding-inline: 1.15rem;
  }
}

@media (min-width: 900px) {
  .mg-dmodal__services-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 1.35rem;
  }
}

.mg-dmodal__svc-card--priority {
  border-color: rgba(62, 224, 208, 0.38);
  box-shadow: 0 0 0 1px rgba(62, 224, 208, 0.12) inset;
}

.mg-dmodal__svc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 0.8rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.mg-dmodal__svc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(62, 224, 208, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(62, 224, 208, 0.15);
}

.mg-dmodal__svc-icon {
  font-size: 1.65rem;
  line-height: 1;
}

.mg-dmodal__svc-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.mg-dmodal__svc-sub {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.35;
}

.mg-dmodal__svc-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #3ee0d0;
  margin-top: 0.15rem;
}

.mg-dmodal__svc-demo {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.1rem 0.38rem;
  border-radius: 6px;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #021018;
  background: linear-gradient(135deg, #ffb38a, #3ee0d0);
  z-index: 3;
}

.mg-dmodal__svc-card--photo {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 0;
  aspect-ratio: 4 / 3;
  isolation: isolate;
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-demo {
  top: 0.55rem;
  right: 0.55rem;
}

.mg-dmodal__svc-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #dceaf2;
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.mg-dmodal__svc-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mg-dmodal__svc-media-shade {
  position: absolute;
  inset: auto 0 0;
  height: 70%;
  background: linear-gradient(180deg, rgba(6, 100, 126, 0) 0%, rgba(6, 100, 126, 0.88) 72%, rgba(6, 100, 126, 0.96) 100%);
  pointer-events: none;
  z-index: 1;
}

.mg-dmodal__svc-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.15rem 0;
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  gap: 0.12rem;
  padding: 0.55rem 0.65rem 0.62rem;
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-name,
.mg-dmodal__svc-card--photo .mg-dmodal__svc-sub,
.mg-dmodal__svc-card--photo .mg-dmodal__svc-cta {
  color: #ffffff;
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-sub {
  color: rgba(255, 255, 255, 0.82);
}

.mg-dmodal__svc-card--photo .mg-dmodal__svc-cta {
  color: rgba(255, 255, 255, 0.92);
  margin-top: 0.05rem;
}

/* Deal photo fills the entire card container on every viewport */
.mg-dmodal__deal-thumb {
  position: absolute;
  inset: 0;
  z-index: 0;
  flex: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.mg-dmodal__deal-thumb img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Scrim so overlaid text stays readable on any photo */
.mg-dmodal__deal-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 20, 28, 0.04) 0%, rgba(4, 20, 28, 0) 32%, rgba(4, 20, 28, 0.62) 68%, rgba(4, 20, 28, 0.88) 100%);
  pointer-events: none;
}

.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-body,
.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-cta {
  position: relative;
  z-index: 1;
}

.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-title,
.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-price {
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(4, 20, 28, 0.65);
}

.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-provider {
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 6px rgba(4, 20, 28, 0.6);
}

.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-original {
  color: rgba(255, 255, 255, 0.65);
}

.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-badge {
  background: rgba(4, 20, 28, 0.55);
  color: #7ceef7;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) .mg-dmodal__deal-badge--discount {
  background: rgba(194, 65, 12, 0.75);
  color: #ffffff;
}

/* Explore map */
/* District cage — interaction allowed, clipped to district */
.mg-dmodal__district-leaflet-host.mg-district-leaflet--caged,
.mg-district-places__map.mg-district-leaflet--caged {
  touch-action: pan-y pinch-zoom;
}

@media (max-width: 768px), (hover: none) {
  .mg-dmodal__district-leaflet-layer.mg-district-leaflet--caged,
  .mg-dmodal__district-leaflet-layer .leaflet-container {
    touch-action: pan-y pinch-zoom;
  }
}

.mg-dmodal__district-map .leaflet-control-zoom,
.mg-district-leaflet--caged .leaflet-control-zoom {
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  z-index: 800;
}

.mg-district-leaflet--caged .leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.94);
}

.mg-dmodal__pane .leaflet-container {
  background: #dceaf2;
}

.mg-dmodal__places-cats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 0.4rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0.65rem 1rem 0.5rem;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 16, 28, 0.98) 0%, rgba(4, 16, 28, 0.92) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mg-dmodal__places-cats::-webkit-scrollbar { display: none; }

.mg-dmodal__cat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  gap: 0.3rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mg-dmodal__cat-btn.is-active,
.mg-dmodal__cat-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.mg-dmodal__places-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.35rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mg-dmodal__place-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mg-dmodal__place-row:hover {
  background: rgba(62, 224, 208, 0.08);
  border-color: rgba(62, 224, 208, 0.2);
}

.mg-dmodal__place-row.is-active {
  background: rgba(62, 224, 208, 0.14);
  border-color: rgba(62, 224, 208, 0.45);
  box-shadow: 0 0 0 1px rgba(62, 224, 208, 0.25);
}

.mg-dmodal__place-pin-hint {
  flex-shrink: 0;
  opacity: 0.55;
  font-size: 0.85rem;
}

.mg-dmodal__explore-hint {
  margin: 0.35rem 1rem 0.15rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
}

.mg-dmodal__place-focus {
  margin: 0.35rem 1rem 0.15rem;
}

.mg-dmodal__place-focus[hidden] {
  display: none !important;
}

.mg-dmodal__place-focus-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(62, 224, 208, 0.16), rgba(15, 96, 128, 0.35));
  border: 1px solid rgba(62, 224, 208, 0.28);
}

.mg-dmodal__place-focus-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.mg-dmodal__place-focus-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mg-dmodal__place-focus-copy strong {
  font-size: 0.82rem;
  color: #fff;
}

.mg-dmodal__place-focus-copy span {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-dmodal__place-focus-rating {
  color: #fbbf24 !important;
}

.mg-dmodal__place-focus-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e8fffb;
}

.mg-dmodal__place-directions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #3ee0d0, #2a9fd4);
  color: #021018;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(42, 159, 212, 0.28);
}

.mg-dmodal__place-directions:hover,
.mg-dmodal__place-directions:focus-visible {
  color: #021018;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.mg-dmodal__place-pin {
  background: transparent !important;
  border: none !important;
}

.mg-dmodal__place-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.mg-dmodal__place-info {
  flex: 1;
  min-width: 0;
}

.mg-dmodal__place-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-dmodal__place-addr {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-dmodal__place-rating {
  font-size: 0.62rem;
  color: #ffd166;
  flex-shrink: 0;
}

/* Deals */
.mg-dmodal__deals-list {
  padding: 0.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mg-dmodal__deal-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Photo deals — the image IS the card: full-bleed cover with content overlaid */
.mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) {
  position: relative;
  isolation: isolate;
  justify-content: flex-end;
  min-height: 230px;
}

.mg-dmodal__deal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 224, 208, 0.3);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.mg-dmodal__deal-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.1rem 0.85rem 0;
}

.mg-dmodal__deal-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.mg-dmodal__deal-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(62, 224, 208, 0.18);
  color: #3ee0d0;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mg-dmodal__deal-badge--discount {
  background: rgba(255, 107, 107, 0.18);
  color: #ff8a8a;
}

.mg-dmodal__deal-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.mg-dmodal__deal-provider {
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.45);
}

.mg-dmodal__deal-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.mg-dmodal__deal-price {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.94);
}

.mg-dmodal__deal-original {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.52);
  text-decoration: line-through;
}

.mg-dmodal__deal-cta {
  align-self: stretch;
  flex-shrink: 0;
  padding: 0 0.85rem 0.85rem;
}

.mg-dmodal__deal-cta .mg-dmodal__deal-btn {
  width: 100%;
}

.mg-dmodal__deal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #3ee0d0 0%, #2a9fd4 100%);
  color: #021018;
  font-size: 0.64rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, filter 0.15s;
}

.mg-dmodal__deal-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.mg-dmodal__empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.74rem;
}

.mg-dmodal__loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72rem;
}

.mg-dmodal__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #3ee0d0;
  border-radius: 50%;
  animation: mgDModalSpin 0.7s linear infinite;
}

@keyframes mgDModalSpin {
  to { transform: rotate(360deg); }
}

/* Hide legacy small district card when Atlas modal is active */
.mg-app--atlas #mgDistrictCard,
.mg-app--atlas #mgDistrictPreviewTag,
.mg-app--atlas .mg-district-preview-tag {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Narrow phones ──────────────────────────────────────────── */
@media (max-width: 420px) {
  .mg-dmodal__head {
    padding: 0.7rem 0.75rem 0.5rem;
    gap: 0.5rem;
  }

  .mg-dmodal__name {
    font-size: clamp(1.05rem, 5.8vw, 1.28rem);
  }

  .mg-dmodal__district-viz {
    grid-template-columns: 1fr;
    padding: 0 0.75rem 0.55rem;
    gap: 0.45rem;
  }

  .mg-dmodal__district-map-wrap {
    height: clamp(120px, 22dvh, 150px);
    min-height: clamp(120px, 22dvh, 150px);
    max-height: clamp(120px, 22dvh, 150px);
    border-radius: 14px;
  }

  .mg-dmodal__district-meta {
    max-height: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .mg-dmodal__meta-chip--muted {
    flex: 0 0 auto;
  }

  .mg-dmodal__desc {
    padding: 0 0.75rem 0.55rem;
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
  }

  .mg-dmodal__nav {
    padding: 0 0.65rem 0.55rem;
    gap: 0.28rem;
  }

  .mg-dmodal__tab {
    padding: 0.48rem 0.28rem;
    font-size: 0.58rem;
    gap: 0.22rem;
    border-radius: 12px;
  }

  .mg-dmodal__tab svg {
    width: 14px;
    height: 14px;
  }

  .mg-dmodal__services-grid {
    padding: 0.4rem 0.75rem max(1rem, env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
  }

  .mg-dmodal__svc-card {
    padding: 0.7rem 0.65rem;
    border-radius: 14px;
  }

  .mg-dmodal__svc-card--photo {
    aspect-ratio: 4 / 3;
  }

  .mg-dmodal__explore-viz {
    padding: 0 0.75rem 0.45rem;
  }

  .mg-dmodal__district-map-wrap--explore {
    height: clamp(160px, 26dvh, 220px);
    min-height: clamp(160px, 26dvh, 220px);
    max-height: clamp(160px, 26dvh, 220px);
  }

  .mg-dmodal__explore-hint,
  .mg-dmodal__place-focus {
    margin-inline: 0.75rem;
  }

  .mg-dmodal__places-cats {
    padding: 0.55rem 0.75rem 0.45rem;
  }

  .mg-dmodal__places-list,
  .mg-dmodal__deals-list {
    padding-inline: 0.75rem;
  }
}

/* ── Tablet+ ────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .mg-dmodal__head {
    padding: 1rem 1.25rem 0.65rem;
  }

  .mg-dmodal__district-viz {
    padding: 0 1.25rem 0.85rem;
    gap: 0.85rem;
  }

  .mg-dmodal__district-map-wrap {
    height: clamp(160px, 20dvh, 220px);
    min-height: clamp(160px, 20dvh, 220px);
    max-height: clamp(160px, 20dvh, 220px);
  }

  .mg-dmodal__district-meta {
    max-height: clamp(160px, 20dvh, 220px);
  }

  .mg-dmodal__desc {
    padding: 0 1.25rem 0.85rem;
    font-size: 0.8rem;
    max-width: 72ch;
    -webkit-line-clamp: 3;
  }

  .mg-dmodal__nav {
    padding: 0 1.15rem 0.75rem;
    max-width: 720px;
  }

  .mg-dmodal__district-map-wrap--explore {
    height: clamp(220px, 30dvh, 340px);
    min-height: clamp(220px, 30dvh, 340px);
    max-height: clamp(220px, 30dvh, 340px);
  }

  .mg-dmodal__explore-viz {
    padding: 0 1.25rem 0.55rem;
  }

  .mg-dmodal__deals-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 0.55rem 1.25rem 1.35rem;
    max-width: 920px;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
  }

  .mg-dmodal__deal-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
  }

  .mg-dmodal__deal-card:has(.mg-dmodal__deal-thumb) {
    min-height: 250px;
  }

  .mg-dmodal__deal-thumb {
    position: absolute;
    inset: 0;
    flex: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .mg-dmodal__deal-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mg-dmodal__deal-body {
    padding: 0.65rem 0.75rem 0.25rem;
  }

  .mg-dmodal__deal-cta {
    align-self: stretch;
    padding: 0 0.75rem 0.75rem;
  }

  .mg-dmodal__deal-btn {
    width: 100%;
  }

  .mg-dmodal__places-list {
    padding: 0.4rem 1.25rem 1.35rem;
    max-width: 920px;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── Desktop / large tablet ─────────────────────────────────── */
@media (min-width: 900px) {
  .mg-dmodal__head {
    padding: 1.15rem 1.5rem 0.75rem;
  }

  .mg-dmodal__name {
    font-size: clamp(1.4rem, 2vw, 1.75rem);
  }

  .mg-dmodal__district-viz {
    padding: 0 1.5rem 0.95rem;
    max-width: 1180px;
    width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
  }

  .mg-dmodal__district-map-wrap {
    height: clamp(190px, 24dvh, 280px);
    min-height: clamp(190px, 24dvh, 280px);
    max-height: clamp(190px, 24dvh, 280px);
  }

  .mg-dmodal__district-meta {
    max-height: clamp(190px, 24dvh, 280px);
  }

  .mg-dmodal__desc {
    padding: 0 1.5rem 0.95rem;
    font-size: 0.84rem;
    max-width: 80ch;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
    -webkit-line-clamp: 4;
  }

  .mg-dmodal__nav {
    padding: 0 1.35rem 0.85rem;
    max-width: 640px;
    margin-inline: auto;
    width: 100%;
  }

  .mg-dmodal__tab {
    font-size: 0.74rem;
    padding: 0.65rem 0.55rem;
  }

  .mg-dmodal__district-map-wrap--explore {
    height: min(46dvh, 520px);
    min-height: 320px;
    max-height: min(46dvh, 520px);
  }

  .mg-dmodal__explore-viz {
    padding: 0 1.5rem 0.65rem;
    max-width: 1180px;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
  }

  .mg-dmodal__svc-card {
    padding: 1rem 0.85rem;
  }

  .mg-dmodal__svc-card--photo {
    aspect-ratio: 4 / 3;
  }

  .mg-dmodal__deals-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1100px;
    padding-inline: 1.5rem;
  }

  .mg-dmodal__places-list {
    max-width: 1100px;
    padding-inline: 1.5rem;
  }

  .mg-dmodal__explore-hint,
  .mg-dmodal__place-focus {
    margin-inline: auto;
    max-width: 1100px;
    width: calc(100% - 3rem);
  }

  .mg-dmodal__places-cats {
    padding-inline: 1.5rem;
    max-width: none;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Tablet portrait/landscape: map + list stack with usable list height */
@media (min-width: 640px) and (max-width: 1099px) {
  .mg-dmodal__pane#mgDModalPaneExplore.is-active:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mg-dmodal__district-map-wrap--explore {
    height: clamp(230px, 32dvh, 360px);
    min-height: clamp(230px, 32dvh, 360px);
    max-height: clamp(230px, 32dvh, 360px);
  }

  .mg-dmodal__places-cats {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .mg-dmodal__pane#mgDModalPaneExplore .mg-dmodal__places-list {
    flex: 1 1 auto;
    min-height: 180px;
  }
}

/* Side-by-side explore on wide screens */
@media (min-width: 1100px) {
  .mg-dmodal__pane#mgDModalPaneExplore.is-active:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.95fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 0 1rem;
    padding: 0.35rem 1.5rem 1rem;
    max-width: 1280px;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .mg-dmodal__explore-viz {
    grid-column: 1;
    grid-row: 1 / -1;
    padding: 0;
    max-width: none;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .mg-dmodal__district-map-wrap--explore {
    flex: 1 1 auto;
    height: auto;
    min-height: 360px;
    max-height: none;
  }

  .mg-dmodal__explore-hint {
    grid-column: 2;
    grid-row: 1;
    margin: 0 0 0.35rem;
    width: auto;
    max-width: none;
  }

  .mg-dmodal__places-cats {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    padding: 0 0 0.45rem;
    max-width: none;
    background: transparent;
    border-bottom: none;
  }

  .mg-dmodal__place-focus {
    grid-column: 2;
    grid-row: 3;
    margin: 0 0 0.45rem;
    width: auto;
    max-width: none;
  }

  .mg-dmodal__places-list {
    grid-column: 2;
    grid-row: 4;
    margin: 0;
    padding: 0;
    max-width: none;
    max-height: none;
    min-height: 220px;
    overflow-y: auto;
  }
}

/* ── Short landscape ────────────────────────────────────────── */
@media (max-height: 520px) and (orientation: landscape) {
  .mg-dmodal__head {
    padding: 0.4rem 0.85rem 0.35rem;
    gap: 0.35rem;
  }

  .mg-dmodal__head::after {
    display: none;
  }

  .mg-dmodal__district-viz {
    display: none;
  }

  .mg-dmodal__desc {
    display: none;
  }

  .mg-dmodal__nav {
    padding: 0 0.75rem 0.4rem;
  }

  .mg-dmodal__tab {
    padding: 0.4rem 0.25rem;
    font-size: 0.58rem;
  }

  .mg-dmodal__tab > span {
    display: none;
  }

  .mg-dmodal__district-map-wrap--explore {
    height: min(52dvh, 220px);
    min-height: 140px;
    max-height: min(52dvh, 220px);
  }

  .mg-dmodal__pane#mgDModalPaneExplore.is-active:not([hidden]) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: stretch;
  }

  .mg-dmodal__explore-viz {
    flex: 1 1 52%;
    min-width: 220px;
    padding: 0 0.5rem 0.4rem 0.85rem;
  }

  .mg-dmodal__explore-hint {
    display: none;
  }

  .mg-dmodal__places-cats {
    flex: 1 1 40%;
    padding: 0.35rem 0.85rem 0.25rem 0.35rem;
    background: transparent;
    border: none;
  }

  .mg-dmodal__places-list {
    flex: 1 1 40%;
    max-height: 42dvh;
    padding: 0.25rem 0.85rem 0.65rem 0.35rem;
  }
}

/* ── Tall phones: use vertical space ────────────────────────── */
@media (min-height: 780px) and (max-width: 480px) {
  .mg-dmodal__district-map-wrap {
    height: clamp(145px, 20dvh, 180px);
    min-height: clamp(145px, 20dvh, 180px);
    max-height: clamp(145px, 20dvh, 180px);
  }

  .mg-dmodal__district-map-wrap--explore {
    height: clamp(260px, 38dvh, 340px);
    min-height: clamp(260px, 38dvh, 340px);
    max-height: clamp(260px, 38dvh, 340px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-dmodal__sheet,
  .mg-dmodal__aurora,
  .mg-dmodal__halo {
    animation: none !important;
    transition: none !important;
  }
}
