/**
 * FD Returns Calculator Styles
 */
#fd-calculator-pro-tool {
    padding: 30px;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
    margin: 20px auto;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}
#fd-calculator-pro-tool .form-grid {
    display: grid;
    gap: 20px 30px;
}
#fd-calculator-pro-tool .form-group { margin-bottom: 0; }
#fd-calculator-pro-tool .form-group.full-width { grid-column: 1 / -1; }
#fd-calculator-pro-tool label { display: block; margin-bottom: 8px; font-size: 13px; color: #333; }
#fd-calculator-pro-tool .input-group { display: flex; }
#fd-calculator-pro-tool input[type="number"],
#fd-calculator-pro-tool select {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;
}
#fd-calculator-pro-tool .checkbox-group { display: flex; align-items: center; gap: 10px; padding-top: 15px; }
#fd-calculator-pro-tool .calculator-actions { display: flex; gap: 10px; margin-top: 25px; flex-wrap: wrap; }
#fd-calculator-pro-tool .calculator-button {
    flex: 1; padding: 12px; border: none; border-radius: 4px; color: white;
    font-size: 12px; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 120px;
}
#fd-calculator-pro-tool .calculator-button:active { transform: scale(0.98); }
#fd-calculator-pro-tool #calculateBtn { background-color: #1e73be; }
#fd-calculator-pro-tool #calculateBtn:hover { background-color: #165a94; }
#fd-calculator-pro-tool #resetBtn { background-color: #6c757d; }
#fd-calculator-pro-tool #resetBtn:hover { background-color: #5a6268; }
#fd-calculator-pro-tool #printBtn, #fd-calculator-pro-tool #exportBtn { background-color: #28a745; display: none; }
#fd-calculator-pro-tool #printBtn:hover, #fd-calculator-pro-tool #exportBtn:hover { background-color: #218838; }
#fd-calculator-pro-tool .error-message {
    color: #d9534f; background-color: #f2dede; border: 1px solid #ebccd1;
    padding: 12px; border-radius: 4px; margin-top: 15px; display: none;
    grid-column: 1 / -1;
}
#fd-calculator-pro-tool .results-container { margin-top: 30px; display: none; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
#fd-calculator-pro-tool .results-summary { display: grid; grid-template-columns: 250px 1fr; gap: 30px; align-items: center; }
#fd-calculator-pro-tool .chart-container { position: relative; height: 250px; width: 250px; margin: 0 auto; }
#fd-calculator-pro-tool .summary-details { padding: 20px; background-color: #f8f9fa; border-radius: 4px; }
#fd-calculator-pro-tool .summary-details h3 { margin: 0 0 15px 0; font-size: 18px; color: #333; }
#fd-calculator-pro-tool .summary-details p { margin: 12px 0; font-size: 14px; display: flex; justify-content: space-between; }
#fd-calculator-pro-tool .summary-details p span {
    color: #1e73be;
    /* --- FIX: Allow large numbers in summary to wrap --- */
    word-break: break-all;
    text-align: right;
    padding-left: 10px; /* Add some space between label and value */
}
#fd-calculator-pro-tool .breakdown-section { margin-top: 30px; }
#fd-calculator-pro-tool table { width: 100%; border-collapse: collapse; margin-top: 15px; }
#fd-calculator-pro-tool th, #fd-calculator-pro-tool td {
    padding: 10px 12px; text-align: right; font-size: 14px;
    /* --- FIX: Allow large numbers in table cells to wrap --- */
    word-break: break-word; /* Use break-word for better wrapping within table cells */
}
#fd-calculator-pro-tool th { background-color: #f2f2f2; text-align: right; border-bottom: 2px solid #ddd; }
#fd-calculator-pro-tool td { border-bottom: 1px solid #eee!important; }
#fd-calculator-pro-tool tr:last-child td { border-bottom: none; }
#fd-calculator-pro-tool td:first-child, #fd-calculator-pro-tool th:first-child { text-align: center; }

@media (max-width: 768px) {
    #fd-calculator-pro-tool { padding: 20px; }
    #fd-calculator-pro-tool .form-grid { grid-template-columns: 1fr; }
    #fd-calculator-pro-tool .checkbox-group { padding-top: 0; }
    #fd-calculator-pro-tool .results-summary { grid-template-columns: 1fr; gap: 20px; }
    #fd-calculator-pro-tool .chart-container { height: 220px; width: 220px; }
    #fd-calculator-pro-tool .calculator-actions { flex-direction: column; }
    #fd-calculator-pro-tool table, #fd-calculator-pro-tool thead, #fd-calculator-pro-tool tbody, #fd-calculator-pro-tool th, #fd-calculator-pro-tool td, #fd-calculator-pro-tool tr { 
        display: block; 
    }
    #fd-calculator-pro-tool thead tr { 
        position: absolute; top: -9999px; left: -9999px;
    }
    #fd-calculator-pro-tool tr { 
        border: 1px solid #ddd; margin-bottom: 10px; background: #fdfdfd;
    }
    #fd-calculator-pro-tool td {
        border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; text-align: right;
    }
    #fd-calculator-pro-tool td:last-child { border-bottom: none; }
    #fd-calculator-pro-tool td:before {
        position: absolute; top: 50%; transform: translateY(-50%); left: 10px; width: 45%; 
        padding-right: 10px; white-space: nowrap; content: attr(data-label);
        font-weight: 400; text-align: left; color: #555;
    }
    /* --- FIX: Adjust font size for summary on smaller screens --- */
    #fd-calculator-pro-tool .summary-details p {
        font-size: 13px;
    }
}