/* TEMVIO v1.6.0 RC2.2 — Android IME + system navigation safe-area hotfix */
:root{
  --temvio-rc22-nav-safe:max(
    54px,
    var(--temvio-inset-bottom-safe,0px),
    env(safe-area-inset-bottom,0px)
  );
}

/* Android system navigation must never cover TEMVIO controls. */
html.temvio-android .bottom-nav{
  bottom:calc(8px + var(--temvio-rc22-nav-safe))!important;
}
html.temvio-android .fab{
  bottom:calc(88px + var(--temvio-rc22-nav-safe))!important;
}
@media(max-width:900px){
  html.temvio-android #appShell .main{
    padding-bottom:calc(124px + var(--temvio-rc22-nav-safe))!important;
  }
}

/* Bottom-sheet/modal actions (Publish project, Cancel, etc.) stay above Android nav. */
html.temvio-android .modal-wrap:not(.hidden){
  padding-bottom:var(--temvio-rc22-nav-safe)!important;
}
html.temvio-android .modal-wrap:not(.hidden) .modal{
  box-sizing:border-box!important;
  max-height:calc(100dvh - 8px)!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
html.temvio-android .modal-wrap:not(.hidden) .modal-actions{
  position:sticky!important;
  bottom:0!important;
  z-index:12!important;
  background:rgba(255,255,255,.98)!important;
  backdrop-filter:blur(10px);
  padding:12px 0 calc(12px + var(--temvio-rc22-nav-safe))!important;
  margin-bottom:calc(-1 * var(--temvio-rc22-nav-safe))!important;
  border-top:1px solid rgba(220,229,225,.92)!important;
}

/* Auth panel gets explicit scroll room even if OEM WebView does not report IME height. */
html.temvio-android #authModal .auth-rc2,
html.temvio-android #authModal .modal{
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  scroll-padding-top:20px!important;
  scroll-padding-bottom:180px!important;
}

/* Forced IME mode: independent from the older innerHeight/VisualViewport detector. */
html.temvio-android.temvio-ime-open .modal-wrap:not(.hidden){
  top:var(--temvio-rc22-vv-top,0px)!important;
  bottom:auto!important;
  left:0!important;
  right:0!important;
  height:var(--temvio-rc22-vv-height,100dvh)!important;
  min-height:0!important;
  place-items:start center!important;
  align-items:start!important;
  overflow:hidden!important;
  padding:
    max(6px,var(--temvio-inset-top-safe,0px))
    max(8px,var(--temvio-inset-right-safe,0px))
    6px
    max(8px,var(--temvio-inset-left-safe,0px))!important;
}
html.temvio-android.temvio-ime-open .modal-wrap:not(.hidden) .modal{
  width:min(700px,100%)!important;
  height:auto!important;
  max-height:calc(var(--temvio-rc22-vv-height,100dvh) - 8px)!important;
  overflow-y:auto!important;
  padding-bottom:220px!important;
  scroll-padding-top:20px!important;
  scroll-padding-bottom:220px!important;
  margin:0 auto!important;
}
html.temvio-android.temvio-ime-open .modal-wrap:not(.hidden) .modal-actions{
  position:static!important;
  padding:12px 0 28px!important;
  margin:18px 0 0!important;
  border-top:1px solid rgba(220,229,225,.92)!important;
}
html.temvio-android.temvio-ime-open .bottom-nav,
html.temvio-android.temvio-ime-open .fab{
  visibility:hidden!important;
  pointer-events:none!important;
}
html.temvio-android.temvio-ime-open .field:has(input:focus),
html.temvio-android.temvio-ime-open .field:has(textarea:focus),
html.temvio-android.temvio-ime-open .field:has(select:focus){
  scroll-margin-top:22px!important;
  scroll-margin-bottom:150px!important;
}
html.temvio-android.temvio-ime-open textarea:focus{
  max-height:148px!important;
  min-height:112px!important;
  overflow-y:auto!important;
}
html.temvio-android.temvio-ime-open #postDescription:focus,
html.temvio-android.temvio-ime-open #bidCover:focus,
html.temvio-android.temvio-ime-open #inviteNote:focus,
html.temvio-android.temvio-ime-open #teamDescription:focus,
html.temvio-android.temvio-ime-open #teamTaskDescription:focus{
  min-height:118px!important;
  max-height:148px!important;
}

/* Keep the auth logo on a white tile inside the app UI. */
html.temvio-android .auth-fast-logo{
  box-sizing:content-box!important;
  background:#fff!important;
  border:1px solid #e4ece8!important;
  border-radius:18px!important;
  padding:7px!important;
  box-shadow:0 8px 22px rgba(15,118,110,.10)!important;
}
