/* JF4166: reliable native scrolling for the music folder tree on touch screens. */
@media (max-width:760px), (hover:none) and (pointer:coarse){
  .music-folder-browser{
    overflow:hidden!important;
  }

  .music-folder-tree{
    box-sizing:border-box;
    width:100%;
    height:clamp(360px,62svh,680px)!important;
    height:clamp(360px,62dvh,680px)!important;
    min-height:360px!important;
    max-height:680px!important;
    overflow-x:hidden!important;
    overflow-y:scroll!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:none!important;
    overscroll-behavior-y:auto!important;
    scrollbar-gutter:auto!important;
    scrollbar-width:thin;
    scrollbar-color:#8f8b86 #eee8e1;
    touch-action:pan-y!important;
    padding:5px 5px calc(88px + env(safe-area-inset-bottom))!important;
  }

  .music-folder-tree::-webkit-scrollbar{
    width:8px;
  }

  .music-folder-tree::-webkit-scrollbar-track{
    background:#eee8e1;
    border-radius:999px;
  }

  .music-folder-tree::-webkit-scrollbar-thumb{
    min-height:34px;
    background:#8f8b86;
    border:2px solid #eee8e1;
    border-radius:999px;
  }

  .music-folder-node,
  .music-folder-node>summary,
  .music-folder-children,
  .music-folder-album{
    touch-action:pan-y!important;
  }
}

/* Older WebViews without svh/dvh still receive a bounded native scroller. */
@supports not (height:1svh){
  @media (max-width:760px){
    .music-folder-tree{
      height:62vh!important;
    }
  }
}
