/*
 * fix-and-flip.css — Fusion Calculator
 * Extracted from fix-and-flip.html (batch-29c1-css-extraction-fix-and-flip)
 * Source: 4 inline <style> blocks merged in document order
 *   Block 1 (unnamed):                   original lines 15–1015
 *   Block 2 (lf-disable-menus):          original lines 1016–1026
 *   Block 3 (lf-autofill-natural-reset): original lines 1027–1056
 *   Block 4 (lf-autofill-lastwins):      original lines 1057–1099
 * Do not add shared/global rules here — page-specific styles only.
 */
        body {
            background: linear-gradient(to bottom right, #134160, #586C75, #134160, #586C75) no-repeat fixed;
            background-size: cover;
            padding: 20px 20px 20px;
            /* padding: clamp(12px, 2vw, 40px); */
        }


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

            /* misma distancia arriba y abajo */
            margin: 40px 0;
        }

        h2 {
            font-family: 'alfarn', serif;
            text-align: center;
            color: #FDA929;
            letter-spacing: 1.5px;
            font-weight: 500;

            /* sin márgenes extra */
            margin: 0;
        }

        /* ===== 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,
        .results-table {
            max-width: 600px;
            /* match MAO */
            margin: 20px auto;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 1) !important;
            padding: 20px;
            border-radius: 15px;
        }


        label {
            margin-top: 10px;
            font-weight: bold;
            color: white;
            position: relative;
            display: inline-block;
        }

        input,
        select {
            width: 95%;
            margin-top: 5px;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 25px;
            background-color: transparent;
            color: white;
        }

        /* Keep the selected value the same color as inputs while focused */
        select:focus {
            color: var(--ctrl-fg) !important;
            -webkit-text-fill-color: var(--ctrl-fg);
        }

        input::placeholder {
            color: #ccc;
        }

        input[type="checkbox"]:checked {
            accent-color: #FDA929;
        }

        .conditional {
            display: none;
        }

        .lending-options {
            display: flex;
            justify-content: space-around;
            gap: 10px;
            margin-top: 10px;
            text-align: center;
        }

        .lending-options label {
            display: inline-block;
            font-weight: normal;
        }

        .lending-options input {
            margin-right: 5px;
        }

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

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

        .lender-section {
            padding: 20px;
            border-radius: 15px;
        }

        .section-header {
            background-color: rgba(255, 217, 0, 0.2);
            color: #FDA929;
            font-family: 'alfarn', serif;
            text-align: center;
            font-size: 20px;
            padding: 10px;
            border-radius: 10px;
            margin-top: 20px;
        }

        .button-container {
            text-align: center;
            margin-top: 20px;
        }

        #clearFormButton {
            background-color: #FDA929;
            color: #134160;
            border: none;
            border-radius: 25px;
            padding: 10px 20px;
            font-family: 'alfarn', serif;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.2s ease;
            display: inline-block;
        }

        #clearFormButton:hover {
            background-color: #ffcc66;
            transform: scale(1.05);
        }

        .info-icon {
            display: inline-block;
            background-color: #FDA929;
            color: white;
            font-size: 14px;
            font-weight: bold;
            width: 14px;
            height: 14px;
            line-height: 14px;
            text-align: center;
            border-radius: 50%;
            cursor: pointer;
            position: relative;
            transition: transform 0.2s ease;
        }

        .info-icon:hover {
            transform: scale(1.1);
        }

        .info-box {
            display: none;
            position: absolute;
            background-color: #1c3341;
            color: white;
            padding: 15px;
            border-radius: 12px;
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2) !important;
            width: 400px;
            font-size: 14px;
            line-height: 1.5;
            z-index: 1000;
            top: 0;
            left: calc(100% + 10px);
            white-space: normal;
            transition: opacity 0.3s ease, transform 0.3s ease;
            pointer-events: none;
        }

        .info-box strong {
            color: #FDA929;
        }

        .info-box p {
            margin: 5px 0;
        }

        .info-icon:hover+.info-box,
        .info-icon:focus+.info-box {
            display: block;
            pointer-events: auto;
        }

        /* RESULTS: 2x2 grid, compact cards */
        .results-container {
            display: grid;
            grid-template-columns: repeat(2, minmax(260px, 1fr));
            gap: 16px 20px;
            max-width: 900px;
            /* match MAO panel width */
            margin: 0 auto 30px auto;
        }


        .result-card {
            background-color: #2b4a5e;
            color: white;
            padding: 12px;
            border-radius: 10px;
            border: 2px solid #FDA929;
            box-shadow: 0 0 8px 1.5px #FDA929 !important;
            min-height: 150px;
        }


        /* Titles slightly smaller to match compact look */
        .result-card h3 {
            font-family: 'alfarn', serif;
            font-size: 16px;
            color: #FDA929;
            margin: 0 0 8px 0;
            text-align: center;
        }


        /* List layout + tighter typography */
        .result-card ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .result-card ul li {
            font-size: 15px;
            margin: 6px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            padding-bottom: 4px;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
            letter-spacing: 0.2px;
        }


        .result-card ul li strong {
            color: #FDA929;
            font-weight: 700;
        }

        .result-card ul li span {
            color: #ffffff;
            font-weight: 700;
        }

        /* Responsive: stack to one column on small screens */
        @media (max-width: 800px) {
            .results-container {
                grid-template-columns: 1fr;
            }
        }

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

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

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

        @media (max-width: 900px) {
            .result-card {
                width: 100%;
            }

            /* stack on smaller screens */
        }

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

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


        /* =================== INPUT STYLING ================== */

        /* ===== Unified Control Theme (glass + gold) — from MAO ===== */
        :root {

            /* center column is 680px; its results use a 12px gap -> each card width */
            --center-col-width: 680px;
            --center-results-gap: 12px;
            --center-card-width: calc((var(--center-col-width) - var(--center-results-gap)) / 2);
        }


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

        /* Layout helpers for rows/columns like MAO */
        .form-rows {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .two-col {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 20px;
        }

        .two-col .field {
            min-width: 0;
            display: flex;
            flex-direction: column;
        }

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


        /* === Three-column layout (robusto, sin “elementos perdidos”) === */
        .ff-grid {
            display: grid;
            /* 2C-F: center col min changed 520px → 0 — eliminates horizontal overflow
               between 500-519px viewports before the 1200px collapse breakpoint fires.
               The 1200px collapse already handles full single-column stacking on tablet/mobile.
               Desktop 3-col appearance is 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"
                "hml center pml";
            grid-auto-rows: auto;
            column-gap: 24px;
            row-gap: 10px;
            max-width: 1400px;
            margin: 0 auto 24px;
            align-items: start;
        }

        /* Cada “columna” es un item real del grid (evitamos display:contents) */
        .col {
            display: flex;
            flex-direction: column;
            gap: 16px;
            min-width: 0;
        }

        .lending-bar {
            grid-area: lending;
            grid-column: 1 / -1;
        }

        #col-hml {
            grid-area: hml;
        }

        #col-pml {
            grid-area: pml;
        }

        .center-col {
            grid-area: center;
        }

        /* Responsive: apilar SIN perder nada */
        @media (max-width: 1200px) {
            .ff-grid {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "lending"
                    "center"
                    "hml"
                    "pml";
            }

            /* En móvil, ocultar secciones desactivadas para no dejar “huecos” */
            .hidden {
                display: none !important;
            }
        }


        .hidden {
            visibility: hidden;
            /* keeps the column width reserved */
            pointer-events: none;
            /* behaves as if it's not there */
        }

        /* Side loan calculator cards */
        .loan-card {
            background: rgba(19, 65, 96, 0.199);
            border-radius: 15px;
            padding: 0px;
            color: #fff;
            box-shadow: 0 5px 10px rgba(0, 0, 0, .8) !important;
            margin-top: 0;
            /* no extra gap under the title */

        }

        /* Drop side cards to align with center form top */
        #col-hml .loan-card,
        #col-pml .loan-card {
            position: relative;
            top: 0px;
            /* match the title's drop */
            margin-top: 0px;
        }


        /* Center form a bit narrower to fit three columns nicely */
        #fixAndFlipForm {
            width: 100%;
            /* fill the fixed center column */
            max-width: unset;
            margin: 0;
        }

        /* Results stack under each column */
        .col-results {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
        }

        /* Center column: two cards side-by-side */
        .center-col .col-results {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        /* Center results: stack on small screens */
        @media (max-width: 900px) {
            .center-col .col-results {
                grid-template-columns: 1fr;
            }
        }


        .col-results .result-card {
            width: 100%;
        }

        /* Left and Right columns: make result cards same width as center cards */
        .ff-grid>section:not(.center-col) .col-results .result-card {
            max-width: var(--center-card-width);
            width: 100%;
            margin: 0 auto;
            /* center within the side column */
        }

        @media (max-width: 1200px) {
            .ff-grid>section:not(.center-col) .col-results .result-card {
                max-width: 100%;
            }
        }


        /* keep columns from overlapping by including padding/borders in width */
        #fixAndFlipForm,
        .loan-card,
        .result-card,
        .lender-section {
            box-sizing: border-box;
        }


        /* ensure the grid always has fixed tracks + gap */


        /* the center form should fit its column exactly */
        #fixAndFlipForm {
            width: 100%;
            max-width: unset;
            margin: 0;
        }



        /* Lending bar under the main title */
        .lending-bar {
            grid-area: lending;
            grid-column: 1 / -1;
            margin: 8px 0 14px 0;
            /* tight gap above the form */
            text-align: center;
        }

        .lending-bar .lending-title {
            font-family: 'alfarn', serif;
            color: #ffffff;
            font-size: 18px;
            margin: 0 0 10px 0;
            letter-spacing: 1px;
        }

        /* Pretty toggle checkboxes (use existing IDs) */
        .lending-bar .toggle-group {
            display: flex;
            justify-content: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .lending-bar .lf-toggle {
            appearance: none;
            -webkit-appearance: none;
            position: absolute;
            left: -9999px;
        }

        .lending-bar .toggle-pill {
            cursor: pointer;
            padding: 10px 16px;
            border-radius: 999px;
            border: 1.5px solid rgba(253, 169, 41, .55);
            background:
                linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)),
                rgba(19, 65, 96, .35);
            color: #eaf2f7;
            font-weight: 600;
            box-shadow: 0 0 8px rgba(253, 169, 41, .25) inset !important;
            transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
        }

        .lending-bar .toggle-pill:hover {
            transform: translateY(-1px);
            border-color: rgba(253, 169, 41, .85);
        }

        .lending-bar .lf-toggle:checked+.toggle-pill {
            background:
                linear-gradient(180deg, rgba(255, 217, 0, .22), rgba(255, 255, 255, .06)),
                rgba(19, 65, 96, .45);
            color: #ffffff;
            border-color: #FDA929;
            box-shadow: 0 0 0 2px rgba(253, 169, 41, .5), 0 0 10px rgba(253, 169, 41, .45) inset !important;
        }

        /* Clear Form button fixed on the top-right */
        #clearFormButton {
            position: fixed;
            top: 14px;
            right: 16px;
            z-index: 1000;
            background-color: #FDA929;
            color: #134160;
            border: none;
            border-radius: 999px;
            padding: 10px 18px;
            font-family: 'alfarn', serif;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 2px 10px rgba(0, 0, 0, .35) !important;
            transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
        }

        #clearFormButton:hover {
            background-color: #ffcc66;
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(0, 0, 0, .4) !important;
        }


        /* Titles ABOVE the loan cards */
        .col-title {
            font-family: 'alfarn', serif;
            color: #ffffff;
            font-size: 16px;
            letter-spacing: .5px;
            text-align: center;
            background: transparent;
            padding: 0 14px;
            border-radius: 12px;
            margin: 0 0 10px 0;
            /* drop title down a bit */
            max-width: 500px;

            .h3leyend {
                font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
                transform-style: Italic !important;
                color: #ffffff;
                font-size: 16px;
                opacity: .45;
            }
        }



        /* Nudge left/right columns up to align with the center form */
        .col.shift-up {
            margin-top: 0;
        }

        /* On small screens (1-column) remove the offset */
        @media (max-width:1200px) {
            .col.shift-up {
                margin-top: 0;
            }
        }

        /* ============== INFO ICON STYLE =========== */

        /* Info icons + overlays (MAO style) */
        .info-icon {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 14px;
            height: 14px;
            margin-left: 4px;
            border-radius: 50%;
            background: #ffffff4d;
            color: #1c3341;
            font-size: 13px;
            font-weight: 400;
            cursor: pointer;
            position: relative;
            transition: background-color .25s ease, color .25s ease, transform .2s ease;
        }

        .info-icon:hover {
            background: #FDA929;
            color: #fff;
            transform: translateY(-1px);
        }

        .info {
            position: relative;
            display: inline-flex;
            align-items: center;
        }

        .help-text {
            position: absolute;
            top: calc(100% + 6px);
            left: 50%;
            transform: translateX(-50%);
            width: 380px;
            max-width: min(90vw, 420px);
            background: #2B4A5E;
            color: #fff;
            padding: 8px 12px;
            border-radius: 10px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, .35) !important;
            z-index: 9999;
            font-size: 14px;
            line-height: 1.4;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            user-select: text;
            transition: opacity .2s ease, transform .2s ease;
        }

        .help-text::before {
            content: "";
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-bottom-color: #2B4A5E;
        }

        .info:hover .help-text,
        .help-text:hover,
        .help-text:focus-within {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateX(-50%) translateY(0);
        }


        /* ========== INPUT AND HEADERS FONT STYLE ==============*/

        /* === Match MAO label + input typography === */
        #fixAndFlipForm label,
        #hardMoneyCard label,
        #privateMoneyCard label {
            margin-top: 0;
            font-weight: bold;
            color: white;
            position: relative;
            display: inline-block;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
        }

        .lf-control {
            font-family: inherit;
            /* MAO lets controls inherit */
            font-size: 16px;
            /* MAO control size */
            font-weight: normal;
            /* MAO default */
            letter-spacing: normal;
            /* neutral tracking like MAO */
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;

        }

        input::placeholder {
            color: #cccccc74;
        }

        /* MAO placeholder tone */



        /* Preserve glass background + text color on browser autofill */
        .lf-control:-webkit-autofill,
        .lf-control:-webkit-autofill:hover,
        .lf-control:-webkit-autofill:focus {
            -webkit-text-fill-color: var(--ctrl-fg) !important;
            caret-color: var(--ctrl-fg) !important;

            /* keep your gradient/tint instead of white/yellow autofill */
            background:
                linear-gradient(180deg, var(--ctrl-bg1), var(--ctrl-bg2)),
                var(--ctrl-tint) !important;

            /* nuke WebKit’s painted layer so our background shows through */
            box-shadow: 0 0 0 1000px transparent inset !important;

            /* fallback trick: defer autofill paint */

        }

        /* Firefox autofill */
        .lf-control:-moz-autofill {
            color: var(--ctrl-fg) !important;
            background:
                linear-gradient(180deg, var(--ctrl-bg1), var(--ctrl-bg2)),
                var(--ctrl-tint) !important;
            box-shadow: 0 0 0 1000px transparent inset !important;
        }

        /* Make sure controls always use the same text paint channel */
        .lf-control {
            -webkit-text-fill-color: var(--ctrl-fg);
        }


        /* === GRID ROWS: titles (row 1), panels (row 2), results (row 3) === */
        .ff-grid {
            display: grid;
            /* 2C-F: center col min changed 520px → 0 — same fix as block 1 above */
            grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr) minmax(260px, 1fr);
            grid-template-areas:
                "lending lending lending"
                "hmlTitle centerTitle pmlTitle"
                "hmlPanel centerPanel pmlPanel"
                "hmlRes   centerRes   pmlRes";
            column-gap: 24px;
            row-gap: 14px;
            max-width: 1400px;
            margin: 0 auto 24px;
            align-items: start;
        }

        /* Grid area mapping */
        .lending-bar {
            grid-area: lending;
            grid-column: 1 / -1;
        }

        #hmlTitleCell {
            grid-area: hmlTitle;
        }

        #centerTitleCell {
            grid-area: centerTitle;
        }

        #pmlTitleCell {
            grid-area: pmlTitle;
        }

        #hmlPanelCell {
            grid-area: hmlPanel;
        }

        #centerPanelCell {
            grid-area: centerPanel;
        }

        #pmlPanelCell {
            grid-area: pmlPanel;
        }

        #hmlResultsCell {
            grid-area: hmlRes;
        }

        #centerResultsCell {
            grid-area: centerRes;
        }

        #pmlResultsCell {
            grid-area: pmlRes;
        }

        /* Make title row look like your previous headers */
        .grid-title {
            display: flex;
            justify-content: center;
            align-items: flex-end;
            min-width: 0;
        }

        /* Center title placeholder: keep height minimal */
        #centerTitleCell {
            min-height: 0;
        }

        /* Responsive stack */
        @media (max-width: 1200px) {
            .ff-grid {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "lending"
                    "centerPanel"
                    "centerRes"
                    "hmlTitle"
                    "hmlPanel"
                    "hmlRes"
                    "pmlTitle"
                    "pmlPanel"
                    "pmlRes";
            }

            /* when hidden, collapse in mobile to avoid blank gaps */
            .hidden {
                display: none !important;
            }
        }


        /* Center results: two cards side-by-side (desktop) */
        #centerResultsCell .col-results {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }

        @media (max-width: 900px) {
            #centerResultsCell .col-results {
                grid-template-columns: 1fr;
            }
        }

        /* Side results: keep cards visually aligned to center card width */
        #hmlResultsCell .result-card,
        #pmlResultsCell .result-card {
            max-width: var(--center-card-width);
            width: 100%;
            margin: 0 auto;
        }

        @media (max-width: 1200px) {

            #hmlResultsCell .result-card,
            #pmlResultsCell .result-card {
                max-width: 100%;
            }
        }

/* === lf-disable-menus === */
        nav,
        .navbar,
        .menu,
        .tabs,
        .tab-nav,
        .topnav,
        #tabs {
            display: none !important;
        }

/* === lf-autofill-natural-reset === */
        /* === Natural look for autofill & instant reset on blur/tab change === */
        .lf-control:-webkit-autofill,
        .lf-control:-webkit-autofill:hover,
        .lf-control:-webkit-autofill:focus {
            transition: none !important;
            -webkit-text-fill-color: var(--ctrl-fg, #eaf2f7) !important;
            caret-color: var(--ctrl-fg, #eaf2f7) !important;
            background:
                linear-gradient(180deg, var(--ctrl-bg1, rgba(255, 255, 255, .06)), var(--ctrl-bg2, rgba(255, 255, 255, .02))),
                var(--ctrl-tint, rgba(19, 65, 96, .35)) !important;
            -webkit-background-clip: padding-box !important;
            background-clip: padding-box !important;
            -webkit-box-shadow: 0 0 0 1000px rgba(19, 65, 96, .35) inset !important;
            box-shadow: 0 0 0 1000px rgba(19, 65, 96, .35) inset !important;
        }

        .lf-control:-webkit-autofill:not(:focus) {
            -webkit-box-shadow: 0 0 0 1000px rgba(19, 65, 96, .35) inset !important;
            box-shadow: 0 0 0 1000px rgba(19, 65, 96, .35) inset !important;
            transition: none !important;
        }

        .lf-autofill-reset input:-webkit-autofill,
        .lf-autofill-reset .lf-control:-webkit-autofill {
            -webkit-box-shadow: 0 0 0 1000px rgba(19, 65, 96, .35) inset !important;
            box-shadow: 0 0 0 1000px rgba(19, 65, 96, .35) inset !important;
            transition: none !important;
        }

/* === lf-autofill-lastwins === */
        /* === LAST-WINS AUTOFILL/REPAINT NEUTRALIZER (tab switch / visibility repaint) === */
        .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;
        }

        /* Blink/WebKit autofill + preview repaint (keeps glass theme) */
        .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;
        }

        /* Firefox */
        input.lf-control:-moz-autofill,
        textarea.lf-control:-moz-autofill {
            box-shadow: none !important;
            background: transparent !important;
            color: #eaf2f7 !important;
        }

        /* Enforce glass on focus after return from hidden tab */
        .lf-control:focus {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
                rgba(19, 65, 96, 0.42) !important;
        }

        /* ============================================================
           2C-F — Responsive: tablet & mobile polish
           All rules below are additive max-width overrides.
           Desktop rules above this block are untouched.
           The primary fix (minmax 520px → 0) is applied inline above.
           ============================================================ */

        /* --- 768px: form padding + result card text compression --- */
        @media (max-width: 768px) {

            /* Lending bar: tighten padding on phone */
            .lending-bar {
                padding: 12px;
            }

            /* Result cards: reduce padding and font on phone */
            .result-card {
                padding: 14px 12px;
            }

            .result-card h3 {
                font-size: .9rem;
            }

            .result-card ul li {
                font-size: .8rem;
            }

            /* side results already max-width: 100% at 1200px — ensure no centering gap */
            #hmlResultsCell .result-card,
            #pmlResultsCell .result-card {
                margin: 0;
            }
        }

        /* --- 480px: body padding + title font size --- */
        @media (max-width: 480px) {

            body {
                padding: 12px 10px;
            }

            h1 {
                font-size: 1.5rem;
            }
        }
