/* ==================================================
   WATERCoyote — LAKE POWELL MOBILE STABILITY
   Prevent layout shifts and mobile replay jitter.
================================================== */

[data-lake-powell-widget],
.lake-powell-top,
.lake-scene,
.lake-chart-panel,
.lake-slider-wrap {
  overflow-anchor: none;
}

/* Keep the changing date/elevation readout from reflowing the page. */
.lake-powell-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  min-height: 72px;
}

.lake-powell-info {
  min-width: 0;
}

.lake-powell-date,
.lake-powell-elevation,
#lpElevationMarkerText {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lake-powell-date,
.lake-powell-elevation {
  min-height: 1.08em;
}

/* Isolate the two continuously changing visual areas from page layout. */
.lake-scene,
.lake-mini-chart {
  contain: layout paint;
}

.lake-water,
.lake-elevation-marker,
.lake-chart-marker,
.lake-chart-cursor {
  backface-visibility: hidden;
  transform: translateZ(0);
}

@media (max-width: 850px) {
  .lake-powell-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    min-height: 66px;
  }

  .lake-powell-info-right {
    text-align: right;
  }

  /*
     During replay the values update about 20 times per second. On phones,
     long CSS transitions can overlap continuously and make Safari repaint
     the page unevenly. Instant frame-to-frame level changes remain visually
     animated while eliminating that expensive transition queue.
  */
  .lake-water,
  .lake-elevation-marker {
    transition: none !important;
  }
}

@media (max-width: 520px) {
  .lake-powell-top {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 132px;
    gap: 12px;
  }

  .lake-powell-info-right {
    text-align: left;
  }

  .lake-powell-date {
    font-size: 25px;
  }

  .lake-powell-elevation {
    font-size: 38px;
  }
}
