/* App shell — lock viewport; only #screen-container scrolls */

html,
body {
  height: 100%;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

#screen-container {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Mobile: fixed bottom nav */
#nav-host .bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 767px) {
  #nav-host .sidebar-layout {
    display: none;
  }
}

/* Desktop: pinned sidebar, scrollable main */
@media (min-width: 768px) {
  #nav-host {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 16rem;
    flex-shrink: 0;
    order: -1;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    border-right: 1px solid rgb(226 232 240);
    background: white;
  }

  #nav-host .bottom-nav {
    display: none;
  }

  #nav-host .sidebar-layout {
    height: 100%;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #screen-container {
    flex: 1 1 0%;
    min-width: 0;
    height: 100dvh;
    max-height: 100dvh;
    max-width: none;
    padding-bottom: 1.5rem;
  }
}

.finance-fab {
  position: fixed;
  z-index: 40;
  right: max(1rem, calc(50% - 20rem));
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .finance-fab {
    bottom: 1.5rem;
  }
}
