/* Statistics page layout fixes. Loaded after dashboard.css, which holds the
   base statistics rules. */

/* Grow with the content instead of squashing the cards on short windows. */
.statistics-layout {
    height: auto;
    min-height: max(650px, calc(100vh - 8.5rem));
    grid-template-rows: minmax(320px, 1fr) auto;
}
.statistics-card-grid {
    grid-template-rows: repeat(2, minmax(min-content, 1fr));
}
.statistics-transfer-header {
    flex-wrap: wrap;
}

/* Line the cards up: icon and text start at the top, so every label sits at
   the same height whatever the length of the detail below it. */
.statistics-card-grid > .card {
    min-width: 0;
    overflow: hidden;
}
.statistics-metric {
    align-items: flex-start;
}
.statistics-metric > div:last-child {
    flex: 1;
    min-width: 0;
}
.statistics-metric-icon {
    margin-top: 0.1rem;
}
.statistics-metric-label,
.statistics-metric-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.statistics-metric-value {
    line-height: 1.2;
}
.statistics-metric-detail {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (max-width: 640px) {
    .statistics-card-grid {
        grid-template-rows: none !important;
    }
}
