/* esn-mobile.css (Nov 4 2026, helper B-18 task 20538914): phone fixes for the panel.
   Phone widths only (max-width:640px); desktop is untouched.
   Undo: bash /root/rollback-20538914.sh */
@media (max-width:640px){
  /* 1. Dashboard: your servers first, promo cards after them */
  #esn2-main:has(> [class*="DashboardContainer___StyledDiv4-"]){display:flex;flex-direction:column}
  #esn2-main:has(> [class*="DashboardContainer___StyledDiv4-"]) > [class*="DashboardContainer___StyledDiv-"]{order:-2}
  #esn2-main:has(> [class*="DashboardContainer___StyledDiv4-"]) > [class*="DashboardContainer___StyledDiv4-"]{order:-1;margin-bottom:16px}

  /* 2. Floating buttons: keep the help button visible and stop them covering the last row */
  body{padding-bottom:84px}
  #esn-road1k{left:62px!important;max-width:calc(100vw - 140px)!important;box-sizing:border-box}
  body:has([class^="DropdownMenu___StyledDiv-"]) #esn-road1k,
  body:has([class^="DropdownMenu___StyledDiv-"]) #esn-chat-root,
  body:has([class^="DropdownMenu___StyledDiv-"]) #esnpf-mfab{visibility:hidden}

  /* /plans: the Monthly/Yearly switch sits between the help and chat buttons, the language pill above it, and the 1K counter steps aside there */
  body:has(#esnx-sw) #esn-road1k{display:none!important}
  #esnx-sw{left:62px!important;right:auto!important;transform:none!important;margin:0!important;max-width:calc(100vw - 140px)}
  body:has(#esnx-sw) #esn-i18n{top:auto!important;bottom:144px!important}

  /* 3. File manager: the row menu opens as a sheet at the bottom of the screen, always fully on screen */
  [class^="DropdownMenu___StyledDiv-"]{position:fixed!important;left:8px!important;right:8px!important;top:auto!important;
    bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;width:auto!important;max-height:70vh;overflow-y:auto;
    z-index:2147483646!important;box-shadow:0 -6px 30px rgba(0,0,0,.55)}
  [class^="DropdownMenu___StyledDiv-"] [class*="FileDropdownMenu__StyledRow-"]{min-height:44px}
  [class*="FileDropdownMenu___StyledDiv-"]{min-width:44px;min-height:40px}

  /* 4. Console: full server address, roomier command box */
  .grid.grid-cols-6.gap-2 > .cursor-pointer:first-child{grid-column:span 6 / span 6}

  /* 5. Inputs at 16px so iPhone Safari does not zoom the page when you tap them */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea:not(.xterm-helper-textarea){font-size:16px!important}

  /* 6. Server tabs: fade on the right shows there are more tabs to swipe to */
  [class*="SubNavigation-"]{-webkit-mask-image:linear-gradient(90deg,#000 82%,transparent);mask-image:linear-gradient(90deg,#000 82%,transparent);scroll-snap-type:x proximity}
  [class*="SubNavigation-"] a{scroll-snap-align:start}

  /* 7. /plans (signed in): long sale prices in the services and add-on cards wrap instead of pushing the page sideways */
  #professional-services div[style*="space-between"],#add-ons div[style*="space-between"]{flex-wrap:wrap}
  [class*="DealsSection___StyledLabel2-"]{max-width:100%;min-width:0;flex-wrap:wrap;white-space:normal;box-sizing:border-box}
  #professional-services strong,#add-ons strong{white-space:normal!important;min-width:0}
}
