/* Desktop-only post-sidebar layout correction.
 * One continuous Shutdown PNG/UV frame per box: use original 96px / 24px
 * nine-slice art, never stacked decorative CSS borders. All mobile-web rules,
 * minimap stage coordinates, party drag/drop, chat input and IDs are untouched. */
@media screen and (min-width:901px){
 /* Width of both rails is shared and defined in desktop-shell.css. */
 /* Consume the sidebar's full inside width instead of inset cards with nested gutters. */
 body:not(.mobile-web) #game .premium-left-rail,
 body:not(.mobile-web) #game .premium-right-rail{
  box-sizing:border-box!important;
  width:100%!important;max-width:100%!important;
  margin:0!important;padding:0!important;
  gap:0!important;
  min-width:0!important;min-height:0!important;
 }
 body:not(.mobile-web) #game .premium-left-rail{
  display:flex!important;flex-direction:column!important;
  align-items:stretch!important;
  /* styles.css .sidebar sets scrollbar-gutter:stable and reserves an empty
   * scrollbar-width strip on the right even when the six slots all fit. */
  scrollbar-gutter:auto!important;
  overflow-x:hidden!important;overflow-y:auto!important;
 }
 body:not(.mobile-web) #game .premium-left-rail > :is(.trainer-card,.party-panel),
 body:not(.mobile-web) #game .premium-right-rail > :is(.hud-minimap-panel,.hud-missions-panel,.premium-chat-panel){
  box-sizing:border-box!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  margin:0!important;padding:0!important;
  border:6px solid transparent!important;
  border-image:url("../login/frame.png?v=cabare-uv-1") 24 fill / 6px / 0 stretch!important;
  border-radius:0!important;background-color:#192135!important;
  box-shadow:none!important;
 }
 /* Keep the original six-slot physical party renderer; only its enclosing
  * flex footprint changes. Short desktop viewports scroll the rail. */
 body:not(.mobile-web) #game .premium-left-rail > .trainer-card{
  flex:0 0 auto!important;
  height:auto!important;overflow:hidden!important;
 }
 body:not(.mobile-web) #game .premium-left-rail > .party-panel{
  display:flex!important;flex-direction:column!important;
  flex:1 1 0!important;
  height:auto!important;min-height:360px!important;
  overflow:hidden!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .premium-panel-heading{
  box-sizing:border-box!important;flex:0 0 36px!important;
  width:100%!important;height:36px!important;min-height:36px!important;
  margin:0!important;padding:2px 6px!important;
  gap:5px!important;overflow:hidden!important;
  border:5px solid transparent!important;
  border-image:url("../login/frame-active.png?v=cabare-uv-1") 24 fill / 5px / 0 stretch!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .premium-panel-heading > strong{
  min-width:0!important;overflow:hidden!important;
  white-space:nowrap!important;text-overflow:ellipsis!important;
  font:700 12px/16px Arial,sans-serif!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .hud-online-badge{
  flex:0 0 auto!important;
 }
 /* The 3.75rem old portrait column, 10px nested padding and 12px frame
  * clipped the username/EXP. Reserve the portrait, let copy use the rest. */
 body:not(.mobile-web) #game .premium-left-rail .trainer-identity{
  box-sizing:border-box!important;width:100%!important;min-width:0!important;
  display:grid!important;grid-template-columns:66px minmax(0,1fr)!important;
  align-items:center!important;gap:7px!important;
  margin:0!important;padding:5px 6px!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-portrait-shell{
  box-sizing:border-box!important;width:66px!important;height:66px!important;
  min-width:66px!important;min-height:66px!important;
  margin:0!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-identity-copy,
 body:not(.mobile-web) #game .premium-left-rail .trainer-xp{
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  min-width:0!important;overflow:hidden!important;
 }
 body:not(.mobile-web) #game .premium-left-rail #passport-title{
  max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;
  white-space:nowrap!important;
 }
 body:not(.mobile-web) #game .premium-left-rail #passport-name{
  width:100%!important;max-width:100%!important;min-width:0!important;
  margin:1px 0!important;overflow:hidden!important;
  text-overflow:ellipsis!important;white-space:nowrap!important;
  font-size:14px!important;line-height:18px!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-role,
 body:not(.mobile-web) #game .premium-left-rail .trainer-xp-text{
  max-width:100%!important;min-width:0!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
  font-size:10px!important;line-height:13px!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-xp{
  gap:2px!important;margin-top:3px!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-xp-track{
  box-sizing:border-box!important;max-width:100%!important;
 }
 /* Both money and collection now own a real fraction of the card; no clipped
  * second column or off-screen amount, even for large character balances. */
 body:not(.mobile-web) #game .premium-left-rail .trainer-stats{
  box-sizing:border-box!important;display:grid!important;
  grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)!important;
  gap:3px!important;width:100%!important;min-width:0!important;
  margin:0!important;padding:3px 4px 5px!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-stats > div{
  box-sizing:border-box!important;min-width:0!important;width:100%!important;
  margin:0!important;padding:4px!important;
  border:5px solid transparent!important;
  border-image:url("../login/slot.png?v=cabare-uv-1") 24 fill / 5px / 0 stretch!important;
  background-color:#182134!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-stats > div + div{
  padding-left:4px!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-stats span{
  display:block!important;max-width:100%!important;
  margin:0 0 3px!important;overflow:hidden!important;
  white-space:nowrap!important;text-overflow:ellipsis!important;
  font:400 11px/14px Arial,sans-serif!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .trainer-stats strong{
  display:block!important;width:100%!important;min-width:0!important;
  margin:0!important;overflow-wrap:anywhere!important;
  font:700 12px/15px Arial,sans-serif!important;
  font-variant-numeric:tabular-nums!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .party-panel #party-list{
  box-sizing:border-box!important;flex:1 1 0!important;
  min-height:0!important;width:100%!important;
  margin:0!important;padding:0!important;
  grid-template-rows:repeat(6,minmax(0,1fr))!important;
  gap:0!important;overflow:hidden!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .party-panel #party-list > :is(.party-card,.party-empty){
  width:100%!important;min-width:0!important;min-height:0!important;
  margin:0!important;
 }
 body:not(.mobile-web) #game .premium-left-rail .party-panel > .hud-wide-command{
  box-sizing:border-box!important;flex:0 0 32px!important;
  width:100%!important;max-width:none!important;
  min-width:0!important;height:32px!important;min-height:32px!important;
  margin:0!important;
 }
 /* Compact, fixed missions height; the reclaimed pixels belong to the chat.
  * Minimap scales only by its existing JS aspect-fit calculation. */
 body:not(.mobile-web) #game .premium-world-layout:not(.chat-collapsed):not(.chat-expanded) .premium-right-rail{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:clamp(210px,33dvh,310px) 174px minmax(0,1fr)!important;
  align-content:stretch!important;overflow:hidden!important;
 }
 body:not(.mobile-web) #game .premium-right-rail > :is(.hud-minimap-panel,.hud-missions-panel,.premium-chat-panel){
  min-height:0!important;height:100%!important;overflow:hidden!important;
  display:flex!important;flex-direction:column!important;
 }
 body:not(.mobile-web) #game .premium-right-rail #hud-minimap{
  margin:0!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel > .premium-panel-heading{
  box-sizing:border-box!important;flex:0 0 32px!important;
  height:32px!important;min-height:32px!important;
  width:100%!important;margin:0!important;padding:1px 5px!important;
  gap:5px!important;
  border:4px solid transparent!important;
  border-image:url("../login/frame-active.png?v=cabare-uv-1") 24 fill / 4px / 0 stretch!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel #hud-missions-open{
  box-sizing:border-box!important;flex:0 0 auto!important;
  min-width:54px!important;max-width:42%!important;
  height:23px!important;min-height:23px!important;
  margin-left:auto!important;padding:0 5px!important;
  border:4px solid transparent!important;
  border-image:url("../login/button.png?v=cabare-uv-1") 24 fill / 4px / 0 stretch!important;
  font:700 11px/14px Arial,sans-serif!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel #hud-missions-list{
  box-sizing:border-box!important;flex:1 1 0!important;
  width:auto!important;min-height:0!important;
  margin:0!important;padding:0!important;gap:0!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  border:4px solid transparent!important;
  border-image:url("../login/slot.png?v=cabare-uv-1") 24 fill / 4px / 0 stretch!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-row{
  box-sizing:border-box!important;flex:0 0 35px!important;
  min-height:35px!important;height:35px!important;
  width:100%!important;min-width:0!important;
  display:grid!important;grid-template-columns:17px minmax(0,1fr) auto!important;
  align-items:center!important;gap:4px!important;
  margin:0!important;padding:1px 4px!important;
  border:3px solid transparent!important;
  border-image:url("../login/slot.png?v=cabare-uv-1") 24 fill / 3px / 0 stretch!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-row.complete{
  border-image-source:url("../login/frame-active.png?v=cabare-uv-1")!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-symbol{
  width:16px!important;height:16px!important;min-width:16px!important;
  font-size:10px!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-copy{
  min-width:0!important;overflow:hidden!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-copy strong{
  font:700 11px/13px Arial,sans-serif!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-copy span{
  margin-top:1px!important;font:400 10px/12px Arial,sans-serif!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .hud-missions-panel .hud-mission-progress{
  max-width:62px!important;white-space:nowrap!important;
  font:700 10px/13px Arial,sans-serif!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .premium-chat-panel{
  flex:1 1 auto!important;min-height:0!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .premium-chat-panel #chat-body,
 body:not(.mobile-web) #game .premium-right-rail .premium-chat-panel .chat-log,
 body:not(.mobile-web) #game .premium-right-rail .premium-chat-panel #chat-messages{
  min-height:0!important;min-width:0!important;flex:1 1 auto!important;
 }
 body:not(.mobile-web) #game .premium-right-rail .premium-chat-panel .chat-log{
  box-sizing:border-box!important;width:100%!important;
  margin:0!important;padding:0!important;
 }
 /* Preserve the original chat maximise/minimise state: do not resurrect
  * minimap or missions while the chat rail owns this column. */
 body:not(.mobile-web) #game .premium-world-layout:is(.chat-collapsed,.chat-expanded) .premium-right-rail{
  grid-template-rows:minmax(0,1fr)!important;
 }
}
@media screen and (min-width:901px) and (max-height:720px){
 body:not(.mobile-web) #game .premium-world-layout:not(.chat-collapsed):not(.chat-expanded) .premium-right-rail{
  grid-template-rows:clamp(165px,28dvh,210px) 162px minmax(0,1fr)!important;
 }
}
@media screen and (min-width:901px) and (max-height:580px){
 body:not(.mobile-web) #game .premium-world-layout:not(.chat-collapsed):not(.chat-expanded) .premium-right-rail{
  grid-template-rows:155px 154px minmax(210px,1fr)!important;
  overflow-y:auto!important;
 }
}
