/* KM Classificador v3.3.1.012.001 — Mobile App Shell / Viewport Lock */
:root{
  --km-shell-top:0px;
  --km-shell-height:100dvh;
}
.km-mobile-scroll-viewport{display:contents}

@media (max-width:900px){
  html.km-mobile-shell,
  html.km-mobile-shell body.km-redesign{
    width:100%;
    height:100%;
    min-height:0!important;
    max-width:100%;
    overflow:hidden!important;
    overscroll-behavior:none;
    background:var(--km-shell-bg,#eef3f7);
  }
  html.km-mobile-shell body.km-redesign{
    position:fixed;
    inset:0;
    padding-left:0!important;
    padding-bottom:0!important;
  }
  html.km-mobile-shell body.km-redesign:before{
    position:fixed;
    inset:0;
  }

  /* App chrome remains still; only the content viewport scrolls. */
  html.km-mobile-shell .km-topbar{
    position:fixed!important;
    left:0;
    right:0;
    top:0;
    z-index:80;
    width:100%;
    max-width:100%;
    margin:0;
    transform:translateZ(0);
  }
  html.km-mobile-shell .km-bottom-nav{
    z-index:85;
    transform:translateZ(0);
    transition:transform .18s ease,opacity .18s ease;
  }
  html.km-mobile-shell .km-mobile-scroll-viewport{
    display:block;
    position:fixed;
    z-index:1;
    left:0;
    right:0;
    top:var(--km-shell-top);
    height:var(--km-shell-height);
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior-y:contain;
    overscroll-behavior-x:none;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    background:transparent;
    isolation:isolate;
  }
  html.km-mobile-shell .km-mobile-scroll-viewport::-webkit-scrollbar{display:none}
  html.km-mobile-shell .km-mobile-scroll-viewport>header,
  html.km-mobile-shell .km-mobile-scroll-viewport>main{
    width:100%;
    max-width:100%;
    min-width:0;
  }
  html.km-mobile-shell body.km-redesign main,
  html.km-mobile-shell body.km-redesign.km-route-home main{
    margin-bottom:0;
    padding-bottom:max(18px,env(safe-area-inset-bottom));
  }

  /* Horizontal hardening: wide content may scroll inside its own component, never the page. */
  html.km-mobile-shell .km-page,
  html.km-mobile-shell .km-subview,
  html.km-mobile-shell .card,
  html.km-mobile-shell .ops-panel,
  html.km-mobile-shell .dc-panel,
  html.km-mobile-shell .km-help-card,
  html.km-mobile-shell .km-acct-card,
  html.km-mobile-shell .km-home-grid,
  html.km-mobile-shell .km-home-side,
  html.km-mobile-shell .km-home-actions,
  html.km-mobile-shell .settings-grid-v33,
  html.km-mobile-shell .rule-layout,
  html.km-mobile-shell .export-layout,
  html.km-mobile-shell .rule-form-grid,
  html.km-mobile-shell .sim-grid,
  html.km-mobile-shell .library-filters,
  html.km-mobile-shell .searchline,
  html.km-mobile-shell .scopebar{
    min-width:0!important;
    max-width:100%;
  }
  html.km-mobile-shell img,
  html.km-mobile-shell video,
  html.km-mobile-shell canvas{max-width:100%;height:auto}
  html.km-mobile-shell input,
  html.km-mobile-shell select,
  html.km-mobile-shell textarea{max-width:100%}
  html.km-mobile-shell .tablewrap,
  html.km-mobile-shell .mini-table,
  html.km-mobile-shell .history-preview-table,
  html.km-mobile-shell .dc-tabs,
  html.km-mobile-shell .km-subnav{
    max-width:100%;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* Modal/bottom-sheet layer keeps the locked document behind it. */
  html.km-mobile-shell .modalback,
  html.km-mobile-shell .km-confirm-back,
  html.km-mobile-shell .km-routine-drawer,
  html.km-mobile-shell .km-impact-back,
  html.km-mobile-shell .km-import-back,
  html.km-mobile-shell .km-command-back,
  html.km-mobile-shell .km-help-backdrop,
  html.km-mobile-shell .km-onboarding-back,
  html.km-mobile-shell .km-acct-sheetback{
    overscroll-behavior:none;
  }

  /* iOS keyboard: give the visual viewport back to forms and temporarily hide the tab bar. */
  html.km-mobile-shell body.km-keyboard-open .km-bottom-nav{
    opacity:0;
    pointer-events:none;
    transform:translateY(calc(100% + 24px));
  }
  html.km-mobile-shell body.km-keyboard-open .km-next-action{display:none}
}

@media (min-width:901px){
  .km-mobile-scroll-viewport{display:contents!important}
}
