/* TEMVIO v1.1.2 — Keyboard + Locale Safe Area */
:root{
  --temvio-vv-height:100dvh;
  --temvio-vv-top:0px;
  --temvio-keyboard-height:0px;
}

/* When Android IME is open, use the actual VisualViewport rather than layout viewport. */
html.temvio-keyboard-open .modal-wrap:not(.hidden){
  top:var(--temvio-vv-top) !important;
  bottom:auto !important;
  left:0 !important;
  right:0 !important;
  height:var(--temvio-vv-height) !important;
  min-height:0 !important;
  padding:
    max(8px,var(--temvio-inset-top-safe))
    max(10px,var(--temvio-inset-right-safe))
    8px
    max(10px,var(--temvio-inset-left-safe)) !important;
  place-items:start center !important;
  align-items:start !important;
  overflow:hidden !important;
}

html.temvio-keyboard-open .modal-wrap:not(.hidden) .modal{
  width:min(700px,100%) !important;
  max-height:calc(var(--temvio-vv-height) - var(--temvio-inset-top-safe) - 12px) !important;
  overflow-y:auto !important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scroll-padding-top:18px;
  scroll-padding-bottom:160px;
  margin:0 auto !important;
}

/* Keep multiline fields usable while the keyboard is visible. */
html.temvio-keyboard-open .modal textarea:focus{
  min-height:132px;
}
html.temvio-keyboard-open #postDescription:focus,
html.temvio-keyboard-open #bidCover:focus,
html.temvio-keyboard-open #inviteNote:focus{
  min-height:150px;
}

/* Avoid fixed app controls competing with the keyboard. */
html.temvio-keyboard-open .bottom-nav,
html.temvio-keyboard-open .fab{
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Locale reload restores native safe-area variables from localStorage before first paint.
   Keep header geometry language-independent. */
#appShell{
  padding-top:var(--temvio-inset-top-safe) !important;
}
#appShell .topbar{
  min-height:70px !important;
  padding-top:0 !important;
  align-items:center !important;
}
#appShell .topbar h1{
  line-height:1.2;
  overflow-wrap:anywhere;
}
@media(max-width:680px){
  #appShell .topbar{
    gap:8px;
  }
  #appShell .topbar h1{
    font-size:clamp(25px,7.2vw,32px) !important;
    max-width:min(68vw,360px);
  }
  #appShell .topbar .right{
    flex:0 0 auto;
  }
}
