
/* =========================================================
   JF QUANTUM V9.5 — STRUCTURAL IPHONE LAYOUT FIX
   ========================================================= */
:root{
  --jf95-safe-top:env(safe-area-inset-top,0px);
  --jf95-safe-bottom:env(safe-area-inset-bottom,0px);
  --jf95-nav-h:76px;
}

/* Override the legacy fixed-height/hidden-overflow architecture. */
html{
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  overflow:hidden!important;
  background:#07050d!important;
}

body{
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  background:#07050d!important;
}

#appShell{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100dvh!important;
  min-height:100dvh!important;
  max-height:100dvh!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  padding:0 0 calc(var(--jf95-nav-h) + var(--jf95-safe-bottom))!important;
  box-sizing:border-box!important;
}

/* Header keeps its natural height. */
#appShell > header{
  position:relative!important;
  flex:0 0 auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  box-sizing:border-box!important;
}

/* Legacy nav remains a hidden functional relay. */
#appShell > #tabs{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-height:0!important;
  max-height:1px!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* This is the key correction: one flexible scrolling workspace. */
#appShell > main,
#workspace{
  position:relative!important;
  inset:auto!important;
  flex:1 1 auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:8px 8px 96px!important;
  box-sizing:border-box!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
}

/* Eliminate inherited artificial lower heights/spaces. */
#workspace::after{
  content:none!important;
  display:none!important;
}

.bottom-spacer,
.nav-spacer,
.footer-spacer,
.safe-spacer,
.mobile-bottom-spacer,
.build-zone,
.build-area,
.build-footer,
.footer-build,
.bottom-build,
[data-bottom-spacer],
[data-build-zone]{
  display:none!important;
  width:0!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

/* Compact build marker: overlay only, no layout footprint. */
#v51BuildMarker{
  position:fixed!important;
  left:16px!important;
  bottom:calc(var(--jf95-nav-h) + var(--jf95-safe-bottom) + 9px)!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  z-index:10005!important;
  pointer-events:none!important;
}

/* Navigation and FAB stay independent of the content flow. */
#jf93-nav{
  bottom:0!important;
  height:calc(var(--jf95-nav-h) + var(--jf95-safe-bottom))!important;
}

#jf93-fab{
  right:14px!important;
  bottom:calc(var(--jf95-nav-h) + var(--jf95-safe-bottom) + 11px)!important;
}

/* Prevent cards or panels from being cropped by inherited rules. */
#workspace .panel,
#workspace section,
#workspace article,
#workspace .card,
#workspace .panel-body{
  max-height:none;
}

@media(max-width:390px){
  :root{--jf95-nav-h:72px}
  #appShell > main,
  #workspace{
    padding:8px 8px 88px!important;
  }
  #v51BuildMarker{
    left:14px!important;
    bottom:calc(var(--jf95-nav-h) + var(--jf95-safe-bottom) + 7px)!important;
  }
  #jf93-fab{
    right:10px!important;
    bottom:calc(var(--jf95-nav-h) + var(--jf95-safe-bottom) + 9px)!important;
  }
}

/* Older Safari fallback */
@supports not (height:100dvh){
  #appShell{
    height:-webkit-fill-available!important;
    min-height:-webkit-fill-available!important;
    max-height:-webkit-fill-available!important;
  }
}
