/* XP_SCROLL_FIX_20260625_START */
html {
  height: 100%;
}

body {
  overscroll-behavior: none;
}

.workspace,
.workspace > .placeholder-page {
  min-width: 0;
  min-height: 0;
}

.workspace > .placeholder-page {
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.placeholder-page:has(> .page-card),
.placeholder-page:has(.data-table),
.placeholder-page:has(.settings-grid),
.placeholder-page:has(.wallet-page-layout),
.placeholder-page:has(.rank-page-card) {
  place-items: start center;
  align-items: start;
}

.placeholder-page > .page-card,
.placeholder-page > .page-card.wide-card,
.placeholder-page > .page-card.admin-page-card,
.placeholder-page > .rank-page-card {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.placeholder-page:has(.usage-log-table) > .page-card.wide-card,
.placeholder-page:has(.admin-log-table) > .page-card.wide-card,
.placeholder-page:has(.data-table) > .page-card.wide-card,
.placeholder-page:has(.settings-grid) > .page-card.wide-card,
.placeholder-page:has(.wallet-page-layout) > .page-card.wide-card {
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.data-table {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.usage-log-table {
  width: 100%;
  max-width: 100%;
  max-height: clamp(280px, calc(100dvh - 430px), 620px);
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

@supports not (height: 100dvh) {
  .usage-log-table {
    max-height: clamp(280px, calc(100vh - 430px), 620px);
  }
}

.usage-log-table table {
  min-width: 980px;
}

.usage-log-table th,
.usage-log-table td {
  vertical-align: middle;
}

.usage-log-table th:nth-child(4),
.usage-log-table td:nth-child(4) {
  min-width: 210px;
}

.usage-log-table .token-breakdown strong,
.usage-log-table .token-breakdown small {
  white-space: normal;
}

.stats-range-actions {
  align-items: center;
}

.stats-range-actions .range-hint {
  flex: 1 1 280px;
}

.admin-page-card:has(.admin-log-table) .admin-log-table {
  overflow: auto;
  overscroll-behavior: contain;
}

.wallet-page-layout,
.wallet-top-layout,
.settings-grid,
.admin-settings-grid {
  min-width: 0;
}

@media (min-width: 761px) {
  .workspace > .placeholder-page {
    height: 100%;
  }

  .placeholder-page:has(.usage-log-table) {
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }

  .placeholder-page:has(.usage-log-table) > .page-card.wide-card {
    width: min(1280px, 100%);
  }

  .page-card:has(.data-table) {
    padding-bottom: 24px;
  }
}

@media (max-width: 760px) {
  body {
    overscroll-behavior-y: auto;
  }

  .workspace > .placeholder-page {
    display: block;
    max-height: none;
    overflow: visible;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    scrollbar-gutter: auto;
  }

  .placeholder-page > .page-card,
  .placeholder-page > .page-card.wide-card,
  .placeholder-page > .page-card.admin-page-card,
  .placeholder-page > .rank-page-card {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .data-table {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: auto;
  }

  .usage-log-table {
    max-height: none;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .usage-log-table table {
    min-width: 920px;
  }

  .stats-range-actions .soft-button {
    min-width: 0;
  }
}
/* XP_SCROLL_FIX_20260625_END */
