/* HTNS v302 r100 — iPhone/PWA login bottom-fill correction.
   Keeps the safe-area-aware full-height login canvas from r99, but restores the
   complete lower church composition. The scene now scales to the remaining viewport
   instead of using cover + bottom anchoring, which had zoomed/cropped the church too low. */
@media (max-width: 899px) {
  html.htns-theme-v234.login-screen-active[data-theme="light"],
  html.htns-theme-v234.login-screen-active[data-theme="light"] body,
  html.htns-theme-v234.login-screen-active[data-theme="light"] body #app {
    width:100% !important;
    height:max(100vh, calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    min-height:max(100vh, calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    max-height:none !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    background:#cfe7fb !important;
  }

  html.htns-theme-v234.login-screen-active[data-theme="light"] body {
    position:fixed !important;
    inset:0 !important;
  }

  html.htns-theme-v234[data-theme="light"] body #app #gate.gate[data-login-skin="r71"] {
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    right:0 !important;
    bottom:auto !important;
    height:max(100vh, calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    min-height:max(100vh, calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    max-height:none !important;
    overflow:hidden !important;
    background:#a2ccfb url('/htns-login-hero-r82.jpg') center top / 100% auto no-repeat !important;
  }

  html.htns-theme-v234[data-theme="light"] body #app #gate.gate[data-login-skin="r71"] .htns-login-scene-r71 {
    flex:1 1 auto !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 0 env(safe-area-inset-bottom, 0px) !important;
    box-sizing:border-box !important;
    background-color:#cfe7fb !important;
    background-image:url('/htns-login-scene-r82.jpg') !important;
    background-repeat:no-repeat !important;
    /* Fit the complete r82 church artwork into the remaining viewport. This fills the
       former white strip without zooming the church downward/cropping its lower half. */
    background-size:100% 100% !important;
    background-position:center top !important;
  }
}

/* Standalone iOS uses the same safe-area-aware height. No extra vertical bleed is
   needed now that the scene itself fills its complete remaining box. */
@media (display-mode: standalone) and (max-width: 899px) {
  html.htns-theme-v234[data-theme="light"] body #app #gate.gate[data-login-skin="r71"] {
    height:max(100vh, calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    min-height:max(100vh, calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))) !important;
  }
}
