/* The map is a workspace inside the public MIKI Family shell, not a
   full-viewport overlay above its navigation. This file has a new URL because
   the previous map guard is served with immutable browser caching. */
body.miki-pulse.miki-map-page #main-content {
  height: calc(100dvh - 64px);
  min-height: 0;
  overflow: hidden;
}

body.miki-pulse.miki-map-page .dark-map-page {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* The common top bar already names the page. Keep the h1 available to
   assistive technology without spending map height on a second header. */
body.miki-pulse.miki-map-page .dark-map-page > .df-page-head {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

body.miki-pulse.miki-map-page .dark-map-page > .miki-map-shell {
  position: relative;
  z-index: 1;
  inset: auto;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  margin: 0;
}

/* Desktop filter content must scroll inside the map instead of extending
   below the shorter stage now that the site header is visible. */
@media (min-width: 761px) {
  body.miki-pulse.miki-map-page .miki-map-shell.is-filter-open .df-map-sidebar {
    max-height: calc(100% - 90px);
    overflow-y: auto;
  }

  body.miki-pulse.miki-map-page .miki-map-shell .df-map-sidebar .miki-map-panel:not([hidden]) {
    max-height: none;
    overflow-y: visible;
  }
}

/* These floating launchers cover the map's places panel and edge controls.
   They remain available on other pages; this tool has its own controls. */
body.miki-pulse.miki-map-page .miki-music-widget,
body.miki-pulse.miki-map-page .miki-ai-guide,
body.miki-pulse.miki-map-page .site-counter-floating {
  display: none !important;
}

@media (max-width: 760px) {
  body.miki-pulse.miki-map-page .dark-map-page > .miki-map-shell {
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
  }

  body.miki-pulse.miki-map-page .miki-map-shell .df-map-sidebar {
    max-height: min(36%, 320px);
  }

  body.miki-pulse.miki-map-page .miki-map-shell.is-filter-open .df-map-sidebar {
    bottom: 64px;
    max-height: calc(100% - 230px);
    overflow-y: auto;
  }

  body.miki-pulse.miki-map-page .miki-map-shell .df-map-sidebar .miki-map-panel:not([hidden]) {
    max-height: none;
    overflow-y: visible;
  }

  body.miki-pulse.miki-map-page .miki-map-shell:not(.is-filter-open) .df-map-attribution {
    bottom: calc(min(36%, 320px) + 84px);
  }

  /* The open filter sheet reaches close to the tool row at 320px. Put the
     source credit into the narrow gap below that row, never over zoom. */
  body.miki-pulse.miki-map-page .miki-map-shell.is-filter-open .df-map-attribution {
    top: 134px;
    bottom: auto;
  }
}

@media (max-width: 620px) {
  body.miki-pulse.miki-map-page #main-content {
    height: calc(100dvh - 60px);
  }
}
