/*
 * mortgage.css — Fusion Calculator
 * Extracted from mortgage.html (batch-29d-css-extraction-mortgage)
 * Source: 9 inline <style> blocks merged in document order
 *   Block 1 (unnamed):           original lines 10–1275
 *   Block 2 (unnamed):           original lines 1278–1298
 *   Block 3 (lf-unified-controls): original lines 1301–1463
 *   Block 4 (lf-golden-buttons): original lines 1466–1503
 *   Block 5 (unnamed):           original lines 1505–1579
 *   Block 6 (unnamed):           original lines 1582–1673
 *   Block 7 (unnamed):           original lines 1676–1730
 *   Block 8 (unnamed):           original lines 1732–1770
 *   Block 9 (unnamed):           original lines 1772–1793
 * Do not add shared/global rules here — page-specific styles only.
 */
        :root {
            /* colors */
            --colorHs: #FDA929;
            --colorLabels: white;
            --colorPlaceHolders: #ffffff54;
            --colorInstructions: #ccc;
            --colorStartDateBtn: #FDA929;
            /*Colors of Compute Bton after select the target */
            --colorComputeSelectBtn: #FFA500;
            /* color of target variable */
            --colorInputToCal: #FFA500;
            /* colors amortization */
            --colorAmortizationHover: #39546F;
            --colorAmortizationCol1: rgba(247, 249, 255, 0.947);
            --colorAmortizationCol2: white;
            /*--colorAmortizationCol2: rgb(178, 167, 218); */
            /*--colorAmortizationCol2: linear-gradient(to bottom right, #134160, #586C75, #134160, #586C75) no-repeat fixed;*/
            --colorYearlySummary: #fff2ce;
            --colorBackgroundTotalsEmpty: linear-gradient(to bottom right, #134160, #586C75, #134160, #586C75) no-repeat fixed;
            --colorBackgroundTotals: #fff2ce;

            /* Border Radius */
            --inputBorderRadius: 25px;
            /* Margins */
            --labelsMarginLeft: 50px;
            /* Widths */
            --amortizationTableWidth: 100%;

        }

        body {
            background: linear-gradient(to bottom right, #134160, #586C75, #134160, #586C75) no-repeat fixed;
            background-size: cover;
            /*font-family: 'alfarn', serif;
            margin: 0 auto;*/
            padding: 20px 20px 20px;
        }

        h1,
        h2,
        h3 {
            font-family: 'alfarn', serif;
            text-align: center;
            color: var(--colorHs);
            margin-top: 20px;
            margin-bottom: 20px;
            letter-spacing: 1px;
            text-align: center;
        }

        h1 {
            font-weight: 700;
            margin: 40px 0;
        }

        h2,
        h3 {
            font-weight: 500;
        }

        /* horizontal lines on the calculator */
        hr {
            width: 100%;
            height: .01px;
            background-color: #dcdc4f;
            opacity: 0.4;
        }

        vrl {
            width: 0, 01px;
            height: 95%;
            background-color: #dcdc4f;
            opacity: 0.4;
        }

        .resultSeparator hr {
            width: 95%;
            height: 0.01px;
            background-color: #dcdc4f;
            opacity: 0.4;
            margin-top: 0px;
            margin-bottom: 0px;
        }


        /* HERE BEGINS THE FIXED CODE AMONG ALL CALCULATORS */

        .navbar {
            display: flex;
            justify-content: space-around;
            align-items: center;
            background-color: rgba(255, 255, 255, 0.1);
            padding: 15px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        .navbar a {
            color: #fff;
            text-decoration: none;
            padding: 15px 35px;
            border-radius: 5px;
            font-family: 'alfarn-2', sans-serif;
            font-weight: bold;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        .navbar a:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .navbar a.active {
            background-color: #ff9900;
            color: #000;
        }

        @media (max-width: 768px) {
            .navbar {
                flex-direction: column;
            }

            .navbar a {
                padding: 10px;
                width: 100%;
                text-align: center;
            }
        }

        .main-wrapper {
            display: flex;
            flex-direction: column;
            min-height: 95vh;
        }

        .main-content {
            max-width: 1240px;
            margin: 0 auto;
            flex: 1;
            padding: 0 20px 20px;
        }

        /* ===== Ocultar COMPLETAMENTE el scrollbar (seguir desplazando) ===== */
        /* WebKit (Chrome / Edge / Safari) */
        html::-webkit-scrollbar,
        body::-webkit-scrollbar {
            width: 0;
            /* sin ancho */
            height: 0;
            /* sin alto (para ejes horizontales) */
            background: transparent;
            /* por si el motor pinta pista */
        }

        /* Firefox */
        html,
        body {
            scrollbar-width: none;
            /* oculta el scrollbar */
            scrollbar-color: transparent transparent;
            /* redundante: “por si acaso” */
        }

        /* Windows/IE legado (EdgeHTML) – no estorba en navegadores modernos */
        html,
        body {
            -ms-overflow-style: none;
            /* esconder barras en motores MS antiguos */
        }

        form {
            max-width: 1240px;
            margin: 20px auto;
            /* box-shadow: 0 5px 10px rgba(0, 0, 0, 1); */
            /* padding: 0px;*/
            /* border-radius: 15px;*/
        }

        .footer {
            background-color: rgba(255, 255, 255, 0.1);
            color: white;
            text-align: center;
            padding: 5px;
            margin-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
        }

        .footer .disclaimer {
            width: 70%;
            font-size: 14px;
            line-height: 1.6;
            margin: 10px auto;
            letter-spacing: 0.5px;
        }

        .disclaimer-label {
            color: #FDA929;
            font-size: 20px;
            line-height: 1.6;
            margin: 5px;
            font-weight: bold;
        }


        /* HERE ENDS THE FIXED CODE AMONG ALL CALCULATORS */

        /* Two columns: 70% form / 30% results */
        /* Layout: form on top, results under it (full width of main-content) */
        .calculator-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            max-width: 900px;
            margin: 0 auto;
            position: relative;
            padding-bottom: 50px;
            box-sizing: border-box;
        }




        .calculator-left {
            grid-area: left;
        }


        .calculator-right {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            margin-top: 25px;

            /* ⬇️ Keep results visible as you scroll the amortization table */
            position: relative;
            top: 12px;
            /* adjust cushion from top as you like */
            z-index: 5;
            /* above the amortization header (z-index:1) */
        }

        .calculator-right .results-panel {
            flex: 1 1 0;
            box-sizing: border-box;
        }








        /* optional: scroll inside the tall side */
        .calculator-left {
            overflow: hidden;
        }


        /* Make results panels use the column width cleanly */
        .calculator-right .results-panel {
            width: 90%;
            margin: 10px 10px 10px 10px;
        }

        /* MOBILE: stack vertically – put results above or below as you like */
        @media (max-width: 980px) {
            .calculator-container {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "left"
                    "right";
                row-gap: 24px;
                min-height: auto;
            }
        }


        .calculator-left {
            flex: 1;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 1);
            border-radius: 15px;
            flex: 100%;
            width: 100%;
        }

        .section {
            background-color: transparent;
        }

        /* === Two-column calculator grid === */
        .inputs-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px 50px;
            align-items: start;
        }

        .inputs-grid .full-span {
            grid-column: 1 / -1;
        }

        /* tighten label/input spacing inside grid items */
        .inputs-grid .label-button,
        .inputs-grid .label-button-2 {
            margin-left: 0;
            width: 100%;
        }

        .inputs-grid .lf-control {
            margin-left: 0;
            width: 100%;
        }

        .inputs-grid .select-wrap {
            width: auto;
        }

        /* keep the tiny unit selects beside their inputs */
        .inline-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .inline-row .lf-control {
            flex: 1 1 auto;
        }

        .inline-row .option-selector.lf-control {
            width: 100px;
            min-width: 72px;
        }


        .section h2,
        h3 {
            margin-top: 1px;
            margin-left: 20px;
            margin-bottom: 10px;
            color: #FDA929;
            /*border-top: 1px solid white;*/
            width: 100%;
            text-align: left;
            font-family: 'alfarn', serif;
            font-size: 14px;
        }

        .section-title h2 {
            margin-top: 1px;
            margin-bottom: 50px;
            font-size: 14px;
            font-family: Georgia, 'Times New Roman', Times, serif;
        }

        .results-panel {
            box-shadow: 0 0 8px 2px #FDA929;
            background-color: #2b4a5e;
            /*background: white;*/
            color: white;
            /*color: #134160;*/
            margin: 0 0px 0px 0px;
            padding: 10px;
            border: 2px solid #FDA929;
            width: 100%;
            max-width: 900px;
            border-radius: 15px;
            text-align: center;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;

        }


        .results-panel h3 {
            font-family: 'alfarn', serif;
            /*color: #134160;*/
            text-align: center;
            margin-top: 0px;
            margin-bottom: 4px;
            font-size: 16px;
        }

        .results-panel hr {
            width: 100%;
            height: .01px;
            background-color: #dcdc4f;
            opacity: 0.4;
            margin-top: 0px;
            margin-bottom: 0px;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
        }



        .section p {
            margin-left: 20px;
            font-weight: bold;
            color: var(--colorInstructions);
        }

        /* inputs in tables */
        .section label {
            display: inline-block;
            position: relative;
            margin-left: 20px;
            width: 100%;
            text-align: left;
            /*margin-bottom: 5px;*/
            /*font-size: 1em;
            color:#FDA929;*/
            color: white;
            flex: left;
            /*margin: 5px;*/
            font-size: 14px;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            font-weight: bold;

        }

        .section input {
            width: 100%;
            background-color: transparent;
            color: white;
            padding: 10px 0px;
            margin-left: 0px;
            border: 1px solid #ccc;
            border-radius: var(--inputBorderRadius);
            flex: left;
            /*margin: 0px;
            margin-right: 0px;*/
            margin-top: 5px;
            font-size: 16px;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            font-weight: bold;
        }

        .section input::placeholder {
            color: var(--colorPlaceHolders);
            padding-left: 5px;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            font-weight: normal;
        }

        .section input:focus {
            outline: none;
            border-color: #FDA929;
            /*border-color: #4CAF50;*/
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.828);
        }


        .section button {
            width: 100%;
            background-color: #FDA929;
            color: #fff;
            border: none;
            cursor: pointer;
            font-family: 'alfarn', serif;
            font-size: 14px;
            padding: 10px;
            border-radius: 25px;
        }

        .section button:hover {
            background-color: #e08924;
        }

        .section button:focus {
            outline: none;
            background-color: #e08924;
        }

        .section input[type="button"]:hover {
            background-color: #e08924;
        }

        /* Calculator (Inputs + Buttons) Table */
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 0px;
        }

        tbody {
            margin-top: 0px;
        }

        th,
        td {
            border: 0;
            text-align: center;
        }

        .input-selector {
            display: flex;
            align-items: left;
            justify-content: space-evenly;
            flex-wrap: wrap;
            flex-flow: row wrap;
            /*align-items: center;*/
        }

        .input-selector label {
            display: inline-block;
            position: relative;
            margin-bottom: 5px;
            font-weight: 600;
            font-size: 1em;
            color: var(--colorLabels);
            flex: left;
            margin-top: 10px;
            width: 100%;
            text-align: left;
            margin-left: 15px;
        }

        .input-selector input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: var(--inputBorderRadius);
            font-size: 16px;
            flex: left;
            margin: 0px;
            margin-right: 0px;
        }

        /* transparent focus, no square */
        select:focus {
            outline: none;
            border-color: transparent !important;
            box-shadow: none;
            background-color: transparent;
        }


        th {
            background-color: transparent;
        }

        /* 2C-G: replaced display:block table override with horizontal scroll.
           Rationale: amortization rows are generated by JS with no data-label attrs,
           so td::before { content: attr(data-label) } showed nothing — labels were blank.
           Scroll preserves column background coloring, sticky header, and border-radius.
           The inputs-grid 2-col → 1-col collapse is added at the same breakpoint. */
        @media (max-width: 600px) {

            /* Inputs grid: stack to single column on small phones */
            .inputs-grid {
                grid-template-columns: 1fr;
                gap: 10px;
            }
        }

        /* Amortization Table */

        /* Amortization Table Totals */
        #tableTotals {
            border-collapse: collapse;
            width: var(--amortizationTableWidth);
            /*gap: 20px;*/
            margin-left: 0%;
            align-items: center;
            background-color: var(--colorAmortizationBackground);
            box-shadow: 0px 0px 30px rgb(0, 0, 0);
            /* Soft shadow */
            border: 5px solid #FDA929;
            border-radius: 25px;
        }

        #totalsTitle {
            font-family: 'alfarn', serif;
            color: #ffffff;
            text-align: center;
            font-size: 2em;
        }

        #tableTotals tr {
            border-bottom: 3px solid #ddd;
        }

        #tableTotals th {
            background-color: #fff2ce;
            padding: 7px;
            text-align: center;
            color: #39546F;
            font-family: 'alfarn', serif;
        }

        #tableTotals td {
            padding: 7px;
            text-align: center;
            color: #39546F;
            font-family: 'Inter', sans-serif;
            background-color: white;
            font-weight: bold;
        }

        /* Amortization Table */
        #amortizationTable {
            border-collapse: collapse;
            width: var(--amortizationTableWidth);
            /*gap: 20px;*/
            margin-left: 0%;
            align-items: center;
            background-color: var(--colorAmortizationBackground);
            box-shadow: 0px 0px 30px rgb(0, 0, 0);
            /* Soft shadow */
            border: 5px solid #FDA929;
            border-radius: 25px;
        }

        #amortizationTable tr {
            border-bottom: 3px solid #ddd;
        }

        #amortizationTable tr:hover {
            background-color: var(--colorAmortizationHover);
        }

        #amortizationTable caption {
            text-align: center;
            /*background-color: white;*/
        }

        .amortizationTitle {
            font-family: 'alfarn', serif;
            color: #ffffff;
            text-align: center;
            font-size: 23px;
            text-shadow: 0px 7px 5px rgb(0, 0, 0), 0 0 20px rgb(255, 255, 255), 0px 0px 5px rgb(0, 0, 0);
        }

        /* Fix header */
        #amortizationTable thead[id='amortizationHeader'] {
            position: sticky;
            top: 0;
            z-index: 1;
            background-color: #fff2ce;
        }

        #amortizationTable th {
            background-color: #fff2ce;
            background: #fff2ce;
            padding: 7px;
            text-align: center;
            color: #39546F;
            font-family: 'alfarn', serif;
            /* fix header: */
            position: sticky;
            top: 0;
            z-index: 1;
        }

        #amortizationTable td {
            padding: 7px;
            text-align: center;
            color: #39546F;
            font-family: 'Inter', sans-serif;
            /*background-color: white;*/
        }

        /* columns background */
        #amortizationTable td[class='columnMonthNumber'] {
            background-color: var(--colorAmortizationCol2);
        }

        #amortizationTable td[class='columnMonthName'] {
            /*background-color: rgb(177, 135, 216);*/
            background-color: var(--colorAmortizationCol2);
            text-align: left;
        }

        #amortizationTable td[class='columnMonthlyPayment'] {
            /*background-color: rgb(162, 230, 235);*/
            background-color: var(--colorAmortizationCol1);
        }

        #amortizationTable td[class='columnInterest'] {
            background-color: var(--colorAmortizationCol2);
        }

        #amortizationTable td[class='columnPrincipal'] {
            background-color: var(--colorAmortizationCol1);
        }

        #amortizationTable td[class='columnEndingBalance'] {
            /*background-color: pink;*/
            background-color: var(--colorAmortizationCol2);
        }

        /* yearly summary */
        #amortizationTable td[class="tdYearlyTotals"] {
            padding: 7px;
            text-align: center;
            background-color: var(--colorYearlySummary);
            color: #39546F;
            font-family: 'alfarn', serif;
        }

        #amortizationTable td[class="tdYearlyTotalAmount"] {
            padding: 7px;
            text-align: center;
            background-color: var(--colorYearlySummary);
            color: #39546F;
            font-family: 'alfarn', serif;
        }

        #amortizationTable td[class="tdYearlyInterest"] {
            padding: 7px;
            text-align: center;
            background-color: var(--colorYearlySummary);
            color: #39546F;
            font-family: 'alfarn', serif;
        }

        #amortizationTable td[class="tdYearlyPrincipal"] {
            padding: 7px;
            text-align: center;
            background-color: var(--colorYearlySummary);
            color: #39546F;
            font-family: 'alfarn', serif;
        }

        #amortizationTable td[class="tdYearlyEmpty"] {
            background-color: var(--colorYearlySummary);
            color: #39546F;
            font-family: 'alfarn', serif;
            text-align: center;

        }

        /* Totals */
        #amortizationTable td[class="tdTotals"] {
            background-color: var(--colorBackgroundTotals);
            text-align: center;
            font-size: 2em;
            color: #39546F;
            font-family: 'alfarn', serif;
        }

        #amortizationTable td[class="tdTotalsInterest"] {
            background-color: var(--colorBackgroundTotals);
            text-align: center;
            font-size: 2em;
            color: #39546F;
            font-family: 'alfarn', serif;

        }

        #amortizationTable td[class="tdTotalsPrincipal"] {
            background-color: var(--colorBackgroundTotals);
            text-align: center;
            font-size: 2em;
            color: #39546F;
            font-family: 'alfarn', serif;

        }

        /* Round corners*/
        #amortizationTable th[id="supLeftCorner"] {
            border-top-left-radius: 0px;
        }

        #amortizationTable th[id="supRightCorner"] {
            border-top-right-radius: 0px;
        }

        #btn-top {
            position: fixed;
            top: 0;
            /*bottom: 20px;*/
            right: 0;
            background-color: rgba(224, 137, 36, 0.8);
            color: #fff;
            border: none;
            padding: 15px;
            cursor: pointer;
            display: none;
            border-radius: 25px;
            margin-top: 20px;
        }

        #btn-top:hover {
            background-color: rgba(224, 137, 36, 1);
        }

        #btn-end {
            position: fixed;
            top: 100px;
            /*bottom: 20px;*/
            right: 0;
            background-color: rgba(224, 137, 36, 0.8);
            color: #fff;
            border: none;
            padding: 15px;
            cursor: pointer;
            display: none;
            border-radius: 25px;
            margin-top: 20px;
        }

        #btn-end:hover {
            background-color: rgba(224, 137, 36, 1);
        }

        /* Error message when Compute can not be executed */
        .error {
            color: rgb(255, 255, 255);
            font-size: 0.9em;
        }

        /* Style for the paragraphs that show the results in the panels */
        .resultParagraph {
            display: flex;
            justify-content: space-between;
            font-size: 14px;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
            font-weight: bold;
            margin-top: 5px;
            margin-bottom: 5px;
        }

        .numericResult {
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
            font-weight: bold;
            /*color: #FDA929;*/
            font-size: 15px;
        }

        /* Style Annual Interest */
        .input-wrapper {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        .input-wrapper input {
            padding-right: 1em;
            box-sizing: border-box;
            width: 100%;
        }

        .input-wrapper::after {
            content: "";
            position: absolute;
            right: 13px;
            top: 55%;
            transform: translateY(-50%);
            color: rgba(255, 255, 255, 0.726);
            pointer-events: none;
        }

        /* Style for the labels that are not buttons */
        .label-button-2 {
            /*display: none;*/
            /*padding: 10px 20px;
            padding: 3px 10px;*/
            font-size: 11px;
            background-color: transparent;
            color: white;
            /*font-weight: bold;*/
            /*border: 2px solid rgba(255, 255, 255, 0.203);*/
            border-radius: 25px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            width: 100%;
            margin-left: 0px;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
        }

        #labelPurchasePrice {
            display: inline-block;
            width: 62%;
            text-align: center;
            /*font-size: medium;*/
            transition: border-color 0.3s;

        }

        #labelDownPayment {
            display: inline-block;
            width: 50%;
            text-align: center;
            /*font-size: medium;*/
            transition: border-color 0.3s;
        }

        #labelPropertyTax {
            display: inline-block;
            width: 65%;
            text-align: center;
            /*font-size: medium;*/
            transition: border-color 0.3s;
        }

        #labelHomeInsurance {
            display: inline-block;
            width: 75%;
            text-align: center;
            /*font-size: medium;*/
            transition: border-color 0.3s;
        }

        #labelStartDate {
            display: inline-block;
            width: 50%;
            text-align: center;
            /*font-size: medium;*/
            transition: border-color 0.3s;
        }

        /* Style for the labels that are buttons */


        .label-button {
            padding: 5px 5px;
            border-radius: 25px;
            border: 2px solid #f0c76a;
            color: #fff;
            background: linear-gradient(180deg, #fda929, #e08924);
            font-family: 'alfarn', serif;
            font-size: 8px;
            font-weight: 400;
            box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .18);
            cursor: pointer;
            transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
        }

        .label-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 14px 28px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .22);
            filter: brightness(1.05);
        }

        .label-button:active {
            transform: translateY(0);
        }

        #labelButtonLoanAmount {
            border: 1px solid white;
            width: 41%;
            font-size: 11px;
            padding-bottom: 6px;
            padding-top: 6px;

        }

        #labelButtonInterestRate {
            border: 1px solid white;
            width: 41%;
            font-size: 11px;
            padding-bottom: 6px;
            padding-top: 6px;
        }

        #labelButtonLoanTerm {
            border: 1px solid white;
            width: 41%;
            font-size: 11px;
            padding-bottom: 6px;
            padding-top: 6px;
        }

        #labelButtonMonthlyPayment {
            border: 1px solid white;
            width: 41%;
            font-size: 11px;
            padding-bottom: 6px;
            padding-top: 6px;
        }

        /* glow effect on calculate buttons */
        .glow-border {
            animation: glow 1.5s infinite !important;
            border-color: #00f !important;
        }

        @keyframes glow {
            0% {
                box-shadow: 0 0 0px rgba(0, 128, 255, 0.4);
                border-color: #ccc;
            }

            50% {
                box-shadow: 0 0 10px rgba(0, 128, 255, 0.8);
                border-color: #00f;
            }

            100% {
                box-shadow: 0 0 0px rgba(0, 128, 255, 0.4);
                border-color: #ccc;
            }
        }

        .glow-blue {
            animation: full-glow 1.5s infinite;
        }

        @keyframes full-glow {

            0%,
            100% {
                box-shadow: 0 0 0 rgba(0, 128, 255, 0.3);
            }

            50% {
                box-shadow: 0 0 20px 8px rgba(0, 128, 255, 0.6);
            }
        }

        /*
        .glow-white {
            animation: golden-glow 1.5s infinite;
            background-color: rgba(255, 215, 0, 0.05);
        }

        @keyframes golden-glow {
            0%, 100% {
                box-shadow: 0 0 0px rgba(255, 215, 0, 0.3);
            }
            50% {
                box-shadow: 0 0 15px 5px rgba(235, 233, 226, 0.8);
            }
        }
            */
        .lf-left-tab.glow-white {
            animation: golden-glow 1.5s ease-in-out infinite;
            will-change: box-shadow;
        }

        .fuse-wrap.glow-white {
            animation: golden-glow 1.5s ease-in-out infinite;
            will-change: box-shadow;
        }

        /* Keep the base shadows in all keyframe steps, and just animate an extra layer */
        @keyframes golden-glow {

            0%,
            100% {
                box-shadow:
                    /* keep your original two layers */
                    inset 0 0 0 2px rgba(255, 255, 255, .18),
                    0 8px 18px rgba(0, 0, 0, .35),
                    /* animated layer (off) */
                    0 0 0 0 rgba(235, 233, 226, 0);
            }

            50% {
                box-shadow:
                    inset 0 0 0 2px rgba(255, 255, 255, .35),
                    /* slightly brighter inset ring */
                    0 8px 18px rgba(0, 0, 0, .35),
                    0 0 15px 5px rgba(235, 233, 226, 0.8);
                /* the glow */
            }
        }

        /* shake effect */

        .shake-horizontal {
            animation: shake 1s ease-in-out infinite;
            animation-duration: infinite;
        }

        @keyframes shake {
            0% {
                transform: translateX(0);
            }

            25% {
                transform: translateX(-6px);
            }

            50% {
                transform: translateX(6px);
            }

            75% {
                transform: translateX(-4px);
            }

            100% {
                transform: translateX(0);
            }
        }

        .shake-jitter {
            animation: rotate-jitter 0.4s infinite;
        }

        @keyframes rotate-jitter {
            0% {
                transform: rotate(0deg);
            }

            25% {
                transform: rotate(-5deg);
            }

            50% {
                transform: rotate(5deg);
            }

            75% {
                transform: rotate(-3deg);
            }

            100% {
                transform: rotate(0deg);
            }
        }

        .shake-vertical {
            animation: vertical-jitter 0.4s infinite;
        }

        @keyframes vertical-jitter {
            0% {
                transform: translateY(0);
            }

            25% {
                transform: translateY(-4px);
            }

            50% {
                transform: translateY(4px);
            }

            75% {
                transform: translateY(-2px);
            }

            100% {
                transform: translateY(0);
            }
        }


        /* STYLE FOR THE SELECT BUTTONS */

        .option-selector {
            font-size: 12px;
            padding: 10px 0;
            padding-left: 7px;
            text-align: left;
            width: 18%;
            border-radius: 25px;
            color: #fda829d6;
            background-color: transparent;
            border: 1px solid #ccc;
            transition: background-color 0.2s, color 0.2s;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D'10'%20height%3D'6'%20viewBox%3D'0%200%2010%206'%20fill%3D'none'%20xmlns%3D'http%3A//www.w3.org/2000/svg'%3E%3Cpath%20d%3D'M1%201L5%205L9%201'%20stroke%3D'%23fda829'%20stroke-width%3D'1.5'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 5px center;
            background-size: 11px;
        }

        .option-selector:hover {
            background-color: #45606F;
            color: white;
        }


        /* STYLE FOR DATE PICKER*/

        .custom-date-wrapper {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        /* Visible field (mm/dd/yyyy) */
        .custom-date-wrapper input[type="date"],
        .custom-date-wrapper input[type="text"] {
            font-size: 12px;
            padding-left: 7px;
            border: 1px solid #ccc;
            border-radius: 25px;
            background-color: transparent;
            color: #ffffffaf;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            cursor: pointer;
        }

        /* Hide the native picker indicator (we use a custom icon) */
        .custom-date-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
            opacity: 0;
        }

        /* Hidden native date input used only to open the OS date picker + hold ISO value */
        .custom-date-wrapper .lf-date-native {
            position: absolute;
            inset: 0;
            opacity: 0;
            pointer-events: none;
        }

        /* Custom calendar icon */
        .custom-date-wrapper .date-icon {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-10%);
            width: 22px;
            height: 22px;
            cursor: pointer;
            opacity: .85;
            background-repeat: no-repeat;
            background-position: center;
            background-size: 22px 22px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
        }

        .custom-date-wrapper .date-icon:hover {
            opacity: 1;
        }

        .custom-date-wrapper .date-icon:focus {
            outline: 2px solid #f0c76a;
            outline-offset: 2px;
            border-radius: 6px;
        }

        /* Text input should feel editable */
        .custom-date-wrapper input[type="text"] {
            cursor: text;
        }


        /* Give the input some room on the right for the icon */
        .custom-date-wrapper .lf-control,
        .custom-date-wrapper input[type="date"] {
            padding-right: 42px !important;
        }

/* === unnamed block 2 === */
        /* Hard override: keep labels flush-left inside the grid */

        .inputs-grid .label-button-2 {
            margin-left: 0 !important;
            padding-left: 0 !important;
            text-align: left !important;
        }

        /* Also neutralize the generic `.section label { margin-left:20px; }` for our headers */
        .section label.label-button-2 {
            margin-left: 0 !important;
        }

        /* Keep inputs aligned with labels */
        .inputs-grid .lf-control {
            margin-left: 0 !important;
            width: 100%;
            /* full cell width looks best with the new labels */
        }

/* === lf-unified-controls === */
        :root {
        }

        .lf-control-wrap {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        /* apply to inputs / textareas / selects */
        .lf-control {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            width: 100%;
            padding-left: 16px !important;
            /* adjust as desired (12–20px looks good) */

            border-radius: var(--ctrl-radius);
            border: 1px solid rgba(253, 169, 41, 0.65) !important;
            /* ← golden border */
            background:
                linear-gradient(180deg, var(--ctrl-bg1), var(--ctrl-bg2)),
                var(--ctrl-tint);
            color: var(--ctrl-fg);
            font-size: 16px;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
            outline: none;
            transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
            backdrop-filter: blur(3px);
            margin-bottom: 5px;
        }


        .lf-control:hover {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
                rgba(19, 65, 96, 0.42);
            border-color: var(--ctrl-border-hover);
        }

        .lf-control:focus {
            border-color: #FDA929;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 3px var(--ctrl-ring) !important;
        }

        .lf-control:disabled {
            opacity: var(--ctrl-disabled);
            cursor: not-allowed;
        }

        textarea.lf-control {
            border-radius: 14px;
            min-height: 110px;
            resize: vertical;
        }

        .lf-control::placeholder {
            color: #eaf2f7;
        }

        /* Select chevron + wrapper */
        .select-wrap {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        .select-wrap select.lf-control {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="%23FDA929"><path d="M7 10l5 5 5-5z"/></svg>');
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 18px 18px;
            cursor: pointer;

            padding: 1px 10px;
            /* ← vertical and horizontal padding */
            height: 32px;
            /* ← sets overall dropdown height */
            font-size: 15px;
            /* ← text size */
            width: 100%;
            /* ← or set a specific width, like 150px */
            background-position: right 16px center;
            /* move the chevron */
            background-size: 14px;
            /* shrink or enlarge the arrow icon */

        }

        /* Keep white text in CLOSED select after choice */
        .select-wrap select,
        select {
            color: #eaf2f7 !important;
            -webkit-text-fill-color: #eaf2f7 !important;
        }

        /* Dropdown menu readability + blue glass menu (used in Rehab) */
        select option,
        select optgroup,
        .select-wrap select option,
        .select-wrap select optgroup {
            color: #eaf2f7 !important;
            background-color: rgba(19, 65, 96, 0.90) !important;
        }

        select option:hover,
        select option:focus,
        select option:checked {
            color: #eaf2f7 !important;
            background-color: rgba(19, 65, 96, 0.96) !important;
        }

        select::-webkit-scrollbar {
            width: 12px;
        }

        select::-webkit-scrollbar-track {
            background: rgba(19, 65, 96, 0.70);
        }

        select::-webkit-scrollbar-thumb {
            background: rgba(19, 65, 96, 0.96);
            border-radius: 8px;
            border: 2px solid rgba(19, 65, 96, 0.70);
        }

        /* Autofill repaint neutralizer (so cookies/suggestions don’t turn fields white/yellow) */
        .lf-control,
        .select-wrap select.lf-control {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
                rgba(19, 65, 96, 0.35) !important;
        }

        .lf-control:-webkit-autofill,
        .lf-control:-webkit-autofill:hover,
        .lf-control:-webkit-autofill:focus,
        input:-webkit-autofill,
        input:-webkit-autofill:hover,
        input:-webkit-autofill:focus,
        select:-webkit-autofill {
            -webkit-text-fill-color: #eaf2f7 !important;
            caret-color: #eaf2f7 !important;
            background-color: transparent !important;
            background-image: none !important;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1000px rgba(19, 65, 96, 0.35) inset !important;
            -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1000px rgba(19, 65, 96, 0.35) inset !important;
            transition: background-color 99999s linear 0s, color 0s !important;
        }

/* === lf-golden-buttons === */
        /* Sticky "Print Report" button */
        .lf-sticky-btn {
            padding: 12px 18px;
            border-radius: 25px;
            border: 2px solid #f0c76a;
            color: #fff;
            background: linear-gradient(180deg, #fda929, #e08924);
            font-family: 'alfarn', serif;
            font-size: 14px;
            font-weight: 600;
            box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .18);
            cursor: pointer;
            transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
        }

        .lf-sticky-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 14px 28px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .22);
            filter: brightness(1.05);
        }

        .lf-sticky-btn:active {
            transform: translateY(0);
        }

        /* Mini chart styling for the PDF (used when we build the offscreen report HTML) */
        .lf-chart-bar {
            height: 12px;
            border-radius: 8px;
            background: linear-gradient(90deg, #fda929, #e3d28e);
            box-shadow: 0 2px 8px rgba(0, 0, 0, .25) inset;
        }

        .lf-chart-bar--secondary {
            background: linear-gradient(90deg, #45606F, #67889a);
        }

/* === unnamed block 5 === */
        /* === Selector INSIDE the existing input (no second box) === */
        .fuse-wrap {
            /* wrapper just for positioning */
            position: relative;
            width: 100%;
        }

        /* make room on the right INSIDE the input for the selector */
        .fuse-wrap .lf-control {
            padding-right: 0px;
            /* room for the unit selector */
        }

        /* gold divider at ~90% (unit area is 72px wide) */
        .fuse-wrap::after {
            content: "  ";
            position: absolute;
            right: 45px;
            /* matches the width of the symbol area */
            top: calc(50% - 19px);
            /* centers vertically inside the pill */
            height: 39px;
            /* shorter fixed height so it never bleeds out */
            width: 1px;
            background: rgba(253, 169, 41, 0.65);
            border-radius: 1px;
            pointer-events: none;
        }


        /* the selector sits on top of the input, INSIDE it */
        .unit-inside {
            position: absolute;
            right: 10px;
            padding-left: 30px;
            padding-right: 0px;
            margin-right: 0px;
            top: 5px;
            bottom: 5px;
            width: 60px;
            /* change to widen/narrow the unit area */
            display: flex;
            align-items: right;
            justify-content: right;
            font-weight: 700;
            font-size: 15px;
            /* big symbol like your sketch */
            color: transparent;
            background: transparent;
            border: 0;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            text-align-last: center;
            cursor: pointer;
        }

        /* hide native arrow on some browsers (keeps select accessible) */
        .unit-inside::-ms-expand {
            display: none;
        }


        /* remove up/down arrows for number fields */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type=number] {
            --moz-appearance: textfield;
        }

/* === unnamed block 6 === */
        /* === Inline left buttons inside inputs ================================ */
        .lf-with-left-btn {
            position: relative;
            width: 100%;
        }

        /* give space for the left triangle tab, but do NOT change height/size */
        .lf-with-left-btn .lf-control {
            box-sizing: border-box;
            /* padding doesn’t change the visual width */
            padding-left: 50px !important;
            /* room for the tab (adjust 48–56px if needed) */
            padding-right: 10px;
            padding-top: var(--ctrl-pad-y);
            padding-bottom: var(--ctrl-pad-y);
        }

        /* compact yellow tab INSIDE the input (immune to global button styles) */
        .lf-left-tab {
            all: unset;
            height: 42px;
            box-sizing: border-box;
            position: absolute;
            left: 0;
            top: 6px;
            bottom: 0;
            width: 43px !important;
            /* never stretch */
            z-index: 2;
            /* sit on top of input background */
            border: 1px solid rgba(253, 169, 41, .65);
            background: linear-gradient(180deg, #fda929, #e08924);
            border-top-left-radius: 90px;
            border-bottom-left-radius: 9px;
            border-top-right-radius: 1px;
            border-bottom-right-radius: 1px;
            box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 8px 18px rgba(0, 0, 0, .35);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
        }

        .lf-left-tab:hover {
            transform: translateY(-1px);
            filter: brightness(1.05);
        }

        .lf-left-tab:active {
            transform: none;
        }

        .lf-left-tab::before {
            content: "";
            width: 0;
            height: 0;
            border-left: 14px solid #fff;
            /* white triangle */
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            transform: translateX(2px);
        }



        /* keep your old orange header-pills but hide them (we’ll click them via JS) */
        .label-button {
            display: inline-block !important;
            margin-bottom: 6px;
            padding: 5px 10px;
            border-radius: 20px;
            border: 1px solid #f0c76a;
            color: white;
            background: linear-gradient(180deg, #fda929, #e08924);
            font-family: 'alfarn', serif;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            text-align: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .18);
        }


        /* uniform sizing everywhere */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

/* === unnamed block 7 === */
        /* === Floating action stack (top-right) =============================== */
        /* === Bottom action row (under calculator) ============================ */
        /* === Floating action stack (top-right) =============================== */
        /* === Bottom action row (under left calculator column) ================ */
        /* === Bottom action row (locked under left column) ==================== */
        .side-actions {
            /* take it out of normal flow so right column changes won't push it */
            position: absolute;
            left: 0;
            bottom: 16px;
            /* sits just under the left card's shadow */
            /* width of the left column (2fr of 2fr+1fr) minus the 24px column gap */
            width: calc((100% - 24px) * 2 / 3);

            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            gap: 5px;
        }

        .side-actions .lf-sticky-btn {
            width: auto;
        }

        .side-actions .custom-date-wrapper {
            width: auto;
        }

        .side-actions .custom-date-wrapper input[type="text"] {
            width: auto;
            min-width: 180px;
        }

        /* Mobile: revert to normal flow and full width */
        @media (max-width: 980px) {
            .calculator-container {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "left"
                    "right";
                padding-bottom: 0;
                /* no absolute controls on mobile */
            }

            .side-actions {
                justify-content: center;
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                margin-top: 1px;
            }
        }

/* === unnamed block 8 === */
        /* Start Date polish in the side-actions stack */
        .side-actions .custom-date-wrapper {
            position: relative;
            width: 100%;
        }

        .side-actions .custom-date-wrapper .lf-control {
            width: 100%;
            padding: 10px 5px;
            padding-right: 42px !important;
            /* space for the calendar icon */
            box-sizing: border-box;
            /* padding won’t change size */
        }

        /* Keep the native calendar icon inside the pill and aligned */
        .side-actions input[type="date"]::-webkit-calendar-picker-indicator {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            opacity: .9;
            filter: invert(1) brightness(1.2);
            cursor: pointer;
            margin: 0;
        }

        /* Remove any square/yellow focus border on select/date */
        .side-actions input[type="date"]:focus {
            border-color: transparent !important;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 3px var(--ctrl-ring) !important;
            outline: none;
        }

        .side-actions .lf-sticky-btn {
            width: 100%;
        }

/* === unnamed block 9 === */
        /* Sticky Download button (bottom-right) */
        .download-fab {
            position: fixed;
            right: 24px;
            bottom: 24px;
            z-index: 1000;
        }

        @media (max-width: 980px) {
            .download-fab {
                right: 12px;
                bottom: 12px;
            }
        }


        #amortizationTableContainer {
            scroll-margin-top: 160px;
            /* adjust to match sticky results height */
        }

        /* ============================================================
           2C-G — Responsive: tablet & mobile
           All rules below are additive max-width overrides.
           Desktop rules above this block are untouched.
           ============================================================ */

        /* --- 768px: amortization table horizontal scroll --- */
        @media (max-width: 768px) {

            /* Wrap the amortization table container in a horizontal scroll.
               The table has JS-generated inline widths (5%, 4%, 11%, 20%×4).
               display:block was removed (see 600px fix above) because it produced
               unlabelled cells. Scroll keeps the table intact and readable. */
            #amortizationTableContainer {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                border-radius: 16px;
            }

            /* Ensure both amortization tables have a readable minimum width */
            #amortizationTable,
            #tableTotals {
                min-width: 480px;
            }

            /* Reduce amortization cell padding on phone to compact the scroll width */
            #amortizationTable th,
            #amortizationTable td,
            #tableTotals th,
            #tableTotals td {
                padding: 5px 4px;
                font-size: .75rem;
            }

            /* Results panels: tighter padding on phone */
            .results-panel {
                padding: 10px 12px;
            }
        }

        /* --- 480px: section padding + title scale --- */
        @media (max-width: 480px) {

            /* Body/main padding on small phones */
            body {
                padding: 10px;
            }

            /* Section heading scale */
            .section h2,
            h3 {
                font-size: 1rem;
            }

            /* Amortization title scale */
            .amortizationTitle {
                font-size: 18px;
            }
        }
