/* DASM R6.55 — approved Teams density + Player Ownership compact layout.
   Promoted from STAGING after web/phone approval. Responsive safeguards preserve
   iPad portrait/landscape and phone touch targets. */

html body #view-teams .teams-grid{align-items:start!important}
html body #view-teams .team-card{align-self:start!important}
html body #view-teams .squad-list{align-content:start!important}
html body #view-teams .squad-row,
html body #view-teams .team-player-owner-link{box-sizing:border-box!important}

/* Website / desktop. */
@media (min-width:1101px) and (hover:hover) and (pointer:fine){
  html body #view-teams .team-card{padding:12px!important}
  html body #view-teams .team-card-head{margin-bottom:6px!important}
  html body #view-teams .squad-head{padding:3px 5px!important;margin:0 0 1px!important;min-height:0!important}
  html body #view-teams .squad-list{gap:2px!important}
  html body #view-teams .squad-row{min-height:23px!important;height:auto!important;padding:2px 5px!important;line-height:1.08!important}
  html body #view-teams .team-player-owner-link{min-height:18px!important;height:auto!important;padding:0!important;line-height:1.08!important}
  html body #view-teams .team-value{margin-top:5px!important;padding-top:5px!important}
}

/* iPad / touch-tablet landscape. */
@media (min-width:900px) and (max-width:1366px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
  html body #view-teams .team-card{padding:11px!important}
  html body #view-teams .team-card-head{margin-bottom:6px!important}
  html body #view-teams .squad-head{padding:3px 5px!important;margin:0 0 1px!important;min-height:0!important}
  html body #view-teams .squad-list{gap:2px!important}
  html body #view-teams .squad-row{min-height:26px!important;height:auto!important;padding:2px 5px!important;line-height:1.1!important}
  html body #view-teams .team-player-owner-link{min-height:22px!important;height:auto!important;padding:0!important;line-height:1.1!important}
  html body #view-teams .team-value{margin-top:5px!important;padding-top:5px!important}
}

/* iPad / tablet portrait. */
@media (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  html body #view-teams .team-card-head{margin-bottom:6px!important}
  html body #view-teams .squad-list{gap:2px!important}
  html body #view-teams .squad-row{min-height:27px!important;height:auto!important;padding:2px 5px!important;line-height:1.1!important}
  html body #view-teams .team-player-owner-link{min-height:23px!important;height:auto!important;padding:0!important;line-height:1.1!important}
  html body #view-teams .team-value{margin-top:5px!important;padding-top:5px!important}
}

/* Phones retain the approved touch density. */
@media (max-width:760px){
  html body #view-teams .squad-row{min-height:30px!important}
  html body #view-teams .team-player-owner-link{min-height:24px!important}
}

/* Player Ownership popup density + Main League rank to the left of the logo. */
#teamModal .owner-list.r653-owner-density{gap:3px!important;margin-top:7px!important;align-content:start!important}
#teamModal .owner-list.r653-owner-density>button{
  display:grid!important;grid-template-columns:38px minmax(0,1fr) auto!important;align-items:center!important;
  column-gap:7px!important;min-height:0!important;padding:5px 7px!important;line-height:1.06!important
}
#teamModal .owner-list.r653-owner-density>button>.r653-owner-rank{
  grid-column:1!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  width:38px!important;min-width:38px!important;min-height:34px!important;padding:0 2px!important;border-right:1px solid #e3eaee!important;
  color:#173a63!important;font-style:normal!important;font-size:10px!important;font-weight:950!important;line-height:1!important;
  letter-spacing:.01em!important;text-align:center!important
}
#teamModal .owner-list.r653-owner-density>button>.r653-owner-rank small{
  display:block!important;margin-top:2px!important;color:#718596!important;font-size:5.5px!important;font-weight:950!important;
  letter-spacing:.11em!important;line-height:1!important
}
#teamModal .owner-list.r653-owner-density>button>span:not(.r653-owner-rank){
  grid-column:2!important;display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;column-gap:7px!important;
  align-items:center!important;min-width:0!important
}
#teamModal .owner-list.r653-owner-density>button>span:not(.r653-owner-rank) .team-logo{grid-column:1!important;grid-row:1 / span 2!important}
#teamModal .owner-list.r653-owner-density b,#teamModal .owner-list.r653-owner-density small{line-height:1.05!important}
#teamModal .owner-list.r653-owner-density>button>span:not(.r653-owner-rank)>b{margin:0!important;font-size:10px!important}
#teamModal .owner-list.r653-owner-density>button>span:not(.r653-owner-rank)>small{margin-top:1px!important;font-size:6.5px!important}
#teamModal .owner-list.r653-owner-density>button>em{
  grid-column:3!important;justify-self:end!important;margin:0!important;white-space:nowrap!important;font-size:7px!important;line-height:1!important
}
@media (min-width:1101px) and (hover:hover) and (pointer:fine){
  #teamModal .owner-list.r653-owner-density>button{padding:4px 6px!important;column-gap:6px!important}
}
@media (min-width:761px) and (max-width:1366px) and (hover:none) and (pointer:coarse){
  #teamModal .owner-list.r653-owner-density{gap:4px!important}
  #teamModal .owner-list.r653-owner-density>button{min-height:46px!important;padding:4px 7px!important}
  #teamModal .owner-list.r653-owner-density>button>.r653-owner-rank{min-height:36px!important}
}
@media (max-width:760px){
  #teamModal .owner-list.r653-owner-density{gap:4px!important}
  #teamModal .owner-list.r653-owner-density>button{grid-template-columns:36px minmax(0,1fr) auto!important;min-height:48px!important;padding:5px 6px!important;column-gap:6px!important}
  #teamModal .owner-list.r653-owner-density>button>.r653-owner-rank{width:36px!important;min-width:36px!important;min-height:36px!important}
  #teamModal .owner-list.r653-owner-density>button>span:not(.r653-owner-rank){grid-template-columns:32px minmax(0,1fr)!important;column-gap:6px!important}
  #teamModal .owner-list.r653-owner-density>button>span:not(.r653-owner-rank) .team-logo{width:32px!important;height:32px!important;min-width:32px!important}
}

/* Keep the close X visible while the ownership list scrolls. */
html body #teamModal .team-modal-card:has(.owner-list.r653-owner-density)>.modal-head{
  position:sticky!important;top:-1px!important;z-index:140!important;margin:0 0 12px!important;padding:2px 0 8px!important;
  background:linear-gradient(180deg,#fff 0%,#fff 78%,rgba(255,255,255,.94) 100%)!important
}
html body #teamModal .team-modal-card:has(.owner-list.r653-owner-density)>.modal-head #closeTeamModal{
  position:relative!important;z-index:145!important;flex:0 0 auto!important;box-shadow:0 2px 8px rgba(16,47,93,.08)!important
}
@media(max-width:760px){
  html body #teamModal .team-modal-card:has(.owner-list.r653-owner-density)>.modal-head{padding-top:3px!important;padding-bottom:7px!important}
}
