/* 1. Force the container to use 100% of the screen width */
.ui-card-container {
    display: grid !important;
    /* Use 'auto-fill' instead of 'auto-fit' and set a lower minimum width */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; 
    gap: 2px !important; /* Minimal gap between columns */
    width: 100% !important;
    max-width: none !important; /* Removes any template-imposed width limits */
    padding: 2px 0 !important;
}

/* 2. Remove internal whitespace from the cards themselves */
.ui-card {
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 3. Force the Title and Button to sit tight together */
.card-contents {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 3px !important;
}
.ui-card .card-title {
    font-size: 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.ui-card .card-summary {
    display: none !important;
}
.ui-card .card-multiple-links a:first-child {
    display: none !important;
}
.ui-card .card-multiple-links a {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
}