/* Emergency Fund Calculator Layout Fix */
.finqna-calculator.monthly-budget .fi-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center; /* vertically align label + input */
    margin-bottom: 1em;  /* spacing between rows */
    width: 100%;         /* stretch full width of calculator */
}

/* Label takes natural width, no forced column */
.finqna-calculator.monthly-budget .fi-label-wrap {
    flex: 0 0 auto; /* shrink to content width */
    margin-right: 0.5em;
    width: 40%;
}

/* Input takes remaining space but limited for numeric entry */
.finqna-calculator.monthly-budget .fi-input {
    flex: 1 1 auto;   /* take remaining space */
    max-width: 180px; /* numeric input box limited width */
    min-width: 50px;  /* ensure not too small */
    box-sizing: border-box;
}

.fi-step {
    margin-top: -8px;
}

/* Change color of border for each step */

.fi-step-income .fi-box {
    border-left: 9px solid #3c9294;
}

.fi-step-housing .fi-box {
    border-left: 9px solid #5e93cb;
}

.fi-step-transport .fi-box {
    border-left: 9px solid #f28e2b;
}

.fi-step-living .fi-box {
    border-left: 9px solid #edc949;
}

.fi-step-health .fi-box {
    border-left: 9px solid #e15759;
}

.fi-step-child .fi-box {
    border-left: 9px solid #6dd1c9;
}

.fi-step-savings .fi-box {
    border-left: 9px solid #4aa76c;
}

.fi-step-debt .fi-box {
    border-left: 9px solid #af7aa1;
}

.fi-step-misc .fi-box {
    border-left: 9px solid #ff9da7;
}


/* Mobile: stack input below label, full width */
@media (max-width: 767px) {
    .finqna-calculator.monthly-budget .fi-section {
        flex-direction: column;
        align-items: stretch;  /* inputs stretch to container width */
    }

    .finqna-calculator.monthly-budget .fi-label-wrap {
        margin-right: 0;
        margin-bottom: 0.25em;
        width: 100%; /* label full width */
    }

    .finqna-calculator.monthly-budget .fi-input {
        max-width: 100%; /* fill container */
        width: 100%;
    }
}