/* Bayān 13.5 — navigation autonome + correctif de défilement Safari/iOS.
   Chargé en toute dernière position : cette couche neutralise uniquement les
   conflits de navigation/scroll accumulés par les anciennes feuilles. */

/* Ne jamais transformer html ET body en conteneurs de scroll verticaux.
   overflow-x:hidden fait calculer overflow-y:auto dans WebKit/Chromium et
   casse notamment position:sticky. clip masque le débordement horizontal sans
   créer de nouveau scroll container. */
html{
  max-width:100%!important;
  min-height:100%!important;
}
body.app-quran{
  max-width:100%!important;
  min-height:100vh!important;
  min-height:100dvh!important;
}
body.app-quran .app-shell,
body.app-quran main,
body.app-quran .view,
body.app-quran #homeView{
  max-width:100%!important;
  overflow-x:clip!important;
  overflow-y:visible!important;
}

/* La barre reste réellement visible pendant tout le scroll, mobile et desktop. */
body.app-quran .topbar{
  position:sticky!important;
  top:0!important;
  z-index:5000!important;
}

/* Accueil : aucune ancienne règle de bouton/grille ne peut créer une carte
   géante ou couper les cartes suivantes. */
body.app-quran .v133-home{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-y:visible!important;
}
body.app-quran .v133-home-grid{
  grid-auto-rows:max-content!important;
  align-items:start!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
body.app-quran .v133-home-card{
  display:block!important;
  position:relative!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  touch-action:manipulation!important;
}
body.app-quran .v133-home-card b,
body.app-quran .v133-home-card small{
  position:static!important;
  visibility:visible!important;
  opacity:1!important;
}

/* Les contrôles de navigation doivent rester tactiles même pendant le chargement
   du corpus. */
body.app-quran .nav-button,
body.app-quran .v134-mobile-menu-toggle,
body.app-quran [data-v133-action],
body.app-quran [data-v133-search],
body.app-quran [data-v133-group],
body.app-quran [data-v133-tool]{
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:rgba(16,58,50,.12);
}

/* Le menu mobile est un panneau de navigation, jamais une zone qui agrandit ou
   bloque le document. */
@media(max-width:1100px){
  body.app-quran .topbar{
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  body.app-quran .topbar > .main-nav.app-local-nav{
    max-height:min(70vh,520px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.app-quran .topbar:not(.v134-mobile-nav-open) > .main-nav.app-local-nav{
    display:none!important;
  }
  body.app-quran .topbar.v134-mobile-nav-open > .main-nav.app-local-nav{
    display:grid!important;
  }
}

/* Message de secours uniquement si le moteur principal ne charge pas. */
.v135-runtime-warning{
  width:min(1180px,calc(100% - 24px));
  margin:10px auto;
  padding:11px 13px;
  border:1px solid #d6b75c;
  border-radius:14px;
  background:#fff8df;
  color:#4c3a05;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:.86rem;
}
.v135-runtime-warning button{min-height:38px;white-space:nowrap}
@media(max-width:520px){.v135-runtime-warning{align-items:stretch;flex-direction:column}.v135-runtime-warning button{width:100%}}
