/**
 * SIMPEL v0.16.47 — Global Layout Stability & Motion Calm
 * Stability layer only: no business state, permission, request, or data change.
 */

/* Keep the document width stable when pages, dialogs, media viewers, or the
   command palette lock scrolling. This prevents the whole shell shifting
   sideways by the scrollbar width on desktop. */
html{
  scroll-behavior:auto;
  scrollbar-gutter:stable;
}
@media (min-width:851px){
  html{overflow-y:scroll}
}

/* Prefer the small/stable viewport on mobile so browser chrome expanding and
   collapsing does not continuously change the minimum page geometry. */
body.layout-stable-v01647 .app-shell,
body.layout-stable-v01647.auth-body,
body.layout-stable-v01647 .login-shell,
body.layout-stable-v01647 .ecosystem-login,
body.layout-stable-v01647 .ecosystem-login .login-panel{
  min-height:100vh;
  min-height:100svh;
}

/* Fixed translucent blur layers are visually attractive but can shimmer or
   repaint during scrolling on lower-end phones and some desktop GPUs. Use an
   opaque surface for a calmer, stable shell. */
body.layout-stable-v01647 .topbar,
body.layout-stable-v01647 .bottom-nav,
body.layout-stable-v01647 form[data-journal-form]>.button-row{
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  background:var(--surface)!important;
}
body.layout-stable-v01647 .sidebar-backdrop,
body.layout-stable-v01647 .command-backdrop,
body.layout-stable-v01647 .modal-backdrop{
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}

/* Decorative fixed page gradients force a repaint while the viewport scrolls.
   Keep the same design language without a fixed compositing layer. */
body.layout-stable-v01647.ypia-ecosystem::before{position:absolute}

/* Controls should change color/shadow, not their physical position. This
   removes the 1–2px lift/scale effect that made dense pages feel as if they
   were moving under the pointer/finger. */
body.layout-stable-v01647 .btn,
body.layout-stable-v01647 .nav-link,
body.layout-stable-v01647 .report-action-card,
body.layout-stable-v01647 .ops-command-domain,
body.layout-stable-v01647 .settings-tab,
body.layout-stable-v01647 .network-bar button{
  transform:none!important;
}
body.layout-stable-v01647 .btn:hover:not(:disabled),
body.layout-stable-v01647 .btn:active:not(:disabled),
body.layout-stable-v01647 .nav-link:hover,
body.layout-stable-v01647 .report-action-card:hover,
body.layout-stable-v01647 .ops-command-domain:hover,
body.layout-stable-v01647 .network-bar button:active{
  transform:none!important;
}
body.layout-stable-v01647 .btn,
body.layout-stable-v01647 .nav-link,
body.layout-stable-v01647 .report-action-card,
body.layout-stable-v01647 .ops-command-domain{
  transition-property:background,border-color,box-shadow,color,filter,opacity!important;
}

/* Preserve the server-rendered icon/glyph dimensions. The v0.16.47 JS no
   longer swaps these controls after first paint. */
body.layout-stable-v01647 .nav-link>span:first-child,
body.layout-stable-v01647 .bottom-nav :is(a,button)>span:first-child{
  flex:0 0 22px;
  width:22px;
  min-width:22px;
  text-align:center;
}
body.layout-stable-v01647 .ypia-icon-legacy,
body.layout-stable-v01647 [data-ypia-legacy-icon="1"]{
  display:inline-grid!important;
}

/* v0.16.48 — Trackpad/Wheel Scroll Chaining Hotfix
   Keep horizontal rubber-band contained, but never block vertical wheel/trackpad
   chaining from body/table wrappers to the document scrolling element. Keyboard
   scrolling already targets the document directly; this keeps pointer gestures
   on the same vertical path without reintroducing layout wobble. */
body.layout-stable-v01647{
  overscroll-behavior-x:none;
  overscroll-behavior-y:auto;
}
body.layout-stable-v01647 .sidebar-scroll{
  overscroll-behavior:contain;
}
body.layout-stable-v01647 :is(.table-wrap,.table-responsive,.ypia-table-scroll,.overflow-table){
  overscroll-behavior-x:contain;
  overscroll-behavior-y:auto;
}

/* Stable image boxes for shell identity while image bytes are still loading. */
body.layout-stable-v01647 :is(.brand-icon,.sidebar-brand-link) img{
  display:block;
  object-fit:contain;
}

/* Keep deliberate drawer/dialog movement, but respect reduced-motion users. */
@media (prefers-reduced-motion:reduce){
  body.layout-stable-v01647 *,
  body.layout-stable-v01647 *::before,
  body.layout-stable-v01647 *::after{
    scroll-behavior:auto!important;
  }
}
