/* NDL live rendering-performance layer */

body,
.ndl-shell,
.ndl-main,
.ndl-sidebar {
  background-attachment: scroll !important;
}

.ndl-city-card__bg,
.ndl-weather-widget__bg {
  transform: translateZ(0);
  backface-visibility: hidden;
}

@media (max-width: 1024px) {
  body,
  body::before,
  body::after,
  .ndl-shell,
  .ndl-main,
  .ndl-sidebar {
    background-attachment: scroll !important;
  }

  .ndl-mobile-header,
  .ndl-toolbar,
  .ndl-market-overview,
  .ndl-manager-intro,
  .ndl-modal,
  .ndl-hero--final .ndl-pulse-row {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .ndl-card,
  .ndl-widget-card,
  .ndl-price-card,
  .ndl-market-card,
  .ndl-city-card,
  .ndl-stock-card,
  .ndl-asset-card,
  .ndl-summary-card {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .13) !important;
  }
}

@media (max-width: 700px) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 100ms !important;
    scroll-behavior: auto !important;
  }

  .ndl-widget-card:hover,
  .ndl-card:hover,
  .ndl-price-card:hover {
    transform: none !important;
  }

  .ndl-city-card__bg,
  .ndl-weather-widget__bg {
    will-change: auto !important;
  }
}

/* Keep the master background identical across pages */
@media (min-width:701px){
  html body{
    background-attachment:fixed!important;
    background-position:center top!important;
    background-size:cover!important;
  }
}

/* Emergency scroll-performance correction */
html body{
  background-attachment:scroll!important;
}
.ndl-card,
.ndl-widget-card,
.ndl-hero,
.ndl-toolbar,
.ndl-market-overview,
.ndl-manager-intro,
.ndl-mobile-header,
.ndl-modal,
.ndl-price-card,
.ndl-stock-card{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

/* Permanent GPU-memory optimization */
*,
*::before,
*::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Stop permanent compositor layers */
.ndl-city-card__bg,
.ndl-weather-widget__bg {
  transform: none !important;
  backface-visibility: visible !important;
  will-change: auto !important;
}

.ndl-direct-drag > [data-ndl-item],
.ndl-drag-ghost {
  will-change: auto !important;
}

.ndl-widget-card::after {
  filter: none !important;
}

/* Prices page: compact high-density card grid */
body[data-page="prices"] .ndl-price-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 11px !important;
}

body[data-page="prices"] .ndl-price-grid > * {
  grid-column: auto !important;
}

body[data-page="prices"] .ndl-market-card {
  min-height: 150px !important;
  padding: 13px 14px !important;
  gap: 9px !important;
  grid-template-rows: auto 1fr auto !important;
  border-radius: 18px !important;
}

body[data-page="prices"] .ndl-market-card__top {
  gap: 8px !important;
}

body[data-page="prices"] .ndl-market-card__identity strong {
  font-size: 12px !important;
}

body[data-page="prices"] .ndl-market-card__identity-copy span {
  font-size: 9px !important;
}

body[data-page="prices"] .ndl-market-card__value {
  margin-top: 5px !important;
}

body[data-page="prices"] .ndl-market-card__value b {
  font-size: 21px !important;
}

body[data-page="prices"] .ndl-market-card__change {
  padding-top: 8px !important;
}

@media (max-width: 1450px) {
  body[data-page="prices"] .ndl-price-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1100px) {
  body[data-page="prices"] .ndl-price-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body[data-page="prices"] .ndl-price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 460px) {
  body[data-page="prices"] .ndl-price-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Prices page: remove redundant hero copy, keep compact market stats */
body[data-page="prices"] .ndl-market-overview {
  min-height: 0 !important;
  padding: 12px 14px !important;
  display: flex !important;
  justify-content: flex-end !important;
}

body[data-page="prices"] .ndl-market-overview > div:first-child {
  display: none !important;
}

body[data-page="prices"] .ndl-market-overview__stats {
  width: 100% !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

body[data-page="prices"] .ndl-market-overview__stats > span {
  min-width: 92px !important;
  padding: 8px 12px !important;
}

body[data-page="prices"] .ndl-market-overview {
  display: none !important;
}

/* Prices crypto search: keep dropdown fully inside viewport */
body[data-page="prices"] .ndl-crypto-manager {
  position: relative;
  z-index: 200;
}

body[data-page="prices"] .ndl-crypto-manager .ndl-tsetmc-results {
  right: auto !important;
  left: 0 !important;
  width: min(460px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
}

body[data-page="prices"] .ndl-toolbar--prices {
  overflow: visible !important;
}

/* NDL FIX: keep all selected city cards visible */
.ndl-city-grid,
.ndl-city-grid.is-expanded {
  max-height: none !important;
  overflow: visible !important;
}
.ndl-city-grid .ndl-city-card,
.ndl-city-grid:not(.is-expanded) .ndl-city-card,
.ndl-city-grid:not(.is-expanded) .ndl-city-card:nth-child(n),
.ndl-city-grid .ndl-city-card[hidden] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.ndl-city-expand {
  display: none !important;
}

/* Keep the theme artwork sized to the viewport, not each page's height. */
html body {
  background-attachment: fixed !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}
