/* BitClac v390: responsive collision and first-paint stability fixes. */

/* The enhanced coin picker starts hidden. A later display:grid rule must not
   override the native hidden contract before JavaScript selects one picker. */
body[data-page="liquidation-heatmap"] .liquidation-heatmap-coin-field[hidden] {
  display: none !important;
}

/* Keep the three direction buttons inside their toolbar cell on laptop-width
   desktop shells, where the sidebar leaves less room than the viewport implies. */
body[data-page="futures-overheat"] .fho-direction {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-page="futures-overheat"] .fho-direction button {
  min-width: 0;
  padding-inline: 8px;
}

/* The SSR reserve has the same markup and geometry as the async home ranking.
   Inserting the live section and hiding its adjacent reserve is one layout step. */
body[data-page="home"] [data-fho-home] + [data-fho-home-reserve] {
  display: none;
}

body[data-page="home"] :is([data-fho-home], [data-fho-home-reserve]) .fho-home__grid {
  min-height: 190px;
}

@media (max-width: 760px) {
  body[data-page="home"] :is([data-fho-home], [data-fho-home-reserve]) .fho-home__grid {
    min-height: 392px;
  }

  html {
    scroll-padding-block-end: calc(var(--mobile-bottom-nav-height, 76px) + env(safe-area-inset-bottom, 0px) + 16px);
  }

  html body[data-page="home"],
  html body[data-page="liquidation-heatmap"],
  html body[data-page="futures-overheat"] {
    padding-bottom: calc(var(--mobile-bottom-nav-height, 76px) + env(safe-area-inset-bottom, 0px) + 16px) !important;
  }

  body:is([data-page="home"], [data-page="liquidation-heatmap"], [data-page="futures-overheat"])
    :is(a, button, input, select, summary, [tabindex], .fho-tabs, .fho-toolbar, .liquidation-heatmap-filter-grid, .fho-home__actions) {
    scroll-margin-block-end: calc(var(--mobile-bottom-nav-height, 76px) + env(safe-area-inset-bottom, 0px) + 16px);
  }

  body[data-page="futures-overheat"] .fho-pagination {
    flex-wrap: wrap;
  }

  body[data-page="futures-overheat"] .fho-pagination button {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding-inline: 10px;
    white-space: nowrap;
  }

  body[data-page="futures-overheat"] .fho-pagination button:first-child,
  body[data-page="futures-overheat"] .fho-pagination button:last-child {
    min-width: max-content;
  }
}

/* /BitClac v390 */
