/* MUTA v273 - 33-market-grid-fix - Fix Chainlink alone + uneven grid + mobile */
#marketGrid, #forexGrid, #stocksGrid, #indicesGrid, #iranAssetsGrid, .home-markets-grid-wrapper{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
}
#marketGrid .market-card, #forexGrid .market-card, #stocksGrid .market-card, #indicesGrid .market-card, #iranAssetsGrid .market-card,
.home-markets-grid-wrapper .home-market-card{
  min-width: 0 !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Balance last row - if 10 items, center last 1 or 2 */
#marketGrid{
  justify-items: stretch !important;
}
#marketGrid::after{
  content: '' !important;
  display: none !important;
}

/* Make Chainlink and any last single card centered on desktop */
@media(min-width:1101px){
  #marketGrid .market-card:last-child:nth-child(3n+1){
    grid-column: 2 / 3 !important;
  }
  #marketGrid .market-card:nth-last-child(2):nth-child(3n+1){
    grid-column: 1 / 2 !important;
  }
  #marketGrid .market-card:nth-last-child(1):nth-child(3n+2){
    grid-column: 2 / 4 !important;
    max-width: calc(50% - 8px) !important;
    justify-self: center !important;
  }
}

@media(max-width:1100px){
  #marketGrid, #forexGrid, #stocksGrid, #indicesGrid, #iranAssetsGrid, .home-markets-grid-wrapper{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px !important;
  }
}
@media(max-width:720px){
  #marketGrid, #forexGrid, #stocksGrid, #indicesGrid, #iranAssetsGrid, .home-markets-grid-wrapper{
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  #marketGrid .market-card:last-child:nth-child(3n+1){
    grid-column: auto !important;
  }
}

/* Fix market card price font */
.market-card-price, .home-price{
  font-variant-numeric: tabular-nums !important;
  direction: ltr !important;
  text-align: left !important;
  white-space: nowrap !important;
}

/* Fix ticker offline badge - hide when online */
.ticker-tape .offline-badge{
  display: none !important;
}
.ticker-tape.offline .offline-badge{
  display: inline-flex !important;
}
