/* BankMovie V297 — stable iOS safe header
   One safe-area calculation for every public page. No VisualViewport offset is
   used for geometry, so Safari chrome expansion/collapse cannot move the header
   differently from page to page. Android/desktop remain untouched. */
@media (max-width:991.98px){
  html.bm-ios-safe-header{
    --bm-ios-safe-top:max(env(safe-area-inset-top,0px),var(--bm-ios-safe-fallback,0px));
    --bm-ios-header-row:58px;
    --bm-ios-header-total:calc(var(--bm-ios-header-row) + var(--bm-ios-safe-top));
  }

  /* Final geometry. Repeated #siteHeader is intentional: this must win over
     legacy per-page header rules that are printed later in the document. */
  html.bm-ios-safe-header body #siteHeader#siteHeader,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-solid,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-glass,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-admin,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-public-header-v148,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-mobile-header-hidden,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-mobile-header-compact,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-mobile-floating-glass-v148612{
    top:0!important;
    bottom:auto!important;
    box-sizing:border-box!important;
    height:var(--bm-ios-header-total)!important;
    min-height:var(--bm-ios-header-total)!important;
    max-height:var(--bm-ios-header-total)!important;
    padding-top:var(--bm-ios-safe-top)!important;
    padding-bottom:0!important;
    margin-top:0!important;
    transform:none!important;
    translate:none!important;
  }

  /* Safe area belongs to the header shell only. Several legacy page rules add
     env(safe-area-inset-top) to .header-inner as well; explicitly remove that
     second inset so controls land at exactly the same Y position everywhere. */
  html.bm-ios-safe-header body #siteHeader#siteHeader .header-inner,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-admin .header-inner,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-public-header-v148 .header-inner{
    box-sizing:border-box!important;
    height:var(--bm-ios-header-row)!important;
    min-height:var(--bm-ios-header-row)!important;
    max-height:var(--bm-ios-header-row)!important;
    padding-top:0!important;
    padding-bottom:0!important;
    margin-top:0!important;
    margin-bottom:0!important;
    transform:none!important;
    translate:none!important;
  }

  /* Do not let stale hide/compact states reintroduce another vertical offset. */
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-header-hidden,
  html.bm-ios-safe-header body #siteHeader#siteHeader.is-hidden,
  html.bm-ios-safe-header body #siteHeader#siteHeader.hide{
    top:0!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    translate:none!important;
  }

  /* /search has an actual form directly below a fixed header. Reserve exactly
     one safe-area footprint there so the form cannot sit underneath the logo. */
  html.bm-ios-safe-header body.search-page > .search-section{
    margin-top:calc(68px + var(--bm-ios-safe-top))!important;
  }

  /* Movie pages only need a small visual breathing gap below the corrected
     header. This is fixed, not proportional to Dynamic-Island height. */
  html.bm-ios-safe-header body.movie-page .movie-detail,
  html.bm-ios-safe-header body.bm-movie-template-cinematic .movie-detail,
  html.bm-ios-safe-header body.movie-page[data-bm-mobile-layout] .movie-detail{
    margin-top:8px!important;
  }
  html.bm-ios-safe-header body.movie-page .movie-detail > .poster-col,
  html.bm-ios-safe-header body.bm-movie-template-cinematic .movie-detail > .poster-col,
  html.bm-ios-safe-header body.movie-page[data-bm-mobile-layout] .movie-detail > .poster-col{
    margin-top:0!important;
  }
}
