/* All standard data tables share the same phone-landscape full-page behavior. */
@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  body.table-fullscreen-open,
  body.financial-table-fullscreen-open {
    overflow: hidden !important;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1500 !important;
    box-sizing: border-box !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    overflow: auto !important;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    background: #fff !important;
    box-shadow: none !important;
    -webkit-overflow-scrolling: touch;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus > table {
    width: max-content !important;
    min-width: 100% !important;
    margin: 0 !important;
    border-spacing: 0;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus {
    overscroll-behavior-x: none;
    touch-action: pan-x pan-y;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus thead th:first-child {
    z-index: 10 !important;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus :is(
    .list-fullscreen-return-hint,
    .industry-fullscreen-return-hint,
    .stock-query-fullscreen-return-hint,
    .watchlist-fullscreen-return-hint,
    .history-fullscreen-return-hint,
    .paid-rating-fullscreen-return-hint
  ) {
    position: fixed !important;
    inset: auto max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px)) auto !important;
    z-index: 1600 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-sizing: border-box;
    width: 176px !important;
    max-width: calc(100vw - 24px) !important;
    min-height: 48px;
    margin: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 999px !important;
    padding: 6px 11px !important;
    overflow: hidden;
    background: rgba(23, 33, 43, 0.82) !important;
    color: #fff !important;
    text-align: left;
    pointer-events: auto !important;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap,
    #stockQueryTableWrap,
    #watchlistTableWrap,
    .new-high-history-table-wrap,
    .paid-rating-history-table,
    [data-financial-ranking-table],
    [data-financial-compare-table]
  ).is-table-focus :is(
    .list-fullscreen-return-hint,
    .industry-fullscreen-return-hint,
    .stock-query-fullscreen-return-hint,
    .watchlist-fullscreen-return-hint,
    .history-fullscreen-return-hint,
    .paid-rating-fullscreen-return-hint
  ) :is(strong, span) {
    display: block !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body :is(
    .ranking-table-wrap,
    .industry-table-wrap
  ).is-table-focus :is(.list-pagination, .industry-pagination) {
    position: fixed !important;
    inset: auto auto max(12px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px)) !important;
    z-index: 1599 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
