/* S5 APRS 0.7.4: map-only UI for an installed app, including existing
   Edge/Chrome shortcuts whose start URL is the ordinary WordPress page. */
html.s5aprs-pwa-document,
html.s5aprs-pwa-document > body.s5aprs-pwa-body {
  box-sizing:border-box!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.s5aprs-pwa-body,
body.s5aprs-pwa-rescue {
  box-sizing:border-box!important;
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  max-width:none!important;
  height:100vh!important;
  height:100dvh!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  background:#f2f6f9!important;
}
/* When installed from a plain Edge site shortcut, remove the whole WP theme
   shell, not just particular theme header/menu classes. The map is moved to
   a direct body child first, so no site-specific selectors are needed. */
body.s5aprs-pwa-rescue > :not(.s5aprs-v3) {display:none!important}
body.s5aprs-pwa-body > #s5aprs-pwa-root {
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  display:flex!important;
  flex:1 1 0%!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 {
  position:relative!important;
  inset:auto!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  flex:1 1 0%!important;
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
  transform:none!important;
  background:#fff!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-head {
  flex:0 0 auto!important;
  padding:10px 14px!important;
  min-height:0!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3-head h2 {
  font-size:18px!important;
  margin:0!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3-intro-desktop,
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3-intro-mobile {display:none!important}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-toolbar {
  flex:0 0 auto;
  margin:0!important;
  padding:0 14px 10px!important;
}
/* Keep the archive selector available but the data-heavy diagnostics and
   lengthy credits remain on the normal public page. OSM tile attribution
   is retained on the Leaflet map. */
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-history-panel {flex:0 0 auto}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-map-wrap {
  flex:1 1 0%!important;
  min-height:0!important;
  height:0!important;
  margin:0!important;
  overflow:hidden!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-map-wrap > .s5aprs-v3-map {
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-bottom {
  flex:0 0 auto!important;
  min-height:0!important;
  padding:8px 14px!important;
  margin:0!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-freshness {
  flex:0 0 auto!important;
  min-height:0!important;
  padding:4px 14px!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-diagnostics:not(.s5aprs-v3-history-panel),
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-legend,
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-disclaimer {display:none!important}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 [data-s5aprs-pwa-host] {display:none!important}
@media(max-width:760px), (max-width:1100px) and (max-height:550px) and (pointer:coarse) {
  body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-head {
    padding:calc(7px + env(safe-area-inset-top,0px)) 10px 7px!important;
    min-height:54px!important;
  }
  body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-map-wrap {
    flex:1 1 0%!important;
    min-height:0!important;
    height:0!important;
  }
  body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 > .s5aprs-v3-bottom {
    padding:7px 12px calc(7px + env(safe-area-inset-bottom,0px))!important;
  }
  /* There is no WordPress page to return to in the installed app. */
  body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) [data-role="mobile-fullscreen-toggle"] {display:none!important}
}

/* S5 APRS 0.7: body is a viewport-sized flex host, never a scrollable WP page.
   Prevent native PWA shell + a second mobile fullscreen mount from creating
   an empty full-height element above the map. */
html.s5aprs-pwa-document{width:100%!important;height:100%!important;min-height:0!important;overflow:hidden!important}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue){
  position:fixed!important;inset:0!important;top:0!important;left:0!important;
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  justify-content:flex-start!important;gap:0!important;
  width:100%!important;max-width:100%!important;height:100vh!important;height:100dvh!important;
  min-height:0!important;margin:0!important;transform:none!important;overflow:hidden!important;
}
body.s5aprs-pwa-body>#s5aprs-pwa-root{flex:1 1 0%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important}
body.s5aprs-pwa-rescue>.s5aprs-v3{
  flex:1 1 0%!important;position:relative!important;inset:auto!important;
  width:100%!important;height:100%!important;min-height:0!important;margin:0!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3>.s5aprs-v3-head{order:0!important}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3>.s5aprs-v3-map-wrap{
  order:5!important;display:block!important;flex:1 1 0%!important;min-height:0!important;
  height:0!important;overflow:hidden!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3>.s5aprs-v3-map-wrap>.s5aprs-v3-map{
  width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3>.s5aprs-v3-bottom{
  order:6!important;flex:0 0 auto!important;
}

/* v0.7.2: credits/details cannot push the installed map below the viewport. */
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3>.s5aprs-v3-about{display:none!important}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3>.s5aprs-v3-about[open]{
  display:block!important;position:absolute!important;z-index:2000!important;
  top:70px;left:12px;right:12px;max-height:60dvh;overflow:auto;
  background:#fff!important;border:1px solid #cad8e1;border-radius:12px;
  box-shadow:0 8px 25px #0a243945;flex:none!important;margin:0!important;
}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 .s5aprs-v3-mobile-actions{display:flex!important}
body:is(.s5aprs-pwa-body,.s5aprs-pwa-rescue) .s5aprs-v3 .s5aprs-v3-pwa-info{
  display:inline-flex!important;justify-content:center;align-items:center;
  width:36px;height:36px;border:1px solid #648399;border-radius:10px;
  font:700 19px/1 system-ui,sans-serif;color:#f5fcff;background:#1b3a50;
}
