/* Only table scrolling changes; preserve table styling and native bottom controls. */
.table-scroll-shell {
  min-width: 0;
  max-width: 100%;
}
.table-scroll-shell > .table-wrap {
  min-width: 0;
  max-width: 100%;
}
/* Let existing grid tracks contain wide tables instead of expanding the page. */
:where(.grid, .layout) > :has(.table-scroll-shell) { min-width: 0; }
.table-scroll-top {
  position: sticky;
  top: var(--table-scroll-inset, 4px);
  z-index: 20;
  max-width: 100%;
  height: 14px;
  margin-bottom: 4px;
  overflow-x: scroll;
  overflow-y: hidden;
  background: var(--bg, #f7f9fc);
  scrollbar-width: thin;
  scrollbar-color: #a7b5c9 #eef2f8;
}
.table-scroll-top[hidden] { display: none !important; }
.table-scroll-top:focus-visible { outline: 2px solid var(--blue, #2563eb); outline-offset: 2px; }
.table-scroll-spacer { height: 1px; pointer-events: none; }
.table-scroll-top::-webkit-scrollbar { height: 10px; }
.table-scroll-top::-webkit-scrollbar-track { background: #eef2f8; border-radius: 6px; }
.table-scroll-top::-webkit-scrollbar-thumb { background: #a7b5c9; border-radius: 6px; }
.table-scroll-top::-webkit-scrollbar-thumb:hover { background: #8499b7; }
@media (pointer: coarse) {
  .table-scroll-top { height: 10px; margin-bottom: 2px; }
  .table-scroll-top::-webkit-scrollbar { height: 6px; }
}
@media print {
  .table-scroll-top { display: none !important; }
  .table-scroll-shell, .table-scroll-shell > .table-wrap { max-width: none; }
}
