/* /properties/ page styles - extracted from templates/public/search.html so the
   ~67KB sheet is cached by the browser/edge instead of re-downloaded inline
   on every view. Version-busted via ?v=<asset_v> in the template. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    min-height: 100dvh;
}

/* Header — Clean Modern White + Black Tones */
.header {
    background: #ffffff;
    color: #111827;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.agent-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.brand-text p {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 2px;
}
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.header-contact {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.header-contact:hover {
    color: #111827;
}
.header-contact svg {
    color: #374151;
}
.header-divider {
    width: 1px;
    height: 24px;
    background: #e5e7eb;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1000;
    padding: 6px 0;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}
.user-dropdown a:hover {
    background: #f3f4f6;
}
.btn-saved-filter {
    background: white;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}
.btn-saved-filter:hover {
    border-color: #ef4444;
    background: #fef2f2;
}
.btn-saved-filter.active {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}
.btn-save-search {
    background: #111827;
    border: none;
    color: white;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-save-search:hover {
    background: #000000;
}

/* Main Layout — Map LEFT, Listings RIGHT */
.main-layout {
    display: flex;
    height: calc(100dvh - 77px);
}

/* Listings Panel (right side) */
.sidebar {
    flex: 1;
    background: white;
    overflow-y: auto;
    border-left: 1px solid #e2e8f0;
}

/* Filters */
.filters {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.search-row {
    position: relative;
    margin-bottom: 0.5rem;
}
.search-input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.search-input::placeholder { color: #94a3b8; }
.search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
    padding: 0.2rem;
}
.search-clear:hover { color: #475569; }
.filter-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.filter-select {
    padding: 0.45rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.filter-select:focus {
    outline: none;
    border-color: #0ea5e9;
}

/* Multi-select dropdown — reused for Status / City / Beds filters.
   Presents as a single button that opens a popover of checkboxes.
   Selected values show in the button label as either "Label" (one
   selected) or "N selected" (multiple). Click-outside / Esc closes. */
.multi-filter {
    position: relative;
    flex: 1;
    min-width: 0;
}
.multi-filter .mf-button {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    text-align: left;
    color: #334155;
}
.multi-filter[aria-expanded="true"] .mf-button,
.multi-filter .mf-button:focus {
    outline: none;
    border-color: #0ea5e9;
}
.multi-filter .mf-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.multi-filter .mf-caret {
    opacity: 0.55;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.multi-filter .mf-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    max-width: min(320px, 90vw);
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.3rem 0;
}
.multi-filter[aria-expanded="true"] .mf-panel { display: block; }
.multi-filter .mf-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
    color: #334155;
}
.multi-filter .mf-option:hover { background: #f8fafc; }
.multi-filter .mf-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #0ea5e9;
}
.multi-filter .mf-group-label {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.multi-filter .mf-divider { height: 1px; background: #f1f5f9; margin: 0.25rem 0; }

/* Home Type filter now uses the shared .multi-filter dropdown
   pattern (defined above) — same component as Status/City/Beds.
   The old .home-type-row pill styles were removed in the same commit
   as the pattern unification. */
.results-count {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Listing Cards — 2-column grid */
.listings-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.6rem;
    transition: opacity 0.15s ease;
}
/* Subtle dim + pointer-events lock while a fetch is in flight. The
   results-count swaps to "Loading…" separately (see loadListings). */
.listings-container.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.listing-card {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    position: relative;
}
/* AI Match Badge */
.ai-match-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    z-index: 5;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ai-match-pill.high { background: rgba(5, 150, 105, 0.92); }
.ai-match-pill.medium { background: rgba(37, 99, 235, 0.92); }
.ai-match-pill.low { background: rgba(107, 114, 128, 0.85); }
.ai-personalized-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #ede9fe, #f0f4ff);
    border-bottom: 1px solid #c4b5fd;
    font-size: 0.8rem;
    color: #6d28d9;
    font-weight: 500;
}
.ai-personalized-bar svg { flex-shrink: 0; }
.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.listing-card.active {
    border-color: #0ea5e9;
}
.listing-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #e2e8f0;
}
/* Placeholder when image fails to load */
.listing-photo-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.listing-photo-placeholder svg {
    width: 48px;
    height: 48px;
}
.listing-info {
    padding: 0.65rem 0.75rem;
}
.listing-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 0.15rem;
}
/* Price-reduced treatment (struck-through original + drop amount) on
   both the SSR cards (.price) and the JS-rendered cards (.listing-price). */
.price-was {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 0.35rem;
    vertical-align: middle;
}
/* Property-type chip for non-residential cards (Land, Multi-Family) —
   these have no beds/baths/sqft so the chip + lot size fill the
   details row and tell buyers what they're looking at. */
.listing-type-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7c5e2a;
    background: #faf3e3;
    border: 1px solid #ecdfc0;
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: middle;
}
.price-cut-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 0.35rem;
    vertical-align: middle;
    white-space: nowrap;
}
.listing-address {
    font-size: 0.82rem;
    color: #334155;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listing-details {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: #64748b;
}
.listing-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}
.listing-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}
.listing-status.active {
    background: #dcfce7;
    color: #16a34a;
}
.listing-status.pending,
.listing-status.contingent,
.listing-status.active-under-contract {
    background: #fef3c7;
    color: #d97706;
}
.listing-status.accepting-backup-offers,
.listing-status.backup-offers {
    background: #fee2e2;
    color: #dc2626;
}
/* Corner ribbon on the photo for at-a-glance contract-status cues
   (Pending / Contingent / Backups). Active listings get no ribbon. */
.listing-photo-wrap {
    position: relative;
    display: block;
}
.listing-status-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    line-height: 1;
}
.listing-status-ribbon.pending,
.listing-status-ribbon.contingent,
.listing-status-ribbon.active-under-contract {
    background: #f59e0b;
}
.listing-status-ribbon.backup-offers,
.listing-status-ribbon.accepting-backup-offers {
    background: #dc2626;
}
/* Partial-ownership disclosure badge (Pacaso, Ember Homes,
   fractional / 1/8-share listings). Sits under the status ribbon on
   the photo so buyers see it before clicking through and don't
   mistake a fractional share for a whole-home purchase. */
.listing-coownership-ribbon {
    position: absolute;
    top: 42px;
    left: 10px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    background: #7c3aed;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    line-height: 1;
}
/* When no status ribbon is stacked above it, sit at the top */
.listing-coownership-ribbon.solo {
    top: 10px;
}
.listing-mls {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* STR Revenue Badge */
.listing-str {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}
.str-permit-note {
    font-size: 0.7rem;
    color: #b45309;
    line-height: 1.35;
    margin-top: 3px;
}
.str-revenue {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0c4a6e;
}
/* Investor block — NOI / cap rate / first-year write-off. Sits directly
   under .listing-str and inherits its rhythm; only rendered while the
   "Investor numbers" chip is on. */
.listing-invest {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}
.inv-stat {
    font-size: 0.78rem;
    color: #64748b;
}
.inv-stat strong {
    color: #0c4a6e;
    font-weight: 700;
}
.inv-writeoff {
    margin-top: 0.35rem;
    background: #EBF5EE;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}
.inv-writeoff-amt {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0F6E56;
}
.inv-writeoff-pct {
    font-size: 0.7rem;
    color: #64748b;
}
/* Provenance of the land/improvement split the write-off rests on. Amber
   when it's our default assumption rather than published assessor data —
   the number is a tax estimate, so the difference has to be visible. */
.inv-source {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
.inv-source.est {
    color: #b45309;
}
/* "N homes hidden — no rental projection" note above the results list. */
.invest-excluded-note {
    font-size: 0.75rem;
    color: #b45309;
    background: #fffbeb;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.str-zone {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.str-zone.green {
    background: #dcfce7;
    color: #16a34a;
}
.str-zone.yellow {
    background: #fef3c7;
    color: #d97706;
}
.str-zone.red {
    background: #fee2e2;
    color: #dc2626;
}
.str-zone.unknown {
    background: #f1f5f9;
    color: #64748b;
}
.listing-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}
.highlight-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 500;
}
.popup-str {
    font-size: 0.8rem;
    color: #0c4a6e;
    font-weight: 500;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Map Container (left side, fixed 50%) */
.map-container {
    width: 50%;
    flex-shrink: 0;
    position: relative;
}
#map {
    width: 100%;
    height: 100%;
}

/* Map Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}
.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}
/* Custom hover card overlay — positioned manually, no map movement */
.map-hover-card {
    position: absolute;
    z-index: 1000;
    width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.15s;
}
.map-hover-card .hover-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
}
.map-hover-card.above .hover-arrow {
    bottom: -10px;
    border-top: 10px solid #fff;
}
.map-hover-card.below .hover-arrow {
    top: -10px;
    border-bottom: 10px solid #fff;
}
.map-hover-card .hover-photo {
    width: 100%; height: 140px; object-fit: cover; display: block;
}
.map-hover-card .hover-body {
    padding: 10px 14px 12px;
}
.map-hover-card .hover-price {
    font-weight: 700; font-size: 1.1rem; color: #0f172a;
}
.map-hover-card .hover-address {
    font-size: 0.82rem; color: #64748b; margin: 2px 0;
}
.map-hover-card .hover-details {
    font-size: 0.78rem; color: #94a3b8;
}
.map-hover-card .hover-details span { margin-right: 8px; }
.popup-photo-wrap {
    position: relative;
}
.popup-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.popup-compare-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}
.popup-compare-icon:hover {
    transform: scale(1.15);
    background: rgba(255,255,255,1);
}
.popup-compare-icon.added {
    background: #0ea5e9;
    color: white;
}
@keyframes compareBubble {
    0% { transform: scale(1); }
    20% { transform: scale(1.35); }
    40% { transform: scale(0.9); }
    60% { transform: scale(1.15); }
    80% { transform: scale(0.97); }
    100% { transform: scale(1); }
}
@keyframes compareRipple {
    0% { box-shadow: 0 0 0 0 rgba(14,165,233,0.5); }
    100% { box-shadow: 0 0 0 18px rgba(14,165,233,0); }
}
.popup-compare-icon.bubble {
    animation: compareBubble 0.5s ease, compareRipple 0.6s ease;
}
.popup-content {
    padding: 1rem;
}
.popup-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0c4a6e;
}
.popup-address {
    font-size: 0.9rem;
    color: #475569;
    margin: 0.25rem 0 0.5rem;
}
.popup-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #64748b;
}
.popup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.popup-btn {
    flex: 1;
    padding: 0.6rem;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}
.popup-btn-primary {
    background: #0ea5e9;
    color: white;
}
.popup-btn-primary:hover {
    background: #0284c7;
}
.popup-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}
.popup-btn-secondary:hover {
    background: #e2e8f0;
}

/* Mobile Bottom Sheet */
.mobile-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.mobile-bottom-sheet.active {
    transform: translateY(0);
}
.mbs-handle {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 8px auto 0;
}
.mbs-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
}
.mbs-card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.mbs-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    margin-top: 4px;
    border-radius: 12px 12px 0 0;
}
.mbs-content {
    padding: 12px 16px 20px;
}
.mbs-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0c4a6e;
}
.mbs-details {
    font-size: 0.9rem;
    color: #64748b;
    margin: 4px 0;
}
.mbs-address {
    font-size: 0.9rem;
    color: #475569;
}
@media (max-width: 768px) {
    .mobile-bottom-sheet { display: block; }
}

/* Price Pill Markers */
.price-marker-wrapper {
    position: relative;
    cursor: pointer;
}
.price-pill {
    background: white;
    color: #1e293b;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    border: 1px solid #cbd5e1;
    position: relative;
    transition: all 0.15s ease;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
}
.price-pill::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid white;
}
.price-pill:hover {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14,165,233,0.35);
    transform: scale(1.08);
    z-index: 900 !important;
}
.price-pill:hover::after {
    border-top-color: #0ea5e9;
}
.price-pill.active {
    background: #0284c7;
    color: white;
    border-color: #0284c7;
    box-shadow: 0 2px 10px rgba(2,132,199,0.4);
    z-index: 1000 !important;
}
.price-pill.active::after {
    border-top-color: #0284c7;
}

/* Dot marker (compact, shown when zoomed out or crowded) */
.price-dot {
    width: 10px;
    height: 10px;
    background: #1e293b;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: all 0.15s ease;
}
.price-dot:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    transform: scale(1.4);
    z-index: 900 !important;
}
.price-dot.active {
    background: #0284c7;
    border-color: #0284c7;
    box-shadow: 0 2px 8px rgba(2,132,199,0.5);
    z-index: 1000 !important;
}

/* Override leaflet default marker container styles */
.price-marker-container {
    background: transparent !important;
    border: none !important;
}
/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Prevent map tile flickering */
.leaflet-tile-container {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.leaflet-tile {
    will-change: transform;
}

/* Smooth transitions for listing cards */
.listings-container {
    contain: content;
    will-change: contents;
}
.listing-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s ease;
    contain: layout style;
}
.listing-photo {
    /* Prevent layout shift while images load */
    background: #e2e8f0;
}

/* Saved Heart Badge */
.saved-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    color: #ef4444;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
}

/* Compare Icon on Cards */
.compare-card-btn {
    position: absolute;
    top: 10px;
    right: 44px;
    background: rgba(255,255,255,0.95);
    color: #475569;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    padding: 0;
}
.compare-card-btn:hover { background: #e0e7ff; color: #2563eb; }
.compare-card-btn.active { background: #2563eb; color: #fff; }

/* Compare Tray */
.str-compare-tray {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #1a1d27; border-top: 1px solid #2a2d3a;
    padding: 0.6rem 1.5rem; display: flex; align-items: center;
    justify-content: space-between; z-index: 9999;
    transform: translateY(100%); transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.str-compare-tray.visible { transform: translateY(0); }
.str-tray-items { display: flex; gap: 0.6rem; align-items: center; overflow-x: auto; }
.str-tray-item {
    display: flex; align-items: center; gap: 0.4rem;
    background: #0f1117; border: 1px solid #2a2d3a; border-radius: 8px;
    padding: 0.3rem 0.5rem; flex-shrink: 0;
}
.str-tray-item img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; }
.str-tray-item span { font-size: 0.72rem; color: #e4e5e9; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.str-tray-remove { background: none; border: none; color: #8b8d97; cursor: pointer; font-size: 1rem; padding: 0 0.2rem; }
.str-tray-remove:hover { color: #ef4444; }
.str-tray-compare-btn {
    background: #3b82f6; color: #fff; padding: 0.5rem 1.2rem;
    border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    text-decoration: none; white-space: nowrap; transition: opacity 0.2s;
}
.str-tray-compare-btn:hover { opacity: 0.9; }
.str-tray-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.str-tray-clear-btn {
    background: transparent; color: #cbd5e1; padding: 0.4rem 0.85rem;
    border: 1px solid #2a2d3a; border-radius: 8px; font-size: 0.78rem;
    font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.str-tray-clear-btn:hover { background: #2a2d3a; color: #fff; border-color: #3a3d4a; }

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
}
.modal p {
    color: #64748b;
    margin-bottom: 1.5rem;
}
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-form input {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}
.modal-form input:focus {
    outline: none;
    border-color: #0ea5e9;
}
.modal-form button {
    padding: 0.875rem;
    background: #0ea5e9;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.modal-form button:hover {
    opacity: 0.9;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}
.modal-success {
    text-align: center;
    padding: 1rem;
}
.modal-success svg {
    width: 60px;
    height: 60px;
    color: #16a34a;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .listings-container {
        grid-template-columns: 1fr;
    }
    .map-container {
        width: 45%;
    }
}
@media (max-width: 768px) {
    /* Map-first mobile shell: in map view the header + search bar + chips
       + map fill exactly one (dynamic) viewport and the page does NOT
       scroll — so a pan near the map edge can't drag you into the SEO
       band below. The SEO/footer stay in the DOM (crawlable, shown in
       list view), just clipped by the lock. --mobile-chrome-h is the
       live height of the chrome above the map (kept current by
       syncMobileChromeHeight); 108px is the no-chips fallback.
       position:fixed (not just overflow:hidden, which propagates to the
       viewport unreliably) pins the shell so a map pan can't scroll the
       page into the SEO band. The SEO/footer stay in the DOM below,
       clipped — visible again in list view and to crawlers. */
    body:not(.mobile-list-view) {
        position: fixed;
        inset: 0;
        overflow: hidden;
    }
    .main-layout {
        flex-direction: column;
        height: auto;
    }
    .sidebar {
        display: none;
    }
    .map-container {
        width: 100%;
        height: calc(100dvh - var(--mobile-chrome-h, 108px));
    }
    .listings-container {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: row;
        padding: 6px 12px;
        gap: 0;
    }
    .agent-brand {
        gap: 6px;
    }
    .brand-icon svg {
        width: 28px;
        height: 28px;
    }
    .brand-text h1 {
        font-size: 0.9rem;
    }
    .brand-text p {
        display: none;
    }
    .header-actions {
        margin-left: auto;
    }
    .header-divider {
        display: none;
    }
    /* 44px min touch target (was ~35px) for the header CTAs. */
    .header-actions .btn-save-search,
    .header-actions .btn-saved-filter,
    .header-actions #header-user-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ===== Mobile Search Bar ===== */
.mobile-search-bar {
    display: none;
}
@media (max-width: 768px) {
    .mobile-search-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
        position: relative;   /* anchor + stack the typeahead dropdown above the map */
        z-index: 1500;
    }
    /* Dropdown spans the bar (minus the side padding), drops over the map. */
    #mobile-search-bar .search-dropdown { left: 10px; right: 10px; }
    .msb-search {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
        background: #f1f5f9;
        border-radius: 8px;
        padding: 8px 12px;
    }
    .msb-search input {
        border: none;
        background: none;
        outline: none;
        font-size: 16px; /* <16px makes iOS Safari zoom the page on focus */
        width: 100%;
        min-width: 0;
        color: #1e293b;
    }
    .msb-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        background: #fff;
        color: #374151;
        cursor: pointer;
        position: relative;
        flex-shrink: 0;
    }
    .msb-filter-btn-full {
        width: 100%;
        height: 44px;
        font-size: 0.95rem;
        font-weight: 600;
        gap: 10px;
    }
    .msb-filter-count {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #ef4444;
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .msb-search-clear {
        display: none;
        background: none;
        border: none;
        font-size: 1.2rem;
        line-height: 1;
        color: #94a3b8;
        padding: 0 2px;
        cursor: pointer;
    }
}

/* ===== Search typeahead dropdown =====
   Replaces "type -> dump results on the map" with a click-to-open
   results list anchored under whichever search box is in use. */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    max-height: min(60vh, 440px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1600;
}
.search-dropdown.open { display: block; }
.search-dropdown .sd-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
}
.search-dropdown .sd-row:last-child { border-bottom: none; }
.search-dropdown .sd-row:hover,
.search-dropdown .sd-row:active { background: #f1f5f9; }
.search-dropdown .sd-thumb {
    width: 54px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #e2e8f0;
}
.search-dropdown .sd-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-dropdown .sd-addr {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-dropdown .sd-meta { font-size: 0.74rem; color: #64748b; margin-top: 1px; }
.search-dropdown .sd-price { font-size: 0.85rem; font-weight: 700; color: #0F6E56; flex-shrink: 0; }
.search-dropdown .sd-empty { padding: 16px 12px; font-size: 0.85rem; color: #64748b; text-align: center; }
/* Search boxes need a positioning context + to sit above the map. */
.fbar-search { position: relative; }
/* The floating filter-bar search is narrow (~290px); give its dropdown a
   comfortable fixed width (anchored left, extending right over the map)
   so rows don't wrap. */
#fbar-search-dropdown { right: auto; width: 360px; }

/* ===== Mobile List/Map Toggle ===== */
.mobile-view-toggle {
    display: none;
}
@media (max-width: 768px) {
    .mobile-view-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        z-index: 1050;
        background: #1e293b;
        color: #fff;
        border: none;
        border-radius: 24px;
        padding: 13px 22px;
        font-size: 0.95rem;
        font-weight: 600;
        font-family: inherit;
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
        cursor: pointer;
    }
    /* List mode: hide the map, show the (normally hidden) sidebar as a
       full-width list in normal document flow so the page scrolls
       naturally and the content below the map becomes reachable. */
    body.mobile-list-view .main-layout {
        height: auto;
    }
    body.mobile-list-view .map-container {
        display: none;
    }
    body.mobile-list-view .sidebar {
        display: block;
        border-left: none;
        overflow: visible;
    }
    /* The mobile bar already provides search + filters; keep only the
       results count from the desktop filter header. */
    body.mobile-list-view .filters .search-row,
    body.mobile-list-view .filters .filter-row {
        display: none;
    }
    body.mobile-list-view .filters {
        padding: 0.6rem 1rem;
        position: static;
    }
}

/* ===== Map Filter Bar (desktop) =====
   Floating Zillow-style bar over the map. The legacy sidebar
   filter row is hidden on desktop but its inputs stay in the DOM
   as the single source of truth — the bar writes through to them
   so saved searches, URL init, and analytics keep working. */
.fbar, .fbar-chips, .fbar-pop { display: none; }
.fseg { padding: 8px 0; border: 1px solid #d6d3d1; font-size: 0.85rem; text-align: center;
        cursor: pointer; background: #fff; color: #1e293b; flex: 1; user-select: none; }
.fseg:first-child { border-radius: 8px 0 0 8px; }
.fseg:last-child { border-radius: 0 8px 8px 0; }
.fseg + .fseg { border-left: none; }
.fseg.on { background: #0F6E56; color: #E1F5EE; border-color: #0F6E56; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
         border: 1px solid #d6d3d1; border-radius: 20px; font-size: 0.83rem; cursor: pointer;
         background: #fff; color: #1e293b; user-select: none; white-space: nowrap; }
.fchip.on { background: #0F6E56; border-color: #0F6E56; color: #E1F5EE; }
.ftile { border: 1px solid #d6d3d1; border-radius: 8px; padding: 12px 6px; text-align: center;
         cursor: pointer; background: #fff; color: #1e293b; user-select: none; }
.ftile.on { background: #0F6E56; border-color: #0F6E56; color: #E1F5EE; }
.ftile .ft-name { font-size: 0.8rem; font-weight: 600; margin-top: 4px; }
.ftile .ft-count { font-size: 0.7rem; color: #94a3b8; margin-top: 2px; }
.ftile.on .ft-count { color: #9FE1CB; }
.fpop-h3 { font-size: 0.85rem; font-weight: 600; color: #1e293b; margin: 0 0 9px; }
.fpop-sec { margin-bottom: 18px; }
.fpop-select { width: 100%; padding: 9px 10px; border: 1px solid #d6d3d1; border-radius: 8px;
               font-size: 0.85rem; background: #fff; color: #1e293b; font-family: inherit; }
.fhisto { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-bottom: 8px; }
.fhisto div { flex: 1; border-radius: 2px 2px 0 0; background: #1D9E75; min-height: 3px; }
.fhisto div.dim { background: #cbd5e1; }
.fapply { background: #0F6E56; border: none; color: #E1F5EE; font-size: 0.88rem; font-weight: 600;
          padding: 10px 18px; border-radius: 8px; cursor: pointer; }
.fapply:hover { background: #085041; }
.freset { font-size: 0.85rem; color: #64748b; cursor: pointer; text-decoration: underline;
          background: none; border: none; font-family: inherit; }
@media (min-width: 769px) {
    .fbar {
        display: flex; gap: 6px; align-items: center;
        position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1001;
    }
    /* The in-bar search needs ~1100px of viewport (map is 45-50%
       wide) — below that the sidebar search box stays visible
       instead, and the pills shrink so six of them fit a 346px map. */
    .fbar-search {
        flex: 1; min-width: 110px; max-width: 290px; display: none; align-items: center; gap: 8px;
        background: #fff; border: 1px solid #d6d3d1; border-radius: 8px; padding: 0 12px; height: 40px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    }
    .fbar-search input { border: none; outline: none; background: none; font-size: 0.85rem;
                         width: 100%; color: #1e293b; font-family: inherit; min-width: 0; }
    .fbar-search .fbar-search-clear { display: none; background: none; border: none;
                                      font-size: 1.05rem; color: #94a3b8; cursor: pointer; padding: 0 2px; }
    .fbar-pill {
        display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; height: 38px;
        border: 1px solid #d6d3d1; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
        color: #1e293b; background: #fff; cursor: pointer; white-space: nowrap; font-family: inherit;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    }
    .fbar-pill:hover { border-color: #94a3b8; }
    .fbar-pill.open, .fbar-pill.has { background: #0F6E56; border-color: #0F6E56; color: #E1F5EE; }
    .fbar-pill .fbar-caret { font-size: 0.7rem; }
    /* City/town filter surfaced as the first control in the bar
       (relocated from the Tahoe popover). Compact so it doesn't crowd
       the pills; the freeform search box shrinks to absorb its width. */
    .fbar > .fbar-city { flex: 0 1 auto; min-width: 0; max-width: 150px; }
    .fbar > .fbar-city .mf-button {
        height: 38px; border-radius: 8px; border-color: #d6d3d1;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12); font-weight: 600;
        font-size: 0.8rem; padding: 0 10px; color: #1e293b;
    }
    .fbar > .fbar-city[aria-expanded="true"] .mf-button { border-color: #0F6E56; }
    .fbar > .fbar-city .mf-panel { z-index: 1003; }
    .fbar-chips {
        display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
        position: absolute; top: 58px; left: 10px; right: 170px; z-index: 1001;
    }
    .fbar-chip {
        display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
        background: #0F6E56; color: #E1F5EE; border-radius: 16px; font-size: 0.78rem;
        font-weight: 500; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    }
    .fbar-chip:hover { background: #085041; }
    .fbar-chips .fbar-reset { font-size: 0.78rem; color: #1e293b; background: rgba(255,255,255,0.92);
        border: none; border-radius: 16px; padding: 5px 11px; cursor: pointer;
        text-decoration: underline; font-family: inherit; }
    .fbar-pop {
        display: block; position: absolute; top: 58px; width: 340px; max-height: calc(100% - 80px);
        overflow-y: auto; background: #fff; border: 1px solid #e2e8f0;
        border-radius: 12px; padding: 16px; z-index: 1002;
        box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    }
    .fbar-pop[hidden] { display: none; }
    .fbar-pop .fpop-foot { display: flex; align-items: center; justify-content: space-between;
                           margin-top: 4px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
    /* The bar owns the top edge — push Leaflet & custom controls down. */
    .leaflet-top .leaflet-control { margin-top: 58px; }
    /* Legacy sidebar filter UI hidden on desktop (state store only).
       The search row survives until the in-bar search appears. */
    .filters .filter-row { display: none; }
    .filters { padding: 0.6rem 1rem; }
}
@media (min-width: 1100px) {
    .fbar { gap: 7px; }
    .fbar-search { display: flex; }
    .fbar-pill { padding: 0 12px; height: 40px; font-size: 0.85rem; gap: 6px; }
    .filters .search-row { display: none; }
}

/* ===== Mobile Filter Panel ===== */
.mobile-filter-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #1a1a1a;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.mobile-filter-panel.active {
    display: flex;
    transform: translateY(0);
}
.mfp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}
.mfp-close {
    background: #333;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mfp-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}
.mfp-reset {
    background: #333;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
}
.mfp-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}
.mfp-section {
    margin-bottom: 24px;
}
.mfp-section h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.mfp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mfp-pill {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.mfp-pill.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    font-weight: 600;
}
.mfp-select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px; /* <16px makes iOS Safari zoom the page on focus */
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.mfp-select option, .mfp-select optgroup {
    background: #2a2a2a;
    color: #fff;
}
.mfp-footer {
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid #333;
}
.mfp-apply {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Mobile Price Filter ===== */
.mfp-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.mfp-price-input {
    flex: 1;
    /* min-width:0 lets flex shrink below the input's ~180px intrinsic
       minimum — without it the min+dash+max row overflows a 390px
       phone and the sheet appears shoved to the right. 16px font is
       deliberate: anything smaller makes iOS Safari auto-zoom the
       page on focus ("inputs look huge" bug). */
    min-width: 0;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
    outline: none;
}
.mfp-price-input:focus {
    border-color: #fff;
}
.mfp-price-input::placeholder {
    color: #777;
}
.mfp-price-dash {
    color: #666;
    font-size: 1rem;
    flex-shrink: 0;
}
.mfp-slider-wrap {
    position: relative;
    height: 40px;
    margin-bottom: 8px;
}
.mfp-slider-track {
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 4px;
    background: #444;
    border-radius: 2px;
}
.mfp-slider-fill {
    position: absolute;
    height: 100%;
    background: #22d3ee;
    border-radius: 2px;
}
.mfp-range {
    position: absolute;
    top: 6px;
    left: 0;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    height: 24px;
}
.mfp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #22d3ee;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.mfp-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #22d3ee;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.mfp-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    color: #777;
    font-size: 0.75rem;
}

/* ===== Mobile filter sheet — light theme (filter-bar redesign) =====
   Overrides the original dark sheet so phone + desktop share one
   visual language. Kept as a cascade block (same specificity, later
   wins) instead of editing 20 scattered rules. */
.mobile-filter-panel { background: #fff; }
.mfp-header { border-bottom: 1px solid #e2e8f0; }
.mfp-close { background: #f1f5f9; color: #334155; }
.mfp-title { color: #0f172a; }
.mfp-reset { background: #f1f5f9; color: #334155; }
.mfp-section h3 { color: #0f172a; }
.mfp-pill { background: #fff; border-color: #d6d3d1; color: #1e293b; }
.mfp-pill.active { background: #0F6E56; color: #E1F5EE; border-color: #0F6E56; font-weight: 600; }
.mfp-select { background-color: #fff; border-color: #d6d3d1; color: #1e293b; }
.mfp-select option, .mfp-select optgroup { background: #fff; color: #1e293b; }
.mfp-price-input { background: #fff; border-color: #d6d3d1; color: #1e293b; }
.mfp-price-input:focus { border-color: #0F6E56; }
.mfp-price-input::placeholder { color: #94a3b8; }
.mfp-price-dash { color: #94a3b8; }
.mfp-slider-track { background: #e2e8f0; }
.mfp-slider-fill { background: #0F6E56; }
.mfp-range::-webkit-slider-thumb { border-color: #0F6E56; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.mfp-range::-moz-range-thumb { border-color: #0F6E56; }
.mfp-slider-labels { color: #64748b; }
.mfp-footer { border-top: 1px solid #e2e8f0; }
.mfp-apply { background: #0F6E56; }
.mobile-filter-panel .fchip { padding: 9px 12px; }
.mobile-filter-panel .ftile { padding: 10px 4px; }

/* Active-filter chips strip on the phone map screen (same chip
   classes the desktop bar renders). */
.mobile-chips { display: none; }
@media (max-width: 768px) {
    .mobile-chips {
        display: flex; gap: 6px; align-items: center; overflow-x: auto;
        padding: 8px 10px; background: #fff; border-bottom: 1px solid #e2e8f0;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-chips:empty { display: none; }
    .mobile-chips .fbar-chip {
        display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
        background: #0F6E56; color: #E1F5EE; border-radius: 16px; font-size: 0.78rem;
        font-weight: 500; white-space: nowrap; flex-shrink: 0;
    }
    .mobile-chips .fbar-reset {
        font-size: 0.78rem; color: #475569; background: #f1f5f9; border: none;
        border-radius: 16px; padding: 6px 11px; cursor: pointer;
        text-decoration: underline; font-family: inherit; white-space: nowrap; flex-shrink: 0;
    }
}

/* ===== Draw on Map controls (top-left) ===== */
.draw-control-group { display: flex; flex-direction: column; }
/* "Back to <neighborhood>" chip — floats bottom-center over the map
   while a hub-page deep-link polygon is RELEASED (user panned away).
   Clicking re-applies the neighborhood filter + refits the map. */
.nb-back-chip {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 1001;                 /* above leaflet panes/controls */
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    white-space: nowrap;
}
.nb-back-chip:hover { background: #eff6ff; }
@media (max-width: 768px) {
    /* Sit above the fixed List/Map toggle pill on phones */
    .nb-back-chip { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
.leaflet-bar a.draw-toggle, .draw-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; color: #1f2937; font-weight: 600; font-size: 0.78rem;
    padding: 0 12px !important; height: 30px !important; line-height: 30px !important; width: auto !important;
    text-decoration: none;
}
.leaflet-bar a.draw-toggle:hover { background: #f1f5f9; color: #2563eb; }
.leaflet-bar a.draw-toggle.active {
    background: #2563eb !important; color: #fff !important;
}
.leaflet-bar a.draw-clear-toggle, .draw-clear-toggle {
    display: none;
    align-items: center; gap: 6px;
    background: #fff; color: #b91c1c; font-weight: 600; font-size: 0.78rem;
    padding: 0 12px !important; height: 28px !important; line-height: 28px !important; width: auto !important;
    text-decoration: none; border-top: 1px solid #e5e7eb;
}
.leaflet-bar a.draw-clear-toggle.visible { display: inline-flex; }
.leaflet-bar a.draw-clear-toggle:hover { background: #fef2f2; }

/* ===== County Lines Toggle ===== */
.leaflet-top.leaflet-right .leaflet-bar:has(.county-toggle) {
    border: none !important; box-shadow: none !important; overflow: visible !important;
    background: none !important; margin-top: 55px !important;
}
.leaflet-bar a.county-toggle, .county-toggle {
    background: white !important; padding: 6px 12px !important; border-radius: 6px !important;
    font-size: 0.75rem !important; font-weight: 600 !important; color: #334155 !important;
    cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,0.2) !important;
    border: 1px solid #e2e8f0 !important; transition: all 0.2s; user-select: none;
    white-space: nowrap; text-decoration: none !important; display: block !important;
    width: auto !important; height: auto !important; overflow: visible !important; line-height: 1.3 !important;
}
.leaflet-bar a.county-toggle:hover, .county-toggle:hover { background: #f1f5f9 !important; color: #334155 !important; }
.leaflet-bar a.county-toggle.active, .county-toggle.active {
    background: #475569 !important; color: white !important; border-color: #475569 !important;
    box-shadow: 0 2px 8px rgba(71,85,105,0.35) !important;
}
.leaflet-bar a.county-toggle.active:hover, .county-toggle.active:hover { background: #334155 !important; color: white !important; }
.county-label {
    background: none !important; border: none !important; box-shadow: none !important;
    font-size: 11px; font-weight: 700; color: #475569;
    text-shadow: 1px 1px 2px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white, 0 0 4px white;
    white-space: nowrap; pointer-events: none;
}
.county-label .county-label-state { font-size: 9px; font-weight: 500; color: #94a3b8; display: block; text-align: center; }
.city-label {
    background: none !important; border: none !important; box-shadow: none !important;
    font-size: 10px; font-weight: 600; color: #7c3aed;
    text-shadow: 1px 1px 2px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white, 0 0 4px white;
    white-space: nowrap; pointer-events: none; font-style: italic;
}
/* Tourist Core (TCAP) callout — solid fuchsia pill, distinct from the
   purple city limit, orange/blue county lines, and green basemap. */
.tourist-core-label {
    background: #c026d3 !important; border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35) !important;
    font-size: 10px; font-weight: 700; color: #fff !important;
    padding: 2px 8px; border-radius: 11px; text-align: center;
    white-space: nowrap; pointer-events: none;
}
