.chart-container {
    /*flex: 1 1 45%; !* grow + shrink + initial width 45% *!*/
    flex: 0 0 calc(45% - 1rem); /* NEW: no grow, no shrink, fixed basis */
    max-width: calc(45% - 1rem); /* NEW: fix max width */
    min-width: 300px; /* minimum size for small screens */
    margin: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible; /* allow Kendo elements to spill out */
}

.chart-info-box {
    margin-top: 8px;
    text-align: center;
    font-size: 16px;
}

.chart-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Override for charts inside modals */
.chart-container.modal-chart {
    flex: none;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.toggleChart {
    align-self: flex-end;
    margin-bottom: 0.5rem;
    padding: 8px 8px;
    font-size: 14px;
    font-weight: 500;
    background-color: #6fd0c8; /* soft blue */
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

@media print {
    body {
        background: white;
        color: black;
    }

    .chart-container {
        flex: none;
        width: 100% !important;
        max-width: 600px;      /* Fixed upper limit */
        box-shadow: none !important;
        border-radius: 0 !important;
        background: white !important;
        padding: 0 !important;
        margin: 1rem 0 !important;
        page-break-inside: avoid;
    }

    .chart-container canvas {
        width: 100% !important;
        height: auto !important;
        max-height: 100% !important;
        display: block;
    }

    .toggleChart {
        display: none !important;
    }

    .chart-wrapper {
        display: block !important; /* no flex layout on print */
    }

    .chart-info-box {
        display: none !important;
    }
}
