body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
}
header {
    background-color: #005A9C;
    color: white;
    padding: 1rem 2rem;
    text-align: center;
}
header h1 {
    margin: 0;
}
.container {
    display: flex;
    padding: 1rem;
    gap: 1rem;
    align-items: flex-start;
}
.input-panel, .output-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
}
.input-panel { flex: 1; max-width: 450px; }
.output-panel { flex: 2; }
h2 { margin-top: 0; border-bottom: 2px solid #005A9C; padding-bottom: 0.5rem; color: #005A9C; }
fieldset { border: 1px solid #ddd; border-radius: 4px; margin-bottom: 1rem; }
legend { font-weight: bold; color: #333; padding: 0 0.5rem; }
form div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
form label { flex-basis: 60%; font-size: 0.9rem; }
form input { flex-basis: 35%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; text-align: right; }
form input:disabled { background-color: #eee; cursor: not-allowed; }
#main-action-btn { width: 100%; padding: 0.8rem; font-size: 1.1rem; font-weight: bold; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 1rem; }
#main-action-btn:hover { background-color: #218838; }

/* Output Panel Styles */
#output-area { display: flex; flex-direction: column; gap: 1rem; }
.output-single-view h3, .output-compare-view h3 { text-align: center; margin: 0 0 1rem 0; }
.output-single-view h3 span { font-size: 2rem; color: #005A9C; font-weight: bold; }
.chart-container { width: 100%; height: 400px; }
.compare-chart-container { display: flex; gap: 1rem; }     
.compare-chart-container .chart-wrapper {
    flex: 1;
    min-width: 0; 
}    
table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9rem; }
table th, table td { padding: 0.5rem; border: 1px solid #ddd; text-align: left; }
table th { background-color: #f2f2f2; }
table td:not(:first-child) { text-align: right; font-family: monospace; }
.delta-pos { color: #dc3545; }
.delta-neg { color: #28a745; }

/* Scenario Controls Styles */
.scenario-controls { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
#single-view-controls { flex-direction: row; align-items: center; }
.scenario-controls > div { display: flex; gap: 0.5rem; }
.scenario-controls select { flex-grow: 1; padding: 0.5rem; }
.scenario-controls button { padding: 0.5rem 1rem; border-radius: 4px; border: 1px solid #ccc; cursor: pointer; }
#delete-btn { background-color: #dc3545; color: white; border-color: #dc3545; }
.compare-controls label { font-weight: bold; align-self: center; }

/* Toggle Switch Styles */
.compare-toggle-container { display: flex; justify-content: space-between; align-items: center; background-color: #e9ecef; padding: 0.5rem 1rem; border-radius: 5px; margin-bottom: 1rem; }
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #005A9C; }
input:checked + .slider:before { transform: translateX(26px); }

.chart-header { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.chart-header h4 { margin: 0; font-weight: normal; }
.edit-btn { font-size: 0.8rem; padding: 0.2rem 0.6rem; background-color: #e9ecef; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; }
.edit-btn:hover { background-color: #ced4da; }
.chart-wrapper.is-editing { border: 2px solid #005A9C; border-radius: 8px; padding: 0.5rem; }

@media (max-width: 900px) {
    /* Stack the main columns vertically */
    .container {
        flex-direction: column;
    }

    /* Allow the input panel to take the full width */
    .input-panel {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box; /* Ensures padding doesn't add to width */
    }

    /* Stack the comparison charts vertically */
    .compare-chart-container {
        flex-direction: column;
    }
    
    /* Make the comparison table horizontally scrollable */
    #results-table-container {
        overflow-x: auto;
    }

    /* Adjust padding and font sizes for a tighter feel */
    header {
        padding: 1rem;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .input-panel, .output-panel {
        padding: 1rem;
    }
    .scenario-controls {
        flex-wrap: wrap; /* Allow buttons to wrap to the next line if needed */
    }
}

      
/* ========================================= */
/* ===== NEW: Tooltip & Info Icon Styles ===== */
/* ========================================= */

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #005A9C;
    color: white;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
}

/* Tippy.js Theme */
.tippy-box[data-theme~='custom-light'] {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
    max-width: 650px;
}
.tippy-box[data-theme~='custom-light'][data-placement^='top'] > .tippy-arrow::before {
    border-top-color: #ddd;
}
.tippy-box[data-theme~='custom-light'][data-placement^='bottom'] > .tippy-arrow::before {
    border-bottom-color: #ddd;
}
.tippy-box[data-theme~='custom-light'] .tippy-content {
    padding: 10px;
}
.tippy-box[data-theme~='custom-light'] .tippy-content strong {
    color: #005A9C;
}
.tippy-box[data-theme~='custom-light'] .tippy-content { padding: 10px; }
.tippy-box[data-theme~='custom-light'] strong { color: #005A9C; }
.no-wrap {
    white-space: nowrap;
    display: inline-block; /* Ensures consistent behavior */
}
.tippy-flex-container {
    display: flex;
    align-items: flex-start; /* Aligns the top of the description and defaults */
    gap: 1rem; /* Space between description and defaults */
}

.tippy-flex-container p {
    margin: 0; /* Remove default paragraph margin */
    flex-grow: 1; /* Allow description to take up available space */
}

.tippy-defaults {
    flex-shrink: 0;
    text-align: right;
    display: flex; /* Make the container itself a flex container */
    flex-direction: column; /* Stack its children vertically */
    gap: 4px; /* Add a small gap between the default value lines */
}

.tippy-defaults > div {
    display: flex;
    justify-content: space-between;
    gap: 8px; /* Space between the label and the value */
}

.tippy-defaults > div > span {
    white-space: nowrap; /* Keep the value part on a single line */
}