/* --- NEW & COMPACT STYLES --- */

#combined-methods-calculator.compact-layout {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 500px; /* Reduced max-width slightly */
    margin: 20px auto;
    padding: 20px; /* Reduced padding */
    background-color: #fdfdff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    color: #333;
}

#combined-methods-calculator.compact-layout h2 {
    text-align: center;
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 8px;
    color: #2c3e50;
}

#combined-methods-calculator.compact-layout .calculator-intro {
    text-align: center;
    color: #7f8c8d;
    font-size: 15px;
    margin-bottom: 25px;
}

/* Flexbox row for side-by-side fields */
.form-row {
    display: flex;
    gap: 12px; /* Space between the two dropdowns */
    align-items: flex-end; /* Aligns items at the bottom */
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 0; /* Remove margin as .form-row now handles it */
}

/* Method selector takes up more space */
.method-selector {
    flex: 1 1 65%;
}

/* Use quality selector is smaller */
.use-quality-selector {
    flex: 1 1 35%;
}

#combined-methods-calculator.compact-layout label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px; /* Smaller label font */
    color: #34495e;
}

#combined-methods-calculator.compact-layout select {
    width: 100%;
    padding: 12px 10px; /* Adjusted padding */
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: #ffffff;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#combined-methods-calculator.compact-layout select:focus {
    outline: none;
    border-color: #800080;
    box-shadow: 0 0 0 3px rgba(128, 0, 128, 0.15);
}

/* A light, space-saving separator */
.method-separator {
    border: none;
    border-top: 1px solid #e9e9e9;
    margin: 5px 0 20px 0;
}

#combined-methods-calculator.compact-layout input[type="submit"] {
    width: 100%;
    background: linear-gradient(45deg, #ff69b4, #800080);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    padding: 14px; /* Slightly less padding */
    transition: all 0.3s ease;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    display: block;
    margin-top: 10px; /* Space above button */
}

#combined-methods-calculator.compact-layout input[type="submit"]:hover:not(:disabled) {
    background: linear-gradient(45deg, #ff1493, #8b008b);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#combined-methods-calculator.compact-layout input[type="submit"]:disabled {
    background: #cccccc;
    cursor: wait;
    opacity: 0.7;
}

#combined-methods-calculator-result {
    display: none;
    margin-top: 20px;
    padding: 15px; /* Reduced padding */
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    text-align: center;
    color: #1b5e20;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#combined-methods-calculator-result.visible {
    opacity: 1;
    transform: translateY(0);
}

#combined-methods-calculator-result h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}
#combined-methods-calculator-result .result-value {
    font-size: 36px;
    font-weight: bold;
}
#combined-methods-calculator-result .result-label {
    font-size: 15px;
}
#combined-methods-calculator-result small {
    font-size: 12px;
    margin-top: 12px;
}

/* Responsive: For very narrow screens, stack the fields vertically */
@media (max-width: 400px) {
    .form-row {
        flex-direction: column;
        gap: 15px; /* Add vertical gap when stacked */
        align-items: stretch; /* Make items full width */
    }
}