body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f2f5; /* Softer background */
    padding: 20px;
    box-sizing: border-box;
    color: #333;
}

.calculator-container {
    background-color: #ffffff;
    padding: 25px 30px; /* Adjusted padding */
    border-radius: 12px; /* Softer radius */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); /* Softer shadow */
    width: 100%;
    /* Increased max-width slightly to accommodate new fields */
    max-width: 600px;
    text-align: center;
}

h1 {
    color: #1d2129; /* Darker, less harsh than pure black */
    margin-bottom: 12px;
    font-size: 1.7em; /* Slightly smaller to fit longer title */
}

/* Style for input sections */
.input-section {
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    text-align: left;
}

.input-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #005288; /* Consistent blue */
    font-size: 1.1em;
    text-align: center;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 10px;
}

.description, .disclaimer {
    font-size: 0.95em; /* Slightly larger for better readability */
    color: #555e69; /* Softer text color */
    margin-bottom: 25px;
    line-height: 1.5;
}

.disclaimer {
    margin-top: 35px;
    font-size: 0.85em;
    border-top: 1px solid #e1e4e8; /* Softer border */
    padding-top: 20px;
}

.form-group {
    margin-bottom: 18px; /* Slightly less margin */
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px; /* Closer to input */
    font-weight: 500; /* Medium weight */
    color: #3c4043; /* Google-ish input label color */
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%; /* Full width with box-sizing */
    padding: 12px; /* More padding */
    border: 1px solid #ced4da; /* Standard input border color */
    border-radius: 6px; /* Softer radius */
    font-size: 1em;
    box-sizing: border-box; /* Important for width: 100% */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Hide number input spinners */
.form-group input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Safari and Chrome */
    margin: 0;
}

button[type="submit"] {
    background-color: #007bff; /* Bootstrap primary blue */
    color: white;
    padding: 12px 20px; /* Adjusted padding */
    border: none;
    border-radius: 6px; /* Softer radius */
    font-size: 1.05em; /* Slightly adjusted */
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    width: 100%;
    margin-top: 5px; /* Reduced space before button */
}

button[type="submit"]:hover {
    background-color: #0069d9; /* Darker blue on hover */
}

button[type="submit"]:active {
    background-color: #005cbf; /* Even darker on active */
    transform: translateY(1px);
}

/* Result Area Styling */
#resultArea {
    margin-top: 30px;
    padding: 18px;
    background-color: #f8f9fa; /* Lighter gray */
    border: 1px solid #dee2e6; /* Gray border */
    border-radius: 8px;
    text-align: left; /* Align text left within result sections */
}

#resultArea.results-hidden {
    display: none; /* Hide results initially */
}

#resultArea h2 {
    margin-top: 0;
    margin-bottom: 12px; /* Increased margin */
    color: #005288; /* Darker blue for heading */
    font-size: 1.15em;
    text-align: center;
}

#resultArea p {
    margin-bottom: 8px; /* Space between paragraphs */
    font-size: 0.95em;
    color: #343a40; /* Dark gray text */
}

#resultArea strong {
    font-weight: bold;
    font-size: 1.2em; /* Slightly larger result numbers */
    color: #004085; /* Bootstrap primary text */
}

.results-divider {
    border: 0;
    border-top: 1px solid #ced4da; /* Standard border color */
    margin: 20px 0; /* Add space around divider */
}

.info-message {
    font-size: 0.85em !important; /* Ensure smaller font size */
    color: #555e69 !important; /* Softer color */
    margin-top: 10px !important;
}

/* Margin of safety styling */
#dcfMarginOfSafetyResult, #ggmMarginOfSafetyResult {
    font-size: 1.1em !important; /* Slightly smaller than intrinsic value */
}

.positive-margin {
    color: #155724 !important; /* Bootstrap success text color */
}

.negative-margin {
    color: #721c24 !important; /* Bootstrap danger text color */
}

/* Error message styling */
.error-message {
    color: #721c24; /* Bootstrap danger text color */
    background-color: #f8d7da; /* Bootstrap danger background */
    border: 1px solid #f5c6cb; /* Bootstrap danger border */
    padding: 12px;
    border-radius: 6px;
    margin-top: 20px;
    display: none; /* Hidden by default */
    font-size: 0.9em;
    text-align: left;
}