/* Mobile app shell: only main-wrap scrolls; navigation occupies its own row.
   Desktop, modal positioning and business modules remain unchanged. */
@media (max-width:850px) {
  html:has(#root > .app), body:has(#root > .app), #root:has(> .app) {
    height:100%; min-height:0; overflow:hidden;
  }
  #root > .app {
    height:100vh;
    height:100dvh;
    min-height:0;
    display:grid;
    grid-template-rows:minmax(0,1fr) auto;
    grid-template-columns:minmax(0,1fr);
    overflow:hidden;
  }
  #root > .app > .main-wrap {
    grid-row:1; grid-column:1;
    min-height:0; min-width:0; width:100%;
    margin-left:0; overflow:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    scroll-padding-bottom:16px;
  }
  #root > .app > .bottom-nav {
    grid-row:2; grid-column:1;
    position:relative; inset:auto;
    width:100%; min-width:0; margin:0;
    flex-shrink:0;
    background:#fff;
    -webkit-backdrop-filter:none; backdrop-filter:none;
    padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));
  }
  #root > .app > .main-wrap > .app-footer {
    padding-bottom:24px;
  }
}
