/* HTNS Songbook r35 — hard-pin the mobile taskbar to the actual viewport bottom.
   r34 could still inherit a constrained modal containing block on some iPhones.
   This layer makes the active Songbook modal/sheet own the full mobile viewport. */

@media (max-width:719px){
  html.htns-theme-v234 body #modal:has(.modal.htns-songbook-modal){
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    translate:none!important;
    scale:none!important;
    rotate:none!important;
    filter:none!important;
    perspective:none!important;
    contain:none!important;
    will-change:auto!important;
  }

  html.htns-theme-v234 body #modal .modal.htns-songbook-modal,
  html.htns-theme-v234 body #modal .modal.htns-songbook-modal .sheet.htns-songbook-sheet,
  html.htns-theme-v234 body #modal .modal.htns-songbook-modal .htns-songbook-screen,
  html.htns-theme-v234 body #modal .modal.htns-songbook-modal .htns-songbook-viewer{
    transform:none!important;
    translate:none!important;
    scale:none!important;
    rotate:none!important;
    filter:none!important;
    perspective:none!important;
    contain:none!important;
    will-change:auto!important;
  }

  html.htns-theme-v234 body #modal .modal.htns-songbook-modal{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:0!important;
  }

  html.htns-theme-v234 body #modal .modal.htns-songbook-modal .sheet.htns-songbook-sheet{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:0!important;
    border-radius:0!important;
  }

  html.htns-theme-v234 body #modal .htns-songbook-viewer .htns-songbook-viewer-controls{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:0!important;
    width:100vw!important;
    max-width:100vw!important;
    margin:0!important;
    transform:none!important;
    padding:6px 7px calc(7px + env(safe-area-inset-bottom))!important;
    border-radius:20px 20px 0 0!important;
    z-index:2147483646!important;
  }

  html.htns-theme-v234 body #modal .htns-songbook-viewer .htns-songbook-viewer-stage-inner{
    padding-bottom:calc(144px + env(safe-area-inset-bottom))!important;
  }
}

/* On supported iPhones, the small visual viewport is the closest match to the physical visible screen. */
@supports (height:100svh){
  @media (max-width:719px){
    html.htns-theme-v234 body #modal:has(.modal.htns-songbook-modal),
    html.htns-theme-v234 body #modal .modal.htns-songbook-modal,
    html.htns-theme-v234 body #modal .modal.htns-songbook-modal .sheet.htns-songbook-sheet{
      height:100svh!important;
      min-height:100svh!important;
      max-height:100svh!important;
    }
  }
}
