/* Property Listing & EMI — NestFind portal. Namespaced .pl */
* { box-sizing: border-box; }
body { margin: 0; }
.pl {
    --bg: #f4f7fb; --panel: #ffffff; --line: #e4e9f0; --ink: #0f172a; --muted: #64748b;
    --brand: #2563eb; --brand-ink: #1d4ed8; --accent: #0d9488;
    --ok: #16a34a; --warn: #f59e0b; --danger: #ef4444;
    --shadow: 0 12px 32px -18px rgba(37,99,235,.3);
    min-height: calc(100vh - 44px);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    background: radial-gradient(1000px 420px at 90% -10%, rgba(37,99,235,.07), transparent), var(--bg);
    color: var(--ink);
}
.pl-btn { border: 0; cursor: pointer; border-radius: .6rem; padding: .6rem 1rem; font: 600 .88rem inherit; background: var(--brand); color: #fff; transition: transform .1s, background .15s; white-space: nowrap; }
.pl-btn:hover { transform: translateY(-1px); }
.pl-btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.pl-btn.ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.pl-btn.sm { padding: .42rem .75rem; font-size: .8rem; }
.pl-link { border: 0; background: transparent; color: var(--brand-ink); font: 600 .8rem inherit; cursor: pointer; }
.pl-link:hover { text-decoration: underline; }
.pl-h2 { margin: 0 0 1.1rem; font-size: 1.25rem; }

/* Topbar */
.pl-topbar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem; background: var(--panel); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; flex-wrap: wrap; }
.pl-brand { display: flex; align-items: center; gap: .6rem; }
.pl-logo { font-size: 1.6rem; }
.pl-brand b { display: block; font-size: 1.05rem; }
.pl-brand small { color: var(--muted); font-size: .72rem; }
.pl-nav { display: flex; gap: .25rem; margin: 0 auto; flex-wrap: wrap; }
.pl-navbtn { border: 0; background: transparent; color: var(--muted); padding: .5rem .8rem; border-radius: .6rem; font: 600 .85rem inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.pl-navbtn:hover { color: var(--ink); background: #eef2f9; }
.pl-navbtn.active { background: var(--brand); color: #fff; }
.pl-badge { background: rgba(0,0,0,.12); border-radius: 999px; padding: 0 .4rem; font-size: .7rem; min-width: 1.1rem; text-align: center; }
.pl-navbtn.active .pl-badge { background: rgba(255,255,255,.25); }
.pl-top-actions { display: flex; align-items: center; gap: .6rem; }
.pl-live-dot { color: var(--ok); font-size: .72rem; font-weight: 800; letter-spacing: .1em; display: inline-flex; align-items: center; gap: .4rem; }
.pl-live-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); animation: plpulse 1.3s infinite; }
@keyframes plpulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.pl-view { max-width: 1500px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.pl-view[hidden] { display: none !important; }
.pl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; box-shadow: var(--shadow); }
.pl-card h3 { margin: 0 0 1rem; font-size: .95rem; }
.pl-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.pl-card-head h3 { margin: 0; }

/* SEARCH layout */
.pl-search-grid { display: grid; grid-template-columns: 250px 1fr 340px; gap: 1.25rem; align-items: start; }
@media (max-width: 1200px) { .pl-search-grid { grid-template-columns: 250px 1fr; } .pl-mapwrap { grid-column: 1 / -1; } }
@media (max-width: 800px) { .pl-search-grid { grid-template-columns: 1fr; } }

.pl-filters { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.1rem; box-shadow: var(--shadow); position: sticky; top: 76px; }
@media (max-width: 800px) { .pl-filters { position: static; } }
.pl-filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.pl-filter-head h3 { margin: 0; font-size: .95rem; }
.pl-seg { display: flex; background: #eef2f9; border-radius: .6rem; padding: .2rem; margin-bottom: .9rem; }
.pl-seg button { flex: 1; border: 0; background: transparent; padding: .45rem; border-radius: .45rem; font: 600 .82rem inherit; color: var(--muted); cursor: pointer; }
.pl-seg button.active { background: var(--panel); color: var(--brand-ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pl-f { display: block; margin-bottom: .9rem; font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pl-f > span { display: block; margin-bottom: .35rem; }
.pl-f select, .pl-f input[type=text], .pl-f input[type=number], .pl-f textarea { width: 100%; font: 400 .88rem inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .5rem; background: #f8fafc; color: var(--ink); text-transform: none; }
.pl-chips { display: flex; gap: .3rem; flex-wrap: wrap; }
.pl-chip { border: 1px solid var(--line); background: #f8fafc; border-radius: .5rem; padding: .3rem .6rem; font: 600 .8rem inherit; cursor: pointer; color: var(--muted); }
.pl-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pl-range { position: relative; height: 24px; }
.pl-range input { position: absolute; width: 100%; margin: 0; pointer-events: none; -webkit-appearance: none; background: transparent; }
.pl-range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: all; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.pl-range input::-moz-range-thumb { pointer-events: all; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; cursor: pointer; }
.pl-range::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 3px; background: var(--line); border-radius: 2px; }
.pl-range-lbl { display: flex; justify-content: space-between; font-size: .76rem; color: var(--ink); font-weight: 700; text-transform: none; }
.pl-check { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; margin-bottom: .8rem; }
.pl-check input { accent-color: var(--brand); }
.pl-amen-filter { display: flex; flex-wrap: wrap; gap: .3rem; }
.pl-amen-filter button { border: 1px solid var(--line); background: #f8fafc; border-radius: 999px; padding: .25rem .55rem; font: 600 .72rem inherit; cursor: pointer; color: var(--muted); }
.pl-amen-filter button.active { background: #dbeafe; color: var(--brand-ink); border-color: #bfdbfe; }

.pl-results-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.pl-results-head span { font-weight: 700; font-size: .9rem; }
.pl-results-head select { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel); }
.pl-list { display: flex; flex-direction: column; gap: 1rem; }
.pl-lcard { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); display: grid; grid-template-columns: 200px 1fr; overflow: hidden; cursor: pointer; transition: transform .1s, box-shadow .15s; }
@media (max-width: 620px) { .pl-lcard { grid-template-columns: 1fr; } }
.pl-lcard:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -22px rgba(37,99,235,.4); }
.pl-lphoto { position: relative; min-height: 150px; display: grid; place-items: center; font-size: 3rem; color: #fff; }
.pl-lphoto .imgcount { position: absolute; bottom: .5rem; right: .5rem; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; }
.pl-lphoto .fav { position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); cursor: pointer; font-size: 1rem; line-height: 1; }
.pl-lphoto .fav.on { color: var(--danger); }
.pl-lbody { padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.pl-ltags { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .3rem; }
.pl-ltag { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border-radius: 999px; padding: .1rem .45rem; background: #eef2f9; color: var(--muted); }
.pl-ltag.verified { background: #dcfce7; color: var(--ok); }
.pl-ltag.reduced { background: #fef9c3; color: #a16207; }
.pl-ltag.new, .pl-ltag.sea { background: #dbeafe; color: var(--brand-ink); }
.pl-lcard h3 { margin: .1rem 0; font-size: 1.05rem; }
.pl-lprice { font-weight: 800; font-size: 1.15rem; color: var(--brand-ink); }
.pl-lprice small { color: var(--muted); font-weight: 500; font-size: .74rem; }
.pl-lspecs { display: flex; gap: .9rem; font-size: .8rem; color: var(--muted); margin: .35rem 0; flex-wrap: wrap; }
.pl-lspecs b { color: var(--ink); }
.pl-lloc { font-size: .82rem; color: var(--muted); }
.pl-ldesc { font-size: .8rem; color: var(--muted); line-height: 1.45; margin-top: .4rem; flex: 1; }
.pl-lfoot { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; font-size: .78rem; color: var(--muted); }

.pl-mapwrap { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; box-shadow: var(--shadow); position: sticky; top: 76px; }
@media (max-width: 1200px) { .pl-mapwrap { position: static; } }
.pl-map-head { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.pl-map-head span { color: var(--muted); font-size: .8rem; }
#pl-map { width: 100%; height: auto; aspect-ratio: 1; background: linear-gradient(180deg, #e8f0fb, #eaf6f2); border-radius: .7rem; display: block; }
.pl-map-legend { text-align: center; color: var(--muted); font-size: .74rem; margin-top: .5rem; }
.pl-map-pin { cursor: pointer; }
.pl-map-pin text { font-size: 20px; font-weight: 800; fill: #fff; }

.pl-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; border: 1px dashed var(--line); border-radius: 1rem; }

/* PROPERTY DETAIL */
.pl-detail-back { border: 0; background: transparent; color: var(--brand-ink); font: 600 .85rem inherit; cursor: pointer; margin-bottom: 1rem; }
.pl-detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 960px) { .pl-detail-grid { grid-template-columns: 1fr; } }
.pl-gallery { border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow); }
.pl-gallery-main { aspect-ratio: 16/9; display: grid; place-items: center; font-size: 5rem; color: #fff; position: relative; }
.pl-gallery-main .navbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 1.1rem; cursor: pointer; }
.pl-gallery-main .navbtn.prev { left: 1rem; } .pl-gallery-main .navbtn.next { right: 1rem; }
.pl-gallery-main .count { position: absolute; bottom: 1rem; right: 1rem; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; padding: .15rem .6rem; border-radius: 999px; }
.pl-gallery-thumbs { display: flex; gap: .4rem; padding: .5rem; background: var(--panel); }
.pl-gallery-thumbs .t { width: 3.5rem; height: 2.6rem; border-radius: .4rem; display: grid; place-items: center; font-size: 1.1rem; color: #fff; cursor: pointer; opacity: .55; }
.pl-gallery-thumbs .t.on { opacity: 1; outline: 2px solid var(--brand); }
.pl-dsection { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; box-shadow: var(--shadow); margin-top: 1.25rem; }
.pl-dsection h3 { margin: 0 0 1rem; font-size: 1rem; }
.pl-dtitle h2 { margin: 0; font-size: 1.5rem; }
.pl-dtitle .loc { color: var(--muted); margin-top: .2rem; }
.pl-dtitle .price { font-size: 1.7rem; font-weight: 800; color: var(--brand-ink); margin-top: .6rem; }
.pl-dtitle .price small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.pl-dspecs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; }
.pl-dspec { background: #f8fafc; border: 1px solid var(--line); border-radius: .6rem; padding: .7rem .8rem; }
.pl-dspec small { color: var(--muted); font-size: .72rem; text-transform: uppercase; display: block; }
.pl-dspec b { font-size: .95rem; }
.pl-amen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.pl-amen-grid div { font-size: .84rem; padding: .4rem .2rem; }
.pl-locality-scores { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.pl-score { text-align: center; }
.pl-score b { font-size: 1.4rem; font-weight: 800; color: var(--brand-ink); display: block; }
.pl-score small { color: var(--muted); font-size: .74rem; }
.pl-similar { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.pl-similar .s { min-width: 200px; background: #f8fafc; border: 1px solid var(--line); border-radius: .7rem; padding: .8rem; cursor: pointer; }
.pl-similar .s:hover { border-color: var(--brand); }
.pl-similar .s b { font-size: .88rem; display: block; }
.pl-similar .s .p { color: var(--brand-ink); font-weight: 700; font-size: .85rem; }
.pl-similar .s small { color: var(--muted); font-size: .74rem; }

/* Right rail: EMI + agent + visit */
.pl-side-card { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; position: sticky; top: 76px; }
.pl-side-card + .pl-side-card { position: static; }
.pl-emi h3 { margin: 0 0 1rem; font-size: 1rem; }
.pl-emi-slider { margin-bottom: 1rem; }
.pl-emi-slider label { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .3rem; }
.pl-emi-slider label b { color: var(--brand-ink); }
.pl-emi-slider input { width: 100%; accent-color: var(--brand); }
.pl-emi-out { text-align: center; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .5rem; }
.pl-emi-out .big { font-size: 2rem; font-weight: 800; color: var(--brand-ink); }
.pl-emi-out .lbl { color: var(--muted); font-size: .78rem; }
.pl-emi-split { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.pl-emi-split svg { width: 90px; height: 90px; flex: none; }
.pl-emi-split .k { font-size: .8rem; }
.pl-emi-split .k div { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; color: var(--muted); }
.pl-emi-split .k i { width: .7rem; height: .7rem; border-radius: 3px; }
.pl-emi-split .k b { color: var(--ink); }
.pl-afford { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.pl-afford label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.pl-afford input { width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .5rem; }
.pl-afford .r { margin-top: .6rem; font-size: .85rem; }
.pl-afford .r b { color: var(--brand-ink); }
.pl-afford .r.ok { color: var(--ok); }
.pl-afford .r.no { color: var(--danger); }
.pl-agent { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.pl-agent .av { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.pl-agent b { display: block; }
.pl-agent small { color: var(--muted); font-size: .8rem; }
.pl-visit-form { display: flex; flex-direction: column; gap: .6rem; }
.pl-visit-form input, .pl-visit-form select { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .5rem; }

/* SHORTLIST / COMPARE */
.pl-compare-wrap { overflow-x: auto; }
.pl-compare { border-collapse: collapse; width: 100%; min-width: 640px; background: var(--panel); border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow); }
.pl-compare th, .pl-compare td { border: 1px solid var(--line); padding: .7rem .9rem; text-align: left; font-size: .85rem; vertical-align: top; }
.pl-compare th { background: #f8fafc; font-weight: 700; }
.pl-compare .rowhead { background: #f8fafc; font-weight: 700; color: var(--muted); width: 140px; }
.pl-compare .best { color: var(--ok); font-weight: 700; }
.pl-compare .colhead { display: flex; flex-direction: column; gap: .3rem; }
.pl-compare .colhead .thumb { height: 60px; border-radius: .5rem; display: grid; place-items: center; font-size: 1.6rem; color: #fff; }
.pl-compare .rm { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: .78rem; }

/* POST / LEADS */
.pl-post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .pl-post-grid { grid-template-columns: 1fr; } }
.pl-post-form { display: flex; flex-direction: column; gap: .8rem; }
.pl-post-row { display: flex; gap: .6rem; }
.pl-post-row .pl-f { flex: 1; margin-bottom: 0; }
.pl-lead { border: 1px solid var(--line); border-radius: .7rem; padding: .8rem .9rem; margin-bottom: .7rem; background: #f8fafc; }
.pl-lead .lh { display: flex; justify-content: space-between; align-items: center; }
.pl-lead .lh b { font-size: .9rem; }
.pl-lead .lh .st { font-size: .68rem; font-weight: 800; text-transform: uppercase; padding: .1rem .45rem; border-radius: 999px; }
.pl-lead .lh .st.new { background: #dbeafe; color: var(--brand-ink); }
.pl-lead .lh .st.contacted { background: #fef9c3; color: #a16207; }
.pl-lead .lh .st.visit-done { background: #dcfce7; color: var(--ok); }
.pl-lead .lh .st.closed { background: #e2e8f0; color: var(--muted); }
.pl-lead .meta { font-size: .76rem; color: var(--muted); margin: .3rem 0; }
.pl-lead .note { font-size: .82rem; }
.pl-lead .acts { display: flex; gap: .4rem; margin-top: .5rem; }

/* MARKET */
.pl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.pl-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.2rem; box-shadow: var(--shadow); }
.pl-kpi b { font-size: 1.7rem; font-weight: 800; display: block; }
.pl-kpi small { color: var(--muted); font-size: .78rem; }
.pl-kpi .delta { color: var(--ok); font-size: .74rem; font-weight: 600; }
.pl-market-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .pl-market-grid { grid-template-columns: 1fr; } }
#pl-trendchart { width: 100%; height: 200px; }
.pl-psf-row { display: flex; align-items: center; gap: .8rem; padding: .4rem 0; font-size: .83rem; }
.pl-psf-row .n { width: 8rem; color: var(--muted); flex: none; }
.pl-psf-row .b { flex: 1; height: 14px; background: var(--line); border-radius: 4px; overflow: hidden; }
.pl-psf-row .b i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #60a5fa); }
.pl-psf-row .v { width: 4rem; text-align: right; font-weight: 700; }
#pl-typedonut { width: 130px; height: 130px; display: block; margin: 0 auto; }
.pl-donut-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; justify-content: center; font-size: .76rem; color: var(--muted); margin-top: .6rem; }
.pl-donut-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.pl-donut-legend i { width: .7rem; height: .7rem; border-radius: 3px; }

/* Toast */
.pl-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: .7rem 1.1rem; border-radius: .7rem; font-size: .88rem; z-index: 200; box-shadow: 0 15px 40px -12px rgba(0,0,0,.4); max-width: 90vw; }
.pl-toast[hidden] { display: none; }
