/* Rimoly saved items — scoped to the area modal's favorites view. */
#area-overlay.favorites-open .favorite-card-unavailable .favorite-photo { opacity: 1; cursor: pointer; }
#area-overlay.favorites-open .favorite-card-unavailable .favorite-photo img { filter: brightness(.42); }
#area-overlay.favorites-open .favorite-card-unavailable .favorite-title { opacity: 1; cursor: pointer; }
#area-overlay.favorites-open .favorite-unavailable-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(0 0 0 / .12); color: #fff; pointer-events: none;
}
#area-overlay.favorites-open .favorite-unavailable-overlay svg {
  width: 40px; height: 40px; padding: 8px; box-sizing: content-box;
  border-radius: 50%; background: rgb(0 0 0 / .5);
}
#area-overlay.favorites-open .favorite-availability { display: inline-block; margin-top: .35rem; }
.deleted-favorite-preview { min-width: 0; padding: .5rem; color: var(--ink); }
.deleted-favorite-back { min-height: 44px; padding: .5rem .75rem; font: inherit; color: var(--red); background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.deleted-favorite-notice { margin: 1rem 0; padding: .85rem; font-size: 1rem; line-height: 1.45; background: color-mix(in srgb, var(--paper) 92%, var(--red)); border-radius: 8px; }
.deleted-favorite-gallery { display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; border-radius: 10px; }
.deleted-favorite-slide { display: grid; place-items: center; flex: 0 0 100%; min-width: 0; height: clamp(240px, 65vw, 440px); margin: 0; scroll-snap-align: start; background: color-mix(in srgb, var(--paper) 80%, var(--ink)); }
.deleted-favorite-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.deleted-favorite-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: .5rem; }
.deleted-favorite-controls button { min-width: 44px; min-height: 44px; font-size: 1.5rem; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.deleted-favorite-preview h2 { margin: 1rem 0 .5rem; font-size: 1.375rem; line-height: 1.35; overflow-wrap: anywhere; }
.deleted-favorite-price { margin: .5rem 0; font-size: 1.5rem; font-weight: 700; color: var(--red); }
.deleted-favorite-location { font-size: 1.125rem; }
.deleted-favorite-no-photo { padding: 3rem 1rem; text-align: center; background: var(--paper); }
#area-overlay.favorites-open {
  --favorites-accent: var(--red, #d7262f);
  --favorites-surface: var(--paper, #f7f8f9);
  --favorites-ink: var(--ink, #111315);
  --favorites-muted: var(--muted, #687078);
  --favorites-line: var(--line, #e6e8eb);
}

#area-overlay.favorites-open .modal {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--favorites-surface);
  color: var(--favorites-ink);
}

#area-overlay.favorites-open .modal-header {
  flex: 0 0 auto;
  background: var(--favorites-surface);
  color: var(--favorites-ink);
  border-bottom-color: var(--favorites-line);
}

#area-overlay.favorites-open .modal-header h2 {
  min-width: 0;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -.035em;
}

#area-overlay.favorites-open .modal-close {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--favorites-line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

#area-overlay.favorites-open .modal-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

#area-overlay.favorites-open .modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: var(--favorites-surface);
  color: var(--favorites-ink);
}

#area-overlay.favorites-open .favorites-tabs {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 56px;
  border-bottom: 1px solid var(--favorites-line);
  background: var(--favorites-surface);
}

#area-overlay.favorites-open .favorites-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 54px;
  border: 0;
  padding: .75rem .8rem;
  background: transparent;
  color: var(--favorites-muted);
  font: 700 .96rem/1.2 'DM Sans', sans-serif;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease;
}

#area-overlay.favorites-open .favorites-tab[aria-selected="true"] {
  color: var(--favorites-accent);
}

#area-overlay.favorites-open .favorites-tab[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--favorites-accent);
  content: "";
}

#area-overlay.favorites-open .favorites-tab svg {
  width: 19px;
  height: 19px;
  margin-right: .42rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#area-overlay.favorites-open #favorites-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 0 .7rem 1rem;
}

#area-overlay.favorites-open .favorites-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.05rem;
  min-width: 0;
}

#area-overlay.favorites-open .favorite-card {
  display: grid;
  min-width: 0;
  padding: .55rem 0 .8rem;
  border-bottom: 1px solid var(--favorites-line);
  color: var(--favorites-ink);
}

#area-overlay.favorites-open .favorite-open {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#area-overlay.favorites-open .favorite-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: #d9dde0;
}

#area-overlay.favorites-open .favorite-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s ease;
}

#area-overlay.favorites-open .favorite-photo img[hidden] {
  display: none;
}

#area-overlay.favorites-open .favorite-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--favorites-muted);
  font-size: .95rem;
}

#area-overlay.favorites-open .favorite-photo:hover img {
  transform: scale(1.015);
}

#area-overlay.favorites-open .favorite-photo-count {
  position: absolute;
  bottom: .5rem;
  left: .5rem;
  display: inline-grid;
  min-width: 27px;
  min-height: 27px;
  place-items: center;
  padding: .15rem .38rem;
  border-radius: 4px;
  background: rgb(19 21 23 / 78%);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}

#area-overlay.favorites-open .favorite-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
  min-width: 0;
  margin-top: .62rem;
  color: var(--favorites-muted);
  font-size: .9rem;
  line-height: 1.35;
}

#area-overlay.favorites-open .favorite-location,
#area-overlay.favorites-open .favorite-date {
  min-width: 0;
  overflow-wrap: anywhere;
}

#area-overlay.favorites-open .favorite-date {
  flex: 0 0 auto;
  text-align: right;
}

#area-overlay.favorites-open .favorite-title {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: .34rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--favorites-ink);
  font: 500 1.12rem/1.25 'DM Sans', sans-serif;
  overflow-wrap: anywhere;
}

#area-overlay.favorites-open .favorite-price {
  margin-top: .34rem;
  color: var(--favorites-accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

#area-overlay.favorites-open .favorite-status {
  justify-self: start;
  margin-top: .4rem;
  border-radius: 999px;
  padding: .24rem .55rem;
  background: color-mix(in srgb, var(--favorites-accent) 11%, var(--favorites-surface));
  color: var(--favorites-accent);
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.25;
}

#area-overlay.favorites-open .favorite-actions {
  display: flex;
  align-items: center;
  gap: .2rem;
  min-height: 48px;
  margin-top: .48rem;
}

#area-overlay.favorites-open .favorite-action {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  padding: 0;
  background: transparent;
  color: var(--favorites-muted);
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}

#area-overlay.favorites-open .favorite-action:hover,
#area-overlay.favorites-open .favorite-action.is-active {
  background: color-mix(in srgb, var(--favorites-accent) 10%, transparent);
  color: var(--favorites-accent);
}

#area-overlay.favorites-open .favorite-action.favorite-remove {
  color: var(--favorites-accent);
}

#area-overlay.favorites-open .favorite-action svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#area-overlay.favorites-open .favorite-action-spacer {
  flex: 1 1 auto;
}

#area-overlay.favorites-open .favorite-action:disabled,
#area-overlay.favorites-open .favorites-tab:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#area-overlay.favorites-open :is(button, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--favorites-accent) 72%, white);
  outline-offset: 2px;
}

#area-overlay.favorites-open .favorites-state {
  display: grid;
  min-height: min(42vh, 320px);
  place-content: center;
  justify-items: center;
  gap: .55rem;
  padding: 2rem 1rem;
  color: var(--favorites-muted);
  text-align: center;
}

#area-overlay.favorites-open .favorites-state strong {
  color: var(--favorites-ink);
  font-size: 1.05rem;
}

#area-overlay.favorites-open .favorites-state p {
  max-width: 34ch;
  font-size: .88rem;
  line-height: 1.5;
}

#area-overlay.favorites-open .favorites-state[aria-busy="true"] {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--favorites-muted) 10%, transparent), transparent);
  background-size: 200% 100%;
  animation: rimoly-favorites-loading 1.5s ease-in-out infinite;
}

#area-overlay.favorites-open .favorites-retry {
  min-height: 44px;
  margin-top: .35rem;
  border: 1px solid var(--favorites-accent);
  border-radius: 8px;
  padding: .55rem .9rem;
  background: transparent;
  color: var(--favorites-accent);
  font: 800 .86rem 'DM Sans', sans-serif;
  cursor: pointer;
}

#area-overlay.favorites-open .favorites-retry:hover {
  background: var(--favorites-accent);
  color: #fff;
}

/* Saved searches stay on their existing markup and behavior. */
#area-overlay.favorites-open #favorites-panel .saved-searches {
  margin-top: .75rem;
}

#area-overlay.favorites-open #favorites-panel .saved-searches .area-item {
  background: var(--favorites-surface);
  color: var(--favorites-ink);
}

body.dark #area-overlay.favorites-open .modal-header,
body.dark #area-overlay.favorites-open .modal-body,
body.dark #area-overlay.favorites-open .favorites-tabs {
  background: #202326;
  color: #f1f3f4;
  border-color: #45494d;
}

body.dark #area-overlay.favorites-open .favorite-card {
  border-color: #45494d;
}

body.dark #area-overlay.favorites-open .favorite-photo {
  background: #30363b;
}

body.dark #area-overlay.favorites-open .favorite-title,
body.dark #area-overlay.favorites-open .favorites-state strong {
  color: #f1f3f4;
}

body.dark #area-overlay.favorites-open .favorite-meta,
body.dark #area-overlay.favorites-open .favorite-action {
  color: #b5bcc2;
}

body.dark #area-overlay.favorites-open .favorite-action.favorite-remove {
  color: #ff9ca8;
}

body.dark #area-overlay.favorites-open .favorites-tab[aria-selected="true"] {
  color: #ff9ca8;
}

body.dark #area-overlay.favorites-open .favorites-state[aria-busy="true"] {
  background-image: linear-gradient(90deg, transparent, rgb(255 255 255 / 7%), transparent);
}

body.dark #area-overlay.favorites-open .favorites-retry {
  color: #ff9ca8;
  border-color: #ff9ca8;
}

@media (max-width: 700px) {
  #area-overlay.favorites-open {
    z-index: 430;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0 0 calc(84px + env(safe-area-inset-bottom));
    background: var(--favorites-surface);
  }

  #area-overlay.favorites-open .modal {
    width: 100%;
    max-width: none;
    height: calc(100dvh - 84px - env(safe-area-inset-bottom));
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  #area-overlay.favorites-open .modal-header {
    position: sticky;
    z-index: 3;
    top: 0;
    min-height: 60px;
    padding: max(.5rem, env(safe-area-inset-top)) .95rem .55rem;
    border-bottom: 1px solid var(--favorites-line);
  }

  #area-overlay.favorites-open .modal-header h2 {
    font-size: 1.36rem;
  }

  #area-overlay.favorites-open .modal-close {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  #area-overlay.favorites-open .favorites-tabs {
    top: 0;
    min-height: 56px;
  }

  #area-overlay.favorites-open #favorites-panel {
    padding: 0 .55rem calc(1rem + env(safe-area-inset-bottom));
    scroll-padding-bottom: 1rem;
  }

  #area-overlay.favorites-open .favorites-feed {
    gap: .6rem;
  }

  #area-overlay.favorites-open .favorite-card {
    padding: .48rem 0 .62rem;
  }

  #area-overlay.favorites-open .favorite-photo {
    aspect-ratio: 1.42 / 1;
  }

  #area-overlay.favorites-open .favorite-meta {
    font-size: .91rem;
  }

  #area-overlay.favorites-open .favorite-title {
    font-size: 1.14rem;
  }

  #area-overlay.favorites-open .favorite-price {
    font-size: 1.38rem;
  }
}

@media (min-width: 701px) {
  #area-overlay.favorites-open .modal {
    width: min(100%, 620px);
    max-height: min(86dvh, 900px);
    border: 1px solid var(--favorites-line);
    border-radius: 16px;
    box-shadow: 0 20px 70px rgb(15 18 20 / 27%);
  }

  #area-overlay.favorites-open .modal-header {
    padding: 1rem 1.25rem;
  }

  #area-overlay.favorites-open #favorites-panel {
    padding: 0 1rem 1rem;
  }
}

@keyframes rimoly-favorites-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  #area-overlay.favorites-open *,
  #area-overlay.favorites-open *::before,
  #area-overlay.favorites-open *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
