/* Mobile viewport containment, preserving the internally zoomable map canvas. */
@media(max-width:767px){
html body .cse-app,html body .cse-app.cse-unified-page{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;margin-left:auto!important;margin-right:auto!important}
html body .cse-app .cse-integrated-heading,html body .cse-app .cse-integrated-tabs,html body .cse-app nav.cse-shared-tabs,html body .cse-app nav.cse-shared-map-links,html body .cse-app .cse-shared-today,html body .cse-app .layout,html body .cse-app .search-card,html body .cse-app .map-panel,html body .cse-app .browse,html body .cse-app .results,html body .cse-app .yz-main,html body .cse-app .pr-main{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
html body .cse-app .layout,html body .cse-app.cse-mw-900 .layout{grid-template-columns:minmax(0,1fr)!important}
html body .cse-app nav.cse-shared-tabs,html body .cse-app .cse-integrated-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html body .cse-app nav.cse-shared-tabs>a,html body .cse-app .cse-integrated-tabs>a{min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important}
html body .cse-app .cse-integrated-heading h1,html body .cse-app .cse-integrated-heading h2,html body .cse-app .cse-integrated-heading p{max-width:100%!important;overflow-wrap:break-word!important}
html body .cse-app #mapViewport{width:100%!important;max-width:100%!important;min-width:0!important;overflow:auto!important}
html body .cse-app .map-head{flex-wrap:wrap!important}
html body .cse-app input,html body .cse-app select,html body .cse-app textarea{max-width:100%!important;min-width:0!important}
}
/* Beta 11: constrain the plugin's intrinsically sized map and grid on phones. */
@media(max-width:767px){
 html body .cse-app{overflow-x:clip!important;contain:layout!important}
 html body .cse-app .layout,html body .cse-app .layout>*,html body .cse-app .finder,html body .cse-app .search-card,html body .cse-app .map-panel,html body .cse-app .map-wrap,html body .cse-app .results,html body .cse-app .cse-integrated-heading,html body .cse-app .cse-shared-today,html body .cse-app .cse-shared-map-links,html body .cse-app .cse-shared-tabs{min-width:0!important;max-width:100%!important}
 html body .cse-app .map-viewport,html body .cse-app #mapViewport{overflow:auto!important;overscroll-behavior:contain!important;max-width:100%!important}
 html body .cse-app .map-canvas,html body .cse-app #mapCanvas{max-width:none!important}
 html body .cse-app img:not(#mapImg),html body .cse-app video,html body .cse-app iframe{max-width:100%!important}
}

/* Beta 12: constrain the entire document only when the cemetery plugin is present.
   Avoid global overflow hiding: the map viewport remains independently scrollable. */
@media (max-width: 767px) {
  body:has(.cse-app) { min-width:0 !important; max-width:100% !important; }
  body:has(.cse-app) .cse-app,
  body:has(.cse-app) .cse-app > *,
  body:has(.cse-app) .cse-app .layout,
  body:has(.cse-app) .cse-app .layout > *,
  body:has(.cse-app) .cse-app .map-panel {
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }
  body:has(.cse-app) .cse-app .layout {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
  }
  body:has(.cse-app) .cse-app #mapViewport {
    max-width:100% !important;
    overflow:auto !important;
  }
  body:has(.cse-app) .cse-app .cse-integrated-heading h1,
  body:has(.cse-app) .cse-app .cse-integrated-heading h2 {
    white-space:normal !important;
    overflow-wrap:break-word !important;
  }
}
