/**
 * IDX search.
 *
 * Loaded only on /search and /idx/*. Everything here is built from the brand
 * tokens in config/site.php, so a second agent's site is a token swap and not
 * a rewrite of this file.
 */

/* --- Search bar ---------------------------------------------------------
 *
 * One sticky row, the width of the window, holding everything that changes the
 * search. Treatment follows carolinesweezeyrealestate.com: a light band, white
 * rounded controls with a hairline and a soft shadow, sentence case, and a
 * black save at the far end. The search page is the one place on the site
 * that reads as an application rather than a brochure, and its corners are
 * rounded where the rest of the site is square, on purpose.
 */

.page-search {
  --idx-r: 8px;
  --idx-r-lg: 12px;
  --idx-shadow: 0 1px 2px color-mix(in srgb, var(--c-ink) 6%, transparent);
  --idx-shadow-up: 0 8px 24px color-mix(in srgb, var(--c-ink) 12%, transparent);
}

.section--results { padding-top: clamp(1.25rem, 2.5vw, 2rem); }

.sbar-wrap {
  position: sticky;
  /* Under the site header. idx.js measures the real height; the fallback is
     the height the header has on this page. */
  top: var(--header-h, 76px);
  z-index: 40;
  background: var(--c-paper-alt);
  border-bottom: 1px solid var(--c-line);
}

.sbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem var(--s-gutter);
}

/* Visually hidden, still read out. Every control in the bar has one. */
.sbar__hide {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The shared control face. Every box in the bar wears it. */
.sbar__pilltop,
.sbar__find,
.idx-viewswitch,
.idx-sort {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--idx-r);
  box-shadow: var(--idx-shadow);
}

/* --- The search box ------------------------------------------------------ */

.sbar__find {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 22rem;
  min-width: 15rem;
  max-width: 34rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sbar__find:focus-within { border-color: var(--c-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-ink) 8%, transparent); }

.sbar__findicon {
  flex: none;
  width: 16px; height: 16px;
  margin-left: 0.85rem;
  fill: none; stroke: var(--c-ink); stroke-width: 2; stroke-linecap: round;
}

.sbar__find input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-ink);
  background: none;
  border: 0;
  padding: 0.62rem 0.7rem;
  appearance: none;
}
.sbar__find input:focus { outline: none; }
.sbar__find input::placeholder { color: var(--c-muted); font-weight: 400; }
.sbar__find input::-webkit-search-cancel-button { margin-right: 0.2rem; }

/* Icon only. Enter submits too; this is for the thumb. */
.sbar__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  margin: 0.25rem;
  color: var(--c-white);
  background: var(--c-ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.sbar__go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sbar__go:hover { background: var(--c-slate); }

/* --- Filter controls ----------------------------------------------------- */

.sbar__pills { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.sbar__pill { position: relative; }

.sbar__pilltop {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--f-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  white-space: nowrap;
  list-style: none;
  user-select: none;
  transition: border-color .15s ease;
}
/* The disclosure triangle, replaced with a chevron of our own. */
.sbar__pilltop::-webkit-details-marker { display: none; }
.sbar__pilltop::marker { content: ''; }
.sbar__pilltop::after {
  content: '';
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.55;
}
.sbar__pilltop:hover { border-color: var(--c-ink); }
.sbar__pilltop:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }

/* A control whose filter is actually set reads as set, closed or open. */
.sbar__pill.is-on > .sbar__pilltop {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-white);
}
.sbar__pill[open] > .sbar__pilltop { border-color: var(--c-ink); }
.sbar__pill[open] > .sbar__pilltop::after { transform: translateY(2px) rotate(225deg); }

.sbar__pop {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 5;
  min-width: 15rem;
  padding: 1rem;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--idx-r-lg);
  box-shadow: var(--idx-shadow-up);
}

.sbar__poptitle {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.sbar__pop select {
  font-family: var(--f-body);
  font-size: 0.9rem;
  color: var(--c-ink);
  background-color: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--idx-r);
  padding: 0.55rem 2.1rem 0.55rem 0.7rem;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23848484' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 11px;
}
.sbar__pop select:focus { border-color: var(--c-ink); outline: none; }

.sbar__to {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.72rem;
  color: var(--c-muted);
  text-align: center;
}

.sbar__apply {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem;
  font-family: var(--f-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-white);
  background: var(--c-ink);
  border: 0;
  border-radius: var(--idx-r);
  cursor: pointer;
}
.sbar__apply:hover { background: var(--c-slate); }

/* Rendered on every search so the map can show it after a filter changes. */
.sbar__clear[hidden] { display: none; }
.sbar__clear {
  padding: 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* --- Layout and save ----------------------------------------------------- */

.sbar__end { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

/* A segmented capsule: one track, the current view raised out of it. */
.idx-viewswitch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
}

.idx-viewswitch__btn {
  padding: 0.38rem 0.9rem;
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--c-muted);
  border-radius: 999px;
  white-space: nowrap;
}
.idx-viewswitch__btn:hover { color: var(--c-ink); }
.idx-viewswitch__btn.is-active {
  background: var(--c-paper-alt);
  color: var(--c-ink);
}

.sbar__save {
  padding: 0.6rem 1.05rem;
  font-family: var(--f-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--c-white);
  background: var(--c-ink);
  border-radius: var(--idx-r);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.sbar__save:hover { background: var(--c-slate); }

/* --- The heading row ----------------------------------------------------- */

.idx-head {
  padding: 1.1rem var(--s-gutter) 0.25rem;
}

.idx-head__title {
  margin: 0 0 0.35rem;
  font-family: var(--f-body);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--c-ink);
}

.idx-head__row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.idx-head__count { margin: 0; font-size: 0.86rem; color: var(--c-muted); }

.idx-head__sort { display: inline-flex; align-items: center; }

/* Reads as a word with a chevron, not a box, as on the reference. */
.idx-sort {
  font-family: var(--f-body);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--c-ink);
  background-color: transparent;
  border: 0;
  border-radius: var(--idx-r);
  box-shadow: none;
  padding: 0.3rem 1.4rem 0.3rem 0.4rem;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14'%3E%3Cpath fill='none' stroke='%231a1a1a' stroke-width='1.5' d='M3 5.5 6 2.5l3 3M3 8.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  background-size: 11px 13px;
}
.idx-sort:hover { background-color: var(--c-paper-alt); }
.idx-sort:focus { outline: 2px solid var(--c-ink); outline-offset: 1px; }

/* --- Narrow screens ------------------------------------------------------ */

@media (max-width: 1100px) {
  .sbar__end { margin-left: 0; }
}

@media (max-width: 760px) {
  .sbar-wrap { position: static; }
  .sbar { gap: 0.5rem; padding: 0.6rem var(--s-gutter); }
  .sbar__find { flex: 1 1 100%; max-width: none; }
  /* One line of controls that scrolls sideways, rather than four stacked rows. */
  .sbar__pills {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .sbar__pills::-webkit-scrollbar { display: none; }
  .sbar__pill { flex: none; }
  /* An absolutely positioned panel inside a scrolling row would be clipped. */
  .sbar__pop { position: fixed; left: var(--s-gutter); right: var(--s-gutter); top: auto; min-width: 0; }
  .sbar__end { flex: 1 1 100%; justify-content: space-between; }
  .idx-head { padding: 0.9rem var(--s-gutter) 0.25rem; }
  .idx-head__title { font-size: 1.1rem; }
}

/* --- Attribution -------------------------------------------------------- */

/**
 * Required in every view. Sized to be plainly readable, never a hidden
 * disclosure, and never smaller than the specs above it.
 */
/*
 * flex-wrap put the mark on a line of its own whenever the credit was long
 * enough to wrap, which on a card is most of them. nowrap keeps the mark
 * beside the first line and lets the text itself wrap under it.
 */
.idx-attribution {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--c-muted);
}
.idx-attribution__text { min-width: 0; }

.idx-attribution__mark {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--c-accent-deep);
  border-radius: 50%;
  transform: translateY(-1px);
}

/* Under the body, on the same inset, with a hairline above so it reads as
   the card's footer rather than a caption that drifted. */
.idx-attribution--card {
  padding: 0.8rem 0 0;
  margin: 0 1rem 1.1rem;
  border-top: 1px solid var(--c-line);
}

.idx-attribution--row { margin-top: 0.6rem; }

.idx-attribution--detail {
  padding: 0.9rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 1.5rem;
}

.idx-attribution__mls { color: var(--c-muted); }

/* --- Grid --------------------------------------------------------------- */

.idx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

/*
 * The card is a photograph with facts under it, and nothing around it.
 *
 * No border at rest. The image carries the shape, and a shadow arrives on
 * hover to say the whole card is the link. A card for one of John's own
 * listings keeps a thin gold line so it stands out from other brokers'
 * homes without shouting.
 */
.idx-card {
  position: relative;   /* the overlay favorite button is positioned against this */
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid transparent;
  border-radius: var(--idx-r-lg, 12px);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.idx-card:hover { box-shadow: var(--idx-shadow-up, 0 8px 24px rgba(0,0,0,.12)); transform: translateY(-2px); }
.idx-card--ours { border-color: var(--c-accent-soft); }

.idx-card__link { display: block; text-decoration: none; color: inherit; }

.idx-card__media { position: relative; aspect-ratio: 3 / 2; background: var(--c-paper-alt); overflow: hidden; border-radius: var(--idx-r-lg, 12px); }
.idx-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.idx-card:hover .idx-card__media img { transform: scale(1.03); }
.idx-card__media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--c-paper-alt);
  border-bottom: 1px solid var(--c-line);
}
.idx-card__media-empty span {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--c-muted);
}

/*
 * A card with no photograph collapses its media frame to a strip.
 *
 * Around six listings in ten arrive with no usable image, a fault in the
 * feed's media sync rather than anything about the home. Holding a full frame
 * open for each turned a page of results into a wall of empty rectangles.
 */
.idx-card--nophoto .idx-card__media { aspect-ratio: auto; height: 2.75rem; }
.idx-card--nophoto .idx-card__media-empty { justify-content: flex-end; padding-right: 0.9rem; }
.idx-card--nophoto .idx-card__status,
.idx-card--nophoto .idx-card__ours { top: 50%; bottom: auto; transform: translateY(-50%); }


.idx-card__status,
.idx-card__ours {
  position: absolute;
  top: 0.75rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
}
.idx-card__status { left: 0.75rem; background: var(--c-white); color: var(--c-ink); }
.idx-card__ours  { right: 0.75rem; background: var(--c-accent); color: var(--c-white); }

.idx-card__body { padding: 1.1rem 1rem 1.15rem; flex: 1; }

.idx-card__price { font-size: 1.25rem; font-weight: 700; color: var(--c-ink); margin: 0 0 0.55rem; letter-spacing: -0.01em; }
.idx-card__price-note { font-size: 0.74rem; font-weight: 500; color: var(--c-muted); margin-left: 0.4rem; }

.idx-card__address { font-family: var(--f-body); font-size: 0.92rem; font-weight: 600; margin: 0 0 0.8rem; line-height: 1.45; color: var(--c-ink); }
.idx-card__address span { display: block; font-weight: 400; color: var(--c-muted); font-size: 0.84rem; margin-top: 0.2rem; }

/* "3 Beds · 2 Baths · 1,500 Sq.Ft." with the separators drawn, not typed. */
.idx-card__specs,
.idx-row__specs {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--c-body);
}
.idx-card__specs li + li::before,
.idx-row__specs li + li::before { content: '\00b7'; margin: 0 0.45rem; color: var(--c-muted); }
.idx-card__specs strong,
.idx-row__specs strong { font-weight: 600; color: var(--c-ink); }

/*
 * --- Favorite / save control -----------------------------------------------
 * A plain form (see partials/favorite-button.php): no JavaScript is required
 * to add or remove a favorite, assets/js/favorites.js only removes the page
 * reload. Sign-in is asked for only when this is actually pressed, never
 * before, per CLAUDE.md's registration gating rule.
 *
 * Two placements. --overlay sits on the grid card's photo, in the empty
 * bottom-right corner the status and "Our listing" badges (top-left,
 * top-right) leave free. --inline sits in the normal flow, next to the
 * price, on the list row and the detail page.
 */
.favorite-form { margin: 0; }

.favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--f-body);
  color: var(--c-ink);
}
.favorite-btn__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: fill .15s ease, stroke .15s ease;
}
.is-saved .favorite-btn__icon { fill: var(--c-accent-deep); stroke: var(--c-accent-deep); }
.favorite-btn:hover .favorite-btn__icon { stroke: var(--c-accent-deep); }

.favorite-form--overlay {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 1;
}
.favorite-form--overlay .favorite-btn {
  width: 2.15rem;
  height: 2.15rem;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}
/* Screen-reader only inside the round overlay button: the icon alone reads
   at this size, and "Save" printed over a photo needs more room than a
   circle this small can give it without crowding the heart. */
.favorite-form--overlay .favorite-btn__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
/* Same collapse the status and "Our listing" badges get on a photo-less
   card, so the button lands mid-height of the thin strip rather than under
   it. */
.idx-card--nophoto .favorite-form--overlay { bottom: auto; top: 50%; transform: translateY(-50%); }

.favorite-form--inline .favorite-btn { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.favorite-form--inline .favorite-btn__icon { width: 16px; height: 16px; }

.idx-row__head .favorite-form--inline { margin-left: auto; }

/* --- List --------------------------------------------------------------- */

.idx-list { display: flex; flex-direction: column; gap: 1.1rem; }

.idx-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.4rem;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  overflow: hidden;
}
.idx-row:hover { border-color: var(--c-accent); }
.idx-row--ours { border-color: var(--c-accent-soft); }

.idx-row__media { display: block; aspect-ratio: 4 / 3; background: var(--c-paper-alt); }
.idx-row__media img { width: 100%; height: 100%; object-fit: cover; }
.idx-row__media-empty { display: block; width: 100%; height: 100%; }

/* Same collapse as the grid card: no photograph, no frame held open for one. */
.idx-row--nophoto { grid-template-columns: 3.25rem 1fr; gap: 1rem; }
.idx-row--nophoto .idx-row__media { aspect-ratio: auto; }

.idx-row__body { padding: 1.1rem 1.25rem 1.2rem 0; min-width: 0; }

.idx-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.idx-row__address { font-family: var(--f-body); font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.4; }
.idx-row__address a { text-decoration: none; color: inherit; }
.idx-row__address span { display: block; font-weight: 400; color: var(--c-muted); font-size: 0.85rem; }

.idx-row__price { font-size: 1.25rem; font-weight: 700; color: var(--c-ink); margin: 0; white-space: nowrap; }
.idx-row__price-note { display: block; font-size: 0.7rem; font-weight: 400; color: var(--c-muted); }

.idx-row__status { color: var(--c-accent-deep); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.68rem; }

@media (max-width: 640px) {
  .idx-row { grid-template-columns: 1fr; }
  .idx-row__body { padding: 0 1.1rem 1.2rem; }
}

/* --- Empty state and pager ---------------------------------------------- */

.idx-empty {
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  background: var(--c-white);
  padding: clamp(2rem, 5vw, 3.25rem);
  text-align: center;
}
.idx-empty h2 { font-size: var(--t-display-m); margin: 0 0 0.75rem; }
.idx-empty p { max-width: 52ch; margin: 0 auto; color: var(--c-ink-soft); }

.idx-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.idx-pager__page,
.idx-pager__step {
  min-width: 2.4rem;
  padding: 0.55rem 0.8rem;
  text-align: center;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--c-ink-soft);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  background: var(--c-white);
}
.idx-pager__page:hover,
.idx-pager__step:hover { border-color: var(--c-accent); color: var(--c-ink); }
.idx-pager__page.is-current { background: var(--c-ink); color: var(--c-white); border-color: var(--c-ink); }
.idx-pager__gap { padding: 0 0.3rem; color: var(--c-muted); }

/* --- Notes -------------------------------------------------------------- */

.idx-note {
  margin: 2rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--c-paper-alt);
  border-left: 2px solid var(--c-accent);
  border-radius: var(--s-radius);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--c-ink-soft);
  max-width: 76ch;
}
.idx-note--sold { background: none; border-left-color: var(--c-line); }

/* --- Disclaimer --------------------------------------------------------- */

.idx-disclaimer {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-line);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--c-muted);
  max-width: 90ch;
}
.idx-disclaimer p { margin: 0 0 0.7rem; }
.idx-disclaimer p:last-child { margin-bottom: 0; }
.idx-disclaimer__source { color: var(--c-ink-soft); font-weight: 700; }

/* ==========================================================================
   Map search
   ========================================================================== */

/* The map view is a fixed two-panel workspace, so the page itself must not
   scroll. Only the results rail does. */
/*
 * The map fills the first screen, and the page still scrolls.
 *
 * This used to set overflow:hidden on the body and display:none on the footer,
 * to make the map view feel like an application. That was a mistake, and once
 * the map became the default view it became a real one: the footer is where
 * the Fair Housing notice, the Standardized Operating Procedures link, the
 * brokerage name and address and the agent's licensed designation live, and a
 * required notice set to display:none is not displayed. The map view now
 * carries the same compliance surface every other page has.
 */
.idx-map {
  position: relative;   /* the save prompt is positioned against this */
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(384px, 0.7fr);
  /* map.js measures the real chrome height and sets --map-chrome. The
     fallback keeps the layout sane before the script runs. */
  height: calc(100vh - var(--map-chrome, 200px));
  min-height: 460px;
  border-top: 1px solid var(--c-line);
}

/*
 * The canvas keeps Leaflet's stacking to itself.
 *
 * Leaflet gives its own panes z-index 400 and its controls up to 1000, and
 * without this they compete with the rest of the page at the root level
 * instead of with each other. That is what put the map on top of the search
 * bar's filter panels, which opened underneath it and looked cut in half.
 * Every z-index inside this element, ours and Leaflet's, is now local.
 */
/* overflow hidden: if the map's own stylesheet ever fails to load, its tiles
   stay inside this panel instead of spilling over the whole page. */
.idx-map__canvas { position: relative; isolation: isolate; overflow: hidden; background: var(--c-paper-alt); }
.idx-map__nomap { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 22rem; margin: 0; padding: 1rem 1.2rem; font-size: 0.9rem; text-align: center; color: var(--c-ink); background: var(--c-white); border-radius: 8px; box-shadow: 0 4px 16px color-mix(in srgb, var(--c-ink) 15%, transparent); }

/* Street-level tiles are OpenStreetMap's, which are drawn in colour. Taken to
   grey here so they read as the same map as the grey canvas above zoom 16. */
.tile-detail { filter: grayscale(1) brightness(1.12) contrast(0.85); }
.idx-map__leaflet { position: absolute; inset: 0; }

/* --- Map tools ----------------------------------------------------------- */

.idx-map__tools {
  position: absolute;
  top: 1rem; left: 1rem;
  z-index: 500;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.idx-map__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  color: var(--c-ink-soft);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 10%, transparent);
  cursor: pointer;
}
.idx-map__toggle input { accent-color: var(--c-accent); }

.idx-map__btn {
  font-family: var(--f-body);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink);
  cursor: pointer;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 10%, transparent);
}
.idx-map__btn:hover { border-color: var(--c-accent); }
.idx-map__btn:disabled { opacity: 0.6; cursor: wait; }
.idx-map__btn--clear { color: var(--c-accent-deep); }

/* Near me: a crosshair and the words, in the same pill. */
.idx-map__btn--near { display: inline-flex; align-items: center; gap: 0.4rem; }
.idx-map__btn--near svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.idx-map__btn--near[hidden] { display: none; }
.is-drawing .idx-map__leaflet { cursor: crosshair; }

.idx-map__hint,
.idx-map__noscript {
  position: absolute;
  top: 4.2rem; left: 1rem; right: 1rem;
  z-index: 500;
  max-width: 42ch;
  background: var(--c-ink);
  color: var(--c-white);
  padding: 0.7rem 0.9rem;
  border-radius: var(--s-radius);
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0;
}
.idx-map__noscript { top: auto; bottom: 1rem; background: var(--c-white); color: var(--c-ink); border: 1px solid var(--c-line); }

.idx-map__status {
  position: absolute;
  bottom: 1rem; left: 1rem;
  z-index: 500;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  color: var(--c-muted);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.idx-map.is-loading .idx-map__status { opacity: 1; }

/* Offered when the map has moved but the results have not followed it. */
.idx-map__redo {
  position: absolute;
  top: 1rem; left: 50%;
  transform: translateX(-50%);
  z-index: 520;
  font-family: var(--f-body);
  background: var(--c-ink);
  color: var(--c-white);
  border: 1px solid var(--c-ink);
  border-radius: var(--s-radius);
  padding: 0.6rem 1.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 14px color-mix(in srgb, var(--c-ink) 28%, transparent);
}
.idx-map__redo:hover { background: var(--c-accent-deep); border-color: var(--c-accent-deep); }
.idx-map__redo[hidden] { display: none; }

/* --- Pins ---------------------------------------------------------------- */

.pin-wrap { background: none; border: 0; }

.pin {
  display: inline-block;
  transform: translate(-50%, -50%);
  background: var(--c-ink);
  color: var(--c-white);
  font-family: var(--f-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--c-ink);
  white-space: nowrap;
  box-shadow: 0 1px 5px color-mix(in srgb, var(--c-ink) 30%, transparent);
  transition: background-color .15s ease, transform .15s ease;
}
.pin--ours { background: var(--c-accent); border-color: var(--c-accent-deep); }
.pin-wrap.is-active .pin,
.pin-wrap:hover .pin {
  background: var(--c-accent);
  border-color: var(--c-accent-deep);
  transform: translate(-50%, -50%) scale(1.14);
  z-index: 900;
}

/* Zoomed out, a few hundred price labels overlap into an unreadable mass, so
   they collapse to dots. The price comes back on hover and on the way in. */
.is-dense .pin:not(.pin--photo) {
  width: 11px; height: 11px;
  padding: 0;
  border-radius: 50%;
  color: transparent;
  overflow: hidden;
  text-indent: -99em;
  border-width: 2px;
  border-color: var(--c-white);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 45%, transparent);
}
.is-dense .pin-wrap.is-active .pin:not(.pin--photo),
.is-dense .pin-wrap:hover .pin:not(.pin--photo) {
  width: auto; height: auto;
  padding: 0.3rem 0.55rem;
  border-radius: 2px;
  color: var(--c-white);
  text-indent: 0;
  border-width: 1px;
  border-color: var(--c-accent-deep);
}

/*
 * A pin whose price would land on one already showing.
 *
 * Same dot as the zoomed out state, and for the same reason: two prices
 * printed through each other read as neither. map.js decides which ones, on
 * every pan. The price comes back on hover, and the pin is still there to
 * click either way.
 */
.pin-wrap.is-crowded .pin:not(.pin--photo) {
  width: 11px; height: 11px;
  padding: 0;
  border-radius: 50%;
  color: transparent;
  overflow: hidden;
  text-indent: -99em;
  border-width: 2px;
  border-color: var(--c-white);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 45%, transparent);
}
.pin-wrap.is-crowded:hover .pin,
.pin-wrap.is-crowded.is-active .pin {
  width: auto; height: auto;
  padding: 0.3rem 0.55rem;
  border-radius: 2px;
  color: var(--c-white);
  text-indent: 0;
  border-width: 1px;
  border-color: var(--c-accent-deep);
}

/*
 * No map popup.
 *
 * Clicking a pin used to open a small popup on the map, which meant two clicks
 * and a lost map position to actually see the house. It now opens the
 * quick-look panel, so the popup and its styles are gone rather than left here
 * to rot. Leaflet's own popup chrome is still reset, because Leaflet draws it
 * for the attribution control.
 */
.leaflet-popup-content-wrapper { border-radius: var(--s-radius); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; font-family: var(--f-body); }

/* --- Results rail -------------------------------------------------------- */

.idx-map__rail {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--c-line);
  background: var(--c-paper);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.idx-map__railhead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
  padding: 1rem 1.25rem 0.85rem;
}
.idx-map__railtop { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.idx-map__count { margin: 0; font-size: 0.9rem; color: var(--c-ink-soft); }
.idx-map__count strong { color: var(--c-ink); font-weight: 700; }
.idx-map__note { margin: 0.35rem 0 0; font-size: 0.72rem; color: var(--c-muted); }

.idx-map__note[hidden] { display: none; }

.idx-map__results { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.4rem; }
.idx-map__empty { margin: 1rem 0; font-size: 0.88rem; color: var(--c-muted); line-height: 1.6; }

/* Two up once the rail is wide enough that a single column wastes it. */
@media (min-width: 1280px) {
  .idx-map__results { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .idx-map__results .idx-map__empty { grid-column: 1 / -1; }
}
@media (min-width: 1500px) {
  .idx-map { grid-template-columns: minmax(0, 1.15fr) minmax(560px, 0.85fr); }
}

/* --- Loading placeholders ------------------------------------------------ */

.mapbone {
  display: block;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  overflow: hidden;
}
.mapbone__media { display: block; aspect-ratio: 3 / 2; background: var(--c-paper-alt); }
.mapbone__lines { display: block; padding: 0.8rem 0.85rem; }
.mapbone__lines span { display: block; height: 0.62rem; border-radius: 2px; background: var(--c-paper-alt); }
.mapbone__lines span + span { margin-top: 0.5rem; }
.mapbone__lines span:nth-child(1) { width: 42%; }
.mapbone__lines span:nth-child(2) { width: 78%; }
.mapbone__lines span:nth-child(3) { width: 58%; }

.mapbone { animation: mapbone-pulse 1.4s ease-in-out infinite; }
@keyframes mapbone-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  .mapbone { animation: none; }
}
.idx-map__rail .idx-disclaimer { margin: 0; padding: 1.25rem; border-top: 1px solid var(--c-line); }

/*
 * The same clothes as the grid card.
 *
 * No border at rest, a rounded photograph, a lift on hover, and the facts in
 * the same face and order. The rail card keeps what the grid card does not
 * have, the photo arrows, the save button and the seen state, but a visitor
 * switching between List and Map should not feel the cards change.
 */
.mapcard {
  background: var(--c-white);
  border: 1px solid transparent;
  border-radius: var(--idx-r-lg, 12px);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .15s ease;
}
.mapcard:hover,
.mapcard.is-active { box-shadow: var(--idx-shadow-up, 0 8px 24px rgba(0,0,0,.12)); }
.mapcard:hover { transform: translateY(-2px); }
.mapcard--ours { border-color: var(--c-accent-soft); }

/*
 * Photo on top, full width.
 *
 * These were a 116px thumbnail beside the text, which made a listing read as a
 * table row. A property card is a photograph with a price under it, and the
 * rail is wide enough to give it one.
 */
.mapcard__link { display: block; text-decoration: none; color: inherit; }
.mapcard__media { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--c-paper-alt); overflow: hidden; border-radius: var(--idx-r-lg, 12px); }
.mapcard__media img { width: 100%; height: 100%; object-fit: cover; }
/*
 * Quiet on purpose.
 *
 * Around six listings in ten arrive with no usable photo, which is a fault in
 * the feed's media sync rather than anything about the home. A loud beige slab
 * repeated down the rail made the whole search look broken, so this says what
 * it needs to and stops.
 */
.mapcard__nophoto {
  display: flex; align-items: center; justify-content: flex-end;
  width: 100%; height: 100%;
  padding: 0 0.7rem;
  background: var(--c-paper-alt);
  font-size: 0.62rem; letter-spacing: 0.04em; color: var(--c-muted);
}

/*
 * A card with no photograph collapses its media band to a strip.
 *
 * Around six listings in ten arrive with no usable image, a fault in the
 * feed's media sync rather than anything about the home. Holding a full 3:2
 * frame open for each of them turned the rail into a column of empty beige
 * rectangles. The badge still has somewhere to sit, the absence is still
 * stated, and the listing takes the room it actually has content for.
 */
.mapcard--nophoto .mapcard__media { aspect-ratio: auto; height: 2.5rem; }
/* Clear of the save button, which floats at the top right of every card. */
.mapcard--nophoto .mapcard__nophoto { padding-right: 5.6rem; }
.mapcard--nophoto .mapcard__status,
.mapcard--nophoto .mapcard__ours { top: 50%; bottom: auto; transform: translateY(-50%); }
.mapcard__status,
.mapcard__ours {
  position: absolute; top: 0.75rem; left: 0.75rem;
  font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  padding: 0.35rem 0.65rem; border-radius: 999px;
  background: var(--c-white); color: var(--c-ink);
}
.mapcard__ours { top: auto; bottom: 0.75rem; background: var(--c-accent); color: var(--c-white); }

/*
 * display: block, because this is a <span>.
 *
 * map.js builds the rail card out of spans so the whole thing can sit inside
 * one anchor. An inline box renders horizontal padding but does not offset
 * the block level children inside it, so the price and the address sat hard
 * against the card edge while the computed padding said otherwise.
 */
.mapcard__body { display: block; padding: 1rem 0.9rem 1rem; min-width: 0; }
.mapcard__price {
  display: block;
  font-family: var(--f-body);
  font-size: 1.2rem; font-weight: 700; line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}
.mapcard__addr  { display: block; font-size: 0.9rem; font-weight: 600; color: var(--c-ink); margin-top: 0.55rem; }
.mapcard__addr em { display: block; font-style: normal; font-weight: 400; font-size: 0.82rem; color: var(--c-muted); margin-top: 0.2rem; }
.mapcard__specs { display: block; font-size: 0.8rem; color: var(--c-body); margin-top: 0.7rem; }
.mapcard .idx-attribution--card { padding: 0.75rem 0 0; margin: 0 0.9rem 0.95rem; font-size: 0.72rem; }

/* --- Narrow screens ------------------------------------------------------ */

@media (max-width: 900px) {
  /* Stacked. A 40% wide map is not a map. */
  .idx-map { grid-template-columns: 1fr; height: auto; }
  .idx-map__canvas { height: 58vh; min-height: 340px; }
  .idx-map__rail { border-left: 0; border-top: 1px solid var(--c-line); overflow: visible; }
  .idx-map__railhead { position: static; }
}

/* --- Full screen map ----------------------------------------------------- */

body.map-full { overflow: hidden; }
.idx-map.is-full {
  position: fixed;
  inset: 0;
  z-index: 900;
  height: 100vh;
  margin: 0;
  border-top: 0;
  background: var(--c-paper);
}

/* --- Pin preview ---------------------------------------------------------
 *
 * Opens on a click of the price, not on hover. It is something a visitor
 * points at and presses, so it takes pointer events, has a cursor, and says
 * what pressing it does.
 */

.mappeek {
  position: absolute;
  z-index: 600;
  width: 228px;
  transform: translate(-50%, -100%);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--c-ink) 18%, transparent);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .13s ease, transform .13s ease;
  pointer-events: none;
  cursor: pointer;
}
.mappeek.is-on { opacity: 1; visibility: visible; pointer-events: auto; }
.mappeek.is-on:hover { box-shadow: 0 10px 28px color-mix(in srgb, var(--c-ink) 24%, transparent); }
.mappeek--below { transform: translate(-50%, 0); }

.mappeek__img { display: block; width: 100%; height: 118px; object-fit: cover; }
.mappeek__nophoto {
  display: flex; align-items: center; justify-content: center;
  height: 60px; background: var(--c-paper-alt);
  font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted);
}
.mappeek__price { display: block; font-size: 0.98rem; font-weight: 700; color: var(--c-ink); padding: 0.55rem 0.7rem 0.1rem; }
.mappeek__addr  { display: block; font-size: 0.78rem; color: var(--c-ink-soft); padding: 0 0.7rem; }
.mappeek__specs { display: block; font-size: 0.72rem; color: var(--c-muted); padding: 0.2rem 0.7rem 0.5rem; }
.mappeek__attr  {
  display: block; font-size: 0.64rem; line-height: 1.35; color: var(--c-muted);
  padding: 0.4rem 0.7rem; border-top: 1px solid var(--c-line); background: var(--c-paper-alt);
}

/* Says what pressing the card does, so it does not read as a dead tooltip. */
.mappeek__more {
  display: block;
  padding: 0.5rem 0.7rem;
  background: var(--c-ink);
  color: var(--c-white);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
}
.mappeek.is-on:hover .mappeek__more { background: var(--c-accent-deep); }

.mappeek__x {
  position: absolute;
  top: 0.35rem; right: 0.35rem;
  z-index: 2;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c-white) 92%, transparent);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: 0.95rem; line-height: 1; color: var(--c-ink-soft);
  cursor: pointer;
}
.mappeek__x:hover { color: var(--c-ink); border-color: var(--c-accent); }

/* --- Card carousel, save, seen ------------------------------------------- */

/* A container, so the arrows can be placed a third of the card's width down,
   which is the centre of a 3:2 photograph however wide the rail is. */
.mapcard__top { position: relative; container-type: inline-size; }

.mapcard.is-seen { opacity: 0.72; }
.mapcard.is-seen .mapcard__price::after {
  content: 'seen';
  font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-muted); font-weight: 400; margin-left: 0.45rem;
}

.mapcard__dots {
  position: absolute; bottom: 0.35rem; right: 0.35rem;
  background: color-mix(in srgb, var(--c-ink) 72%, transparent); color: var(--c-white);
  font-size: 0.56rem; letter-spacing: 0.06em;
  padding: 0.12rem 0.34rem; border-radius: 2px;
  opacity: 0; transition: opacity .15s ease;
}
.mapcard.has-gallery:hover .mapcard__dots { opacity: 1; }

/* Round white buttons at the two edges of the photograph, on hover. The old
   offsets dated from the 116px thumbnail and sat over the address. */
.mapcard__arrow {
  position: absolute;
  top: 33%;
  top: calc(100cqw / 3);
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c-white) 94%, transparent);
  border: 0;
  border-radius: 999px;
  color: var(--c-ink);
  font-size: 1.15rem; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background-color .15s ease;
  padding: 0 0 2px;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 18%, transparent);
}
.mapcard__arrow--prev { left: 0.6rem; }
.mapcard__arrow--next { right: 0.6rem; }
.mapcard.has-gallery:hover .mapcard__arrow,
.mapcard__arrow:focus-visible { opacity: 1; }
.mapcard__arrow:hover { background: var(--c-white); }

.mapcard__save {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--c-white);
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  color: var(--c-ink);
  transition: color .15s ease;
}
.mapcard__save svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.mapcard__save-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.mapcard__save:hover { color: var(--c-accent-deep); }
.mapcard__save.is-on { color: var(--c-accent-deep); }
.mapcard__save.is-on svg { fill: var(--c-accent); stroke: var(--c-accent-deep); }
.mapcard__save.is-on .mapcard__save-label::after { content: 'd'; }

/* --- Save prompt --------------------------------------------------------- */

.mapreg {
  position: absolute;
  inset: 0;
  z-index: 950;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--c-ink) 42%, transparent);
  padding: 1.5rem;
}
.mapreg.is-on { display: flex; }
.mapreg[hidden] { display: none; }

.mapreg__inner {
  position: relative;
  max-width: 30rem;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 14px 44px color-mix(in srgb, var(--c-ink) 28%, transparent);
}
.mapreg__x {
  position: absolute; top: 0.5rem; right: 0.7rem;
  background: none; border: 0; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--c-muted);
}
.mapreg__x:hover { color: var(--c-ink); }
.mapreg__eyebrow {
  margin: 0 0 0.6rem; font-size: 0.66rem; letter-spacing: var(--t-tracking);
  text-transform: uppercase; color: var(--c-accent-deep); font-weight: 400;
}
.mapreg__title { font-size: var(--t-display-m); margin: 0 0 0.7rem; line-height: 1.2; }
.mapreg__body  { margin: 0 0 1.3rem; font-size: 0.92rem; line-height: 1.6; color: var(--c-ink-soft); }
.mapreg__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 0.9rem; }
.mapreg__later {
  background: none; border: 0; cursor: pointer;
  font-family: var(--f-body); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted);
}
.mapreg__later:hover { color: var(--c-ink); }
.mapreg__fine { margin: 0; font-size: 0.72rem; color: var(--c-muted); }


/* --- The saved list -------------------------------------------------------
 *
 * The panel behind the Saved button in the map toolbar. Same overlay shape as
 * the register prompt above, one step higher in the stack so that if both are
 * somehow up, the list is the one you can reach. Its rows are built by
 * assets/js/map.js out of localStorage.
 */
.idx-map__btn--saved { display: inline-flex; align-items: center; gap: 0.4rem; }
.idx-map__btn--saved svg { width: 13px; height: 13px; fill: currentColor; }
.idx-map__btn--saved[hidden] { display: none; }

.mapsaved {
  position: absolute;
  inset: 0;
  z-index: 960;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--c-ink) 42%, transparent);
  padding: 1.5rem;
}
.mapsaved.is-on { display: flex; }
.mapsaved[hidden] { display: none; }

.mapsaved__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 27rem;
  /* The list scrolls inside the panel rather than the panel growing past the
     map it is sitting on. */
  max-height: min(32rem, 100%);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--s-radius);
  box-shadow: 0 14px 44px color-mix(in srgb, var(--c-ink) 28%, transparent);
}

.mapsaved__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--c-line);
}
.mapsaved__title { font-size: 1.05rem; margin: 0; line-height: 1.2; }
.mapsaved__x {
  background: none; border: 0; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--c-muted);
}
.mapsaved__x:hover { color: var(--c-ink); }

.mapsaved__list { overflow-y: auto; padding: 0.35rem 1.25rem; }
.mapsaved__empty { margin: 1.1rem 0; font-size: 0.9rem; color: var(--c-ink-soft); }

.mapsaved__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.3rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--c-line);
}
.mapsaved__row:last-child { border-bottom: 0; }

.mapsaved__link { text-decoration: none; color: inherit; min-width: 0; }
.mapsaved__link:hover .mapsaved__addr { color: var(--c-accent-deep); }
.mapsaved__price { display: block; font-weight: 500; }
.mapsaved__addr  { display: block; font-size: 0.88rem; color: var(--c-ink-soft); }
.mapsaved__addr em { display: block; font-style: normal; font-size: 0.8rem; color: var(--c-muted); }

.mapsaved__remove {
  grid-column: 2; grid-row: 1;
  background: none; border: 0; cursor: pointer; padding: 0;
  font-family: var(--f-body); font-size: 0.68rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted);
}
.mapsaved__remove:hover { color: var(--c-accent-deep); }

/* Attribution spans the row, under both columns. */
.mapsaved__row .idx-attribution--card { grid-column: 1 / -1; margin: 0.45rem 0 0; }
.mapsaved__note {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0; font-size: 0.72rem; color: var(--c-muted);
}

.mapsaved__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--c-line);
}
.mapsaved__fine { margin: 0; flex: 1 1 11rem; font-size: 0.72rem; color: var(--c-muted); }
.mapsaved__send { flex: 0 0 auto; }


/* The card the quick-look panel is currently showing. */
.mapcard.is-open,
.idx-card.is-open,
.idx-row.is-open {
  border-color: var(--c-accent);
  box-shadow: inset 3px 0 0 var(--c-accent);
}

/* The promise the old hero used to make, moved to the foot of the results
   where it is read rather than scrolled past. */
.idx-note--free { background: none; border-left-color: var(--c-accent-soft); }

/* --- Photo URL debugger --------------------------------------------------
 *
 * Only ever rendered by assets/js/photo-debug.js, which only loads on
 * ?debug=photos. Deliberately ugly: it is a diagnostic, not a feature, and it
 * should be obvious that the page is in a debug mode.
 */

.photodebug {
  display: block;
  padding: 0.35rem 0.5rem;
  font-family: var(--f-mono);
  font-size: 10px;
  line-height: 1.4;
  word-break: break-all;
  text-align: left;
  color: #4a3f00;
  background: #fdf6d3;
  border-top: 1px solid #e8dca6;
  border-bottom: 1px solid #e8dca6;
  cursor: text;
  user-select: all;
}
.photodebug b {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 2px;
  background: #4a3f00;
  color: #fdf6d3;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.photodebug--ok      { background: #e6f4e6; border-color: #bcdcbc; color: #1d4a1d; }
.photodebug--ok b    { background: #1d4a1d; color: #e6f4e6; }
.photodebug--blocked { background: #fbe3e3; border-color: #e9b8b8; color: #6d1b1b; }
.photodebug--blocked b { background: #a11b1b; color: #fbe3e3; }
.photodebug--none    { background: #eeeeee; border-color: #d6d6d6; color: #555; }

/* "rent" beside a lease price. The feed carries no lease term, so the site
   does not print a period it cannot know. */
.idx-card__per, .idx-row__per, .mapcard__per, .listing__per {
  margin-left: 0.35rem;
  font-family: var(--f-body);
  font-size: 0.62em;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* --- Upgraded search controls --------------------------------------------
 *
 * assets/js/controls.js builds these on top of the selects that are already in
 * the markup. The select stays, keeps its name and value, and is what submits;
 * everything here is the face on top of it. With scripting off none of this
 * exists and the selects are the control, which is why they are hidden by a
 * class the script adds rather than by default.
 */

.sbar__pop.is-upgraded select,
.sbar__pop.is-upgraded .sbar__to,
.sbar__pop.is-upgraded .sbar__apply { display: none; }

.sbar__pop--wide { min-width: 20rem; }

/* --- Two-handle range ----------------------------------------------------- */

.rangec { padding-top: 0.15rem; }

.rangec__out {
  display: block;
  margin-bottom: 0.9rem;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--c-ink);
}

.rangec__track {
  position: relative;
  height: 4px;
  margin: 0 10px 0.5rem;
  background: var(--c-paper-alt);
  border-radius: 999px;
}

.rangec__fill {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--c-accent);
  border-radius: 999px;
}

/* Two native range inputs stacked on one track. Native because they bring
   keyboard support, touch targets and screen reader semantics with them. */
.rangec__handle {
  position: absolute;
  left: -10px; right: -10px;
  top: 50%;
  width: calc(100% + 20px);
  margin: 0;
  transform: translateY(-50%);
  appearance: none;
  background: none;
  pointer-events: none;   /* the track is not draggable, only the thumbs are */
}
.rangec__handle:focus { outline: none; }

.rangec__handle::-webkit-slider-thumb {
  appearance: none;
  pointer-events: auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 25%, transparent);
  cursor: grab;
}
.rangec__handle::-moz-range-thumb {
  pointer-events: auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--c-ink) 25%, transparent);
  cursor: grab;
}
.rangec__handle:active::-webkit-slider-thumb { cursor: grabbing; border-color: var(--c-accent); }
.rangec__handle:active::-moz-range-thumb     { cursor: grabbing; border-color: var(--c-accent); }
.rangec__handle:focus-visible::-webkit-slider-thumb { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.rangec__handle:focus-visible::-moz-range-thumb     { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }

.rangec__ends {
  display: flex; justify-content: space-between;
  font-size: 0.66rem; color: var(--c-muted);
}

/* --- Ordered steps -------------------------------------------------------- */

.stepc {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--c-paper-alt);
  border-radius: 999px;
}

.stepc__btn {
  flex: 1 1 0;
  padding: 0.45rem 0.2rem;
  font-family: var(--f-body);
  font-size: 0.8rem;
  color: var(--c-ink-soft);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.stepc__btn:hover { color: var(--c-ink); }
.stepc__btn.is-on {
  background: var(--c-ink);
  color: var(--c-white);
  font-weight: 700;
}

/* --- Choices -------------------------------------------------------------- */

.choicec { display: flex; flex-direction: column; gap: 1px; }

.choicec__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  font-family: var(--f-body);
  font-size: 0.88rem;
  text-align: left;
  color: var(--c-ink);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.choicec__btn:hover { background: var(--c-paper-alt); }
.choicec__btn svg {
  flex: none;
  width: 15px; height: 15px;
  fill: none; stroke: var(--c-accent-deep); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
}
.choicec__btn.is-on { background: var(--c-paper-alt); font-weight: 700; }
.choicec__btn.is-on svg { opacity: 1; }

/* --- Corners ---------------------------------------------------------------
 *
 * Everything on the search page that reads as an object rather than as chrome.
 *
 * These used --s-radius-lg, which is the site's radius and is 0. The site is
 * square cornered on purpose, but the search page is not: its photographs are
 * rounded, and a square card behind a rounded photograph showed its corners
 * the moment a shadow appeared under it on hover. One token for every object
 * here, and it is the search page's, not the site's.
 */

.idx-card,
.idx-row,
.mapcard,
.mapbone,
.mappeek,
.sbar__pop { border-radius: var(--idx-r-lg, 12px); }

/* The frame carries the radius and clips the photograph, so the image itself
   does not need one. */
.idx-card__media img,
.idx-row__media img,
.mapcard__media img { border-radius: 0; }

.idx-card__status, .idx-card__ours,
.idx-row__status  { border-radius: 999px; }

/* --- Saved searches, on /favorites -------------------------------------- */
.saved-searches { margin-bottom: 3rem; }
.saved-searches__title { font-size: 1.35rem; margin: 0 0 1rem; }
.saved-searches__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-line); }
.saved-search {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem;
  padding: 1rem 0; border-bottom: 1px solid var(--c-line);
}
.saved-search__label { flex: 1 1 18rem; color: var(--c-ink); font-weight: 600; }
.saved-search__state { font-size: 0.88rem; color: var(--c-muted); }
.saved-search__actions { display: flex; gap: 1rem; }
.saved-search__actions form { margin: 0; }
.saved-search__btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.88rem; color: var(--c-ink); text-decoration: underline;
}
.saved-search__btn:hover { color: var(--c-accent-deep); }

/* Results served from cache while the feed is down. */
.idx-stale { margin: 0.4rem 0 0; font-size: 0.88rem; color: var(--c-muted); }

/* While a pan loads, the homes already in the rail stay, dimmed, rather than
   being swapped for placeholders. See map.js load(). */
.idx-map__results { transition: opacity .15s ease; }
.idx-map.is-loading .idx-map__results { opacity: 0.55; }

/*
 * The brokerage's listings: a small photograph with the price under it.
 * map.js places these first, so an overlapping price pin gives way to them.
 * One that still lands on another photo pin drops its photograph and reads as
 * a price.
 */
.pin--photo {
  padding: 0;
  background: var(--c-white);
  color: var(--c-ink);
  border: 2px solid var(--c-white);
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c-ink) 35%, transparent);
}
.pin--photo img { display: block; width: 64px; height: 44px; object-fit: cover; background: var(--c-paper-alt); }
.pin--photo .pin__price { display: block; padding: 0.1rem 0.3rem; font-size: 0.68rem; line-height: 1.3; }
.pin--photo.pin--ours { border-color: var(--c-accent); }
.pin-wrap--photo.is-active .pin--photo,
.pin-wrap--photo:hover .pin--photo {
  background: var(--c-white);
  color: var(--c-ink);
  border-color: var(--c-accent);
}
.pin-wrap--photo.is-crowded .pin--photo img { display: none; }
.pin-wrap--photo.is-crowded:hover .pin--photo img { display: block; }

/* ==========================================================================
   Search bar, portal pattern (14 September 2026, John: "copy Zillow").
   Overrides the bar rules above: white band, outlined buttons that open a
   panel with an Apply button, segmented Beds and Baths, Save search at the end.
   Colours and type stay the site's own tokens.
   ========================================================================== */

.sbar-wrap { background: var(--c-white); border-bottom: 1px solid var(--c-line); }
.sbar { flex-wrap: nowrap; gap: 0.5rem; padding-block: 0.65rem; }

.sbar__find {
  flex: 0 1 24rem;
  min-width: 13rem;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--c-ink) 28%, var(--c-white));
  border-radius: 8px;
  background: var(--c-white);
}

.sbar__pills { flex-wrap: nowrap; gap: 0.45rem; }

.sbar__pilltop {
  height: 42px;
  padding: 0 0.85rem 0 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--c-white);
  border: 1px solid color-mix(in srgb, var(--c-ink) 28%, var(--c-white));
  border-radius: 8px;
}
.sbar__pilltop:hover { border-color: var(--c-ink); }

/* Set filters read as set without turning the whole button black. */
.sbar__pill.is-on > .sbar__pilltop {
  background: color-mix(in srgb, var(--c-ink) 6%, var(--c-white));
  border-color: var(--c-ink);
  color: var(--c-ink);
}
.sbar__pill[open] > .sbar__pilltop { border-color: var(--c-ink); box-shadow: 0 0 0 1px var(--c-ink); }

.sbar__pop {
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 17rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 32px color-mix(in srgb, var(--c-ink) 22%, transparent), 0 0 0 1px var(--c-line);
}
.sbar__pop--wide { min-width: 21rem; }
.sbar__pop--end { left: auto; right: 0; }

.sbar__poptitle {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-ink);
}

.sbar__group { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.sbar__group:last-of-type { margin-bottom: 0; }

.sbar__radio {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0;
  font-size: 0.92rem;
  color: var(--c-ink);
  cursor: pointer;
}
.sbar__radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-ink); }

/* Any, 1+, 2+ ... as one row of joined buttons. */
.sbar__seg {
  display: flex;
  border: 1px solid color-mix(in srgb, var(--c-ink) 28%, var(--c-white));
  border-radius: 8px;
  overflow: hidden;
}
.sbar__seg label { position: relative; flex: 1 1 0; }
.sbar__seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.sbar__seg span {
  display: block;
  padding: 0.6rem 0.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  color: var(--c-ink);
  border-left: 1px solid color-mix(in srgb, var(--c-ink) 18%, var(--c-white));
}
.sbar__seg label:first-child span { border-left: 0; }
.sbar__seg input:hover + span { background: color-mix(in srgb, var(--c-ink) 6%, var(--c-white)); }
.sbar__seg input:checked + span { background: var(--c-ink); color: var(--c-white); }
.sbar__seg input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: -3px; }

.sbar__range { display: flex; align-items: flex-end; gap: 0.6rem; }
.sbar__field { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 0; font-size: 0.78rem; color: var(--c-muted); }
.sbar__field--block { display: block; }
.sbar__field--block .sbar__poptitle { display: block; }
.sbar__pop .sbar__field select { height: 42px; padding-block: 0; border-color: color-mix(in srgb, var(--c-ink) 28%, var(--c-white)); border-radius: 8px; }
.sbar__range .sbar__to { padding: 0 0 0.75rem; }

.sbar__apply { height: 42px; margin-top: 1.1rem; padding: 0; font-size: 0.9rem; font-weight: 700; border-radius: 8px; }

/* The bar's controls from before this pattern, now unused. */
.sbar__pop.is-upgraded select,
.sbar__pop.is-upgraded .sbar__to,
.sbar__pop.is-upgraded .sbar__apply { display: revert; }

.sbar__end { flex: 0 0 auto; }
.sbar__save { height: 42px; display: inline-flex; align-items: center; padding: 0 1.1rem; border-radius: 8px; font-size: 0.88rem; font-weight: 700; }
.sbar__clear { font-size: 0.86rem; }

/* Narrow screens: the box on its own row, the buttons in a row that scrolls,
   and a panel that rises from the bottom of the screen. */
@media (max-width: 1100px) {
  .sbar { flex-wrap: wrap; }
  .sbar__find { flex: 1 1 100%; }
  /* Wrapping rather than scrolling here: a scrolling row would clip the
     panels, which still drop down from their buttons at this width. */
  .sbar__pills { flex: 1 1 auto; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .sbar__pills { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .sbar__pills::-webkit-scrollbar { display: none; }
  .sbar__end { flex: 1 1 100%; justify-content: space-between; }
  .sbar__pop,
  .sbar__pop--wide,
  .sbar__pop--end {
    position: fixed;
    top: auto; right: 0; bottom: 0; left: 0;
    min-width: 0;
    max-height: 78vh;
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    padding-bottom: calc(1.15rem + env(safe-area-inset-bottom));
  }
}

/* Price: two boxes with a list of amounts under each, portal style. */
.sbar__range { align-items: center; gap: 0.55rem; }
.sbar__combo { position: relative; flex: 1 1 0; min-width: 0; }
.sbar__combo input {
  width: 100%;
  height: 42px;
  padding: 0 0.75rem;
  font-family: var(--f-body);
  font-size: 0.92rem;
  color: var(--c-ink);
  background: var(--c-white);
  border: 1px solid color-mix(in srgb, var(--c-ink) 28%, var(--c-white));
  border-radius: 8px;
}
.sbar__combo input:focus { outline: none; border-color: var(--c-ink); box-shadow: 0 0 0 1px var(--c-ink); }
.sbar__combo input::placeholder { color: var(--c-muted); }
.sbar__dash { flex: 0 0 10px; height: 1.5px; background: var(--c-muted); }
.sbar__opts {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 5;
  max-height: 15rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem 0;
  list-style: none;
  background: var(--c-white);
  border-radius: 8px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--c-ink) 20%, transparent), 0 0 0 1px var(--c-line);
}
.sbar__opts[hidden],
.sbar__opts li[hidden] { display: none; }
.sbar__opts button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.8rem;
  font-family: var(--f-body);
  font-size: 0.9rem;
  text-align: left;
  color: var(--c-ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.sbar__opts button:hover { background: color-mix(in srgb, var(--c-ink) 6%, var(--c-white)); }

/* The price slider under the two boxes. Track and handles come from the
   .rangec rules above; this only spaces it inside the panel. */
.sbar__pop .rangec { margin-top: 1.1rem; padding: 0 0.35rem; }
