/* Responsive wrapper around heatmap tables */
.sch-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Optional: subtle scroll hint / spacing */
.sch-table-wrap {
  padding-bottom: 6px; /* gives room for iOS scroll bar */
}

/* Ensure table behaves nicely inside wrapper */
.sch-table-wrap > table[data-change-heatmap="1"] {
  width: 100%;
  min-width: 520px;  /* tweak: prevents columns collapsing too much */
}

/* Small screens: slightly smaller padding/font for readability */
@media (max-width: 600px) {
  table[data-change-heatmap="1"] td,
  table[data-change-heatmap="1"] th {
    padding: 6px 8px;
    font-size: 14px;
  }
}
table[data-change-heatmap="1"] {
  border-collapse: collapse;
  background: #ffffff;
}

table[data-change-heatmap="1"] td,
table[data-change-heatmap="1"] th {
  padding: 8px 10px;
  vertical-align: middle;
}

/* Header row (first row in tbody) */
table[data-change-heatmap="1"] tbody tr:first-child td,
table[data-change-heatmap="1"] tbody tr:first-child th {
  font-weight: 700;
}

/* Alignment rules */
table[data-change-heatmap="1"] td:first-child,
table[data-change-heatmap="1"] th:first-child {
  text-align: left;
}

table[data-change-heatmap="1"] td:not(:first-child),
table[data-change-heatmap="1"] th:not(:first-child) {
  text-align: right;
}

/* Heatmap cells */
table[data-change-heatmap="1"] td[data-heatmap="1"] {
  font-variant-numeric: tabular-nums;
  font-weight: 600;

  /* JS sets --h (0..120-ish) and --a (0..1 intensity) */
  background: hsl(var(--h) 80% 88%);
  color: hsl(var(--h) 70% 22%);
  border-radius: 6px;
  transition: background-color 150ms ease, color 150ms ease;
}

/* Empty / non-numeric values */
table[data-change-heatmap="1"] td[data-heatmap="0"] {
  opacity: 0.55;
}