/* V5.8 — compact tab bar and keyboard-safe shell. */
:root{--hk-tabbar:51px;--hk-viewport-top:0px;--hk-viewport-left:0px;}
/* Do not fix both body and app: iOS pans the visual viewport when focusing a field. */
html,body{position:static!important;inset:auto!important;}
#app,#app.app-mode,#app.screen-mode{position:absolute!important;inset:var(--hk-viewport-top) auto auto var(--hk-viewport-left)!important;}
#app.app-mode .app-shell .nav-item{gap:3px;}
#app.app-mode .app-shell>.header{-webkit-backdrop-filter:none!important;backdrop-filter:none!important;}
/* While typing, only the visible area is used; do not count bottom safe area twice. */
html.hk-keyboard:root{--hk-tabbar:0px;--hk-bottom-safe:0px;}
html.hk-keyboard #app.app-mode .app-shell>.nav,html.hk-keyboard #app .cart-floating{display:none!important;}
html.hk-keyboard #app.app-mode .app-shell{grid-template-rows:calc(var(--hk-topbar) + var(--hk-top-safe)) minmax(0,1fr) 0px!important;}
html.hk-keyboard #app .shade{padding-top:var(--hk-top-safe);align-items:flex-end;}
html.hk-keyboard #app .sheet,html.hk-keyboard #app .review-sheet{max-height:100%!important;margin:0 auto!important;padding-bottom:16px!important;scroll-padding:12px 0 16px;}
html.hk-keyboard #app .app-scroll,html.hk-keyboard #app.screen-mode{scroll-padding:12px 0 16px;}
#app input:focus,#app textarea:focus{outline-offset:1px;}
@media(orientation:landscape) and (max-height:500px){:root{--hk-tabbar:48px;}}
