/* Puff Putt v033 (PP-005): on-screen keyboard (iPhone Safari / Home-Screen app).
   While a text field is focused and the keyboard is up, the fit script sets html.kb plus --kb-top / --kb-h (the visual viewport).
   The active screen is pinned to that visible area, so a dialog re-centres above the keyboard and scrolls inside itself instead of
   being squeezed, clipped and pushed up with an empty gap below it. The bottom safe-area inset is under the keyboard, so --sab is 0
   while it is open. Everything returns to normal when the field loses focus (Done). */
html.kb { --sab: 0px; }
html.kb .screen.active { top: var(--kb-top, 0px); height: var(--kb-h, var(--app-h)); }
html.kb .screen.overlay.active { align-items: center; padding-top: calc(var(--sat) + 8px); padding-bottom: 8px; }
html.kb .screen.overlay.active .modal { max-height: 100%; overflow: auto; animation: none; scrollbar-width: none; }
html.kb .screen.overlay.active .modal::-webkit-scrollbar { display: none; }
/* A keyboard that shrinks the window (Android Chrome, and iOS where it resizes) can make a portrait phone look "landscape";
   the turn-your-phone prompt must not cover the field being typed in. Real rotation changes the width, which ends kb mode. */
html.kb #rotate { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
