/*
 * The property finder shared by every theme (views: site/finder/bar, quick, rescue).
 * A theme gives it its own look by setting these on :root in theme.css (the defaults below have no specificity,
 * so a theme always wins whatever the load order). finder.css loads after theme.css: a theme rule that restyles a
 * finder part needs one more class than the rule here (prefix it with .ef):
 *   --ef-font  --ef-ink  --ef-muted  --ef-surface (controls)  --ef-raised (menus, sheets)  --ef-tint (hover)
 *   --ef-line  --ef-accent  --ef-accent-ink  --ef-radius (boxes)  --ef-round (pill shapes)  --ef-shadow  --ef-focus
 */
:where(:root) {
    --ef-font: inherit;
    --ef-ink: #15171c;
    --ef-muted: #5f6571;
    --ef-surface: #ffffff;
    --ef-raised: #ffffff;
    --ef-tint: rgba(21, 23, 28, .055);
    --ef-line: rgba(21, 23, 28, .15);
    --ef-accent: #1f4fd1;
    --ef-accent-ink: #ffffff;
    --ef-radius: 12px;
    --ef-round: 999px;
    --ef-shadow: 0 24px 60px -24px rgba(12, 14, 20, .38), 0 2px 8px rgba(12, 14, 20, .07);
    --ef-focus: var(--ef-accent);
}

.ef, .ef-suggest { font-family: var(--ef-font); color: var(--ef-ink); }
.ef *, .ef *::before, .ef *::after, .ef-suggest * { box-sizing: border-box; }
.ef-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ef-ic { width: 18px; height: 18px; flex: none; }
:where(.ef fieldset) { margin: 0; padding: 0; border: 0; min-width: 0; }
.ef-n { margin-left: auto; padding-left: 10px; font-size: 12px; font-weight: 500; color: var(--ef-muted); font-variant-numeric: tabular-nums; }

/* ---------- search page: layout ---------- */
.ef:not(.ef--quick) { display: grid; gap: 14px; margin: 0 0 30px; }
.ef-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ef-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ef-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-height: 34px; }

/* a note above the finder: the property someone came for is no longer listed */
.ef-notice { margin: 0; padding: 14px 18px; border: 1px solid var(--ef-line); border-left: 3px solid var(--ef-accent); border-radius: min(10px, var(--ef-radius)); background: var(--ef-tint); font-size: 15px; line-height: 1.5; }

/* Buy / Rent */
.ef-seg { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--ef-line); border-radius: var(--ef-round); background: var(--ef-surface); }
.ef-seg label { position: relative; display: flex; }
.ef-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ef-seg span { display: inline-flex; align-items: baseline; justify-content: center; gap: 6px; width: 100%; padding: 9px 18px; border-radius: var(--ef-round); font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background-color .2s, color .2s; }
.ef-seg .ef-n { margin: 0; padding: 0; font-size: 12px; color: inherit; opacity: .7; }
.ef-seg label:hover span { background: var(--ef-tint); }
.ef-seg input:checked + span { background: var(--ef-accent); color: var(--ef-accent-ink); }
.ef-seg input:checked + span .ef-n { opacity: 1; }
.ef-seg input:focus-visible + span { outline: 2px solid var(--ef-focus); outline-offset: 2px; }

/* search box */
.ef-search { position: relative; display: flex; align-items: center; flex: 1 1 320px; min-width: 0; }
.ef-search > .ef-ic { position: absolute; left: 15px; color: var(--ef-muted); pointer-events: none; }
.ef-search input { width: 100%; height: 50px; padding: 0 16px 0 44px; border: 1px solid var(--ef-line); border-radius: var(--ef-radius); background: var(--ef-surface); color: var(--ef-ink); font: inherit; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.ef-search input::placeholder { color: var(--ef-muted); opacity: .9; }
.ef-search input:focus { border-color: var(--ef-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ef-accent) 22%, transparent); }

/* filter buttons */
.ef-field { position: relative; }
.ef-field[hidden] { display: none; }
.ef-pill { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 12px 6px 14px; border: 1px solid var(--ef-line); border-radius: var(--ef-radius); background: var(--ef-surface); color: var(--ef-ink); cursor: pointer; list-style: none; user-select: none; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.ef-pill::-webkit-details-marker { display: none; }
.ef-pill::marker { content: ''; }
.ef-pill:hover { border-color: color-mix(in srgb, var(--ef-ink) 35%, transparent); }
.ef-pill:focus-visible { outline: 2px solid var(--ef-focus); outline-offset: 2px; }
.ef-pill__k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ef-muted); }
.ef-pill__v { max-width: 230px; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ef-pill__chev { width: 16px; height: 16px; color: var(--ef-muted); transition: transform .2s; }
.ef-pill.is-on { border-color: var(--ef-accent); box-shadow: inset 0 0 0 1px var(--ef-accent); background: color-mix(in srgb, var(--ef-accent) 7%, var(--ef-surface)); }
.ef-field[open] > .ef-pill { border-color: var(--ef-accent); }
.ef-field[open] > .ef-pill .ef-pill__chev { transform: rotate(180deg); }

/* the menu of a filter */
.ef-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 1200; width: max-content; min-width: 270px; max-width: min(380px, calc(100vw - 32px)); padding: 6px; border: 1px solid var(--ef-line); border-radius: min(calc(var(--ef-radius) + 4px), calc(var(--ef-radius) * 2)); background: var(--ef-raised); color: var(--ef-ink); box-shadow: var(--ef-shadow); }
.ef-field:last-of-type .ef-pop { left: auto; right: 0; }
.ef-pop__head, .ef-pop__foot { display: none; }
.ef-pop__body { max-height: min(62vh, 440px); overflow: auto; overscroll-behavior: contain; }
.ef-note { margin: 6px 10px 10px; font-size: 13px; line-height: 1.45; color: var(--ef-muted); }
.ef-find { width: calc(100% - 8px); height: 40px; margin: 4px 4px 6px; padding: 0 12px; border: 1px solid var(--ef-line); border-radius: min(10px, var(--ef-radius)); background: var(--ef-surface); color: var(--ef-ink); font: inherit; font-size: 14px; outline: none; }
.ef-find:focus { border-color: var(--ef-accent); }

.ef-opts { margin: 0; padding: 0; list-style: none; }
.ef-opt label { position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 12px; border-radius: min(10px, var(--ef-radius)); font-size: 14px; line-height: 1.3; cursor: pointer; }
.ef-opt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ef-opt label:hover { background: var(--ef-tint); }
.ef-opt label:has(input:focus-visible) { outline: 2px solid var(--ef-focus); outline-offset: -2px; }
.ef-opt__t { min-width: 0; overflow-wrap: anywhere; }
.ef-opt input:checked ~ .ef-opt__t { font-weight: 700; color: var(--ef-accent); }
.ef-opt input:checked ~ .ef-n { color: var(--ef-accent); }
.ef-opt label:has(input:checked) { background: color-mix(in srgb, var(--ef-accent) 9%, transparent); }
.ef-opt label:has(input:checked)::after { content: ''; flex: none; width: 7px; height: 12px; margin: -3px 2px 0 2px; border: solid var(--ef-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ef-opt.is-none label { opacity: .42; cursor: not-allowed; }
.ef-opt.is-none label:hover { background: none; }
.ef-opt[hidden] { display: none; }
.ef-opt--d0 > label { font-weight: 600; }
.ef-opt--d1 > label { padding-left: 30px; }
.ef-opt--d2 > label { padding-left: 48px; font-size: 13.5px; }
.ef-opt--d1 > label::before, .ef-opt--d2 > label::before { content: ''; position: absolute; top: 50%; width: 8px; border-top: 1px solid var(--ef-line); }
.ef-opt--d1 > label::before { left: 16px; }
.ef-opt--d2 > label::before { left: 34px; }

/* sizes as a grid, bedrooms as a row of chips */
.ef-opts--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.ef-opt--wide { grid-column: 1 / -1; }
.ef-opts--row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; }
.ef-opts--row .ef-opt label { min-height: 40px; padding: 8px 12px; border: 1px solid var(--ef-line); border-radius: var(--ef-round); }
.ef-opts--row .ef-opt label::after { display: none; }
.ef-opts--row .ef-opt label:has(input:checked) { border-color: var(--ef-accent); }

/* price */
.ef-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 6px 6px; }
.ef-select { display: grid; gap: 6px; min-width: 0; }
.ef-select > span, .ef-sort > span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ef-muted); }
.ef-select select, .ef-sort select { width: 100%; height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--ef-line); border-radius: min(10px, var(--ef-radius)); background: var(--ef-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; color: var(--ef-ink); font: inherit; font-size: 14px; font-weight: 600; appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; }
.ef-select select:focus, .ef-sort select:focus { border-color: var(--ef-accent); }
.ef select option { background: var(--ef-raised); color: var(--ef-ink); }
.ef select option:disabled { color: var(--ef-muted); }

/* sort and the no-script button */
.ef-sort { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.ef-sort select { width: auto; min-width: 190px; height: 46px; border-radius: var(--ef-radius); }
.ef-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--ef-radius); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; transition: filter .2s, transform .2s; }
.ef-btn--primary { background: var(--ef-accent); color: var(--ef-accent-ink); }
.ef-btn--primary:hover { filter: brightness(1.08); }
.ef-btn:focus-visible { outline: 2px solid var(--ef-focus); outline-offset: 3px; }
.ef-on .ef-apply { display: none; }

/* what is showing: count, filters in use, clear */
.ef-total { margin: 0; font-size: 15px; color: var(--ef-muted); }
.ef-total b { margin-right: 2px; font-size: 20px; font-weight: 700; color: var(--ef-ink); font-variant-numeric: tabular-nums; }
.ef-total.is-busy::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 10px; vertical-align: -1px; border: 2px solid var(--ef-line); border-top-color: var(--ef-accent); border-radius: 50%; animation: ef-spin .7s linear infinite; }
.ef-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ef-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 8px 4px 12px; border: 1px solid var(--ef-line); border-radius: var(--ef-round); background: var(--ef-tint); color: var(--ef-ink); font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color .2s, background-color .2s; }
.ef-chip .ef-ic { width: 14px; height: 14px; opacity: .7; }
.ef-chip:hover { border-color: var(--ef-accent); background: color-mix(in srgb, var(--ef-accent) 10%, transparent); }
.ef-chip:focus-visible, .ef-clear:focus-visible { outline: 2px solid var(--ef-focus); outline-offset: 2px; }
.ef-clear { font-size: 13px; font-weight: 600; color: var(--ef-muted); text-decoration: underline; text-underline-offset: 3px; }
.ef-clear:hover { color: var(--ef-ink); }

/* results while the next ones load */
[data-ef-results] { transition: opacity .18s; }
[data-ef-results].ef-busy { opacity: .45; pointer-events: none; cursor: progress; }

/* ---------- suggestions under a search box ---------- */
.ef-suggest { position: fixed; z-index: 2147482500; margin: 0; padding: 6px; overflow: auto; list-style: none; border: 1px solid var(--ef-line); border-radius: min(calc(var(--ef-radius) + 2px), calc(var(--ef-radius) * 2)); background: var(--ef-raised); box-shadow: var(--ef-shadow); text-align: left; }
.ef-suggest__head { padding: 6px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ef-muted); }
.ef-suggest__item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 12px; border-radius: min(10px, var(--ef-radius)); font-size: 14px; line-height: 1.3; cursor: pointer; }
.ef-suggest__item--d0 { font-weight: 600; }
.ef-suggest__item:hover, .ef-suggest__item[aria-selected="true"] { background: var(--ef-tint); }
.ef-suggest__item mark { padding: 0; background: none; color: var(--ef-accent); font-weight: 700; }

/* ---------- home search ---------- */
.ef--quick { display: grid; gap: 12px; width: 100%; text-align: left; }
.ef-seg--quick { justify-self: start; }
.ef-seg--quick span { padding: 9px 20px; }
.ef-quick { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: stretch; padding: 6px; border: 1px solid var(--ef-line); border-radius: min(calc(var(--ef-radius) + 6px), calc(var(--ef-radius) * 2)); background: var(--ef-raised); color: var(--ef-ink); box-shadow: var(--ef-shadow); }
.ef-quick__cell { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 8px 16px; border-left: 1px solid var(--ef-line); }
.ef-quick__cell:first-child { border-left: 0; }
.ef-quick__label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ef-muted); cursor: pointer; }
.ef-quick__field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ef-quick__field .ef-ic { color: var(--ef-muted); }
.ef-quick input, .ef-quick select { width: 100%; min-width: 0; padding: 4px 0; border: 0; background: transparent; color: var(--ef-ink); font: inherit; font-size: 15px; font-weight: 600; outline: none; text-overflow: ellipsis; }
.ef-quick input::placeholder { color: var(--ef-muted); font-weight: 500; opacity: .95; }
.ef-quick select { padding-right: 22px; appearance: none; -webkit-appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 0 center / 16px no-repeat; cursor: pointer; }
.ef-quick input:focus, .ef-quick input:focus-visible, .ef-quick select:focus, .ef-quick select:focus-visible { outline: none; box-shadow: none; border: 0; }
.ef-quick__cell:focus-within { border-radius: min(12px, var(--ef-radius)); background: var(--ef-tint); box-shadow: inset 0 -2px 0 var(--ef-accent); }
.ef-go { min-height: 58px; padding: 0 28px; border-radius: min(calc(var(--ef-radius) + 2px), calc(var(--ef-radius) * 2)); }
.ef-go .ef-ic { width: 20px; height: 20px; }

/* ---------- when nothing matches ---------- */
.ef-rescue { display: grid; gap: 14px; width: 100%; max-width: 560px; margin: 18px auto 0; text-align: left; }
.ef-rescue__lead { margin: 0; font-size: 15px; line-height: 1.5; }
.ef-rescue__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ef-rescue__list a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 12px 16px; border: 1px solid var(--ef-line); border-radius: var(--ef-radius); color: inherit; text-decoration: none; transition: border-color .2s, background-color .2s; }
.ef-rescue__list a:hover { border-color: var(--ef-accent); background: color-mix(in srgb, var(--ef-accent) 7%, transparent); }
.ef-rescue__list b { flex: none; color: var(--ef-accent); font-variant-numeric: tabular-nums; }
.ef-rescue__more { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; font-size: 14px; font-weight: 600; }
.ef-rescue__more a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
    .ef-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ef-quick__where { grid-column: 1 / -1; border-bottom: 1px solid var(--ef-line); }
    .ef-quick__where + .ef-quick__cell { border-left: 0; }
    .ef-go { grid-column: auto; min-height: 54px; margin: 6px 0 0 6px; }
}

/* ---------- phones: filter menus become sheets ---------- */
@media (max-width: 760px) {
    .ef-head { flex-direction: column; align-items: stretch; }
    .ef-seg { display: flex; }
    .ef-seg label { flex: 1; }
    .ef-search { flex: 1 1 auto; }
    .ef-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ef-pill { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; width: 100%; min-height: 54px; padding: 7px 12px; }
    .ef-pill__v { max-width: 100%; font-size: 13.5px; }
    .ef-pill__chev { display: none; }
    .ef-sort { grid-column: span 2; margin: 0; }
    .ef-bar > .ef-field[data-ef-field="beds"]:not([hidden]) ~ .ef-sort { grid-column: span 1; }
    .ef-sort > span { display: none; }
    .ef-sort select { width: 100%; min-width: 0; height: 54px; }
    .ef-field[open] > .ef-pill::before { content: ''; position: fixed; inset: 0; z-index: 2147481999; background: rgba(9, 11, 15, .5); cursor: default; }
    .ef-pop { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 2147482000; display: flex; flex-direction: column; width: auto; min-width: 0; max-width: none; max-height: 86vh; padding: 0 0 env(safe-area-inset-bottom); border-width: 1px 0 0; border-radius: min(20px, calc(var(--ef-radius) * 2)) min(20px, calc(var(--ef-radius) * 2)) 0 0; animation: ef-up .24s cubic-bezier(.2, .8, .2, 1); }
    .ef-field:last-of-type .ef-pop { right: 0; left: 0; }
    .ef-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 20px; }
    .ef-pop__title { margin: 0; font-size: 18px; font-weight: 700; }
    .ef-pop__x { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--ef-round); background: var(--ef-tint); color: var(--ef-ink); cursor: pointer; }
    .ef-pop__body { flex: 1; max-height: none; padding: 0 10px 8px; }
    .ef-pop__foot { display: block; padding: 12px 16px 14px; border-top: 1px solid var(--ef-line); }
    .ef-pop__foot .ef-btn { width: 100%; min-height: 52px; }
    .ef-opt label { min-height: 48px; font-size: 15px; }
    .ef-range { grid-template-columns: 1fr; }
    .ef-select select { height: 50px; font-size: 16px; }
    .ef-search input, .ef-find, .ef-quick input { font-size: 16px; } /* no zoom on focus in iOS */
    .ef-sum { gap: 8px 10px; }

    .ef-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px; }
    .ef-quick__where { grid-column: 1 / -1; }
    .ef-quick__cell { padding: 10px 14px; }
    .ef-go { grid-column: 1 / -1; margin: 6px 0 0; }
    .ef-seg--quick { justify-self: stretch; }
}
html.ef-lock { overflow: hidden; }

@keyframes ef-up { from { transform: translateY(28px); opacity: 0; } }
@keyframes ef-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .ef *, .ef-suggest { transition: none !important; animation: none !important; }
}
@media print {
    .ef, .ef-suggest { display: none !important; }
}
