@media screen {
  /* The horizontal lane is a sibling of the viewport, never a table overlay. */
  .table-safe-shell {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: calc(100dvh - 165px);
  }
  .table-safe-shell > .table-safe-viewport {
    position: relative;
    flex: 1 1 auto;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow-x: hidden !important;
    overflow-y: auto;
    scrollbar-width: auto;
  }
  .table-horizontal-scroll {
    position: static;
    flex: 0 0 24px;
    box-sizing: border-box;
    width: 100%;
    height: 24px;
    min-height: 24px;
    overflow-x: scroll;
    overflow-y: hidden;
    background: var(--content-bg, #fff);
    border-top: 1px solid var(--line, #d4dde0);
    scrollbar-width: auto;
    overscroll-behavior-x: contain;
  }
  .table-horizontal-scroll[hidden] { display: none !important; }
  .table-horizontal-scroll-width { height: 1px; pointer-events: none; }
  .table-horizontal-scroll:focus-visible { outline: 2px solid var(--brand, #176b5b); outline-offset: -2px; }
  dialog .table-safe-shell { max-height: 60dvh; }
}
@media print {
  .table-safe-shell { display: block; max-height: none; }
  .table-safe-shell > .table-safe-viewport { max-height: none; overflow: visible; }
  .table-horizontal-scroll { display: none !important; }
}
