body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f4f4f4;
}

h1, h2 {
    color: #333;
    text-align: center;
}

.controls {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 90%;
    max-width: 800px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slider-group {
    display: flex;
    flex-direction: column; /* Ensure label is above slider */
}

.slider-group label {
    margin-bottom: 5px; /* Space between label and slider */
}


.slider-group input[type="range"] {
    width: 100%;
}


label {
    font-weight: bold;
    color: #555;
}

select, button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

input[type="range"] {
    cursor: pointer;
}

span {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
     min-width: 60px; /* Ensure span width is consistent */
     text-align: right;
}

.charts {
    display: grid;
    grid-template-columns: 1fr; /* Stack charts on smaller screens */
    gap: 20px;
    width: 90%;
    max-width: 1200px; /* Limit max width */
}

@media (min-width: 900px) { /* Adjust layout for wider screens */
    .charts {
        grid-template-columns: repeat(3, 1fr); /* Three columns on wider screens */
    }
}


.chart-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 300px; /* Fixed height for chart containers */
    display: flex;
    flex-direction: column;
}

.chart-container h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
}

canvas {
    flex-grow: 1; /* Allow canvas to fill container height */
    max-width: 100%; /* Ensure canvas fits within container width */
    height: auto; /* Maintain aspect ratio */
}