/* Shared styles for stickyMatrix() in matrix.mjs: header row and first column stay in view. */
.sticky-matrix-wrap {
  max-width: 100%;
  overflow: auto;
  max-height: 34rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  overscroll-behavior: contain;
  scrollbar-color: var(--color-loom-500) var(--surface-1);
}
.sticky-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.sticky-matrix th,
.sticky-matrix td {
  min-width: 7rem;
  padding: 0.5rem;
  text-align: center;
  border: 1px solid var(--border-default);
}
.sticky-matrix th:first-child,
.sticky-matrix td:first-child {
  min-width: 13rem;
  text-align: start;
  position: sticky;
  left: 0;
  background: var(--surface-1);
  z-index: 1;
}
.sticky-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-1);
}
.sticky-matrix thead th:first-child {
  left: 0;
  z-index: 3;
}
.sticky-matrix button {
  min-width: 3rem;
  padding: 0.3rem 0.45rem;
}
/* Sticky cells need an opaque system background, or scrolled cells show through them. */
@media (forced-colors: active) {
  .sticky-matrix th,
  .sticky-matrix td {
    border-color: CanvasText;
  }
  .sticky-matrix th:first-child,
  .sticky-matrix td:first-child,
  .sticky-matrix thead th {
    background: Canvas;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-matrix-wrap {
    scroll-behavior: auto;
  }
}
