/*
 * rent-estimator.css — Fusion Calculator
 * Extracted from rent-estimator.html (batch-29a-css-extraction-rent-estimator)
 * Source: inline <style> block, lines 19–938
 * Do not add shared/global rules here — page-specific styles only.
 */

        :root {
            --bg-1: #134160;
            /* deep blue */
            --bg-2: #586C75;
            /* steel */
            --gold: #FDA929;
            /* brand gold */
            --text: #EAF2F7;
            --muted: #BFD0D8;
            --shadow: 0 10px 35px rgba(0, 0, 0, .35);
            --radius: 18px;

            /* Rehab control theme */
        }

        * {
            box-sizing: border-box
        }

        html,
        body {
            height: 100%
        }


        body {
            margin: 0;
            color: var(--text);
            font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
            background: linear-gradient(to bottom right, var(--bg-1), var(--bg-2), var(--bg-1), var(--bg-2)) no-repeat fixed;
            overflow-y: auto;
            scrollbar-width: none;
            /* Firefox: sin barra */
            scrollbar-color: transparent transparent;
            -ms-overflow-style: none;
        }

        /* Chrome, Edge, Safari */
        html::-webkit-scrollbar,
        body::-webkit-scrollbar {
            width: 0;
            height: 0;
            background: transparent;
        }

        .page {
            max-width: 1280px;
            margin: 0 auto;
            padding: 28px 20px 80px;
        }

        /* Header becomes vertical, centered */
        .topbar {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            margin-bottom: 18px;
        }

        .page-title {
            text-align: center;
            font-family: 'alfarn', serif;
            color: #FDA929;
            letter-spacing: 1.5px;
            margin-top: 0;
            margin-bottom: 20px;
            font-weight: 700;
        }

        /* Centered address bar above the cards */
        .address-top {
            width: 100%;
            display: flex;
            justify-content: center;
        }

        .address-wrap {
            width: min(860px, 92%);
        }

        .address-wrap .lf-places {
            position: relative;
        }

        .calculate-btn {
            background: var(--gold);
            color: #1A2B34;
            font-weight: 800;
            border: 0;
            ;
            padding: 10px 18px;
            border-radius: 12px;
            cursor: pointer;
            box-shadow: 0 6px 18px rgba(253, 169, 41, .35);
        }

        .calculate-btn:disabled {
            opacity: .6;
            cursor: not-allowed
        }

        /* GRID LAYOUT */
        .grid {
            display: grid;
            grid-template-columns: 1.4fr 0.6fr;
            gap: 18px;
            /* align-items: flex-start; */
            align-items: stretch;
        }

        .card {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }

        .card .card-body {
            padding: 16px;
        }

        /* Inputs (Rehab theme) */
        label {
            display: block;
            font-size: 12px;
            letter-spacing: .3px;
            color: var(--muted);
            margin-bottom: 6px;
        }

        .lf-control {
            -webkit-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);
        }

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

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

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

        input.lf-control:-webkit-autofill,
        input.lf-control:-webkit-autofill:hover,
        input.lf-control:-webkit-autofill:focus {
            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-text-fill-color: var(--ctrl-fg) !important;
            border: 1px solid var(--ctrl-border) !important;
        }

        .address-type-row {
            display: grid;
            gap: 10px;
            margin-bottom: 14px;
        }

        .address-type-row>.input-group {
            min-width: 0;
        }

        .address-only {
            grid-template-columns: 1fr;
        }

        .filters-4 {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        /* Multi-select */
        .dropdown-select {
            width: 100%;
            padding: 10px;
            border: 2px solid rgba(255, 255, 255, .2);
            border-radius: 8px;
            background: rgba(255, 255, 255, .05);
            color: white;
            font-size: 1rem;
            transition: all .3s ease;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 14px;
        }

        .dropdown-select:focus {
            outline: none;
            border-color: #FDA929;
            background: rgba(255, 255, 255, .1);
            box-shadow: 0 0 0 3px rgba(253, 169, 41, .2);
        }

        .dropdown-select option {
            background: #134160;
            color: white;
            padding: 10px;
        }


        /* Multi-select igual que ARV */
        .multi-select-container {
            position: relative;
            width: 100%;
        }

        .multi-select-display {
            width: 100%;
            padding: 10px;
            border: 2px solid rgba(255, 255, 255, .2);
            border-radius: 8px;
            background: rgba(255, 255, 255, .05);
            color: white;
            font-size: 1rem;
            transition: all .3s ease;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 14px;
        }

        .multi-select-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, .95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, .3);
            border-radius: 8px;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
            display: none;
            max-height: 260px;
            overflow-y: auto;
        }

        .multi-select-option {
            display: flex;
            align-items: center;
            padding: 10px 15px;
            cursor: pointer;
            color: #134160;
            font-size: .9rem;
            border-bottom: 1px solid rgba(19, 65, 96, .1);
            transition: background-color .2s ease;
        }

        .multi-select-option:last-child {
            border-bottom: none;
        }

        .multi-select-option:hover {
            background: rgba(253, 169, 41, .2);
        }

        .multi-select-checkbox {
            width: 16px;
            height: 16px;
            margin-right: 10px;
            accent-color: #FDA929;
        }

        /* Sliders */
        /* === SLIDERS ESTILO ARV === */
        /* Mismo color de títulos de sliders que en ARV */
        .input-group label {
            display: block;
            font-size: 0.9rem;
            font-weight: 600;
            color: #FDA929;
            /* mismo naranja de ARV */
            margin-bottom: 4px;
        }


        .slider-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 12px;
        }

        .single-range-container {
            position: relative;
            height: 25px;
            margin: 8px 0;
        }

        .dual-range-container {
            position: relative;
            height: 32px;
            margin: 8px 0;
        }


        /* Track base de los sliders de distancia / tiempo */
        .distance-slider {
            position: absolute;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.2);
            outline: none;
            appearance: none;
            cursor: pointer;
            top: 12px;
            z-index: 2;
        }

        /* Thumb redondo dorado */
        .distance-slider::-webkit-slider-thumb {
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: linear-gradient(45deg, #FDA929, #ffb84d);
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(253, 169, 41, .4);
            position: relative;
            z-index: 3;
        }

        .distance-slider::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: linear-gradient(45deg, #FDA929, #ffb84d);
            cursor: pointer;
            border: none;
            box-shadow: 0 2px 6px rgba(253, 169, 41, .4);
            position: relative;
            z-index: 3;
        }

        /* Rango interior rellenado */
        .single-range-track {
            position: absolute;
            top: 10px;
            height: 6px;
            background: linear-gradient(45deg, #FDA929, #ffb84d);
            border-radius: 3px;
            z-index: 1;
            left: 0;
        }

        /* Dual range (min / max) */
        .dual-range-slider {
            position: absolute;
            left: 0;
            right: 0;
            width: 100%;
            height: 4px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.2);
            outline: none;
            appearance: none;
            cursor: pointer;
            pointer-events: none;
            top: 12px;
        }


        .dual-range-slider::-webkit-slider-thumb {
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: linear-gradient(45deg, #FDA929, #ffb84d);
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(253, 169, 41, .4);
            pointer-events: all;
            position: relative;
            z-index: 1;
        }

        .dual-range-slider::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: linear-gradient(45deg, #FDA929, #ffb84d);
            cursor: pointer;
            border: none;
            box-shadow: 0 2px 6px rgba(253, 169, 41, .4);
            pointer-events: all;
        }

        /* tramo resaltado entre los dos thumbs */
        .range-track {
            position: absolute;
            top: 12px;
            height: 6px;
            background: linear-gradient(45deg, #FDA929, #ffb84d);
            border-radius: 3px;
            z-index: 1;
        }


        /* KPI */
        .comps-kpi-title2 {
            font-family: 'alfarn', serif;
            font-size: 1.3rem;
            text-align: center;
            color: #FDA929;
            letter-spacing: 1px;
            margin: 0px;
            text-decoration: underline;
        }

        .comps-kpi-title {
            font-family: 'alfarn', serif;
            font-size: 1.3rem;
            text-align: center;
            color: #FDA929;
            letter-spacing: 1px;
            margin: 0 0 10px;
            text-decoration: underline;
            padding: 10px;
        }

        .kpi-band {
            display: grid;
            grid-template-columns: 1fr 1.3fr 1fr;
            /* columna del centro más grande */
            gap: 18px;
            margin: 10px 0 18px;
        }

        .kpi-card {
            position: relative;
            background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06));
            border: 1px solid rgba(255, 255, 255, .22);
            border-radius: 16px;
            padding: 9px 8px;
            text-align: center;
            backdrop-filter: blur(8px);
            box-shadow: 0 10px 28px rgba(0, 0, 0, .30), 0 0 0 1px rgba(255, 255, 255, .06) inset;
        }

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


        .kpi-card.small {
            padding: 7px 6px;
            border-radius: 12px;
        }


        .kpi-card.large {
            padding: 7px 6px;
            border-radius: 12px;
        }

        .kpi-label {
            font-family: 'alfarn', serif;
            font-size: 16px;
            letter-spacing: .5px;
            color: #FDA929;
            opacity: .95;
        }

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

        }

        .kpi-card .kpi-value {
            font-size: 1.3rem;
            font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif !important;

        }

        .kpi-sub {
            font-size: 12px;
            color: var(--muted);
            margin-top: 6px;
        }

        /* Table */
        .table-wrap {
            margin-top: 12px;
            border-radius: 16px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.16);
        }

        .table-scroll {
            max-height: none;
            overflow: visible;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        thead {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
        }

        thead th {
            position: sticky;
            top: 0;
            z-index: 2;
        }

        th,
        td {
            font-size: 12px;
            padding: 10px 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        tbody tr:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        /* Map */
        #map {
            width: 100%;
            height: 420px;
            /* ↓ set the exact height you want */
            min-height: 470px;
            flex: 0;
            /* don’t stretch the map’s card body */
            border-radius: 10px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.16);
        }

        .card-body.map-body {
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .lf-dropdown {
            position: relative;
        }

        @media (max-width:1100px) {
            .filters-4 {
                grid-template-columns: 1fr 1fr;
            }
        }


        .single-range-container input[type=range] {
            position: absolute;
            display: grid;
            left: 1px;
            right: 1px;
            top: 50%;
            transform: translateY(-50%);
            height: 5px;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            /* gives the thumb a bit more room */
        }

        /* --- Rent Estimator upgrades: sticky map, legend, table header, CTA --- */

        /* Sticky map card on desktop */
        .map-card {
            position: sticky;
            top: 16px;
            align-self: flex-start;
        }

        @media (max-width: 768px) {
            .map-card {
                position: static;
            }
        }

        /* Small map legend */
        .map-legend {
            display: flex;
            justify-content: center;
            gap: 12px;
            font-size: 11px;
            color: var(--muted);
            margin-bottom: 8px;
            flex-wrap: wrap;
        }

        .map-legend .legend-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .map-legend .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .map-legend .dot.subject {
            background: #ffffff;
            box-shadow: 0 0 0 2px var(--gold);
        }

        .map-legend .dot.comp {
            background: var(--gold);
        }

        .map-legend .dot.radius {
            background: transparent;
            border: 2px solid var(--gold);
            border-radius: 999px;
        }

        /* Comps table header style similar to ARV */
        .comp-checkbox {
            width: 16px;
            height: 16px;
            accent-color: #FDA929;
        }


        /* Bordes redondeados sólo para la fila completa seleccionada */
        #comps-table tbody tr.comp-selected td:first-child {
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
        }

        #comps-table tbody tr.comp-selected td:last-child {
            border-top-right-radius: 10px;
            border-bottom-right-radius: 10px;
        }


        #comps-table thead tr {
            position: sticky;
            top: 0;
            z-index: 2;
        }

        #comps-table thead th {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .06)),
                linear-gradient(180deg, rgba(19, 65, 96, .65), rgba(19, 65, 96, .35));
            color: #ffcc7a;
            font-size: 11px;
            letter-spacing: .4px;
            font-weight: 700;
            text-align: center;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, .35),
                inset 0 -2px 4px rgba(0, 0, 0, .25),
                0 4px 12px rgba(0, 0, 0, .25);
        }

        #comps-table tbody tr:hover {
            /* background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04)); */
            background: rgba(253, 169, 41, 0.15);
        }


        /* Optional: subject row styling, if you add it later */
        #comps-table tbody tr.subject-row td {
            background: linear-gradient(90deg, rgba(253, 169, 41, .16), rgba(253, 169, 41, .05));
            font-weight: 600;
            text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
        }

        #comps-table tbody tr.subject-row td:first-child {
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
        }

        #comps-table tbody tr.subject-row td:last-child {
            border-top-right-radius: 10px;
            border-bottom-right-radius: 10px;
        }

        /* === Top 3 comparables: fondo fijo === */
        #comps-table tbody tr.top-comp-row td {
            /* border-collapse: collapse; */
            background: rgba(19, 65, 96, .60);
            border: #586C75 solid 1px;

            color: #FFFFFF;
            font-weight: 600;
        }

        /* Bordes redondeados solo para la fila completa */
        #comps-table tbody tr.top-comp-row td:first-child {
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
        }

        #comps-table tbody tr.top-comp-row td:last-child {
            border-top-right-radius: 10px;
            border-bottom-right-radius: 10px;
        }


        /* Golden primary CTA similar to ARV */
        #rent-estimate-btn {
            display: block;
            margin: 12px auto 0;
            padding: 14px 28px;
            border-radius: 999px;
            font-weight: 800;
            letter-spacing: 1px;
            text-transform: uppercase;
            background: linear-gradient(180deg, #FFA733 0%, #FDBA4D 100%);
            /* color: #1A2B34; */
            color: #F2F2F2;
            border: 1px solid rgba(255, 255, 255, .35);
            box-shadow:
                0 6px 18px rgba(253, 169, 41, .35),
                inset 0 2px 0 rgba(255, 255, 255, .35);
            transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
        }

        #rent-estimate-btn:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow:
                0 10px 24px rgba(253, 169, 41, .45),
                inset 0 2px 0 rgba(255, 255, 255, .4);
            filter: saturate(1.05);
        }

        .glow-emoji {
            font-size: 18px;
        }

        a.zillow-link:link {
            color: #ffffff;
            /* font-weight: bold; */
            text-decoration: underline;
        }

        a.zillow-link:visited {
            color: #FDA929;
            /* font-weight: bold; */
            text-decoration: underline;
        }

        /* ================= Layout parity with ARV (Top/Bottom content) ================= */
        .page {
            max-width: 1400px;
        }

        .calculator-wrapper {
            display: flex;
            flex-direction: column;
            gap: 18px;
            width: 100%;
            max-width: 1400px;
            margin: 0 auto;
        }

        .top-content {
            display: grid;
            grid-template-columns: 68% 30%;
            gap: 2%;
            align-items: stretch;
        }

        .bottom-content {
            display: grid;
            grid-template-columns: 68% 30%;
            gap: 2%;
            align-items: start;
            margin-top: 0;
        }

        /* Make cards fill columns nicely */
        .top-content>.card,
        .bottom-content>.card {
            width: 100%;
        }

        /* Right top column (button + KPI) */
        .ai-card .kpi-band {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-areas:
                "rent rent"
                "low  high";
            gap: 14px;
            margin: 10px 0 18px;
        }

        /* map the 3 KPI cards (Low, Rent, High) into the 2-row grid */
        .ai-card .kpi-band .kpi-card:nth-child(1) {
            grid-area: low;
        }

        .ai-card .kpi-band .kpi-card:nth-child(2) {
            grid-area: rent;
        }

        .ai-card .kpi-band .kpi-card:nth-child(3) {
            grid-area: high;
        }

        /* make sure RENT card spans nicely */
        .ai-card .kpi-band .kpi-card:nth-child(2) {
            width: 100%;
        }

        /* Mobile: stack vertically for readability */
        @media (max-width: 520px) {
            .ai-card .kpi-band {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "rent"
                    "low"
                    "high";
            }
        }

        .ai-card .card-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* keep the CTA visually centered */
        .ai-card #rent-estimate-btn {
            margin: 6px auto 0;
            width: 100%;
        }

        /* Bottom right: sticky map like ARV */
        .bottom-content .map-card {
            position: sticky;
            top: 16px;
            align-self: start;
        }

        /* Give the map enough vertical presence in the bottom layout */
        .bottom-content #map {
            height: 500px;
            min-height: 400px;
        }

        /* Remove old "full width" spacing if any */
        .bottom-content .card {
            margin-top: 0;
        }

        @media (max-width: 1100px) {

            .top-content,
            .bottom-content {
                grid-template-columns: 1fr;
                gap: 18px;
            }

            .bottom-content .map-card {
                position: static;
            }

            .bottom-content #map {
                height: 420px;
                min-height: 470px;
            }
        }

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

        /* --- 900px: collapse main .grid + slider rows --- */
        @media (max-width: 900px) {

            /* Main two-column grid (1.4fr 0.6fr) → single column */
            .grid {
                grid-template-columns: 1fr;
            }

            /* Slider pairs stack vertically */
            .slider-row {
                grid-template-columns: 1fr;
                gap: 18px;
            }

            /* Map goes static — no sticky on tablet */
            .map-card {
                position: static;
            }

            /* Map height reduced for tablet portrait */
            #map {
                height: 340px;
                min-height: 300px;
            }
        }

        /* --- 768px: filters + comps KPI band --- */
        @media (max-width: 768px) {

            /* Filters: 2-col → 1-col on phone */
            .filters-4 {
                grid-template-columns: 1fr;
            }

            /* Bottom comps KPI band (Selected Comps Average): 3-col → 1-col */
            .bottom-content .kpi-band {
                grid-template-columns: 1fr;
            }

            /* Page padding tightened on phone */
            .page {
                padding: 16px 12px 60px;
            }
        }

        /* --- 480px: map height + top KPI band final collapse --- */
        @media (max-width: 480px) {

            /* Map smaller on short phones */
            #map {
                height: 260px;
                min-height: 220px;
            }

            /* Bottom map in bottom-content */
            .bottom-content #map {
                height: 280px;
                min-height: 240px;
            }

            /* Page title smaller */
            .page-title {
                font-size: 1.4rem;
                letter-spacing: 0.5px;
            }
        }
