.nearby-view[hidden] {
  display: none !important;
}

.nearby-view {
  position: absolute;
  inset: 0;
  z-index: 135;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f5f7fb;
  overflow: hidden;
}

.nearby-header {
  flex: 0 0 auto;
  min-height: 86px;
  padding: 14px 24px 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #e7eaf0;
}

.nearby-header-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nearby-heading {
  min-width: 0;
}

.nearby-kicker {
  display: block;
  margin-bottom: 3px;
  color: #667eea;
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1.15px;
}

.nearby-heading h1 {
  margin: 0;
  color: #1c2430;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 850;
}

.nearby-heading p {
  margin: 6px 0 0;
  color: #8b95a3;
  font-size: 12px;
}

.nearby-heading p b {
  color: #687382;
  font-weight: 750;
}

.nearby-mobile-menu {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f2f4f8;
  color: #535f6e;
  font-size: 18px;
}

.nearby-city-chip {
  flex: 0 0 auto;
  min-width: 168px;
  padding: 9px 13px 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e4e8ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(35,48,65,.045);
}

.nearby-city-chip > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #667eea;
  background: #eef1ff;
}

.nearby-city-chip .ui-icon {
  width: 18px;
  height: 18px;
}

.nearby-city-chip div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nearby-city-chip small {
  color: #9aa3af;
  font-size: 9px;
}

.nearby-city-chip b {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #26313e;
  font-size: 12px;
}

.nearby-toolbar {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f8f9fc;
  border-bottom: 1px solid #e8ebf1;
}

.nearby-segments {
  min-width: 0;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid #e1e5ec;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(35,48,65,.035);
}

.nearby-segments button {
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  color: #7b8592;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  transition: .16s ease;
}

.nearby-segments button:hover {
  background: #f5f6fa;
}

.nearby-segments button.active {
  color: #fff;
  background: linear-gradient(135deg, #667eea, #7589e8);
  box-shadow: 0 7px 16px rgba(102,126,234,.22);
}

.nearby-segments button b {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #7c8795;
  background: #f1f3f7;
  font-size: 9px;
  font-weight: 850;
}

.nearby-segments button.active b {
  color: #6578d2;
  background: rgba(255,255,255,.92);
}

.nearby-online-filter {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #596575;
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
  user-select: none;
}

.nearby-online-filter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nearby-toggle {
  width: 41px;
  height: 24px;
  padding: 3px;
  display: block;
  border-radius: 999px;
  background: #d9dee7;
  transition: .18s ease;
}

.nearby-toggle i {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24,35,48,.18);
  transition: transform .18s ease;
}

.nearby-online-filter input:checked + .nearby-toggle {
  background: #54c66b;
}

.nearby-online-filter input:checked + .nearby-toggle i {
  transform: translateX(17px);
}

.nearby-online-filter > b {
  min-width: 23px;
  height: 21px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #319947;
  background: #eaf8ed;
  font-size: 9px;
}

.nearby-scroll {
  flex: 1;
  min-height: 0;
  padding: 20px 22px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.nearby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 16px;
}

.nearby-person-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2e6ed;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(32,46,65,.06);
  cursor: pointer;
  outline: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.nearby-person-card:hover,
.nearby-person-card:focus-visible {
  transform: translateY(-2px);
  border-color: #cad3f2;
  box-shadow: 0 13px 32px rgba(45,62,86,.105);
}

.nearby-person-visual {
  position: relative;
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 27%, rgba(255,255,255,.95), rgba(255,255,255,0) 36%),
    linear-gradient(145deg, #e9ecff 0%, #f5edff 52%, #eaf5ff 100%);
}

.nearby-person-visual::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 4px;
  height: 18px;
  border-radius: 50%;
  background: rgba(73,83,112,.12);
  filter: blur(6px);
}

.nearby-person-avatar {
  position: relative;
  z-index: 2;
  width: auto !important;
  height: 176px !important;
  max-width: 88%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 9px 12px rgba(37,49,67,.11));
}

.nearby-presence {
  position: absolute;
  z-index: 4;
  left: 11px;
  top: 11px;
  height: 25px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  color: #77818e;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(37,49,67,.07);
  font-size: 9px;
  font-weight: 800;
}

.nearby-presence i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aab2bd;
}

.nearby-presence.online {
  color: #2c9d48;
}

.nearby-presence.online i {
  background: #4dca68;
  box-shadow: 0 0 0 3px rgba(77,202,104,.16);
}

.nearby-person-body {
  padding: 13px 14px 12px;
}

.nearby-person-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.nearby-person-title b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2935;
  font-size: 14px;
  font-weight: 850;
}

.nearby-gender {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.nearby-gender.female {
  color: #d760a1;
  background: #fdeaf4;
}

.nearby-gender.male {
  color: #5481dd;
  background: #eaf1ff;
}

.nearby-gender.not_specified {
  color: #9aa3ae;
  background: #f1f3f6;
}

.nearby-person-city,
.nearby-person-status {
  margin: 7px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8a94a1;
  font-size: 10px;
}

.nearby-person-city .ui-icon {
  width: 12px;
  height: 12px;
  color: #7b8ce1;
}

.nearby-person-status {
  margin-top: 4px;
  color: #a0a8b2;
}

.nearby-world-pill {
  width: 100%;
  min-height: 34px;
  margin-top: 11px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 8px minmax(0,1fr) 13px;
  align-items: center;
  gap: 7px;
  border-radius: 11px;
  color: #4e5c70;
  background: #f5f7fb;
  text-align: left;
}

.nearby-world-pill:hover {
  background: #eef1f8;
}

.nearby-world-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4dca68;
}

.nearby-world-pill b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 780;
}

.nearby-world-pill i {
  color: #98a1ad;
  font-style: normal;
  font-size: 17px;
}

.nearby-person-footer {
  min-height: 37px;
  margin-top: 11px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #edf0f4;
  color: #6b7fd6;
  font-size: 9px;
  font-weight: 800;
}

.nearby-person-footer .ui-icon {
  width: 13px;
  height: 13px;
}

.nearby-empty {
  grid-column: 1 / -1;
  min-height: 300px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #dce2eb;
  border-radius: 22px;
  background: #fff;
}

.nearby-empty > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #6c82df;
  background: #eef1ff;
}

.nearby-empty .ui-icon {
  width: 27px;
  height: 27px;
}

.nearby-empty b {
  margin-top: 16px;
  color: #27313d;
  font-size: 16px;
}

.nearby-empty p {
  max-width: 430px;
  margin: 7px 0 0;
  color: #8a95a2;
  font-size: 11px;
  line-height: 1.55;
}

.nearby-more {
  min-width: 170px;
  height: 42px;
  margin: 22px auto 0;
  padding: 0 18px;
  display: block;
  border: 1px solid #dde3ec;
  border-radius: 13px;
  color: #6575c9;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(35,48,65,.04);
}

.nearby-more:hover {
  background: #f8f9fc;
}

@media (max-width: 1024px) {
  .nearby-view {
    position: fixed;
    inset: 0;
    z-index: 160;
  }

  .nearby-mobile-menu {
    display: grid;
    place-items: center;
  }

  .nearby-header {
    min-height: 72px;
    padding: max(9px, env(safe-area-inset-top)) 12px 9px;
  }

  .nearby-heading h1 {
    font-size: 20px;
  }

  .nearby-heading p {
    margin-top: 4px;
    font-size: 10px;
  }

  .nearby-city-chip {
    min-width: 0;
    max-width: 185px;
  }

  .nearby-toolbar {
    min-height: 64px;
    padding: 9px 12px;
  }

  .nearby-scroll {
    padding: 14px 12px calc(26px + env(safe-area-inset-bottom));
  }

  .nearby-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 11px;
  }

  .nearby-person-visual {
    height: 170px;
  }

  .nearby-person-avatar {
    height: 158px !important;
  }
}

@media (max-width: 700px) {
  .nearby-header {
    align-items: center;
  }

  .nearby-heading p {
    display: none;
  }

  .nearby-city-chip {
    padding: 7px 9px;
  }

  .nearby-city-chip > span {
    width: 31px;
    height: 31px;
  }

  .nearby-city-chip small {
    display: none;
  }

  .nearby-city-chip b {
    max-width: 105px;
    font-size: 10px;
  }

  .nearby-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .nearby-segments {
    width: 100%;
  }

  .nearby-segments button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 7px;
    font-size: 10px;
  }

  .nearby-online-filter {
    min-height: 34px;
    padding: 0 4px;
  }

  .nearby-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
  }

  .nearby-person-card {
    border-radius: 17px;
  }

  .nearby-person-visual {
    height: 164px;
  }

  .nearby-person-avatar {
    height: 153px !important;
  }

  .nearby-presence {
    left: 8px;
    top: 8px;
    height: 22px;
    padding: 0 7px;
    font-size: 8px;
  }

  .nearby-person-body {
    padding: 10px 10px 9px;
  }

  .nearby-person-title b {
    font-size: 12px;
  }

  .nearby-person-city,
  .nearby-person-status {
    font-size: 9px;
  }

  .nearby-world-pill {
    min-height: 31px;
    margin-top: 8px;
    padding: 0 8px;
  }

  .nearby-person-footer {
    min-height: 32px;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 8px;
  }

}

@media (max-width: 390px) {
  .nearby-city-chip > span {
    display: none;
  }

  .nearby-city-chip {
    max-width: 115px;
  }

  .nearby-person-visual {
    height: 150px;
  }

  .nearby-person-avatar {
    height: 142px !important;
  }

  .nearby-person-status {
    display: none;
  }

  .nearby-gender {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

@media (max-width: 1024px) {
  body.sidebar-open .sidebar {
    z-index: 220;
  }

  body.sidebar-open::after {
    z-index: 210;
  }
}

/* v180 — controlled place directory + Nearby privacy */
.nearby-city-chip {
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.nearby-city-chip:hover {
  border-color: #cfd6e3;
  box-shadow: 0 8px 22px rgba(35,48,65,.07);
  transform: translateY(-1px);
}
.nearby-city-edit {
  width: 15px !important;
  height: 15px !important;
  margin-left: auto;
  color: #a2acba;
}
.nearby-empty-action {
  margin-top: 12px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 12px;
  background: #667eea;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(102,126,234,.2);
}

.nearby-settings-dialog {
  width: min(520px, calc(100vw - 28px));
  max-width: 520px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
}
.nearby-settings-dialog::backdrop { background: rgba(20,27,39,.42); backdrop-filter: blur(3px); }
.nearby-settings-card {
  overflow: visible;
  padding: 20px;
  border: 1px solid #e5e9f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24,34,49,.2);
}
.nearby-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.nearby-settings-head small { color: #667eea; font-size: 9px; font-weight: 900; letter-spacing: 1.1px; }
.nearby-settings-head h3 { margin: 4px 0 5px; color: #202a36; font-size: 21px; line-height: 1.1; }
.nearby-settings-head p { margin: 0; max-width: 390px; color: #8d97a5; font-size: 11px; line-height: 1.45; }
.nearby-settings-close { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #f3f5f8; color: #657180; }
.nearby-settings-close .ui-icon { width: 16px; height: 16px; }
.nearby-place-field { position: relative; margin-top: 18px; }
.nearby-place-field > label { display: block; margin-bottom: 7px; color: #596574; font-size: 11px; font-weight: 800; }
.nearby-place-input-wrap { height: 46px; padding: 0 10px 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #dfe4ec; border-radius: 14px; background: #f9fafc; }
.nearby-place-input-wrap:focus-within { border-color: #9aaaf4; box-shadow: 0 0 0 3px rgba(102,126,234,.1); background: #fff; }
.nearby-place-input-wrap > .ui-icon { width: 17px; height: 17px; color: #8b97a8; }
.nearby-place-input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #26313e; font: inherit; font-size: 13px; }
.nearby-place-input-wrap button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #8994a2; background: #eef1f5; }
.nearby-place-input-wrap button .ui-icon { width: 14px; height: 14px; }
.nearby-place-results { position: absolute; z-index: 20; left: 0; right: 0; top: 72px; max-height: 250px; overflow-y: auto; padding: 6px; border: 1px solid #e2e6ed; border-radius: 14px; background: #fff; box-shadow: 0 18px 45px rgba(34,46,64,.16); }
.nearby-place-option { width: 100%; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 10px; text-align: left; }
.nearby-place-option:hover { background: #f3f5ff; }
.nearby-place-option span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nearby-place-option b { color: #27323f; font-size: 12px; }
.nearby-place-option small { color: #929caa; font-size: 10px; }
.nearby-place-option > .ui-icon { width: 15px; height: 15px; color: #7f8ee6; }
.nearby-place-selected { margin-top: 8px; padding: 8px 10px; border-radius: 11px; background: #eefaf5; color: #31745d; font-size: 11px; font-weight: 750; }
.nearby-privacy-row { margin-top: 16px; padding: 13px 14px; display: flex; align-items: center; gap: 14px; border: 1px solid #e6eaf0; border-radius: 15px; background: #fbfcfd; cursor: pointer; }
.nearby-privacy-row > span { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nearby-privacy-row b { color: #303b49; font-size: 12px; }
.nearby-privacy-row small { color: #929ba7; font-size: 10px; line-height: 1.35; }
.nearby-privacy-row input { position: absolute; opacity: 0; pointer-events: none; }
.nearby-privacy-toggle { flex: 0 0 auto; width: 43px; height: 25px; padding: 3px; border-radius: 999px; background: #d8dde5; transition: .16s ease; }
.nearby-privacy-toggle em { display: block; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(30,40,54,.18); transition: .16s ease; }
.nearby-privacy-row input:checked + .nearby-privacy-toggle { background: #47c989; }
.nearby-privacy-row input:checked + .nearby-privacy-toggle em { transform: translateX(18px); }
.nearby-place-request { margin-top: 12px; }
.nearby-place-request > button { padding: 0; color: #677ee4; background: transparent; font-size: 11px; font-weight: 800; }
#nearbyPlaceRequestBox { margin-top: 9px; padding: 11px; border-radius: 12px; background: #f7f8fb; }
#nearbyPlaceRequestBox p { margin: 0 0 8px; color: #7e8896; font-size: 10px; line-height: 1.4; }
#nearbyPlaceRequestBox div { display: flex; gap: 7px; }
#nearbyPlaceRequestName { min-width: 0; flex: 1; height: 38px; padding: 0 10px; border: 1px solid #dfe4eb; border-radius: 10px; background: #fff; font: inherit; font-size: 11px; outline: 0; }
#nearbyPlaceRequestSend { min-height: 38px; padding: 0 12px; border-radius: 10px; background: #e9edff; color: #5f73d3; font-size: 10px; font-weight: 850; }
.nearby-settings-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }
.nearby-settings-actions button { min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 11px; font-weight: 850; }
.nearby-settings-cancel { color: #66717f; background: #f1f3f6; }
.nearby-settings-save { color: #fff; background: linear-gradient(135deg,#667eea,#7589e8); box-shadow: 0 7px 16px rgba(102,126,234,.2); }

@media (max-width: 600px) {
  .nearby-settings-dialog { width: calc(100vw - 18px); }
  .nearby-settings-card { padding: 16px; border-radius: 19px; }
  .nearby-place-results { max-height: 210px; }
}

/* v181 — hierarchical geography: Country -> Region -> City */
.nearby-geo-fields {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.3fr;
  gap: 10px;
}
.nearby-geo-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nearby-geo-field > span {
  color: #596574;
  font-size: 11px;
  font-weight: 800;
}
.nearby-geo-field select {
  width: 100%;
  height: 46px;
  padding: 0 36px 0 12px;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  background: #f9fafc;
  color: #26313e;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  outline: 0;
  appearance: auto;
}
.nearby-geo-field select:focus {
  border-color: #9aaaf4;
  box-shadow: 0 0 0 3px rgba(102,126,234,.1);
  background: #fff;
}
.nearby-geo-field select:disabled {
  color: #9aa4b0;
  background: #f2f4f7;
  cursor: not-allowed;
}
.nearby-geo-fields .nearby-place-selected {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 600px) {
  .nearby-geo-fields { grid-template-columns: 1fr; gap: 11px; }
  .nearby-geo-fields .nearby-place-selected { grid-column: auto; }
}
