/* FOUNTAIN+ V10.4 — Face Card mobile stability layer
   Goal: keep native document scrolling authoritative on iOS/iPadOS/Android,
   while allowing real menus, players and modals to lock only when open. */

html.fc-stability-root{
  min-height:100%;
  overflow-x:clip;
  overflow-y:auto;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body.fc-stability-page{
  min-height:100%;
  max-width:100%;
  overflow-x:clip!important;
  overflow-y:visible!important;
  overscroll-behavior-y:auto!important;
  touch-action:auto;
  -webkit-tap-highlight-color:transparent;
}

/* A real open overlay is the only state allowed to freeze the page. */
html.fc-scroll-locked,
body.fc-scroll-locked{
  overflow:hidden!important;
  overscroll-behavior:none!important;
  touch-action:none!important;
}

/* Avoid accidental horizontal document growth from long media/cards. */
body.fc-stability-page main,
body.fc-stability-page section,
body.fc-stability-page article,
body.fc-stability-page figure,
body.fc-stability-page footer,
body.fc-stability-page header,
body.fc-stability-page nav,
body.fc-stability-page div{
  min-width:0;
}
body.fc-stability-page img,
body.fc-stability-page video,
body.fc-stability-page iframe,
body.fc-stability-page svg,
body.fc-stability-page canvas{
  max-width:100%;
}
body.fc-stability-page iframe,
body.fc-stability-page video{
  touch-action:manipulation;
}

/* Horizontal shelves may swipe sideways, but must never steal a vertical page gesture. */
body.fc-stability-page .woven-rail,
body.fc-stability-page .filters,
body.fc-stability-page .fd-filters,
body.fc-stability-page .af-local-links,
body.fc-stability-page [class*="rail"],
body.fc-stability-page [class*="shelf"]{
  overscroll-behavior-x:contain;
  touch-action:pan-x pan-y pinch-zoom;
}

/* Prevent invisible global shells/backdrops from becoming touch shields on Face Cards. */
body.fc-stability-page .mobile-nav-backdrop:not(.open),
body.fc-stability-page .mobile-settings-backdrop:not(.open),
body.fc-stability-page .ui-nav-backdrop:not(.open),
body.fc-stability-page .ui-settings-backdrop:not(.open),
body.fc-stability-page .beadz-video-lightbox:not(.is-open),
body.fc-stability-page .fpv-overlay:not(.open),
body.fc-stability-page #cinema-player:not(.open){
  pointer-events:none!important;
}

/* Form controls: 16px prevents iOS focus zoom and supports reliable touch input. */
@media(max-width:820px){
  body.fc-stability-page input,
  body.fc-stability-page textarea,
  body.fc-stability-page select{
    font-size:max(16px,1em);
  }
  body.fc-stability-page button,
  body.fc-stability-page input,
  body.fc-stability-page select,
  body.fc-stability-page textarea{
    touch-action:manipulation;
  }
}

/* Keep native scrolling for ordinary Face Card documents; use dynamic height only inside true overlays. */
@supports(height:100dvh){
  body.fc-stability-page .settings-panel.open,
  body.fc-stability-page #cinema-player.open,
  body.fc-stability-page .fpv-overlay.open,
  body.fc-stability-page .beadz-video-lightbox.is-open{
    max-height:100dvh;
  }
}

@supports not (overflow:clip){
  html.fc-stability-root,
  body.fc-stability-page{overflow-x:hidden!important}
}

/* V10.19 — shared phone polish for every Face Card */
@media(max-width:820px){
  html.fc-stability-root{scroll-padding-top:84px}
  body.fc-stability-page iframe{display:block;width:100%;border:0}
  body.fc-stability-page [class*="rail"],
  body.fc-stability-page [class*="shelf"],
  body.fc-stability-page .filters,
  body.fc-stability-page .fd-filters,
  body.fc-stability-page .af-local-links{
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  body.fc-stability-page [class*="rail"]::-webkit-scrollbar,
  body.fc-stability-page [class*="shelf"]::-webkit-scrollbar,
  body.fc-stability-page .filters::-webkit-scrollbar,
  body.fc-stability-page .fd-filters::-webkit-scrollbar,
  body.fc-stability-page .af-local-links::-webkit-scrollbar{display:none}
  body.fc-stability-page a,
  body.fc-stability-page button{-webkit-tap-highlight-color:transparent}
  body.fc-stability-page [id]{scroll-margin-top:84px}
}

@media(max-width:430px){
  body.fc-stability-page{overflow-wrap:break-word}
  body.fc-stability-page iframe,
  body.fc-stability-page video{max-inline-size:100%}
}
