/* ============================================================
   UPSIDE — MAP SEARCH (search.html) + SIGNED-IN HOME SEARCH
   ============================================================
   Layout: compact header, one filter bar, then the map and the
   list side by side filling the rest of the window. The list
   scrolls on its own; the map stays put. Phones show one at a
   time with a floating Map / List switch.
   ============================================================ */

/* ---------- page frame ---------- */
.page-search { background: var(--paper-2); }
.page-search .header,
.page-search .header.is-stuck {
  position: sticky;
  top: 0;
  padding: 10px var(--gut);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 1px 0 var(--mist);
}
.page-search .brand__logo { height: 42px; }
.page-search .footer, .page-search [data-footer], .page-search .rail { display: none; }

.ms { --ms-bar: 64px; }

/* ---------- filter bar ---------- */
.ms-bar {
  position: sticky;
  top: var(--ms-top, 64px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--ms-bar);
  padding: 0 var(--gut);
  background: var(--paper-2);
  border-bottom: 1px solid var(--mist);
}
.ms-q { position: relative; flex: 1 1 340px; max-width: 460px; }
.ms-filters { display: flex; align-items: center; gap: 10px; }
.ms-q input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--mist-2);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  font: 500 0.95rem/1 var(--f-body);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ms-q input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08); }
.ms-q__ico { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--brand-grey); pointer-events: none; }

.ms-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--paper-2); border: 1px solid var(--mist); border-radius: var(--r-sm);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  z-index: 80;
}
.ms-suggest li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 0.94rem;
}
.ms-suggest li small { color: var(--brand-grey); font-size: 0.78rem; white-space: nowrap; flex: none; }
.ms-suggest li:hover, .ms-suggest li[aria-selected="true"] { background: var(--paper); }

.ms-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--paper); border: 1px solid var(--mist); border-radius: var(--r-pill);
}
.ms-seg button {
  height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: transparent; font: 600 0.88rem/1 var(--f-body); color: var(--brand-grey); cursor: pointer;
}
.ms-seg button[aria-checked="true"] { background: var(--ink); color: #fff; }

.ms-dd { position: relative; }
.ms-dd__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 14px;
  border: 1px solid var(--mist-2); border-radius: var(--r-pill);
  background: var(--paper-2); font: 600 0.88rem/1 var(--f-body); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.ms-dd__btn svg { width: 16px; height: 16px; transition: transform 0.18s ease; }
.ms-dd__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.ms-dd.is-set .ms-dd__btn { border-color: var(--ink); background: var(--ink); color: #fff; }
.ms-dd__panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 80;
  min-width: 280px; padding: 16px;
  background: var(--paper-2); border: 1px solid var(--mist); border-radius: var(--r-md);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
  transform-origin: top left;
  animation: ms-pop 0.16s ease-out;
}
@keyframes ms-pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.ms-dd__h { margin: 0 0 8px; font: 600 0.78rem/1 var(--f-body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-grey); }
.ms-dd__h + .ms-chips + .ms-dd__h { margin-top: 16px; }
.ms-range { display: flex; align-items: flex-end; gap: 10px; }
.ms-range label { display: grid; gap: 6px; font: 600 0.78rem/1 var(--f-body); color: var(--brand-grey); }
.ms-range select, .ms-sort select {
  height: 40px; padding: 0 10px; border: 1px solid var(--mist-2); border-radius: 10px;
  background: var(--paper-2); font: 500 0.9rem/1 var(--f-body); color: var(--ink);
}
.ms-range span { padding-bottom: 12px; color: var(--brand-grey); }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chips--col { flex-direction: column; align-items: stretch; }
.ms-chip {
  height: 38px; padding: 0 14px; border: 1px solid var(--mist-2); border-radius: var(--r-pill);
  background: var(--paper-2); font: 600 0.86rem/1 var(--f-body); color: var(--ink); cursor: pointer; text-align: left;
}
.ms-chips--col .ms-chip { border-radius: 10px; }
.ms-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ms-chip:active, .ms-dd__btn:active, .ms-seg button:active { transform: scale(0.97); }

.ms-save { margin-left: auto; height: 42px; padding: 0 18px; white-space: nowrap; }

/* ---------- map + list ---------- */
.ms-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 44%);
  height: calc(100dvh - var(--ms-top, 64px) - var(--ms-bar));
}
.ms-map { position: relative; z-index: 1; height: 100%; background: #e8ecea; }
.ms-map .leaflet-tile-pane { filter: saturate(0.55) contrast(0.96) brightness(1.03); }
.ms-list {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 40px;
  border-left: 1px solid var(--mist);
  background: var(--paper-2);
}
.ms-split.is-loading .ms-grid { opacity: 0.55; transition: opacity 0.2s ease 0.15s; }

.ms-list__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.ms-title { margin: 0; font: 700 1.25rem/1.2 var(--f-display); letter-spacing: -0.015em; color: var(--ink); }
.ms-count { margin: 4px 0 0; font-size: 0.88rem; color: var(--brand-grey); }
.ms-sort { display: flex; align-items: center; gap: 8px; font: 600 0.8rem/1 var(--f-body); color: var(--brand-grey); white-space: nowrap; }
.ms-follow { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 14px; font-size: 0.86rem; color: var(--ink-3); cursor: pointer; }
.ms-follow input { width: 16px; height: 16px; accent-color: var(--ink); }

.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ms-card { border-radius: var(--r-md); background: var(--paper-2); box-shadow: 0 0 0 1px var(--mist); transition: box-shadow 0.18s ease, transform 0.18s ease; }
.ms-card:hover { box-shadow: 0 0 0 1px var(--mist-2), 0 10px 28px rgba(0, 0, 0, 0.09); }
.ms-card__link { display: block; color: inherit; text-decoration: none; }
.ms-card__media { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--r-md) var(--r-md) 0 0; background: var(--mist); }
.ms-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-card__badges { position: absolute; left: 10px; top: 10px; right: 52px; display: flex; flex-wrap: wrap; gap: 6px; }
.ms-card__badge {
  padding: 5px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.94); font: 700 0.7rem/1 var(--f-body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink);
}
.ms-card__badge.is-own { background: var(--accent-btn); color: #fff; }
.ms-card__badge.is-new { background: #1e5b46; color: #fff; }
.ms-card__badge.is-fresh { background: #fff; color: var(--accent-2); }
.ms-card__badge.is-video { background: rgba(10, 10, 10, 0.78); color: #fff; }
/* ▶ on a pin: Upside has a video tour of this home */
.ms-vid {
  position: absolute; left: calc(100% - 6px); top: -8px; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--accent-btn);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); pointer-events: none;
}
.ms-vid svg { width: 11px; height: 11px; margin-left: 1px; }
.ms-dotpin + .ms-vid, .ms-newtag + .ms-vid { left: calc(100% - 4px); top: -10px; }
/* school district names on the map */
.leaflet-tooltip.ms-dlabel {
  background: rgba(255, 255, 255, 0.85); border: 0; box-shadow: none; padding: 2px 6px; border-radius: 6px;
  font: 700 0.72rem/1.2 var(--f-body); color: #2b2b2b; letter-spacing: 0.01em;
}
.leaflet-tooltip.ms-dlabel::before { display: none; }
.ms-dd__fine { margin: 10px 0 0; font-size: 0.74rem; line-height: 1.45; color: rgba(10, 10, 10, 0.55); max-width: 280px; }
/* "New" on a pin: on the market in the last 7 days */
.ms-newtag {
  position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  padding: 2px 6px; border-radius: 6px; background: var(--accent-btn); color: #fff;
  font: 800 0.62rem/1.2 var(--f-body); letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); pointer-events: none;
}
.ms-pin-wrap .ms-pin + .ms-newtag { bottom: calc(100% + 1px); }
.ms-dotpin.is-fresh { border-color: var(--accent-btn); box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.35); }
/* zoomed far out the map shows the newest 300 homes, so most would be
   "new": no New marks until the visitor zooms in */
.ms-far .ms-dotpin + .ms-newtag { display: none; }
.ms-far .ms-dotpin.is-fresh { border-color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.ms-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.9rem; color: var(--ink-2, var(--ink)); cursor: pointer; }
.ms-check input { width: 16px; height: 16px; accent-color: var(--ink); }
.ms-card__fav.p-card__fav { position: absolute; right: 10px; top: 10px; left: auto; bottom: auto; }
.ms-card__body { display: grid; gap: 4px; padding: 12px 14px 14px; }
.ms-card__price { font: 700 1.3rem/1.1 var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.ms-card__specs, .ms-mini__specs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 0.9rem; color: var(--ink-3); }
.ms-card__specs b, .ms-mini__specs b { font-weight: 700; margin-right: 3px; }
.ms-dot { display: inline-block; width: 3px; height: 3px; margin: 0 8px; border-radius: 50%; background: var(--mist-2); }
.ms-card__addr { font-size: 0.9rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-card__office { font-size: 0.72rem; letter-spacing: 0.02em; color: var(--brand-grey); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ms-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 48px 12px; text-align: center; color: var(--brand-grey); }
.ms-pager { display: flex; justify-content: center; gap: 6px; margin: 24px 0 8px; }
.ms-pager button {
  min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--mist-2); border-radius: 10px;
  background: var(--paper-2); font: 600 0.9rem/1 var(--f-body); color: var(--ink); cursor: pointer;
}
.ms-pager button[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ms-pager button:disabled { opacity: 0.35; cursor: default; }
.ms-disclaimer:not(:empty) { margin-top: 24px; font-size: 0.74rem; color: var(--brand-grey); }

/* ---------- price pins ---------- */
.ms-pin-wrap { background: none; border: 0; }
.ms-pin-wrap:focus-visible { outline: none; }
.ms-pin-wrap:focus-visible .ms-pin { box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.35); }
.ms-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
  font: 700 0.78rem/1 var(--f-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.ms-pin::after {
  content: "";
  position: absolute; left: 50%; bottom: -5px;
  width: 8px; height: 8px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
}
.ms-pin.is-own { background: var(--accent-btn); color: #fff; }
.ms-pin.is-pending { background: #f1efe9; color: var(--brand-grey); }
.ms-pin-wrap:hover .ms-pin, .ms-pin-wrap.is-hot .ms-pin {
  background: var(--ink); color: #fff; transform: scale(1.08);
}

.ms-dotpin {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink-3); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer; transition: transform 0.14s ease;
}
.ms-dotpin.is-own { background: var(--accent-btn); }
.ms-dotpin.is-pending { background: #9a9a92; }
.ms-pin-wrap:hover .ms-dotpin, .ms-pin-wrap.is-hot .ms-dotpin { transform: scale(1.35); }
.ms-tip { padding: 4px 8px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font: 700 0.76rem/1 var(--f-body); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.ms-tip::before { border-top-color: var(--ink) !important; }

/* pin popup: a small card */
.ms-pop .leaflet-popup-content-wrapper { padding: 0; border-radius: var(--r-md); overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2); }
.ms-pop .leaflet-popup-content { margin: 0; width: 260px !important; }
.ms-pop .leaflet-popup-tip { box-shadow: none; }
.ms-mini { display: block; color: inherit; text-decoration: none; }
.ms-mini img { display: block; width: 100%; height: 150px; object-fit: cover; background: var(--mist); }
.ms-mini__body { display: grid; gap: 3px; padding: 10px 12px 12px; font-family: var(--f-body); }
.ms-mini__price { font: 700 1.1rem/1.1 var(--f-display); color: var(--ink); }
.ms-mini__addr { font-size: 0.84rem; color: var(--ink-3); }
.ms-mini__office { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--brand-grey); }

.leaflet-container { font-family: var(--f-body); }
.leaflet-control-zoom a { width: 34px !important; height: 34px !important; line-height: 34px !important; color: var(--ink) !important; }
.leaflet-bar { border: 0 !important; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important; border-radius: 10px !important; overflow: hidden; }

/* ---------- phones and small laptops ---------- */
.ms-toggle { display: none; }
@media (max-width: 1180px) {
  .ms-save { display: none; }
  .ms-split { grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); }
}
/* ---------- phones: full-screen map, list in a pull-up sheet ----------
   Like the Zillow app: the map fills the screen under a floating search
   bar and filter chips; the homes are in a sheet that peeks up from the
   bottom and is dragged or tapped up over the map (search.js). Tapping a
   pin shows that home's card above the sheet. */
.ms-home, .ms-fsave, .ms-peekcard, .ms-grab { display: none; }
.ms-locate {
  display: grid; place-items: center; width: 36px; height: 36px; margin-top: 8px;
  border: 0; border-radius: 10px; background: #fff; color: #222; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.ms-locate svg { width: 18px; height: 18px; }
.ms-locate.is-busy svg { animation: ms-skel 1s ease-in-out infinite; }

@media (max-width: 900px) {
  .page-search .header, .page-search .header.is-stuck { display: none; }
  body.page-search { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
  .ms { --ms-bar: auto; --peek: calc(84px + env(safe-area-inset-bottom)); }

  /* the floating search bar and filter chips */
  .ms-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    flex-wrap: wrap; height: auto; gap: 8px;
    padding: calc(env(safe-area-inset-top) + 10px) 12px 6px;
    background: transparent; border: 0; pointer-events: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .ms-bar > * { pointer-events: auto; }
  .ms:has(.ms-list.is-up) .ms-bar { background: var(--paper-2); box-shadow: 0 1px 0 var(--mist); }
  .ms-home {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px;
    border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  .ms-home { color: var(--accent-btn); }
  .ms-home svg { width: 24px; height: 24px; }
  .ms-home:active { transform: scale(0.95); }
  .ms-q { flex: 1 1 0; min-width: 0; max-width: none; }
  .ms-q input {
    height: 44px; border: 0; border-radius: var(--r-pill); background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 16px;                          /* 16px: iOS doesn't zoom in */
  }
  .ms-q input:focus { box-shadow: 0 0 0 2px var(--ink), 0 2px 10px rgba(0, 0, 0, 0.2); }
  .ms-suggest { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 60px); max-height: 60dvh; overflow-y: auto; }
  .ms-filters { flex: 1 1 100%; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 4px; }
  .ms-filters::-webkit-scrollbar { display: none; }
  .ms-filters > * { flex: none; }
  .ms-filters .ms-seg, .ms-filters .ms-dd__btn { border-color: transparent; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16); }
  .ms-filters .ms-seg { background: #fff; padding: 2px; }
  .ms-filters .ms-seg button { height: 32px; padding: 0 14px; }
  .ms-filters .ms-dd__btn { height: 36px; background: #fff; }
  .ms-filters .ms-dd.is-set .ms-dd__btn { background: var(--ink); }
  .ms:has(.ms-list.is-up) .ms-filters .ms-seg,
  .ms:has(.ms-list.is-up) .ms-filters .ms-dd__btn { box-shadow: 0 0 0 1px var(--mist-2); }
  .ms-dd__panel { position: fixed; left: 12px; right: 12px; top: calc(var(--ms-bar-h, 112px) + 4px); min-width: 0; }

  /* the map: the whole screen above the sheet's resting place */
  .ms-split { display: block; height: auto; }
  .ms-map { position: fixed; top: 0; left: 0; right: 0; bottom: calc(var(--peek) - 14px); height: auto; z-index: 1; }
  .ms-map .leaflet-control-zoom { display: none; }      /* pinch to zoom */
  .ms-map .leaflet-top.leaflet-left { top: auto; bottom: 40px; }
  .ms-map .leaflet-top.leaflet-left .leaflet-control { margin-left: 12px; }
  .ms-map .mapmode { border-radius: var(--r-pill); }
  .ms-map .mapmode button { padding: 10px 14px; }
  .ms-map .ms-locate { width: 40px; height: 40px; border-radius: 50%; }

  /* the list sheet */
  .ms-list {
    position: fixed; left: 0; right: 0; top: var(--ms-bar-h, 112px); bottom: 0; z-index: 50;
    height: auto; padding: 0 12px calc(96px + env(safe-area-inset-bottom));
    background: var(--paper-2); border: 0; border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.16);
    overflow: hidden; overscroll-behavior: contain; will-change: transform;
    transform: translate3d(0, calc(100dvh - var(--ms-bar-h, 112px) - var(--peek)), 0);   /* before the script places it */
  }
  .ms-list.is-up { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .ms-grab { display: block; position: sticky; top: 0; z-index: 3; margin: 0 -12px; padding: 8px 0 6px; background: var(--paper-2); cursor: grab; }
  .ms-grab span { display: block; width: 40px; height: 5px; margin: 0 auto; border-radius: 3px; background: #cfcfcf; }
  .ms-list__head { flex-wrap: wrap; justify-content: center; gap: 2px 10px; padding: 0 0 12px; text-align: center; cursor: pointer; }
  .ms-list__head > div { flex: 1 1 100%; }
  /* the sheet's handle reads like Zillow's: "2,390 homes for sale" */
  .ms-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ms-count { margin: 0; font: 700 0.98rem/1.3 var(--f-body); color: var(--ink); }
  .ms-list:not(.is-up) .ms-sort { visibility: hidden; }
  .ms-grid { grid-template-columns: 1fr; }
  .ms-follow { display: none; }

  /* back to the map (only while the list is up) */
  .ms-toggle {
    position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 90;
    display: none; align-items: center; gap: 8px;
    height: 46px; padding: 0 20px; transform: translateX(-50%);
    border: 0; border-radius: var(--r-pill);
    background: var(--ink); color: #fff; font: 700 0.92rem/1 var(--f-body);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); cursor: pointer;
  }
  .ms:has(.ms-list.is-up) .ms-toggle { display: inline-flex; }
  .ms-toggle svg { width: 18px; height: 18px; }
  .ms-toggle:active { transform: translateX(-50%) scale(0.97); }

  /* Save search, floating over the map */
  .ms-fsave {
    display: inline-flex; align-items: center; position: fixed; z-index: 40;
    right: 12px; bottom: calc(var(--peek) + 12px); height: 42px; padding: 0 18px;
    border-radius: var(--r-pill); background: var(--accent-btn); color: #fff;
    font: 700 0.9rem/1 var(--f-body); text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }
  .ms-fsave:active { transform: scale(0.97); }
  .ms:has(.ms-list.is-up) .ms-fsave, body.ms-peeking .ms-fsave { display: none; }

  /* a tapped pin's home, above the sheet */
  .ms-peekcard { display: block; position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(var(--peek) + 4px); animation: ms-peek-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .ms-peekcard[hidden] { display: none; }
  .ms-peekcard .ms-card { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); }
  .ms-peekcard .ms-card__media { aspect-ratio: auto; height: 128px; }
  .ms-peekcard .ms-card__body { padding-top: 10px; padding-bottom: 12px; }
  body.ms-peeking .ms-map .leaflet-top.leaflet-left { visibility: hidden; }
}
@keyframes ms-peek-in { from { opacity: 0; transform: translateY(16px); } }


@media (prefers-reduced-motion: reduce) {
  .ms-dd__panel, .ms-peekcard { animation: none; }
  .ms-pin, .ms-card, .ms-dd__btn svg { transition: none; }
}

/* ============================================================
   SIGNED-IN HOME: the search hero (home-search.js)
   ============================================================ */
.hs {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(640px, 86vh);
  margin: 10px var(--gut) 0;
  padding: 140px 24px 72px;
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}
.hs__media, .hs__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hs::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.18) 45%, rgba(0, 0, 0, 0.5) 100%); }
.hs__inner { width: min(720px, 100%); display: grid; gap: 22px; text-align: center; }
.hs__hello { margin: 0; font: 600 0.82rem/1 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.hs__title { margin: 0; font: 700 clamp(2.2rem, 5.4vw, 4rem)/1.02 var(--f-display); letter-spacing: -0.035em; text-wrap: balance; }
.hs__title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

.hs__tabs { display: inline-flex; justify-self: center; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(10px); }
.hs__tabs button {
  height: 38px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: rgba(255, 255, 255, 0.85); font: 600 0.9rem/1 var(--f-body); cursor: pointer;
}
.hs__tabs button[aria-selected="true"] { background: #fff; color: var(--ink); }

.hs__form { position: relative; display: flex; align-items: center; height: 64px; padding: 6px 6px 6px 22px; border-radius: var(--r-pill); background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28); }
.hs__form input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent;
  font: 500 1.05rem/1 var(--f-body); color: var(--ink);
}
.hs__form input:focus { outline: none; }
.hs__form:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 20px 50px rgba(0, 0, 0, 0.28); }
.hs__go {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: var(--accent-btn); color: #fff; cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.hs__go:hover { background: var(--accent-2); }
.hs__go:active { transform: scale(0.95); }
.hs__go svg { width: 22px; height: 22px; }
.hs .ms-suggest { top: calc(100% + 8px); text-align: left; color: var(--ink); }
.hs__quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hs__quick a {
  padding: 8px 14px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px);
  color: #fff; font: 600 0.84rem/1 var(--f-body); text-decoration: none;
  transition: background 0.15s ease;
}
.hs__quick a:hover { background: rgba(255, 255, 255, 0.28); }

body.has-hs section.hero { display: none; }

@media (max-width: 700px) {
  .hs { min-height: 540px; padding: 110px 16px 48px; margin: 8px 10px 0; border-radius: var(--r-lg); }
  .hs__form { height: 58px; padding-left: 18px; }
  .hs__go { width: 46px; height: 46px; }
}

/* ---------- PCS mode ---------- */
.ms-pcs .ms-dd__btn svg:first-child { width: 16px; height: 16px; margin-right: 2px; }
.pcs-panel { width: 300px; }
.pcs-panel select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.pcs-panel__bah { margin: 14px 0 12px; font-size: .9rem; }
.pcs-panel__row { display: flex; gap: 12px; align-items: center; }
.pcs-panel__off { background: none; border: 0; font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; color: rgba(10,10,10,.6); }
.pcs-panel__fine { margin-top: 12px; font-size: .74rem; line-height: 1.45; color: rgba(10,10,10,.55); }
.pcs-tag { display: inline-block; margin-top: 8px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #f9eeda; color: #7a4b00; }
.pcs-tag.is-ok { background: #e5f4e4; color: #1d5b22; }

/* skeleton cards while the first results load (same size as real cards: no shift) */
.ms-skel { pointer-events: none; }
.ms-skel .ms-card__media { background: var(--mist); }
.ms-skel .ms-card__body i { display: block; height: 12px; border-radius: 6px; background: var(--mist); }
.ms-skel .ms-card__body i:nth-child(1) { width: 45%; height: 16px; }
.ms-skel .ms-card__body i:nth-child(2) { width: 70%; }
.ms-skel .ms-card__body i:nth-child(3) { width: 85%; }
@media (prefers-reduced-motion: no-preference) {
  .ms-skel .ms-card__media, .ms-skel .ms-card__body i { animation: ms-skel 1.4s ease-in-out infinite; }
}
@keyframes ms-skel { 50% { opacity: 0.55; } }
