/* PDIP_SIDEBAR_VIEWPORT_COMPACT_20260927
   Desktop sidebar: preserve every existing link and bottom status; only change geometry.
   Budget: use actual remaining flex height, not hard-coded topbar subtraction. */
@media screen and (min-width:1101px) and (min-height:560px) and (max-height:900px) {
  html body .app-shell.ui-1366-standard .sidebar{
    height:100dvh!important;max-height:100dvh!important;min-height:0!important;
    padding:9px 11px 8px!important;overflow-y:hidden!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .brand{
    min-height:52px!important;padding:0 3px 7px!important;gap:8px!important;flex:0 0 auto!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .brand-badge{
    width:40px!important;height:40px!important;min-width:40px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .brand-copy strong{font-size:13px!important;line-height:1.12!important}
  html body .app-shell.ui-1366-standard .sidebar .brand-copy small{font-size:9px!important;line-height:1.12!important}
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final{
    flex:0 1 auto!important;min-height:0!important;
    gap:3px!important;padding-top:7px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final>a{
    min-height:40px!important;padding:4px 8px!important;gap:8px!important;
    font-size:12.5px!important;line-height:1.12!important;border-radius:8px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final .nav-icon{
    width:28px!important;height:28px!important;min-width:28px!important;
    border-radius:7px!important;font-size:12px!important;flex:0 0 28px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final .nav-public-zone{
    margin-top:5px!important;padding-top:6px!important;gap:4px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final .nav-public-zone>a{
    min-height:42px!important;padding:4px 7px!important;gap:7px!important;
    font-size:11.5px!important;line-height:1.13!important;border-radius:8px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final .nav-public-badge{
    font-size:7.5px!important;padding:2px 4px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .sidebar-foot{
    margin-top:auto!important;flex:0 0 auto!important;
    min-height:33px!important;padding:5px 7px!important;gap:6px!important;
    border-radius:8px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .sidebar-foot strong{font-size:9px!important;line-height:1.1!important}
  html body .app-shell.ui-1366-standard .sidebar .sidebar-foot small{font-size:8px!important;line-height:1.1!important;margin-top:1px!important}

  html body .app-shell.ui-1366-standard:has(.pdip-budget-menu-one-screen,.pdip-budget-one-screen){
    height:100dvh!important;min-height:0!important;max-height:100dvh!important;
  }
  html body .app-shell.ui-1366-standard .main-area:has(.pdip-budget-menu-one-screen,.pdip-budget-one-screen){
    height:100dvh!important;min-height:0!important;max-height:100dvh!important;
    overflow:hidden!important;
  }
  html body .app-shell.ui-1366-standard .main-area:has(.pdip-budget-menu-one-screen,.pdip-budget-one-screen)>.topbar{
    flex-shrink:0!important;
  }
  html body .app-shell.ui-1366-standard .main-area>.content:has(>.pdip-budget-menu-one-screen,>.pdip-budget-one-screen){
    flex:1 1 auto!important;height:auto!important;max-height:none!important;
    min-height:0!important;overflow:hidden!important;
  }
  html body .app-shell.ui-1366-standard .main-area:has(.pdip-budget-menu-one-screen,.pdip-budget-one-screen)>footer{
    display:none!important;
  }
}
  /* Roomier labels on the 673px usable Chrome viewport; compact 625px remains 40px. */
  @media screen and (min-height:650px) {
    html body .app-shell.ui-1366-standard .sidebar .nav-menu-final>a{
      min-height:42px!important;font-size:13px!important;padding:5px 8px!important;
    }
    html body .app-shell.ui-1366-standard .sidebar .nav-menu-final .nav-public-zone>a{
      min-height:44px!important;font-size:12px!important;
    }
  }
@media screen and (min-width:1101px) and (max-height:610px){
  html body .app-shell.ui-1366-standard .sidebar{overflow-y:auto!important;overscroll-behavior:contain!important}
}
@media screen and (max-width:1100px){
  /* Existing mobile drawer, responsive sidebar and document scrolling remain unchanged. */
}

/* PDIP_LOGIN_2PX_VIEWPORT_20260927: desktop login only; no effect on sidebar or finance pages. */
@media screen and (min-width:1101px) and (min-height:520px) and (max-height:900px){
  html body .app-shell.ui-1366-standard .login-page-final {
    min-height:calc(100dvh - 102px)!important;
  }
}
/* V14 SIDEBAR_FILLS_FREE_SPACE_1366: 9 standard items share spare vertical room.
   Mobile and short-height fallback remain on previous geometry. */
@media screen and (min-width:1200px) and (max-width:1440px) and (min-height:620px) and (max-height:850px){
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final{
    flex:1 1 auto!important;min-height:0!important;gap:3px!important;padding-top:7px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final>a{
    flex:1 1 40px!important;min-height:40px!important;max-height:46px!important;
    padding:5px 8px!important;font-size:13px!important;line-height:1.14!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .nav-menu-final .nav-public-zone{
    flex:0 0 auto!important;margin-top:5px!important;
  }
  html body .app-shell.ui-1366-standard .sidebar .sidebar-foot{
    flex:0 0 auto!important;margin-top:6px!important;
  }
}
