#home-filter-legacy[hidden] { display: none; }

.map-filter-tool { position: relative; }
#map-filter-toggle {
  display: grid; place-items: center; box-sizing: border-box; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--night-border, #e0dcd8); border-radius: 50%;
  background: var(--night-search-surface, #fffdfb); color: var(--night-ink, #222); box-shadow: 0 5px 18px #0005; cursor: pointer;
}
#map-filter-toggle svg {
  width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
#map-filter-toggle[aria-expanded="false"]:hover { border-color: var(--night-accent, #e60012); color: var(--night-accent, #e60012); }
#map-filter-toggle[aria-expanded="true"] { border-color: var(--night-red, #d4141c); background: var(--night-red, #d4141c); color: #fff; }
#desktop-filter-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 3; box-sizing: border-box;
  width: min(310px, calc(100vw - 24px)); max-height: calc(100dvh - var(--filter-viewport-offset, 76px));
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; border: 1px solid var(--night-border, #e0dcd8);
  border-radius: 16px; background: var(--night-glass, #fffdfb); color: var(--night-ink, #222); box-shadow: var(--night-shadow, 0 5px 18px #0005);
  backdrop-filter: blur(14px); font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
#desktop-filter-popover .home-filter-section { margin: 0; padding: 14px; }
#desktop-filter-popover .home-filter-heading { margin-bottom: 11px; color: inherit; font-size: 15px; }
#desktop-filter-popover .map-filter-group + .map-filter-group { margin-top: 11px; padding-top: 10px; }
#desktop-filter-popover .map-filter-group h3 { margin-bottom: 7px; font-size: 13px; }
#desktop-filter-popover .map-filter-choices { gap: 6px; }
#desktop-filter-popover .map-filter-chip { min-height: 31px; padding: 4px 2px; border-radius: 9px; }
@media (prefers-reduced-motion: no-preference) {
  #desktop-filter-popover:not([hidden]) { animation: map-settings-appear .16s ease-out; }
}

.map-filter-group + .map-filter-group { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--night-border, #ffffff26); }
.map-filter-group h3 { margin: 0 0 10px; color: var(--night-ink, #fff); font-size: 15px; font-weight: 720; }
.map-filter-choices { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 7px; }
.map-filter-cities { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.map-filter-chip {
  min-width: 0; min-height: 39px; padding: 6px 2px; border: 1px solid var(--night-border, #ffffff26);
  border-radius: 12px; background: #ffffff0b; color: var(--night-ink, #fff); font: inherit; font-size: 12px; cursor: pointer;
}
.map-filter-cities .map-filter-chip { background: #ffffff13; border-radius: 15px; }
.map-filter-chip:is(:hover, :focus-visible) { border-color: var(--night-accent, #ff5258); }
.map-filter-chip[aria-pressed="true"] { border-color: transparent; color: #fff; background: var(--night-red, #d4141c); }
.map-filter-note { margin: 7px 1px 0; color: var(--night-muted, #b5adb1); font-size: 11px; line-height: 1.5; }
@media (max-width: 480px) {
  #mobile-view-filter > #home-filter-section { margin: 0; padding: 1px 1px 14px; background: transparent; }
  #mobile-view-filter #home-filter-heading { display: none; }
}
