:root {
  --ps-bg: #f7f4ef;
  --ps-surface: #fff;
  --ps-ink: #211d17;
  --ps-muted: #756d61;
  --ps-soft: #a39888;
  --ps-border: #e6ded1;
  --ps-gold: #b88a3b;
  --ps-gold-dark: #8b6425;
  --ps-gold-light: #f7edd9;
  --ps-teal: #287e73;
  --ps-teal-light: #e1f1ed;
  --ps-danger: #b4433c;
  --ps-radius: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ps-bg); color: var(--ps-ink); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(184,138,59,.42); outline-offset: 3px; }
.search-app { min-height: 100dvh; padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
.search-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 16px 13px; background: rgba(247,244,239,.94); border-bottom: 1px solid rgba(230,222,209,.82); backdrop-filter: blur(16px); }
.back-button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ps-ink); border: 1px solid var(--ps-border); border-radius: 50%; background: var(--ps-surface); }
.back-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-title-wrap { min-width: 0; }
.eyebrow, .section-kicker { margin: 0 0 3px; color: var(--ps-gold-dark); font-size: 9px; letter-spacing: .15em; font-weight: 700; text-transform: uppercase; }
.search-header h1 { margin: 0; font-size: 19px; line-height: 1.15; font-weight: 600; letter-spacing: -.035em; }
.reset-button { padding: 9px 0 9px 10px; border: 0; background: transparent; color: var(--ps-gold-dark); font-size: 13px; font-weight: 600; }
.search-content { width: min(760px, 100%); margin: 0 auto; padding: 14px 14px 24px; }
.search-section { margin-bottom: 14px; padding: 19px 16px 17px; border: 1px solid rgba(224,215,201,.9); border-radius: var(--ps-radius); background: var(--ps-surface); box-shadow: 0 3px 12px rgba(39,30,17,.045); }
.area-section { padding-top: 18px; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading-row h2 { margin: 0; color: var(--ps-ink); font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.required-label, .multi-hint { color: var(--ps-muted); font-size: 10px; white-space: nowrap; }
.required-label { padding: 5px 8px; border-radius: 99px; color: var(--ps-gold-dark); background: var(--ps-gold-light); font-weight: 600; }
.area-entry-wrap { position: relative; display: flex; align-items: center; min-height: 51px; padding: 0 13px; border: 1px solid #dcd4c8; border-radius: 13px; background: #fff; }
.area-entry-wrap:focus-within { border-color: var(--ps-gold); box-shadow: 0 0 0 3px rgba(184,138,59,.12); }
.search-icon { width: 19px; height: 19px; margin-right: 10px; flex: 0 0 auto; fill: none; stroke: #8d8272; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#areaInput { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; color: var(--ps-ink); background: transparent; font-size: 14px; }
#areaInput::placeholder { color: #a2998c; }
.clear-input { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: #f0ece5; color: #70685e; font-size: 19px; line-height: 1; }
.area-suggestions { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--ps-border); border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(31,25,17,.15); }
.area-suggestions[hidden] { display: none; }
.area-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ps-ink); text-align: left; }
.area-option:hover, .area-option:focus-visible { background: var(--ps-gold-light); }
.area-option-icon { display: grid; place-items: center; flex: 0 0 31px; height: 31px; border-radius: 9px; color: var(--ps-gold-dark); background: #f6f0e5; }
.area-option-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.area-option-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.area-option-name { font-size: 13px; font-weight: 600; }
.area-option-count { color: var(--ps-muted); font-size: 11px; }
.no-area-options { padding: 14px 11px; color: var(--ps-muted); font-size: 12px; line-height: 1.5; }
.selected-area-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.selected-area-wrap[hidden] { display: none; }
.selection-caption { color: var(--ps-muted); font-size: 11px; }
.selected-area-pill { display: inline-flex; align-items: center; gap: 12px; padding: 8px 11px 8px 13px; border: 1px solid #99c7bf; border-radius: 999px; color: #175d55; background: var(--ps-teal-light); font-size: 12px; font-weight: 700; }
.pill-remove { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(40,126,115,.11); font-size: 16px; line-height: 1; }
.inline-error { margin: 10px 0 0; color: var(--ps-danger); font-size: 12px; line-height: 1.45; }
.inline-error[hidden] { display: none; }
.area-helper { margin: 10px 0 0; color: var(--ps-muted); font-size: 11px; line-height: 1.5; }
.locked-filters { border-radius: var(--ps-radius); transition: opacity .2s ease, filter .2s ease; }
.locked-filters.is-locked { opacity: .42; filter: grayscale(.22); pointer-events: none; user-select: none; }
.locked-filters.is-locked .search-section { box-shadow: none; }
.pill-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.choice-pill { min-height: 41px; min-width: 82px; padding: 9px 17px; border: 1px solid #d9d0c2; border-radius: 999px; color: #51493f; background: #fff; font-size: 13px; font-weight: 600; transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease; }
.choice-pill[aria-pressed="true"] { border-color: var(--ps-gold); color: #6d4c16; background: var(--ps-gold-light); box-shadow: inset 0 0 0 1px rgba(184,138,59,.08); }
.choice-pill:active, .type-card:active { transform: scale(.98); }
.budget-fields { display: grid; grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr); align-items: end; gap: 8px; }
.budget-input-wrap { display: block; min-width: 0; }
.budget-input-wrap > span { display: block; margin: 0 0 6px 1px; color: var(--ps-muted); font-size: 10px; }
.currency-input { display: flex; align-items: center; gap: 7px; height: 48px; padding: 0 11px; border: 1px solid #d9d0c2; border-radius: 12px; background: #fff; }
.currency-input b { color: var(--ps-muted); font-size: 14px; font-weight: 500; }
.currency-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ps-ink); font-size: 13px; font-weight: 600; }
.currency-input input::-webkit-outer-spin-button, .currency-input input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.currency-input input[type=number] { -moz-appearance: textfield; }
.budget-to { padding-bottom: 16px; color: var(--ps-muted); text-align: center; font-size: 11px; }
.range-wrap { position: relative; height: 28px; margin: 21px 7px 0; }
.range-track { position: absolute; top: 12px; right: 0; left: 0; height: 4px; border-radius: 99px; background: #e7e2d9; }
.range-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; border-radius: 99px; background: var(--ps-gold); }
.range-thumb { position: absolute; top: 0; left: 0; width: 100%; height: 28px; margin: 0; pointer-events: none; background: none; appearance: none; -webkit-appearance: none; }
.range-thumb::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.range-thumb::-moz-range-track { height: 28px; background: transparent; }
.range-thumb::-webkit-slider-thumb { width: 19px; height: 19px; margin-top: 4.5px; border: 2px solid var(--ps-gold); border-radius: 50%; pointer-events: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16); appearance: none; -webkit-appearance: none; }
.range-thumb::-moz-range-thumb { width: 15px; height: 15px; border: 2px solid var(--ps-gold); border-radius: 50%; pointer-events: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16); }
.range-thumb.range-min { z-index: 3; }
.range-thumb.range-max { z-index: 4; }
.range-hints { display: flex; align-items: center; justify-content: space-between; margin: -2px 1px 0; color: var(--ps-soft); font-size: 10px; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.type-card { position: relative; display: flex; min-height: 106px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: 14px 13px 12px; border: 1px solid #ddd5ca; border-radius: 14px; color: #4d463d; background: #fff; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.type-card svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.type-card > span:last-child { font-size: 12px; font-weight: 600; }
.type-card[aria-pressed="true"] { border: 1.5px solid var(--ps-teal); color: #175d55; background: var(--ps-teal-light); box-shadow: inset 0 0 0 1px rgba(40,126,115,.07); }
.type-check { position: absolute; top: 8px; right: 9px; display: none; color: var(--ps-teal); font-size: 13px; font-weight: 800; }
.type-card[aria-pressed="true"] .type-check { display: block; }
.bedroom-pills { gap: 8px; }
.bedroom-pill { min-width: 0; flex: 1 1 auto; padding-inline: 13px; }
.bedroom-pill[aria-pressed="true"]::before { content: "✓ "; color: var(--ps-teal); }
.section-note { margin: 10px 0 0; color: var(--ps-muted); font-size: 11px; line-height: 1.45; }
.section-note[hidden] { display: none; }
.sticky-action-bar { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 9px; padding: 12px 15px calc(13px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(224,215,201,.95); background: rgba(255,255,255,.96); box-shadow: 0 -7px 22px rgba(31,25,17,.08); backdrop-filter: blur(18px); }
.sticky-summary { display: flex; justify-content: center; align-items: center; gap: 7px; min-height: 14px; color: var(--ps-muted); font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #b8afa2; }
.status-dot.is-ready { background: var(--ps-teal); box-shadow: 0 0 0 3px rgba(40,126,115,.12); }
#viewProperties { display: block; width: 100%; min-height: 52px; padding: 13px 18px; border: 1px solid var(--ps-gold); border-radius: 999px; color: #21180a; background: linear-gradient(135deg, #e0bf80, #c69a4f); box-shadow: 0 4px 12px rgba(165,119,44,.18); font-size: 14px; font-weight: 700; letter-spacing: .005em; transition: opacity .16s ease, transform .16s ease; }
#viewProperties:active:not(:disabled) { transform: scale(.99); }
#viewProperties:disabled { cursor: not-allowed; opacity: .38; box-shadow: none; filter: grayscale(.2); }
.toast-region { position: fixed; z-index: 80; right: 16px; bottom: calc(130px + env(safe-area-inset-bottom, 0px)); left: 16px; display: none; max-width: 460px; margin: 0 auto; padding: 11px 14px; border: 1px solid var(--ps-border); border-radius: 12px; color: var(--ps-ink); background: #fff; box-shadow: 0 6px 22px rgba(0,0,0,.12); font-size: 12px; }
.toast-region.is-visible { display: block; }
@media (min-width: 600px) {
  .search-app { padding-bottom: 28px; }
  .search-header { padding-inline: max(24px, calc((100vw - 760px) / 2)); }
  .search-content { padding: 22px 24px 30px; }
  .type-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .type-card { align-items: center; text-align: center; min-height: 130px; }
  .sticky-action-bar { position: sticky; width: min(760px, 100%); margin: 0 auto; padding: 10px 24px 20px; border: 0; background: transparent; box-shadow: none; }
  .sticky-summary { display: none; }
  #viewProperties { min-height: 54px; }
  .toast-region { bottom: 25px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }

/* PATCH 002: precise, two-way budget range controls and provided property-type artwork. */
.type-card img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
.type-card[aria-pressed="true"] img { transform: scale(1.03); }
.currency-input input[type="text"] { font-variant-numeric: tabular-nums; }
.range-thumb { touch-action: pan-y; }
.range-thumb.range-min:focus-visible { z-index: 7; }
.range-thumb.range-max:focus-visible { z-index: 8; }
.range-thumb:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(184,138,59,.18); }
.range-thumb:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px rgba(184,138,59,.18); }

@keyframes searchSurfaceEnter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .search-header { animation: searchSurfaceEnter .30s cubic-bezier(.2,.7,.25,1) both; }
  .area-section { animation: searchSurfaceEnter .36s cubic-bezier(.2,.7,.25,1) .04s both; }
  .locked-filters { animation: searchSurfaceEnter .36s cubic-bezier(.2,.7,.25,1) .08s both; }
}
