body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #007bff; /* J.P. Morgan blue accent */
}

header h1 {
    color: #003366; /* Darker J.P. Morgan blue */
    margin-bottom: 5px;
}

header p {
    font-size: 1.1em;
    color: #555;
}

.calculator-body {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.input-section, .output-section {
    flex: 1;
    min-width: 300px; /* Ensures sections don't get too narrow */
}

.input-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.output-section {
    padding: 0px; /* Adjusted padding for better internal spacing */
}

.input-section h2, .output-section h2 {
    color: #003366;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #444;
}

.input-group input[type="number"] {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

button#calculateButton {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

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

#summarySection, #chartSection, #annualBreakdownSection {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#summarySection h3, #chartSection h3, #annualBreakdownSection h3 {
    color: #003366;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#summarySection p {
    font-size: 1.05em;
    margin: 8px 0;
    color: #333;
}

#summarySection p span {
    font-weight: bold;
    color: #007bff;
}

.table-container {
    max-height: 400px; /* Limit height and enable scroll for large tables */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

table#annualBreakdownTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table#annualBreakdownTable th, table#annualBreakdownTable td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: right;
    font-size: 0.95em;
}

table#annualBreakdownTable th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0; /* Make header sticky within scrollable container */
    z-index: 1;
}

table#annualBreakdownTable tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

table#annualBreakdownTable tbody tr:hover {
    background-color: #f1f1f1;
}

#investmentChart {
    width: 100% !important; /* Ensure chart.js canvas is responsive */
    max-height: 450px;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #777;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-body {
        flex-direction: column;
    }

    .input-section, .output-section {
        width: 100%;
    }

    header h1 {
        font-size: 1.8em;
    }

    header p {
        font-size: 1em;
    }
}

