/* SamiMap Professional PWA V2 — standalone iPhone shell only */
:root{--bx-pwa-top:env(safe-area-inset-top,0px);--bx-pwa-right:env(safe-area-inset-right,0px);--bx-pwa-bottom:env(safe-area-inset-bottom,0px);--bx-pwa-left:env(safe-area-inset-left,0px)}
html.bx-pwa-standalone,html.bx-pwa-standalone body{width:100%;height:100%;min-height:100dvh;margin:0;overflow:hidden;overscroll-behavior:none;background:#06111a}
html.bx-pwa-standalone body{position:fixed;inset:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
html.bx-pwa-standalone #map,html.bx-pwa-standalone .maplibregl-map{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;min-height:100dvh!important}
html.bx-pwa-standalone button,html.bx-pwa-standalone [role="button"]{-webkit-tap-highlight-color:transparent;touch-action:manipulation;-webkit-user-select:none;user-select:none}
html.bx-pwa-standalone input,html.bx-pwa-standalone textarea{-webkit-tap-highlight-color:transparent}
html.bx-pwa-standalone #searchInput{font-size:16px!important}
html.bx-pwa-standalone #searchResults,html.bx-pwa-standalone #bxNearbyResults,html.bx-pwa-standalone .bx39-panel-body{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
html.bx-pwa-standalone #bxPwaInstallHint{display:none!important}

@media(max-width:760px){
 html.bx-pwa-standalone #bxR38Toggle{left:calc(var(--bx-pwa-left) + 8px)!important;top:calc(var(--bx-pwa-top) + 8px)!important;width:46px!important;height:46px!important;border-radius:15px!important;box-shadow:0 7px 18px rgba(0,0,0,.24)!important}
 html.bx-pwa-standalone body.bx-r38-ui #bxV290SearchDock,html.bx-pwa-standalone body #bxV290SearchDock{left:calc(var(--bx-pwa-left) + 60px)!important;right:calc(var(--bx-pwa-right) + 84px)!important;top:calc(var(--bx-pwa-top) + 8px)!important;height:46px!important}
 html.bx-pwa-standalone #bxV290SearchDock #searchForm{height:46px!important;min-height:46px!important;border-radius:15px!important;background:rgba(5,20,35,.97)!important;backdrop-filter:none!important;box-shadow:0 7px 18px rgba(0,0,0,.22)!important}
 html.bx-pwa-standalone #bxV290SearchDock #searchInput{height:44px!important;line-height:44px!important;font-size:16px!important}
 html.bx-pwa-standalone body #bxV22Weather{top:calc(var(--bx-pwa-top) + 8px)!important;right:calc(var(--bx-pwa-right) + 7px)!important;width:70px!important;max-width:70px!important;height:46px!important;min-height:46px!important;border-radius:15px!important;background:rgba(5,20,35,.97)!important;backdrop-filter:none!important;box-shadow:0 7px 18px rgba(0,0,0,.22)!important}
 html.bx-pwa-standalone #bxNearbyDock{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 8px)!important;top:calc(var(--bx-pwa-top) + 64px)!important;max-width:none!important;padding:2px 0 3px!important;gap:7px!important;scroll-snap-type:x proximity}
 html.bx-pwa-standalone .bx-nearby-chip{height:40px!important;padding:0 12px!important;border-radius:20px!important;font-size:12px!important;box-shadow:0 6px 16px rgba(0,0,0,.20)!important;scroll-snap-align:start}
 html.bx-pwa-standalone #rightRail{right:calc(var(--bx-pwa-right) + 8px)!important;width:46px!important;gap:7px!important;transform:translateY(-44%)!important}
 html.bx-pwa-standalone body.bx-r38-ui #rightRail>button{width:46px!important;height:46px!important;border-radius:14px!important;background:rgba(5,20,35,.97)!important;box-shadow:0 6px 16px rgba(0,0,0,.20)!important}
 html.bx-pwa-standalone #bxNearbyDrawer{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 8px)!important;bottom:calc(var(--bx-pwa-bottom) + 8px)!important;max-height:min(54dvh,520px)!important;border-radius:22px!important;background:rgba(5,17,27,.985)!important;backdrop-filter:none!important;box-shadow:0 18px 44px rgba(0,0,0,.34)!important}
 html.bx-pwa-standalone #bxNearbyCard{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 8px)!important;bottom:calc(var(--bx-pwa-bottom) + 8px)!important;border-radius:20px!important;background:rgba(5,17,27,.985)!important;backdrop-filter:none!important;box-shadow:0 16px 38px rgba(0,0,0,.32)!important}
 html.bx-pwa-standalone .bx-nearby-hit{min-height:58px!important}
 html.bx-pwa-standalone .bx-nearby-go{width:40px!important;height:40px!important;border-radius:12px!important}
 html.bx-pwa-standalone .bx-nearby-dir{min-height:46px!important;border-radius:14px!important}
 html.bx-pwa-standalone #bxR38Drawer{left:calc(var(--bx-pwa-left) + 8px)!important;top:calc(var(--bx-pwa-top) + 62px)!important;bottom:calc(var(--bx-pwa-bottom) + 8px)!important;width:min(88vw,340px)!important;border-radius:22px!important;background:rgba(5,17,27,.99)!important;backdrop-filter:none!important;box-shadow:0 18px 48px rgba(0,0,0,.38)!important}
 html.bx-pwa-standalone #searchResults{max-height:min(56dvh,480px)!important;border-radius:0 0 16px 16px!important}
 html.bx-pwa-standalone body.navigation-active #bxRouteCancelX{left:calc(var(--bx-pwa-left) + 8px)!important;top:calc(var(--bx-pwa-top) + 8px)!important;width:46px!important;height:46px!important;border-radius:15px!important}
 html.bx-pwa-standalone #bxR38TurnCard{left:calc(var(--bx-pwa-left) + 60px)!important;right:calc(var(--bx-pwa-right) + 60px)!important;top:calc(var(--bx-pwa-top) + 8px)!important;min-height:84px!important;border-radius:18px!important;background:rgba(5,18,31,.985)!important;backdrop-filter:none!important;box-shadow:0 10px 28px rgba(0,0,0,.28)!important}
 html.bx-pwa-standalone body.bx-r38-ui.navigation-active #driveHud{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 8px)!important;bottom:calc(var(--bx-pwa-bottom) + 8px)!important;border-radius:19px!important;background:rgba(4,15,27,.99)!important;backdrop-filter:none!important;box-shadow:0 12px 34px rgba(0,0,0,.30)!important}
 html.bx-pwa-standalone #placeModal,html.bx-pwa-standalone #placeCard{max-width:calc(100vw - var(--bx-pwa-left) - var(--bx-pwa-right) - 16px)!important}
}

@media(max-width:430px) and (orientation:portrait){
 html.bx-pwa-standalone body.bx-r38-ui #bxV290SearchDock,html.bx-pwa-standalone body #bxV290SearchDock{left:calc(var(--bx-pwa-left) + 58px)!important;right:calc(var(--bx-pwa-right) + 80px)!important}
 html.bx-pwa-standalone body #bxV22Weather{width:68px!important;max-width:68px!important}
 html.bx-pwa-standalone .bx-nearby-chip{height:39px!important;padding:0 11px!important}
}
@media(max-width:932px) and (orientation:landscape){
 html.bx-pwa-standalone body.bx-r38-ui #bxV290SearchDock,html.bx-pwa-standalone body #bxV290SearchDock{left:calc(var(--bx-pwa-left) + 60px)!important;right:calc(var(--bx-pwa-right) + 86px)!important;top:calc(var(--bx-pwa-top) + 7px)!important}
 html.bx-pwa-standalone body #bxV22Weather{top:calc(var(--bx-pwa-top) + 7px)!important;right:calc(var(--bx-pwa-right) + 7px)!important;height:46px!important}
 html.bx-pwa-standalone #bxNearbyDock{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 64px)!important;top:calc(var(--bx-pwa-top) + 61px)!important}
 html.bx-pwa-standalone #bxNearbyDrawer{left:calc(var(--bx-pwa-left) + 8px)!important;right:auto!important;width:min(46vw,430px)!important;max-height:calc(100dvh - var(--bx-pwa-top) - var(--bx-pwa-bottom) - 80px)!important}
 html.bx-pwa-standalone #bxNearbyCard{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 64px)!important}
 html.bx-pwa-standalone #bxR38Drawer{width:min(42vw,340px)!important}
 html.bx-pwa-standalone #bxR38TurnCard{left:calc(var(--bx-pwa-left) + 58px)!important;right:calc(var(--bx-pwa-right) + 58px)!important;min-height:72px!important}
 html.bx-pwa-standalone body.bx-r38-ui.navigation-active #driveHud{left:calc(var(--bx-pwa-left) + 8px)!important;right:calc(var(--bx-pwa-right) + 64px)!important;bottom:calc(var(--bx-pwa-bottom) + 6px)!important}
}
@media(prefers-reduced-motion:reduce){
 html.bx-pwa-standalone *,html.bx-pwa-standalone *::before,html.bx-pwa-standalone *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}


/* PWA V2.1: iPhone landscape must stay phone-sized, never inherit tablet bars */
@media(min-width:761px) and (max-width:932px) and (orientation:landscape){
 html.bx-pwa-standalone body.bx-r38-ui #bxV290SearchDock,
 html.bx-pwa-standalone body #bxV290SearchDock{
   left:calc(var(--bx-pwa-left) + 60px)!important;
   right:calc(var(--bx-pwa-right) + 84px)!important;
   top:calc(var(--bx-pwa-top) + 7px)!important;
   width:auto!important;height:46px!important;max-width:none!important
 }
 html.bx-pwa-standalone #bxV290SearchDock #searchForm{
   width:100%!important;height:46px!important;min-height:46px!important;
   border-radius:15px!important;background:rgba(5,20,35,.97)!important;
   backdrop-filter:none!important;box-shadow:0 7px 18px rgba(0,0,0,.22)!important
 }
 html.bx-pwa-standalone #bxV290SearchDock #searchInput{
   height:44px!important;line-height:44px!important;font-size:16px!important
 }
 html.bx-pwa-standalone body #bxV22Weather{
   left:auto!important;right:calc(var(--bx-pwa-right) + 7px)!important;
   top:calc(var(--bx-pwa-top) + 7px)!important;
   width:70px!important;max-width:70px!important;height:46px!important;min-height:46px!important;
   padding:0 6px!important;border-radius:15px!important;background:rgba(5,20,35,.97)!important;
   backdrop-filter:none!important;box-shadow:0 7px 18px rgba(0,0,0,.22)!important
 }
 html.bx-pwa-standalone #bxNearbyDock{
   left:calc(var(--bx-pwa-left) + 8px)!important;
   right:calc(var(--bx-pwa-right) + 62px)!important;
   top:calc(var(--bx-pwa-top) + 61px)!important;
   max-width:none!important;width:auto!important
 }
 html.bx-pwa-standalone #rightRail{
   right:calc(var(--bx-pwa-right) + 8px)!important;width:46px!important;
   top:50%!important;transform:translateY(-44%)!important;gap:6px!important
 }
 html.bx-pwa-standalone body.bx-r38-ui #rightRail>button{
   width:46px!important;height:46px!important;border-radius:14px!important;
   background:rgba(5,20,35,.97)!important;box-shadow:0 6px 16px rgba(0,0,0,.20)!important
 }
}


/* PWA V2.2: remove legacy topbar box padding so search and Nearby never overlap */
@media(max-width:932px){
 html.bx-pwa-standalone body.bx-r38-ui #bxV290SearchDock,
 html.bx-pwa-standalone body #bxV290SearchDock{
   box-sizing:border-box!important;padding:0!important;margin:0!important;
   min-height:46px!important;max-height:46px!important;overflow:visible!important
 }
 html.bx-pwa-standalone #rightRail{
   box-sizing:border-box!important;padding:0!important;margin:0!important;
   min-width:46px!important;max-width:46px!important
 }
 html.bx-pwa-standalone body.bx-r38-ui #rightRail>button{
   box-sizing:border-box!important;min-width:46px!important;max-width:46px!important
 }
}
