/* Platform safe-area. Loaded last so it beats legacy 100dvh / 40px floors. */

/* 100dvh / position:fixed = visual viewport. iOS then paints #0D0820 above
   the MapLibre canvas while HTML markers still sit in that gap.
   Size to the large viewport and keep the map position:absolute, inset 0. */
@supports (-webkit-touch-callout: none) {
  html, body, #app {
    height: 100% !important;
    height: -webkit-fill-available !important;
    height: 100lvh !important;
    min-height: 100% !important;
    min-height: -webkit-fill-available !important;
    min-height: 100lvh !important;
    max-height: none !important;
    position: relative !important;
    inset: auto !important;
    overflow: hidden !important;
  }
  html.is-ios.is-standalone #app,
  body.is-ios.is-standalone #app {
    overflow: visible !important;
  }
}

html, body, #app, #screen-home {
  background: #0D0820 !important;
}

/* Android cutout: don't fill the camera hole with #0D0820. Map paints through. */
html.is-android,
body.is-android,
html.is-android #app,
html.is-android #screen-home,
body.is-android #app,
body.is-android #screen-home {
  background: transparent !important;
}

/* iOS standalone: MAP is in-flow full-bleed under the Dynamic Island.
   Wordmark uses padding, not a map offset. NEVER position:fixed here. */
html.is-ios.is-standalone #map,
html.is-ios.is-standalone .map-vignette,
html.is-ios.is-standalone #map-fallback,
html.is-ios.is-standalone .maplibregl-map,
html.is-ios.is-standalone .maplibregl-canvas-container,
html.is-ios.is-standalone .maplibregl-canvas,
body.is-ios.is-standalone #map,
body.is-ios.is-standalone .map-vignette,
body.is-ios.is-standalone #map-fallback,
body.is-ios.is-standalone .maplibregl-map,
body.is-ios.is-standalone .maplibregl-canvas-container,
body.is-ios.is-standalone .maplibregl-canvas {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  transform: none !important;
}

html.is-ios #map-chrome,
body.is-ios #map-chrome {
  padding-top: env(safe-area-inset-top) !important;
  padding-left: env(safe-area-inset-left) !important;
  padding-right: env(safe-area-inset-right) !important;
  background: transparent !important;
}

/* Android: wordmark pads with env(top). Map is full-bleed so the clock
   overlays it — no opaque island. */
body.is-android #map-chrome,
html.is-android #map-chrome {
  padding-top: env(safe-area-inset-top) !important;
  padding-left: env(safe-area-inset-left) !important;
  padding-right: env(safe-area-inset-right) !important;
}
body.is-android #map,
body.is-android .map-vignette,
body.is-android #map-fallback,
html.is-android #map,
html.is-android .map-vignette,
html.is-android #map-fallback {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}
html.is-android #map,
body.is-android #map {
  background: #0D0820 !important;
}

/* Desktop has no island. 14px, not 14px + phone --safe-top. Phones keep env(). */
@media (min-width: 900px) {
  html:not(.is-ios):not(.is-android) #map-chrome,
  body:not(.is-ios):not(.is-android) #map-chrome {
    padding-top: 14px !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

