/*
 * rental.css — Fusion Calculator
 * Extracted from rental.html (batch-29e1-css-extraction-rental)
 * Source: 2 inline <style> blocks merged in document order
 *   Block 1 (unnamed):            original lines 18–2923
 *   Block 2 (lf-input-typography): original lines 2925–2939
 * Do not add shared/global rules here — page-specific styles only.
 */
        * {
            box-sizing: border-box;
            /* font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; */
        }

        body {
            margin: 0;
            padding: 20px 20px 20px;
            background: linear-gradient(to bottom right, #134160, #586C75, #134160, #586C75) no-repeat fixed;
            background-size: cover;
        }

        html::-webkit-scrollbar,
        body::-webkit-scrollbar {
            width: 0;
            height: 0;
            background: transparent;
        }

        html,
        body {
            -ms-overflow-style: none;
            scrollbar-width: none;
            scrollbar-color: transparent transparent;
        }

        h1,
        h2,
        h3,
        h4 {
            margin-top: 0px;
            margin-bottom: 10px;
            font-family: "alfarn", serif;
            letter-spacing: 1.5px;
            text-align: center;
            color: #FDA929;
        }

        h2 {
            font-size: 18px;
        }

        h1 {
            font-family: 'alfarn', serif;
            text-align: center;
            color: #FDA929;
            letter-spacing: 1.5px;
            font-weight: 700;
            margin: 40px 0;
        }

        /* Make page title align to the same max width as the 3-panel grid */
        .rf-page-title {
            width: 100%;
            max-width: var(--rf-max-w);
            /* match .rf-grid and .rf-results-cta */
            margin: 40px auto;
            /* same vertical spacing, centered block */
            padding: 0 10px;
            /* small gutter so it never touches edges */
            text-align: center;
        }

        :root {
            --rf-max-w: 1300px;
            /* match .lf-results-panel width for uniform alignment */
            --muted: #BFD0D8;
            --lf-chart-h: 320px;
            --lf-chart-panel-h: clamp(340px, 34vw, 380px);
            --lf-focus-ring: rgba(253, 169, 41, .35);
            /* --lf-help-font: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; */
            --lf-help-font: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
            --lf-tooltip-arrow: 6px;
            --lf-tooltip-bg: #2B4A5E;
            --lf-tooltip-fg: #F2F2F2;
            --lf-tooltip-gap: 8px;
            --lf-tooltip-max-w: 520px;
            --lf-tooltip-min-w: 220px;
            --lf-tooltip-pad-x: 10px;
            --lf-tooltip-pad-y: 10px;
            --lf-tooltip-radius: 10px;
            --lf-tooltip-shadow: 0 10px 20px rgba(0, 0, 0, .35);
        }

        input::selection,
        textarea::selection {
            color: #fff;
            background: rgba(253, 169, 41, .35);
        }



        /* === Layout Global ============================================ */

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

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

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

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

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

        .main-content {
            flex: 1;
            padding: 20px;
        }

        form {
            max-width: 1000px;
            margin: 20px auto;
        }

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

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

        table {
            width: 100%;
            margin-top: 0px;
            border-collapse: collapse;
        }

        tbody {
            margin-top: 0px;
        }

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

        .container {
            display: flex;
            overflow-x: visible;
            overflow-y: visible;
            /* Option A: use page scroll to avoid overlap */
            flex-direction: column;
            align-items: stretch;
            gap: 10px;
            max-width: var(--rf-max-w);
            min-height: 100vh;
            margin: 10px auto 0;
        }

        .input-section {
            position: relative;
            display: flex;
            overflow: visible;
            flex-direction: column;
            width: 100%;
            max-width: var(--rf-max-w);
            max-height: none;
            /* Option A: let section grow and push results down */
            margin: 0 auto;
            padding-top: 0px;
            font-family: inherit;
            color: #fff;
            background: transparent;
        }

        .full-width {
            flex-basis: 100%;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .nav-button {
            border: none;
            font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
            font-size: 25px;
            cursor: pointer;
        }

        .nav-icon-circle {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 100px;
            height: 44px;
            padding: 0;
            border-radius: 25px;
            color: #fff;
            background: linear-gradient(180deg, #fda929, #e08924);
            box-shadow: 0 14px 28px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .22);
            transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
            cursor: pointer;
        }

        .nav-icon-circle i {
            font-size: 22px;
            line-height: 1;
        }

        .nav-icon-circle:hover {
            transform: translateY(-2px);
        }

        .nav-icon-circle:active {
            transform: scale(1.02);
        }

        .nav-icon-circle:focus-visible {
            outline: 3px solid rgba(253, 169, 41, .55);
            outline-offset: 3px;
        }

        .nav-icon-circle--placeholder {
            visibility: hidden;
            pointer-events: none;
        }

        .nav-button-horizontal {
            width: 50%;
            margin-top: 20px;
            padding: 15px;
            border: none;
            border-radius: 25px;
            font-family: sans-serif;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.3s ease;
            cursor: pointer;
        }

        .nav-button-horizontal:hover {
            background-color: #2980b9;
        }

        .form-grid {
            display: grid;
            gap: 10px 24px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .form-grid .form-group {
            margin: 0;
        }

        .form-grid .full-row {
            grid-column: 1 / -1;
        }

        nav,
        .navbar,
        .menu,
        .tabs,
        .tab-nav,
        .topnav,
        #tabs {
            display: none !important;
        }

        .top-bar {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
        }

        .top-bar .timeline {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
        }

        .top-bar #openModalButton {
            position: absolute;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
        }



        /* === Componentes ============================================ */

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

        .calculator-title {
            text-shadow: 0px 7px 5px rgb(0, 0, 0), 0 0 20px rgb(255, 255, 255), 0px 0px 5px rgb(0, 0, 0);
        }

        .timeline {
            position: relative;
            display: flex;
            justify-content: space-evenly;
            align-items: center;
            width: 100%;
            max-width: 900px;
            margin: 0px auto 0;
            padding: 0 10px 30px;
            background: transparent;
        }

        .timeline::before {
            position: absolute;
            top: 30px;
            right: 0;
            left: 0;
            z-index: 0;
            width: 100%;
            max-width: 800px;
            height: 2px;
            margin: 0 auto;
            background-color: #e9e2d862;
            content: "";
        }

        .timeline-line {
            position: relative;
            flex-grow: 5;
            width: 3px;
            background-color: #e9e2d862;
        }

        .timeline-circle {
            position: relative;
            z-index: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 50px;
            height: 50px;
            margin: 6px 0;
            border: 2px solid white;
            border-radius: 50%;
            font-family: "alfarn", serif;
            font-size: 22px;
            color: rgba(255, 255, 255, 0.9);
            background-color: #2B4A5E;
            transition: transform 0.2s ease, background-color 0.2s ease;
            cursor: pointer;
        }

        .timeline-circle.active {
            background-color: #FF9900;
        }

        .timeline-circle:hover {
            transform: scale(1.1);
        }

        .timeline-label {
            position: absolute;
            top: 56px;
            left: 50%;
            width: max-content;
            max-width: 160px;
            font-family: "alfarn";
            font-size: 16px;
            font-weight: 600;
            text-align: center;
            white-space: nowrap;
            color: #FDA929;
            transform: translateX(-50%);
            pointer-events: none;
        }

        .timeline-circle.active .timeline-label {
            font-weight: 800;
            color: #FF9900;
        }

        .timeline-circle:not(.active) .timeline-label {
            opacity: 0.8;
        }

        .stage {
            position: relative;
            width: 100%;
            margin: 0 6px 16px;
            padding: 20px 20px 10px;
            border-radius: 16px;
            background: transparent;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 1);
        }

        .stage::before {
            position: absolute;
            inset: 0;
            border-radius: 16px;
            pointer-events: none;
            content: "";
        }

        .stage h2 {
            margin-top: 10px;
            margin-bottom: 5px;
            font-family: "alfarn";
            letter-spacing: 1px;
            text-align: center;
            color: #FDA929;
        }

        .income-expenses-grid {
            display: grid;
            gap: 10px;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        }

        label {
            position: relative;
            display: inline-block;
            margin-bottom: 6px;
            font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
            font-size: 15px;
            font-weight: bold;
            color: #fff;
        }

        /* Unified control styling (1:1 with Fix & Flip .lf-control) */
        .lf-control {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            width: 100%;
            padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
            border-radius: var(--ctrl-radius);
            border: 1px solid var(--ctrl-border);
            background:
                linear-gradient(180deg, var(--ctrl-bg1), var(--ctrl-bg2)),
                var(--ctrl-tint);
            color: var(--ctrl-fg);
            font-size: 16px;
            outline: none;
            transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
            backdrop-filter: blur(3px);
            box-sizing: border-box;
        }

        .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::placeholder {
            color: #9fb2be;
        }

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


        .pieChartExpensesItems {
            flex: 0 0 25%;
            min-width: 250px;
            padding: 10px;
            border-radius: 5px;
            font-size: small;
            color: white;
            background-color: transparent;
        }

        canvas {
            filter: drop-shadow(0px 5px 20px rgb(0, 0, 0));
        }

        .hidden {
            display: none;
        }

        .stage-buttons {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            width: 100%;
            max-width: 1000px;
            margin-top: 14px;
        }

        .prev-button {
            margin: 10px;
            padding: 0;
            border: none;
            text-decoration: underline;
            text-decoration-thickness: 1.5px;
            text-underline-offset: 3px;
            color: #FDA929;
            background: transparent !important;
        }

        .prev-button:hover {
            color: white;
        }

        .next-button {
            width: 800px;
            height: 40px;
            margin: 10px;
            padding: 10px;
            border: none;
            border-radius: 25px;
            font-family: "alfarn", serif;
            font-size: 14px;
            font-weight: 700;
            color: #fff;
            background: linear-gradient(180deg, #fda929, #e08924);
            background-color: #FDA929;
            box-shadow: 0 14px 28px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .22);
            transition: background-color .2s ease, transform .06s ease;
            cursor: pointer;
        }

        .next-button:hover {
            background-color: #fda929;
            transform: translateY(-1px);
        }

        .next-button:active {
            transform: translateY(1px);
        }

        .prev-button-horizontal {
            width: 15%;
            margin: 3%;
            padding: 5px;
            border: none;
            border-radius: 25px;
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.3s ease;
            cursor: pointer;
        }

        .prev-button-horizontal:hover {
            background-color: #327a8c;
        }

        .next-button-horizontal {
            width: 15%;
            margin: 3%;
            padding: 5px;
            border: none;
            border-radius: 25px;
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.3s ease;
            cursor: pointer;
        }

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

        .primary-cta {
            position: sticky;
            bottom: 18px;
            z-index: 5;
            align-self: flex-start;
            margin-top: 12px;
            margin-left: 4px;
        }

        #openModalButton {
            width: 800px;
            padding: 12px 18px;
            border: none;
            border-radius: 24px;
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            font-size: 15px;
            font-weight: 700;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.25s ease, transform 0.06s ease;
            cursor: pointer;
        }

        #openModalButton:hover {
            background-color: #e08924;
        }

        #openModalButton:active {
            transform: translateY(1px);
        }

        #openModalButton2 {
            width: 25%;
            margin: 3%;
            padding: 5px;
            border: none;
            border-radius: 25px;
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.3s ease;
            cursor: pointer;
        }

        #openModalButton2:hover {
            background-color: #e08924;
        }

        .modal {
            position: fixed;
            inset: 0;
            top: 0;
            left: 0;
            z-index: 1000;
            display: none;
            overflow: auto;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
        }

        #resultModal {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 100;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
        }

        .modal-content {
            position: relative;
            z-index: 1;
            overflow: auto;
            overflow-y: auto;
            width: 100%;
            max-width: 60%;
            max-height: 85vh;
            margin: 3% auto;
            padding: 20px;
            padding-bottom: 5px;
            border: 1px solid #FDA929;
            border-radius: 15px;
            text-align: center;
            color: black;
            background-color: #2b4a5e;
            box-shadow: 0 0 12px 4px #FDA929;
            -webkit-overflow-scrolling: touch;
        }

        .close {
            float: right;
            font-size: 24px;
            font-weight: bold;
            color: white;
            cursor: pointer;
        }

        .horizontal-timeline {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 20px;
            margin-bottom: 15px;
            padding: 0 10px;
            background-color: transparent;
        }

        .horizontal-timeline::before {
            position: absolute;
            top: 30px;
            right: 10%;
            left: 10%;
            z-index: 1;
            height: 2px;
            background-color: #e9e2d862;
            content: "";
        }

        .timeline-item {
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 25%;
            text-align: center;
            cursor: pointer;
        }

        .timeline-dot {
            position: relative;
            z-index: 1;
            display: flex;
            align-items: center;
            width: 40px;
            height: 40px;
            margin: 10px 0;
            margin-bottom: 5px;
            border: 2px solid white;
            border-radius: 50%;
            color: white;
            background-color: #2B4A5E;
            box-shadow: 0px 0px 20px rgb(0, 0, 0);
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .horizontal-timeline-label {
            font-size: 14px;
            color: white;
            transition: color 0.3s ease;
        }

        .timeline-item.active .timeline-dot {
            border-color: white;
            background-color: #FDA929;
        }

        .timeline-dot:hover {
            transform: scale(1.1);
        }

        .timeline-item.active .timeline-label {
            font-weight: bold;
            color: #4CAF50;
        }

        .missed-result {
            color: red;
        }

        .correct-result {
            color: green;
        }

        .new-input {
            box-sizing: border-box;
            width: 100%;
            padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
            border: 1px solid var(--ctrl-border);
            border-radius: var(--ctrl-radius);
            outline: none;
            font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
            font-size: 16px;
            color: var(--ctrl-fg);
            background: linear-gradient(180deg, var(--ctrl-bg1), var(--ctrl-bg2)),
                var(--ctrl-tint);
            backdrop-filter: blur(3px);
            transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
            -webkit-appearance: none;
            appearance: none;
        }

        .reveal-button {
            display: inline-block;
            margin: 4px;
            padding: 6px 12px;
            border: 1px solid #ccc;
            border-radius: 6px;
            font-size: 14px;
            color: #333;
            background-color: #f0f4f8;
            transition: background-color 0.2s ease;
            cursor: pointer;
        }

        .reveal-button:hover {
            border-color: #999;
            background-color: #e0e6ed;
        }

        .reveal-button:active {
            background-color: #d3dce6;
        }

        select#utilitiesMode option {
            color: var(--ctrl-fg);
            background: #2B4A5E;
        }

        button#addCustomRehab,
        button#addCustomUtility {
            display: inline-block;
            margin-top: 10px;
            padding: 10px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.2s;
            cursor: pointer;
        }

        button#addCustomRehab:hover,
        button#addCustomUtility:hover {
            background-color: #fda829ae;
        }

        button#addCustomRehab:active,
        button#addCustomUtility:active {
            background-color: #FDA929;
        }

        .horizontal-timeline .timeline-item.active .horizontal-timeline-label {
            font-weight: bold;
            color: #4CAF50;
        }

        #utilityButtons button {
            margin: 6px 8px 0 0;
            padding: 8px 14px;
            border: 1px solid var(--ctrl-border);
            border-radius: 999px;
            font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
            font-size: 14px;
            color: var(--ctrl-fg);
            background: linear-gradient(180deg, var(--ctrl-bg1), var(--ctrl-bg2)),
                var(--ctrl-tint);
            backdrop-filter: blur(3px);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
            transition: border-color .18s ease, box-shadow .18s ease, transform .06s ease, background .18s ease;
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
        }

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

        #utilityButtons button:active {
            transform: translateY(1px);
        }

        #utilityInputs button {
            padding: 6px 12px;
            border: 1px solid var(--ctrl-border);
            border-radius: 999px;
            color: var(--ctrl-fg);
            background: rgba(255, 255, 255, 0.06);
            cursor: pointer;
        }

        #utilityInputs button:hover {
            border-color: var(--ctrl-border-hover);
            background: rgba(255, 255, 255, 0.10);
        }

        #utilitiesItemizedWrapper button:-webkit-autofill {
            -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
            -webkit-text-fill-color: var(--ctrl-fg) !important;
        }

        input:-webkit-autofill,
        input:-webkit-autofill:hover,
        input:-webkit-autofill:focus,
        textarea:-webkit-autofill,
        select:-webkit-autofill {
            background-color: transparent !important;
            transition: background-color 99999s ease-in-out 0s;
            -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
            -webkit-text-fill-color: var(--ctrl-fg) !important;
            caret-color: var(--ctrl-fg);
        }

        input:-moz-autofill,
        textarea:-moz-autofill,
        select:-moz-autofill {
            color: var(--ctrl-fg) !important;
            background-color: transparent !important;
            box-shadow: 0 0 0 1000px transparent inset !important;
            -moz-appearance: none;
        }

        input,
        select,
        textarea {
            background-color: transparent !important;
            box-shadow: inset 0 0 0 1000px transparent !important;
            -webkit-background-clip: padding-box;
            background-clip: padding-box;
            -webkit-box-shadow: inset 0 0 0 1000px transparent !important;
        }

        input:autofill,
        textarea:autofill,
        select:autofill {
            color: var(--ctrl-fg) !important;
            background-color: transparent !important;
            box-shadow: 0 0 0 1000px transparent inset !important;
        }

        .expenses-legend-row {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            gap: 6px 10px;
            font-size: 12px;
            line-height: 1.3;
            color: #fff;
        }

        .expenses-legend-row .legend-title {
            font-size: 12px;
            letter-spacing: 0.2px;
            color: #f2f2f2;
            opacity: 0.8;
        }

        .expenses-legend-row .legend-total {
            font-size: 12px;
            color: #f2f2f2;
            opacity: 0.8;
        }

        .expenses-legend-row .legend-breakdown {
            font-size: 12px;
            opacity: 0.8;
        }

        .no-scroll {
            overflow: hidden !important;
        }

        .modal:not(.hidden) {
            display: flex;
        }

        .modal-overlay {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, .55);
        }

        .modal.hidden {
            display: none !important;
        }

        /* --- Animations -------------------------------------------------------------- */

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes lfSlideUpFade {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }



        /* === Dashboard de Resultados ============================================ */

        .results-section {
            overflow-y: auto;
            width: 100%;
            padding: 20px;
            border-radius: 8px;
            font-family: "Trebuchet MS", sans-serif;
            font-size: 16px;
            background: transparent;
            background-color: transparent;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 1);
        }

        .results-row {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 20px;
        }

        .result-category {
            flex: 1;
            min-width: 250px;
            padding: 5px;
            padding-right: 20px;
            padding-bottom: 3px;
            padding-left: 20px;
            border-radius: 5px;
            font-size: 14px;
            color: #134160;
            background-color: #f9f9f9;
        }

        .result-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding: 5px 0;
            border-bottom: 1px solid #eee;
        }

        .metrics-graph-container-projection-inv-analysis {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            gap: 20px;
            max-width: 1000px;
            background-color: transparent;
        }

        .metrics-graph-container-projection {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
            max-width: 1000px;
            max-height: 300px;
            background-color: transparent;
        }

        .metrics-box-projection {
            flex: 30%;
            border-radius: 25px;
            color: white;
            background-color: transparent;
        }

        .chart-container-projection {
            flex: 50%;
            min-width: 250px;
            padding: 10px;
            border-radius: 5px;
            background-color: #f9f9f9;
        }

        .metrics-graph-container {
            display: grid;
            justify-content: space-between;
            align-items: center;
            grid-gap: 1em;
            grid-template-columns: 50% 50%;
            grid-template-rows: 100%;
            max-width: 1000px;
            max-height: 200px;
            background-color: transparent;
        }

        .metrics-graph-container-expenses {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: flex-start;
            gap: 15px;
            width: 100%;
            max-width: 1000px;
            background-color: transparent;
        }

        .metrics-box {
            flex: 0 0 30%;
            border-radius: 25px;
            color: white;
            background-color: transparent;
        }

        .result-item-pie-chart {
            display: flex;
            justify-content: space-between;
            margin-bottom: 3px;
            padding: 5px 0;
            border-bottom: 1px solid #eee;
            font-size: smaller;
        }

        .chart-container {
            display: flex;
            flex: 0 0 35%;
            justify-content: center;
            align-items: center;
            width: 100%;
            max-height: 300px;
            background: transparent;
        }

        .metrics-box h2 {
            color: #FDA929;
        }

        .open-results-btn {
            min-width: 170px;
        }

        .result-section {
            display: none;
            margin-right: 30px;
            margin-bottom: 15px;
            margin-left: 30px;
            padding-right: 30px;
            padding-left: 30px;
            border-radius: 5px;
            font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
            font-size: 16px;
            font-weight: bold;
            color: #134160;
            background-color: transparent;
        }

        #section3.result-section {
            display: none;
            border-radius: 5px;
            font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
            font-size: 16px;
            font-weight: bold;
            color: #134160;
            background-color: transparent;
        }

        #section3.result-section.active {
            display: flex;
            flex-direction: column;
            align-items: center;
            animation: fadeIn 0.5s ease-in-out;
        }

        .result-section.active {
            display: block;
            animation: fadeIn 0.5s ease-in-out;
        }

        .fixed-result-category {
            display: grid;
            justify-items: center;
            align-items: center;
            grid-gap: 3em;
            grid-template-areas: "total-costs item1 item2 item3 item4";
            grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
            grid-template-rows: 100px;
            border-radius: 8px;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
            font-size: 16px;
            font-weight: bold;
            color: white;
            background-color: transparent;
        }

        #fixed-monthly-cash-flow {
            grid-area: total-costs;
        }

        #item1-fixed-result {
            grid-area: item1;
        }

        #item2-fixed-result {
            grid-area: item2;
        }

        #item3-fixed-result {
            grid-area: item3;
        }

        #section1 .metrics-box-projection {
            width: 100%;
            max-width: 1000px;
        }

        .lf-expenses-body {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
        }

        .lf-dash-card[data-target="section3"] .chart-container.lf-expenses-panel {
            display: flex !important;
            flex: 1 1 auto;
            flex-direction: column !important;
            justify-content: flex-start;
            align-items: stretch;
            height: var(--lf-chart-panel-h) !important;
            min-height: 320px;
            max-height: none !important;
        }

        .lf-expenses-chart {
            width: 100%;
            max-width: 100%;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-canvas-wrap {
            display: flex;
            flex: 1 1 auto !important;
            justify-content: center;
            align-items: center;
            min-height: 0;
            padding: 10px;
        }

        .lf-expenses-chart canvas {
            width: 100% !important;
            height: 100% !important;
        }

        .lf-expenses-legend--footer {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
            padding: 0 10px;
        }

        .lf-sticky-btn {
            position: fixed;
            right: 22px;
            bottom: 22px;
            z-index: 1000;
            padding: 12px 18px;
            border: 2px solid #f0c76a;
            border-radius: 25px;
            font-family: "alfarn", serif;
            font-size: 14px;
            font-weight: 600;
            color: #fff;
            background: linear-gradient(180deg, #fda929, #e08924);
            box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .18);
            transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
            cursor: pointer;
        }

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

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

        .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);
        }

        .lf-inline-results {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            animation: none;
        }

        .lf-inline-results__header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }

        .lf-inline-results__title {
            margin: 0;
            font-size: 20px;
            font-weight: 700;
            color: #fff;
        }

        .lf-inline-results__actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .lf-inline-results__btn {
            padding: 10px 14px;
            border: none;
            border-radius: 22px;
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            font-size: 13px;
            font-weight: 700;
            color: #fff;
            background-color: #FDA929;
            transition: background-color 0.25s ease, transform 0.06s ease;
            cursor: pointer;
        }

        .lf-inline-results__btn:hover {
            background-color: #e08924;
        }

        .lf-inline-results__btn:active {
            transform: translateY(1px);
        }

        .lf-inline-results__close {
            border: none;
            font-size: 26px;
            font-weight: 900;
            line-height: 1;
            color: #fff;
            background: transparent;
            cursor: pointer;
        }

        .results-container {
            display: grid;
            gap: 15px;
            grid-template-columns: repeat(2, 1fr);
        }

        .result-card {
            padding: 15px;
            border: 1px solid #f0c76a;
            border-radius: 8px;
            background-color: #2b4a5e;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
        }

        .result-card h3 {
            margin-top: 0;
            padding-bottom: 5px;
            border-bottom: 1px solid #f0c76a;
            font-size: 18px;
            color: #f0c76a;
        }

        .result-card ul {
            margin: 0;
            padding-left: 0;
            list-style-type: none;
        }

        .result-card li {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid rgba(240, 199, 106, 0.15);
            font-size: 14px;
            color: #fff;
        }

        .result-card li:last-child {
            border-bottom: none;
        }

        .result-card li span:last-child {
            font-weight: bold;
        }

        .lf-results-panel {
            max-width: 1300px;
            margin: 18px auto 44px;
            padding: 18px 18px 22px;
            border-radius: 12px;
        }

        .lf-results-panel__header {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }

        .lf-results-panel__title {
            width: 100%;
            margin: 0;
            font-size: 22px;
            letter-spacing: .2px;
            text-align: center;
            text-shadow: 0px 7px 5px rgb(0, 0, 0), 0 0 20px rgb(255, 255, 255), 0px 0px 5px rgb(0, 0, 0);
            color: #ffffff;
        }

        .lf-results-panel__header .lf-inline-results__close {
            position: absolute;
            top: 50%;
            right: 10px;
            transform: translateY(-50%);
        }

        .lf-results-panel .result-section {
            display: block !important;
            margin: 0;
            padding: 0;
            background: transparent;
            animation: none;
        }

        .lf-results-panels {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .lf-results-card {
            padding: 15px;
            border-radius: 8px;
        }

        .lf-results-card h3 {
            margin-top: 0;
            padding-bottom: 5px;
            border-bottom: 1px solid rgba(240, 199, 106, 0.40);
            color: #f0c76a;
        }

        .lf-result-panel.lf-results-card {
            overflow: hidden;
            padding: 0;
        }

        .lf-panel__head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            width: 100%;
            padding: 14px 16px;
            border: 0;
            color: #f0c76a;
            background: transparent;
            cursor: pointer;
        }

        .lf-panel__head:focus-visible {
            border-radius: 10px;
            outline: 2px solid rgba(240, 199, 106, 0.65);
            outline-offset: 3px;
        }

        .lf-panel__title {
            font-family: "alfarn", serif;
            font-size: 16px;
            letter-spacing: .5px;
        }

        .lf-panel__chev {
            font-size: 14px;
            opacity: .9;
            transition: transform .2s ease;
        }

        .lf-result-panel.is-open .lf-panel__chev {
            transform: rotate(180deg);
        }

        .lf-panel__body {
            overflow: hidden;
            max-height: 0;
            padding: 0;
            opacity: 0;
            transition: max-height .25s ease, opacity .2s ease;
        }

        .lf-result-panel.is-open .lf-panel__body {
            max-height: 3000px;
            opacity: 1;
        }

        .lf-result-panel[data-target="fixed-results"] .lf-panel__head {
            display: flex;
            justify-content: center;
            text-align: center;
            cursor: default;
            pointer-events: none;
        }

        .lf-result-panel[data-target="fixed-results"] .lf-panel__chev {
            display: none;
        }

        .lf-result-panel[data-target="fixed-results"] .lf-panel__body {
            overflow: visible;
            max-height: none;
            opacity: 1;
        }

        .lf-result-panel .result-section {
            padding: 0;
            border: 0;
            background: transparent;
            box-shadow: none;
        }

        .lf-result-panel h3 {
            margin-top: 0;
            padding-bottom: 5px;
            border-bottom: 1px solid rgba(240, 199, 106, 0.40);
            color: #f0c76a;
        }

        .lf-fixed-results .fixed-result-category {
            display: grid;
            justify-content: center;
            justify-items: stretch !important;
            align-items: stretch;
            gap: 12px;
            grid-auto-flow: row;
            grid-auto-rows: auto;
            grid-template-areas: none !important;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            grid-template-rows: auto !important;
            margin: 8px 0 0;
        }

        .lf-fixed-results .kpi-card {
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            justify-self: stretch !important;
            align-items: center;
            align-self: stretch !important;
            box-sizing: border-box;
            width: auto !important;
            height: auto !important;
            min-height: 76px;
            padding: 8px 10px;
            border: 1px solid rgba(255, 255, 255, .22);
            border-radius: 14px;
            text-align: center;
            background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06));
            backdrop-filter: blur(8px);
        }

        .lf-fixed-results .kpi-card::before {
            position: absolute;
            inset: 0;
            border-radius: 16px;
            box-shadow: 0 0 0 1px rgba(253, 169, 41, .35), 0 0 22px rgba(253, 169, 41, .15) inset;
            pointer-events: none;
            content: "";
        }

        .lf-fixed-results .kpi-label {
            display: -webkit-box;
            overflow: hidden;
            max-width: 100%;
            font-family: "alfarn", serif;
            font-size: clamp(10px, 0.85vw, 12px);
            line-height: 1.15;
            letter-spacing: .4px;
            color: #FDA929;
            opacity: .95;
            -webkit-box-orient: vertical;
        }

        .lf-fixed-results .kpi-value {
            margin-top: 6px;
            font-size: 16px;
            font-weight: 800;
            text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
            color: #fff;
        }

        .lf-fixed-results .kpi-card .kpi-value {
            margin-top: 4px;
            font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif !important;
            font-size: clamp(14px, 1.25vw, 18px);
            line-height: 1;
        }

        .lf-results-card--span2 {
            grid-column: span 2;
        }

        .lf-results-panel canvas {
            max-width: 100%;
        }

        .lf-results-dashboard {
            display: block;
            margin-top: 14px;
            padding: 18px;
            border: 2px solid rgba(253, 169, 41, 0.65);
            border-radius: 18px;
            background: rgba(43, 74, 94, 0.35);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 32px rgba(253, 169, 41, 0.18);
        }

        .lf-quadrant-grid {
            display: grid;
            gap: 14px;
            grid-template-columns: 1fr;
        }

        .lf-quadrant {
            display: flex;
            flex-direction: column;
        }

        .lf-dash-card {
            padding: 10px;
            border-radius: 16px;
        }

        .lf-dash-card__header {
            margin-bottom: 10px;
            text-align: center;
        }

        .lf-dash-card__title {
            margin: 0;
            font-family: "alfarn", serif;
            font-size: 18px;
            font-weight: 600;
            letter-spacing: .6px;
            color: #FDA929;
        }

        .lf-results-dashboard .result-category>h3 {
            display: none;
        }

        .lf-results-dashboard .result-category {
            padding: 12px 2px;
            border-radius: 14px;
            color: #fff;
            background: transparent;
        }

        .lf-results-dashboard .result-item,
        .lf-results-dashboard .result-item-pie-chart {
            border-bottom: 1px solid rgba(255, 255, 255, .10);
        }

        .lf-results-dashboard .result-item span:first-child {
            color: rgba(255, 255, 255, .86);
        }

        .lf-results-dashboard .chart-container-projection {
            padding: 12px;
            border: 1px solid rgba(255, 255, 255, .14);
            border-radius: 14px;
            background: transparent;
        }

        .lf-results-dashboard .chart-container {
            padding: 10px;
            border: 1px solid rgba(255, 255, 255, .12);
            border-radius: 14px;
        }

        .lf-results-dashboard .metrics-graph-container,
        .lf-results-dashboard .metrics-graph-container-projection,
        .lf-results-dashboard .metrics-graph-container-expenses {
            max-width: none;
            max-height: none;
        }

        .lf-dash-card[data-target="section1"] .metrics-graph-container {
            display: block;
            max-height: none;
        }

        .lf-dash-card[data-target="section1"] .lf-income-hero {
            margin: 0 0 12px;
            padding: 14px 16px;
            border: 1px solid rgba(253, 169, 41, 0.55);
            border-radius: 18px;
            text-align: center;
            background: rgba(255, 255, 255, 0.06);
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25), 0 0 28px rgba(253, 169, 41, 0.14);
        }

        .lf-dash-card[data-target="section1"] .lf-income-hero__label {
            font-family: "alfarn", serif;
            font-size: 18px;
            font-weight: 600;
            letter-spacing: .6px;
            color: #FDA929;
        }

        .lf-dash-card[data-target="section1"] .lf-income-hero__value {
            margin-top: 6px;
            font-size: 34px;
            font-weight: 900;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
            color: #fff;
        }

        .lf-dash-card[data-target="section1"] .result-category {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            border-radius: 16px;
        }

        .lf-dash-card[data-target="section1"] .result-item {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 10px;
            min-height: 128px;
            margin: 0;
            padding: 10px 10px;
            border: 1px solid rgba(253, 169, 41, 0.8);
            border-radius: 14px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.10));
        }

        .lf-dash-card[data-target="section1"] .result-item span:first-child {
            font-size: clamp(10px, 0.85vw, 12px);
            font-weight: 600;
            line-height: 1.15;
            letter-spacing: .4px;
            text-align: center;
            color: #FDA929;
        }

        .lf-dash-card[data-target="section1"] .result-item span:last-child {
            font-size: 22px;
            font-weight: 800;
            line-height: 1;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
            color: #fff;
        }

        .lf-dash-card[data-target="section1"] .result-item__periods {
            display: grid;
            gap: 2px;
            grid-template-columns: 1fr;
            width: 100%;
            text-align: center;
        }

        /* 1) Mantén separación normal entre value/label dentro del mismo bloque */
        .lf-dash-card[data-target="section1"] .result-item__periods,
        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__periods {
            row-gap: 4px;
            /* antes: gap: 2px; (puedes dejar gap y solo subirlo) */
        }

        /* 2) Espacio extra ENTRE Monthly y Annual (el 3er hijo es el Annual value) */
        .lf-dash-card[data-target="section1"] .result-item__periods> :nth-child(3),
        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__periods> :nth-child(3) {
            margin-top: 10px;
            /* ajusta 8–14px a gusto */
        }


        .lf-dash-card[data-target="section1"] .result-item__periods .period-label {
            font-size: 12px;
            font-weight: 400;
            line-height: 1.1;
            /* letter-spacing: .12em; */
            /* text-transform: uppercase; */
            color: var(--muted);
            font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
        }

        .lf-dash-card[data-target="section1"] .result-item__periods .period-value {
            font-size: 20px;
            font-weight: 900;
            line-height: 1;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
            color: #fff;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__periods {
            display: grid;
            gap: 2px;
            grid-template-columns: 1fr;
            margin-top: 2px;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__periods .lf-period__label {
            font-size: 12px;
            font-weight: 400;
            line-height: 1.1;
            /* letter-spacing: .12em; */
            /* text-transform: uppercase; */
            color: var(--muted);
            font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__periods .lf-expenses-kpi__value {
            font-size: 20px;
            font-weight: 900;
            line-height: 1;
            color: #fff;
        }

        .lf-dash-card[data-target="section3"] #section3 {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpis {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            padding: 10px;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi {
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 10px;
            min-height: 128px;
            padding: 10px 10px;
            border: 1px solid rgba(253, 169, 41, 0.8);
            border-radius: 14px;
            text-align: center;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.10));
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__label {
            font-family: "alfarn", serif !important;
            font-size: 16px;
            font-weight: 700;
            line-height: 1.15;
            letter-spacing: 1.5px;
            color: #FDA929;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__value {
            font-size: 22px;
            font-weight: 900;
            letter-spacing: 0.2px;
            text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
            color: #ffffff;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-body {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 14px;
            padding: 10px 0;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-chart {
            width: 100%;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-legend {
            width: 100%;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-panel {
            flex: unset !important;
            width: 100% !important;
            max-width: none !important;
            padding: 14px;
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 18px;
            background: #2b4a5e;
        }

        .lf-dash-card[data-target="section3"] .pieChartExpensesItems.lf-expenses-panel {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .lf-dash-card[data-target="section4"] #section4 {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-kpis {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            padding: 10px;
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-kpi {
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 6px;
            min-height: 92px;
            padding: 14px;
            border: 1px solid rgba(253, 169, 41, 0.8);
            border-radius: 16px;
            text-align: center;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.10));
            box-shadow: 0 10px 22px rgba(0, 0, 0, .20);
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-kpi__label {
            font-size: clamp(10px, 0.85vw, 12px);
            font-weight: 600;
            line-height: 1.15;
            letter-spacing: 0.4px;
            font-family: "alfarn", serif !important;
            color: #FDA929;
            ;
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-kpi__value {
            font-size: 22px;
            font-weight: 900;
            text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
            color: #fff;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-body {
            display: grid;
            gap: 14px;
            grid-template-columns: 1fr;
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-panel {
            display: flex;
            flex-direction: column;
            height: var(--lf-chart-panel-h) !important;
            padding: 14px;
            border: 1px solid rgba(255, 255, 255, .14);
            border-radius: 16px;
            background: #2b4a5e;
        }

        .lf-dash-card[data-target="section4"] .lf-mortgage-panel canvas {
            display: block;
            flex: 1 1 auto;
            width: 100% !important;
            height: 100% !important;
        }

        .lf-dash-card[data-target="section5"] #section5 {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .lf-dash-card[data-target="section5"] .lf-return-kpis {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            padding: 10px;
        }

        .lf-dash-card[data-target="section5"] .lf-return-kpi {
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 6px;
            min-height: 92px;
            padding: 14px;
            border: 1px solid rgba(253, 169, 41, 0.8);
            border-radius: 16px;
            text-align: center;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.10));
            box-shadow: 0 10px 22px rgba(0, 0, 0, .20);
        }

        .lf-dash-card[data-target="section5"] .lf-return-kpi__label {
            font-size: clamp(10px, 0.85vw, 12px);
            font-weight: 600;
            line-height: 1.15;
            letter-spacing: 0.4px;
            font-family: "alfarn", serif !important;
            color: #FDA929;
            /* color: rgba(255, 255, 255, .82); */

        }

        .lf-dash-card[data-target="section5"] .lf-return-kpi__value {
            font-size: 22px;
            font-weight: 900;
            text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
            color: #fff;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
        }

        .lf-dash-card[data-target="section5"] .lf-return-body {
            display: grid;
            grid-template-columns: 1fr;
        }

        .lf-dash-card[data-target="section5"] .lf-return-panel {
            display: flex;
            flex-direction: column;
            height: var(--lf-chart-panel-h) !important;
            padding: 14px;
            border: 1px solid rgba(255, 255, 255, .14);
            border-radius: 16px;
            background: #2b4a5e;
        }

        .lf-dash-card[data-target="section5"] .lf-return-panel__title {
            margin: 0 0 10px 0;
            font-size: 16px;
            font-weight: 800;
            letter-spacing: .3px;
            text-align: center;
            color: #FDA929;
        }

        .lf-dash-card[data-target="section5"] .lf-return-panel canvas {
            display: block;
            flex: 1 1 auto;
            width: 100% !important;
            height: 100% !important;
        }

        .lf-fixed-results .fixed-result-category>.kpi-card {
            grid-area: auto !important;
            min-width: 0;
        }

        .lf-dash-card[data-target="section1"] .lf-income-projection {
            width: 100%;
            margin-top: 14px;
        }

        .lf-dash-card[data-target="section1"] .lf-income-projection__panel {
            box-sizing: border-box;
            width: 100%;
            height: var(--lf-chart-panel-h) !important;
            padding: 14px;
            border: 1px solid rgba(255, 255, 255, .12);
            border-radius: 18px;
            background: #2b4a5e;
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
        }

        .lf-dash-card[data-target="section1"] .lf-income-projection__panel canvas {
            display: block;
            width: 100% !important;
            height: 100% !important;
            max-height: 100% !important;
        }

        #section3 .lf-expenses-kpi__label {
            font-family: "alfarn", serif !important;
            font-weight: 700;
            letter-spacing: 1.5px;
            color: #FDA929;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-canvas-wrap canvas {
            display: block;
            width: 100% !important;
            height: 100% !important;
        }



        /* === Tooltips ============================================ */

        .lf-fixed-results .kpi-label,
        .lf-fixed-results .kpi-label .lf-help {
            font-family: "alfarn", serif;
        }

        .lf-dash-card[data-target="section3"] .lf-expenses-kpi__label .lf-help {
            font-size: clamp(10px, 0.85vw, 12px);
            line-height: 1.15;
            letter-spacing: 0.4px;
            font-family: "alfarn", serif !important;
        }

        .lf-dash-card[data-target="section1"] .result-item>.lf-help,
        .lf-dash-card[data-target="section1"] .result-item .lf-help {
            position: relative;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            font-family: "alfarn", serif;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: 1.5px;
        }

        #section3 .lf-expenses-kpi__label .lf-help {
            font-family: "alfarn", serif !important;
        }

        .lf-help {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .lf-help__trigger {
            display: inline-grid;
            place-items: center;
            width: 16px;
            height: 16px;
            padding: 0;
            border: 0;
            border-radius: 999px;
            font: 700 12px/1 var(--lf-help-font);
            color: var(--lf-tooltip-fg);
            background: rgba(255, 255, 255, .30);
            transition: transform .2s ease, background-color .25s ease, color .25s ease, box-shadow .2s ease;
            cursor: help;
            appearance: none;
        }

        .lf-help__trigger:hover {
            transform: translateY(-1px);
        }

        .lf-help__trigger:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px var(--lf-focus-ring);
        }

        .lf-tooltip {
            position: absolute;
            z-index: 1000;
            visibility: hidden;
            min-width: var(--lf-tooltip-min-w);
            max-width: min(90vw, var(--lf-tooltip-max-w));
            padding: var(--lf-tooltip-pad-y) var(--lf-tooltip-pad-x);
            border-radius: var(--lf-tooltip-radius);
            font-family: var(--lf-help-font) !important;
            font-size: 14px !important;
            font-weight: 400 !important;
            line-height: 1.45;
            letter-spacing: .01em;
            text-align: left;
            text-transform: none;
            white-space: normal;
            overflow-wrap: break-word;
            color: var(--lf-tooltip-fg);
            background: var(--lf-tooltip-bg);
            opacity: 0;
            box-shadow: var(--lf-tooltip-shadow);
            transform: translateX(-50%) translateY(-4px);
            transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
            pointer-events: none;
            inset-block-start: calc(100% + var(--lf-tooltip-gap));
            inset-inline-start: 50%;
        }

        .lf-tooltip strong {
            font-weight: 700;
            letter-spacing: 0;
        }

        .lf-tooltip::before {
            position: absolute;
            border: var(--lf-tooltip-arrow) solid transparent;
            transform: translateX(-50%);
            border-bottom-color: var(--lf-tooltip-bg);
            content: "";
            inset-block-start: calc(-1 * (var(--lf-tooltip-arrow) * 2));
            inset-inline-start: 50%;
        }

        .lf-help__trigger:is(:hover, :focus-visible)+.lf-tooltip {
            visibility: visible;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
            transition-delay: 0s;
            pointer-events: auto;
        }

        .lf-help[data-placement="top"] .lf-tooltip {
            inset-block-end: calc(100% + var(--lf-tooltip-gap));
            inset-block-start: auto;
        }

        .lf-help[data-placement="top"] .lf-tooltip::before {
            border-bottom-color: transparent;
            border-top-color: var(--lf-tooltip-bg);
            inset-block-end: calc(-1 * (var(--lf-tooltip-arrow) * 2));
            inset-block-start: auto;
        }

        .lf-help[data-align="start"] .lf-tooltip {
            transform: translateY(-4px);
            inset-inline-start: 0;
        }

        .lf-help[data-align="start"] .lf-help__trigger:is(:hover, :focus-visible)+.lf-tooltip {
            transform: translateY(0);
        }

        .lf-help[data-align="start"] .lf-tooltip::before {
            transform: none;
            inset-inline-start: 16px;
        }

        .lf-help[data-align="end"] .lf-tooltip {
            transform: translateY(-4px);
            inset-inline-end: 0;
            inset-inline-start: auto;
        }

        .lf-help[data-align="end"] .lf-help__trigger:is(:hover, :focus-visible)+.lf-tooltip {
            transform: translateY(0);
        }

        .lf-help[data-align="end"] .lf-tooltip::before {
            transform: none;
            inset-inline-end: 10px;
            inset-inline-start: auto;
        }

        .lf-help--corner {
            position: relative;
            /* padding-inline-end: 18px; */
        }

        .lf-help--corner .lf-help__trigger {
            position: absolute;
            inset-block-start: 0;
            inset-inline-end: 0;
        }

        .lf-result-panel[data-target="fixed-results"] .lf-help .lf-tooltip {
            display: none !important;
        }

        #lf-tooltip-layer {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 2147483647;
            width: 100%;
            height: 0;
            pointer-events: none;
        }

        #lf-tooltip-layer .lf-tooltip--portal {
            position: fixed;
            top: 0;
            left: 0;
            visibility: visible;
            opacity: 1;
            transform: none !important;
            pointer-events: auto;
        }

        #lf-tooltip-layer .lf-tooltip--portal::before {
            transform: translateX(-50%);
            inset-inline-start: var(--lf-tooltip-arrow-x, 50%);
        }

        #lf-tooltip-layer .lf-tooltip--portal[data-placement="top"]::before {
            border-bottom-color: transparent;
            border-top-color: var(--lf-tooltip-bg);
            inset-block-end: calc(-1 * (var(--lf-tooltip-arrow) * 2));
            inset-block-start: auto;
        }

        #lf-tooltip-layer .lf-tooltip--portal[data-placement="bottom"]::before {
            border-bottom-color: var(--lf-tooltip-bg);
            border-top-color: transparent;
            inset-block-end: auto;
            inset-block-start: calc(-1 * (var(--lf-tooltip-arrow) * 2));
        }

        /* “Eliminar” KPIs sin romper cálculos (IDs siguen existiendo) */
        #fixed-annual-noi,
        #item1-fixed-result,
        #item3-fixed-result {
            display: none !important;
        }




        /* === Media Queries ========================================================== */

        @media (prefers-reduced-motion: reduce) {

            .lf-help__trigger,
            .lf-tooltip {
                transition: none !important;
            }
        }

        @media (max-width: 520px) {
            .lf-dash-card[data-target="section1"] .lf-income-hero__value {
                font-size: 28px;
            }

            .lf-dash-card[data-target="section1"] .lf-income-hero__label {
                font-size: 16px;
            }

            .lf-dash-card[data-target="section1"] .result-category {
                grid-template-columns: 1fr;
            }

            .lf-dash-card[data-target="section5"] .lf-return-kpis {
                grid-template-columns: 1fr;
            }

            :root {
                --lf-chart-panel-h: 320px;
            }
        }

        /* 2C-H: display:block table override removed — rental.html has no HTML tables.
           The td::before { content: attr(data-label) } rule was dead code. */

        @media (max-width: 640px) {
            .lf-fixed-results .fixed-result-category {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

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

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

            .metrics-box,
            .chart-container,
            .pieChartExpensesItems {
                flex: 1 1 100%;
                min-width: 0;
            }

            .metrics-graph-container-expenses {
                max-height: none;
            }

            .stage-buttons {
                justify-content: space-between;
            }

            .results-container {
                grid-template-columns: 1fr;
            }

            .lf-inline-results {
                margin-right: 0;
                margin-left: 0;
            }
        }

        @media (max-width: 780px) {
            .timeline {
                gap: 20px;
            }

            .timeline-label {
                max-width: 120px;
                font-size: 12px;
            }
        }

        @media (max-width: 900px) {
            .form-grid {
                grid-template-columns: 1fr;
            }

            .lf-results-card--span2 {
                grid-column: span 1;
            }

            .lf-dash-card[data-target="section1"] .result-category {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .lf-dash-card[data-target="section4"] .lf-mortgage-kpis {
                grid-template-columns: 1fr;
            }

            .lf-dash-card[data-target="section5"] .lf-return-kpis {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 980px) {
            .lf-fixed-results .fixed-result-category {
                grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            }

            .lf-fixed-results .kpi-card {
                width: 100%;
                max-width: 200px;
                height: 78px;
            }

            .lf-dash-card[data-target="section3"] .lf-expenses-kpis {
                grid-template-columns: 1fr;
            }

            .lf-dash-card[data-target="section3"] .lf-expenses-body {
                display: flex;
                flex-direction: column;
            }
        }

        @media (min-width: 1100px) {
            .lf-quadrant-grid {
                align-items: start;
                grid-template-areas: "q2 q1"
                    "q3 q4";
                grid-template-columns: 1fr 1fr;
            }

            .lf-q1 {
                grid-area: q1;
            }

            .lf-q2 {
                grid-area: q2;
            }

            .lf-q3 {
                grid-area: q3;
            }

            .lf-q4 {
                grid-area: q4;
            }
        }

        @media (max-width: 1180px) {
            .lf-fixed-results .fixed-result-category {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }

        @media (max-width: 1200px) {
            .results-row {
                flex-direction: column;
            }

            .result-category {
                width: 100%;
            }

            .lf-fixed-results .fixed-result-category {
                grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
            }

            .lf-fixed-results .kpi-card {
                height: auto;
                min-height: 82px;
            }
        }



        /* =========================================================
   Rental (4286) - Grid layout refactor (modeled after fix-and-flip-1893)
   ========================================================= */

        .rf-grid {
            display: grid;
            /* 2C-H: center col min changed 520px → 0 — eliminates horizontal overflow
               below 520px viewport before the 1200px collapse breakpoint fires.
               Desktop 3-col appearance unchanged (2fr still dominates at full width). */
            grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr) minmax(260px, 1fr);
            grid-template-areas:
                "lending lending lending"
                "ltitle ctitle rtitle"
                "lpanel cpanel rpanel";
            column-gap: 24px;
            row-gap: 14px;
            width: 100%;
            max-width: var(--rf-max-w);
            margin: 0 auto 24px;
            padding: 6px 0 0;
            align-items: start;
        }

        /* --- Panel visibility modes (default: both OFF until user toggles) --- */
        /* Keep a stable 3-column layout so the CENTER panel never shifts when side panels toggle */
        .rf-grid {
            /* 2C-H: same fix, second rf-grid definition */
            grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr) minmax(260px, 1fr);
            grid-template-areas:
                "lending lending lending"
                "ltitle ctitle rtitle"
                "lpanel cpanel rpanel";
            justify-content: stretch;
        }

        /* Side panels start OFF but their columns are reserved to prevent layout jump */
        .rf-grid.rf-left-off #rfLeftTitleCell,
        .rf-grid.rf-left-off #rfLeftPanelCell {
            visibility: hidden;
            pointer-events: none;
        }

        .rf-grid.rf-right-off #rfRightTitleCell,
        .rf-grid.rf-right-off #rfRightPanelCell {
            visibility: hidden;
            pointer-events: none;
        }

        #rentalInputsGrid>.rf-lending-bar {
            grid-area: lending;
        }

        #rfLeftTitleCell {
            grid-area: ltitle;
        }

        #rfCenterTitleCell {
            grid-area: ctitle;
        }

        #rfRightTitleCell {
            grid-area: rtitle;
        }

        #rfLeftPanelCell {
            grid-area: lpanel;
        }

        #rfCenterPanelCell {
            grid-area: cpanel;
        }

        #rfRightPanelCell {
            grid-area: rpanel;
        }

        /* --- Lending Options (1:1 concept with Fix & Flip) --- */
        .rf-lending-bar {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            padding: 4px 0 10px;
        }

        .rf-lending-title {
            font-family: "alfarn", serif;
            font-size: 18px;
            font-weight: 700;
            letter-spacing: 1.5px;
            color: #fff;
            text-shadow: 0px 7px 5px rgb(0, 0, 0), 0 0 20px rgb(255, 255, 255), 0px 0px 5px rgb(0, 0, 0);
            text-transform: uppercase;
        }

        .rf-toggle-group {
            display: flex;
            gap: 12px;
            align-items: center;
            justify-content: center;
        }

        .rf-toggle {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .rf-toggle-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px 18px;
            border-radius: 999px;
            border: 2px solid rgba(253, 169, 41, .65);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
            box-shadow: 0 10px 22px rgba(0, 0, 0, .25), inset 0 0 0 2px rgba(255, 255, 255, .10);
            font-family: "alfarn", serif;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: .6px;
            color: #fff;
            cursor: pointer;
            user-select: none;
            transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, border-color .2s ease, background .2s ease;
        }

        .rf-toggle-pill:hover {
            transform: translateY(-1px);
            border-color: rgba(253, 169, 41, .85);
            filter: brightness(1.03);
        }

        .rf-toggle:focus-visible+.rf-toggle-pill {
            outline: 3px solid rgba(253, 169, 41, .45);
            outline-offset: 3px;

        }

        .rf-toggle:checked+.rf-toggle-pill {
            background: linear-gradient(180deg, #fda929, #e08924);
            border-color: rgba(255, 255, 255, .55);
            box-shadow: 0 14px 28px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .22);
        }

        /* Titles OUTSIDE the panels (match Fix) */
        .rf-grid-title {
            display: flex;
            align-items: flex-end;
            justify-content: center;
            min-height: 32px;
            margin-top: 2px;
        }

        .rf-col-title {
            margin: 10px;
            font-family: "alfarn", serif;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: 1.5px;
            color: #fff;
            opacity: .75;
            /* text-transform: uppercase; */
            /* text-shadow: 0px 7px 5px rgb(0, 0, 0), 0 0 20px rgb(255, 255, 255), 0px 0px 5px rgb(0, 0, 0); */
        }

        .rf-grid-title--center {
            justify-content: center;
        }

        /* Panels */
        .rf-grid-panel {
            width: 100%;
        }

        .rf-panel {
            position: relative;
            border-radius: 15px;
            padding: 20px;
            background: rgba(19, 65, 96, 0.199);
            border: none;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 1) !important;
            backdrop-filter: none;
        }

        .rf-panel--center {
            padding: 20px;
        }

        /* Panel central: 2 columnas */
        .rf-panel--center .form-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 15px;
        }

        /* Paneles laterales: 1 columna */
        .rf-panel--left .form-grid,
        .rf-panel--right .form-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
        }

        /* “Invisible” like Fix: keep layout width (desktop), collapse (mobile) */
        .rf-col-hidden {
            display: none !important;
        }

        @media (max-width:1200px) {
            .rf-grid {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "lending"
                    "ctitle"
                    "cpanel"
                    "ltitle"
                    "lpanel"
                    "rtitle"
                    "rpanel";
                max-width: 1000px;
                row-gap: 14px;
            }

            .rf-col-hidden {
                display: none !important;
            }

            .rf-results-cta {
                max-width: 1000px;
            }
        }

        @media (max-width:900px) {
            .rf-panel--center .form-grid {
                grid-template-columns: 1fr;
            }
        }

        .rf-results-cta {
            width: 100%;
            max-width: var(--rf-max-w);
            margin: 14px auto 0;
            display: flex;
            justify-content: center;
        }

        .rf-results-cta .next-button {
            width: min(820px, 100%);
        }

        /* Results are always visible; hide legacy CTA */
        .rf-results-cta {
            display: none !important;
        }

        /* --- Down Payment toggle (mortgage-style) --- */
        .fuse-wrap {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
        }

        /* make room INSIDE the pill for the unit selector */
        .fuse-wrap .lf-control {
            width: 100%;
            padding-right: 72px;
        }

        /* gold divider before the unit area (matches mortgage-8408) */
        .fuse-wrap::after {
            content: "";
            position: absolute;
            right: 60px;
            top: calc(50% - 19px);
            height: 39px;
            width: 1px;
            background: rgba(253, 169, 41, 0.65);
            border-radius: 1px;
            pointer-events: none;
        }

        /* selector sits on top of the input, INSIDE it */
        .unit-inside {
            position: absolute;
            right: 10px;
            top: 5px;
            bottom: 5px;
            width: 50px;
            /* tighter = “más fino” */
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 15px;
            color: #ffffff;
            background: transparent !important;
            border: 0 !important;
            outline: 0;
            box-shadow: none !important;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            text-align-last: center;
            cursor: pointer;
            padding: 0;
        }

        .unit-inside:focus {
            outline: none;
        }

        .unit-inside::-ms-expand {
            display: none;
        }

        .unit-inside option {
            color: #0b2f3f;
        }

        /* dropdown readability if it ever opens */

        /* keep label consistent with other mortgage-detail labels */
        .label-button-2 {
            display: block;
            margin-bottom: 6px;
            font-weight: 800;
            color: #fff;
        }

/* === lf-input-typography === */
        /* Typography inside form fields (inputs/selects/textareas) */
        input.lf-control,
        select.lf-control,
        textarea.lf-control,
        input[type="currency"],
        input[type="text"],
        input[type="number"],
        input[type="tel"],
        input[type="email"],
        input[type="search"] {
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;
            font-size: 16px !important;
        }

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

        /* --- 768px: chart panel containment + canvas max-width guard --- */
        @media (max-width: 768px) {

            /* Chart panel containers: prevent overflow when parent card is narrower
               than the chart's rendered width. width: 100% + box-sizing ensures
               the panel fills its column without exceeding it. */
            .lf-dash-card[data-target="section1"] .lf-income-projection__panel,
            .lf-dash-card[data-target="section3"] .chart-container.lf-expenses-panel,
            .lf-dash-card[data-target="section4"] .lf-mortgage-panel,
            .lf-dash-card[data-target="section5"] .lf-return-panel {
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
                overflow: hidden;
            }

            /* Canvas elements: must not exceed their container width.
               Chart.js respects this via its responsive:true option. */
            .lf-results-panel canvas,
            .lf-income-projection__panel canvas,
            .lf-expenses-chart canvas,
            .lf-expenses-canvas-wrap canvas {
                max-width: 100% !important;
                height: auto !important;
            }

            /* Metrics/chart row containers: let them wrap naturally on phone */
            .metrics-graph-container,
            .metrics-graph-container-expenses,
            .metrics-graph-container-projection {
                max-width: 100%;
            }
        }

        /* --- 480px: chart panel height reduction + form padding --- */
        @media (max-width: 480px) {

            /* Reduce chart panel height on small phones.
               The 520px block already reduces --lf-chart-panel-h to 320px.
               This further step brings it down for very narrow screens. */
            :root {
                --lf-chart-panel-h: 260px;
            }

            /* Input section padding tightened */
            .input-section {
                padding: 12px;
            }

            /* Page title scale */
            h1 {
                font-size: 1.5rem;
            }
        }
