table.food-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.food-matrix th, .food-matrix td {
  border: 1px solid #ccc;
  padding: 0.75rem;
  text-align: center;
}

.food-matrix th {
  background-color: #f9f9f9;
  font-weight: bold;
}

.food-matrix caption {
  caption-side: top;
  text-align: left;
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 0.5rem;
}

.food-matrix input[type="checkbox"] {
  width: 1.3em;
  height: 1.3em;
}

@media (max-width: 768px) {
  .food-matrix th, .food-matrix td {
    font-size: 0.9em;
    padding: 0.5rem;
  }
}

/* The scrolling wrapper */

.table-scroll {
  overflow-x: auto;
  min-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* OPTIONAL: only add bottom shadow/gradient when scrolling is possible */

.table-scroll::-webkit-scrollbar {
  height: .6rem;
}

/* Mobile-first tweak: make the table at least as wide as its natural size */

.table-scroll table {
  width: 100%;
  min-width: 45rem;
}

/* You can tighten this rule to small viewports only if you prefer */

@media (min-width: 769px) {
  .table-scroll {
    overflow: visible;
  }
}

