body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333;
}

h1, h2 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 10px;
}

p {
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #555;
}

.controls {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Increased gap */
    align-items: center;
    justify-content: center; /* Center controls */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.controls label {
    font-weight: bold;
    margin-right: -5px; /* Adjust spacing */
}

.controls input[type="number"] {
    width: 60px; /* Slightly smaller */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.controls button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

/* New styles for plot layout */
.plots-wrapper {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    max-width: 1200px; /* Max width for the plots */
    margin-left: auto;
    margin-right: auto;
}

.plot-container {
    flex: 1; /* Allow containers to grow */
    min-width: 350px; /* Minimum width before wrapping */
    max-width: 550px; /* Optional max width */
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Set a fixed height to prevent resize jumping */
    height: 450px; /* Adjust as needed */
    display: flex; /* Use flexbox for centering canvas */
    flex-direction: column; /* Stack title and canvas */
    align-items: center; /* Center horizontally */
}

.plot-container h2 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Make canvas fill the container height (minus title/padding) */
.plot-container canvas {
    max-width: 100%;
    max-height: calc(100% - 40px); /* Approximate height available */
}


#output {
    margin-top: 10px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 3px;
    font-size: 0.9em;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}