#stats-container {
    margin: 2rem 1rem 0;
    font-family: Arial, sans-serif;
    width: 100%;
    box-sizing: border-box;
}

#date-container {
    margin: 0 1rem;
    font-family: Arial, sans-serif;
    width: 100%;
    box-sizing: border-box;
}

#date-container .date-flex {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#date-container dt {
    font-weight: bold;
}

#date-container dd {
    margin-left: 0.5rem;
}

#date-container select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.stat {
    margin-bottom: 1.5rem;
}

.stat dt {
    font-weight: bold;
}

.stat dd.stat-value {
    margin: 0;
}

.stat dd.stat-description {
    display: block;
    margin-top: 0.25rem;
}

.stat > :where(dt, dd.stat-value) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stat label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-description, .chart-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

.config-list {
    list-style: none;
    padding: 0;
}

.config-list li {
    margin: 0.2rem 0;
}

/* Media query for mobile devices (screens smaller than 768px) */
@media (max-width: 768px) {
    #chart {
        height: 50vh; /* Reduce height for mobile */
        min-height: 250px; /* Smaller minimum height */
    }

    #stats-container {
        margin: 1rem 0.5rem 0; /* Reduce margins for mobile */
    }

    #date-container {
        margin: 0 0.5rem; /* Reduce margins for mobile */
    }

    #date-container select {
        font-size: 0.9rem; /* Slightly smaller dropdown text */
        padding: 0.4rem; /* Adjust padding for mobile */
    }

    .stat-description {
        font-size: 0.8rem; /* Smaller text for mobile */
    }
}

/* Media query for very small screens (e.g., phones < 480px) */
@media (max-width: 480px) {
    #chart {
        height: 40vh; /* Further reduce height for very small screens */
        min-height: 200px;
    }

    #date-container .date-flex {
        flex-direction: column; /* Stack label and dropdown on very small screens */
        align-items: flex-start;
        gap: 0.25rem;
    }

    #date-container select {
        width: 100%; /* Full width dropdown on small screens */
    }
}

/* Adjust margins for smaller screens */
@media (max-width: 768px) {
    .chart-description {
        margin-left: 0.5rem; /* Reduced margin, consistent with stats/date */
        margin-top: 1rem; /* Reduced spacing for mobile */
    }
}

@media (max-width: 480px) {
    .chart-description {
        margin-left: 0; /* No indent on very small screens */
        margin-top: 1rem;
    }
}