/* REV unified desktop application shell, preview v1.
   One 440px mobile viewport for all app views, including maps and dialogs.
   On touch/mobile devices the native full-screen layout is unchanged. */
@media (min-width:760px) {
  html[data-rev-app="1"] {
    height:100%!important;
    min-height:100%!important;
    overflow:hidden!important;
    background:#eaf0f8!important;
  }
  html[data-rev-app="1"] body {
    position:relative!important;
    isolation:isolate!important;
    transform:translateZ(0)!important;
    box-sizing:border-box!important;
    width:440px!important;
    min-width:0!important;
    max-width:100%!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0 auto!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    scrollbar-width:none;
    border-radius:22px!important;
    background:#fff!important;
    box-shadow:0 22px 75px #0b2a5040!important;
  }
  html[data-rev-app="1"] body::-webkit-scrollbar{display:none}
  html[data-rev-app="1"] body.rev-map-one {
    overflow:hidden!important;
    padding:0!important;
  }
  html[data-rev-app="1"] body :is(main,.wrap){
    box-sizing:border-box!important;
    max-width:100%!important;
    min-width:0!important;
  }
  html[data-rev-app="1"] body #rev-app-bottom-nav{
    position:fixed!important;
    inset:auto 0 0!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    transform:none!important;
    box-sizing:border-box!important;
    border-radius:0!important;
  }
  /* Transform on the fixed-height body makes fixed dialog backdrops and
     sheets use this phone viewport, rather than the browser viewport. */
  html[data-rev-app="1"] body :is(
    #revAccountShade,#onboard,#revSplash,#evpExecModal,
    #reportModal,#revAddModal,#revVoteModal,#revModalBackdrop,
    .backdrop,.sheet,#navArrive
  ){
    box-sizing:border-box!important;
    max-width:100%!important;
    max-height:100%!important;
  }
  html[data-rev-app="1"] body :is(
    #revAccountCard,.ob-card,.rm-card,.rev-add-card,.rev-vote-card,
    #evpExecModal>*,.sheet
  ){
    box-sizing:border-box!important;
    max-width:calc(100% - 20px)!important;
    max-height:calc(100dvh - 30px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
  }
  html[data-rev-app="1"] body :is(.backdrop,#revAccountShade,#onboard,#revSplash,#evpExecModal,#reportModal,#revAddModal,#revVoteModal,#revModalBackdrop){
    left:0!important;
    right:0!important;
    max-width:100%!important;
  }
  html[data-rev-app="1"] body .sheet{
    width:100%!important;
    max-width:100%!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    margin:0!important;
    max-height:calc(100dvh - 12px)!important;
  }
  html[data-rev-app="1"] body #navArrive{
    left:10px!important;
    right:10px!important;
    width:auto!important;
  }
  html[data-rev-app="1"] body :is(
    #revMusicPanel,#routeSettingsPanel,#routePanel,#details-panel,
    #filterMenu,#searchHistoryPanel,#tripLivePanel,#groupTripPanel
  ){
    box-sizing:border-box!important;
    max-width:100%!important;
    max-height:calc(100dvh - 24px)!important;
  }
  html[data-rev-app="1"] body .leaflet-popup.rev-centered-popup{
    max-width:calc(100% - 20px)!important;
    max-height:calc(100dvh - 24px)!important;
  }
  html[data-rev-app="1"] body .leaflet-popup.rev-centered-popup .leaflet-popup-content{
    max-height:calc(100dvh - 96px)!important;
    overflow-y:auto!important;
  }
  /* The real map viewport is never wider than the phone shell. */
  html[data-rev-app="1"] body.rev-map-one #map,
  html[data-rev-app="1"] body.rev-map-one #revMapScene{
    box-sizing:border-box!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
}

/* Intentionally invisible scroll indicators throughout the REV app.
   Native touch gestures, mouse wheel, trackpad and keyboard scrolling
   remain available; only scrollbar chrome is visually removed. */
html[data-rev-app="1"],
html[data-rev-app="1"] body,
html[data-rev-app="1"] body * {
  scrollbar-width:none!important;      /* Firefox / modern Chromium */
  -ms-overflow-style:none!important;   /* Legacy Microsoft browsers */
}
html[data-rev-app="1"]::-webkit-scrollbar,
html[data-rev-app="1"] body::-webkit-scrollbar,
html[data-rev-app="1"] body *::-webkit-scrollbar {
  display:none!important;
  width:0!important;
  height:0!important;
  background:transparent!important;
}
