/* mxm-nearby: Nearby Users — Phase A.
   Settings-section styling only. Grid + full-page styles arrive in Phase B. */

.mxm-nearby-section {
  display: block;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(108, 99, 255, 0.04);
}

.mxm-nearby-section[data-mxm-nearby-state="granted"] {
  background: rgba(0, 200, 83, 0.06);
  border-color: rgba(0, 200, 83, 0.2);
}

.mxm-nearby-section[data-mxm-nearby-state="admin_disabled"] {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

.mxm-nearby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mxm-nearby-title {
  font-size: 16px;
  font-weight: 600;
  color: inherit;
  margin: 0;
}

.mxm-nearby-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mxm-nearby-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f38ff;
  flex-shrink: 0;
  transform: rotate(0deg);
}

.mxm-nearby-title-animated {
  background: linear-gradient(90deg, #2f38ff 0%, #6b7cff 35%, #2f38ff 70%, #6b7cff 100%);
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: mxmNearbyTitleShimmer 4.2s linear infinite;
  font-weight: 700;
  letter-spacing: 0.005em;
}

@keyframes mxmNearbyTitleShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 240% center; }
}

@media (prefers-reduced-motion: reduce) {
  .mxm-nearby-title-animated { animation: none; }
}

.mxm-nearby-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Native checkbox styled as a track + thumb switch.
   Falls back gracefully if styling fails — the underlying input remains
   clickable and accessible. */
.mxm-nearby-toggle {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #cfd3dc;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 160ms ease;
  margin: 0;
  flex-shrink: 0;
}

.mxm-nearby-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease;
}

.mxm-nearby-toggle:checked {
  background: #6c63ff;
}

.mxm-nearby-toggle:checked::after {
  transform: translateX(20px);
}

.mxm-nearby-toggle:disabled {
  opacity: 0.5;
  cursor: progress;
}

.mxm-nearby-status-text {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: inherit;
  opacity: 0.8;
  line-height: 1.4;
}

.mxm-nearby-advisory {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  color: inherit;
  opacity: 0.7;
  line-height: 1.45;
}

/* -- Phase B: Home-screen card (Location 1) ------------------------------ */

.mxm_nearby_card {
  position: relative;
  overflow: hidden;
  padding: 16px 14px 14px;
  margin-bottom: 36px;
  transition: box-shadow 0.25s ease;
}
.mxm_nearby_card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }

.mxm_nearby_card_accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2f38ff 0%, #7c5cff 50%, #2f38ff 100%);
  pointer-events: none;
}

.mxm_nearby_card_head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.10);
}
.mxm_nearby_card_icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.16), rgba(124, 92, 255, 0.12));
  color: #2f38ff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(47, 56, 255, 0.18));
}
.mxm_nearby_card_head_title {
  font-size: 15.5px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.005em;
}
.mxm_nearby_card_head_meta { line-height: 1.15; }
.mxm_nearby_card_head_label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}
.mxm_nearby_card_head_title {
  font-size: 15px;
  font-weight: 600;
  margin-top: 2px;
}

.mxm_nearby_card_blocker_text {
  margin: 4px 0 12px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.8;
}

.mxm_nearby_card_btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f38ff 0%, #6b7cff 100%);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(47, 56, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.18s ease;
}
.mxm_nearby_card_btn:hover,
.mxm_nearby_card_btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(47, 56, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff !important;
}
.mxm_nearby_card_btn_outline {
  background: transparent;
  color: #2f38ff !important;
  border: 1px solid rgba(47, 56, 255, 0.45);
  box-shadow: none;
}
.mxm_nearby_card_btn_outline:hover,
.mxm_nearby_card_btn_outline:focus {
  background: rgba(47, 56, 255, 0.06);
  color: #2f38ff !important;
  box-shadow: 0 2px 8px rgba(47, 56, 255, 0.12);
}

/* Horizontal-sliding grid of 15 closest */
.mxm_nearby_card_grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}
.mxm_nearby_card_grid::-webkit-scrollbar { height: 6px; }
.mxm_nearby_card_grid::-webkit-scrollbar-track { background: transparent; }
.mxm_nearby_card_grid::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, 0.28); border-radius: 4px; }

/* Profile tile (used by both card and full page) */
.mxm_nearby_tile {
  flex: 0 0 116px;
  scroll-snap-align: start;
  text-align: center;
  text-decoration: none !important;
  color: inherit !important;
  position: relative;
}
.mxm_nearby_tile_avatar_wrap {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto 8px;
}
.mxm_nearby_tile_avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(127, 127, 127, 0.18);
  transition: transform 0.18s ease, border-color 0.18s ease;
  background: #e0e0e0;
}
.mxm_nearby_tile:hover .mxm_nearby_tile_avatar {
  transform: scale(1.04);
  border-color: rgba(47, 56, 255, 0.5);
}
.mxm_nearby_tile_online_dot {
  position: absolute;
  bottom: 5px; right: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #00c853;
  border: 2px solid #fff;
}
.mxm_nearby_tile_name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.mxm_nearby_tile_distance {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 1px;
}

/* Loading + empty states (shared) */
.mxm_nearby_loading,
.mxm_nearby_empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 13px;
  opacity: 0.7;
  width: 100%;
}

/* -- Phase B: Full Nearby page (Location 2) ----------------------------- */

.mxm_nearby_page {
  padding: 20px;
}
.mxm_nearby_page_head { margin-bottom: 22px; }
.mxm_nearby_page_title_wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}
.mxm_nearby_page_title_icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f38ff;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(47, 56, 255, 0.25));
}
.mxm_nearby_page_title {
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.1;
}
.mxm_nearby_page_subtitle {
  font-size: 13.5px;
  opacity: 0.7;
  margin: 0;
  line-height: 1.5;
  padding-left: 46px;
}
@media (max-width: 560px) {
  .mxm_nearby_page_title { font-size: 26px; }
  .mxm_nearby_page_subtitle { padding-left: 40px; }
}

.mxm_nearby_page_blocker {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed rgba(127, 127, 127, 0.25);
  border-radius: 12px;
}
.mxm_nearby_page_blocker_icon {
  width: 80px; height: 80px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.14), rgba(124, 92, 255, 0.10));
  color: #2f38ff;
  display: flex; align-items: center; justify-content: center;
}
.mxm_nearby_page_blocker_title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}
.mxm_nearby_page_blocker_text {
  font-size: 14px;
  opacity: 0.75;
  margin: 0 auto 16px;
  max-width: 460px;
  line-height: 1.5;
}
.mxm_nearby_page_blocker_btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f38ff 0%, #6b7cff 100%);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(47, 56, 255, 0.32);
  transition: transform 0.18s ease;
}
.mxm_nearby_page_blocker_btn:hover { transform: translateY(-1px); color: #fff !important; }

.mxm_nearby_page_controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid rgba(127, 127, 127, 0.14);
  border-radius: 10px;
}
.mxm_nearby_radius_label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}
.mxm_nearby_radius_value {
  font-size: 13px;
  font-weight: 700;
  color: #2f38ff;
}
.mxm_nearby_radius_slider {
  width: 100%;
  accent-color: #2f38ff;
}

.mxm_nearby_page_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 16px 0;
}

.mxm_nearby_page_tile {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit !important;
  background: rgba(127, 127, 127, 0.04);
  border: 1px solid rgba(127, 127, 127, 0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease;
}
.mxm_nearby_page_tile:hover,
.mxm_nearby_page_tile:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(47, 56, 255, 0.12);
  border-color: rgba(47, 56, 255, 0.35);
  color: inherit !important;
}

.mxm_nearby_page_tile_photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e8eaf6;
  overflow: hidden;
}
.mxm_nearby_page_tile_photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.mxm_nearby_page_tile:hover .mxm_nearby_page_tile_photo img {
  transform: scale(1.05);
}

.mxm_nearby_page_tile_online {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px 3px 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mxm_nearby_page_tile_online::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.55);
  animation: mxmNearbyOnlinePulse 2.2s cubic-bezier(0.66, 0, 0, 1) infinite;
}
@keyframes mxmNearbyOnlinePulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(0, 230, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.mxm_nearby_page_tile_body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 14px;
}
.mxm_nearby_page_tile_name {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mxm_nearby_page_tile_username {
  font-size: 12px;
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mxm_nearby_page_tile_reserve {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: #2f38ff;
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mxm_nearby_page_tile_lastseen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.75;
}
.mxm_nearby_page_tile_lastseen_dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(127, 127, 127, 0.55);
  flex-shrink: 0;
}
.mxm_nearby_page_tile_lastseen.is-online {
  color: #00723b;
  font-weight: 600;
  opacity: 1;
}
body.mxm-glassy-dark .mxm_nearby_page_tile_lastseen.is-online { color: #4caf50; }
.mxm_nearby_page_tile_lastseen.is-online .mxm_nearby_page_tile_lastseen_dot {
  background: #00e676;
  box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.55);
  animation: mxmNearbyPageLastseenPulse 2s cubic-bezier(0.66, 0, 0, 1) infinite;
}
@keyframes mxmNearbyPageLastseenPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.55); }
  60%      { box-shadow: 0 0 0 5px rgba(0, 230, 118, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mxm_nearby_page_tile_lastseen.is-online .mxm_nearby_page_tile_lastseen_dot { animation: none; }
}

/* Settings → Nearby section status indicator: reflects whether the viewer
   has Show "last seen" enabled. Green pulse = showing; orange pulse = hidden.
   JS flips the .is-showing / .is-hidden class as the user toggles the field.
   Only relevant when Nearby itself is ON (data-mxm-nearby-state="granted")
   — when the Nearby toggle is OFF the indicator collapses, since the user
   isn't appearing on Nearby in the first place. */
.mxm-nearby-section:not([data-mxm-nearby-state="granted"]) .mxm-nearby-lastseen-flag {
  display: none !important;
}

.mxm-nearby-lastseen-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}

/* Profile header stat cards — Location / Weight / Foot Size. Glass-pill
   treatment with brand accents, prominent enough to read at a glance from
   the page header without dominating the avatar/name composition. */
.mxm-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
  justify-content: center;
}
.mxm-profile-stat {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.08), rgba(124, 92, 255, 0.05));
  border: 1px solid rgba(47, 56, 255, 0.22);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: inherit;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(47, 56, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.22s ease;
}
.mxm-profile-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 56, 255, 0.45);
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.14), rgba(124, 92, 255, 0.08));
  box-shadow: 0 8px 18px rgba(47, 56, 255, 0.22);
}
body.mxm-glassy-dark .mxm-profile-stat {
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.18), rgba(124, 92, 255, 0.10));
  border-color: rgba(139, 149, 255, 0.30);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
body.mxm-glassy-dark .mxm-profile-stat:hover {
  border-color: rgba(139, 149, 255, 0.55);
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.30), rgba(124, 92, 255, 0.18));
}

.mxm-profile-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f38ff 0%, #6b7cff 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(47, 56, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.mxm-profile-stat-icon svg {
  width: 16px;
  height: 16px;
}

.mxm-profile-stat-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile header "Enrolled in Nearby" badge — sits just below @username on
   timeline/content.phtml. Pill with GPS marker glyph, animated #2f38ff
   gradient ring + brand text. Links straight to the Nearby page. */
.mxm-profile-nearby-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.10), rgba(124, 92, 255, 0.08));
  border: 1px solid rgba(47, 56, 255, 0.30);
  color: #2f38ff !important;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.22s ease;
  box-shadow: 0 1px 3px rgba(47, 56, 255, 0.12);
}
.mxm-profile-nearby-badge:hover,
.mxm-profile-nearby-badge:focus {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.18), rgba(124, 92, 255, 0.12));
  box-shadow: 0 4px 12px rgba(47, 56, 255, 0.28);
  color: #2f38ff !important;
  text-decoration: none !important;
}
.mxm-profile-nearby-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f38ff;
  filter: drop-shadow(0 1px 1px rgba(47, 56, 255, 0.30));
}
body.mxm-glassy-dark .mxm-profile-nearby-badge {
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.22), rgba(124, 92, 255, 0.14));
  border-color: rgba(139, 149, 255, 0.40);
  color: #b6c0ff !important;
}
body.mxm-glassy-dark .mxm-profile-nearby-badge:hover,
body.mxm-glassy-dark .mxm-profile-nearby-badge:focus {
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.34), rgba(124, 92, 255, 0.22));
  color: #d6deff !important;
}
body.mxm-glassy-dark .mxm-profile-nearby-badge-icon { color: #b6c0ff; }

/* Distance variant — replaces the "Enrolled in Nearby" badge when a live
   relative distance is available. Filled brand gradient so it reads as the
   higher-value signal it is. */
.mxm-profile-nearby-badge--distance {
  background: linear-gradient(135deg, #2f38ff, #7c5cff);
  border-color: transparent;
  color: #ffffff !important;
  text-transform: none;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(47, 56, 255, 0.30);
}
.mxm-profile-nearby-badge--distance:hover,
.mxm-profile-nearby-badge--distance:focus {
  background: linear-gradient(135deg, #2730e6, #6f4ff0);
  color: #ffffff !important;
  box-shadow: 0 5px 14px rgba(47, 56, 255, 0.40);
}
.mxm-profile-nearby-badge--distance .mxm-profile-nearby-badge-icon {
  color: #ffffff;
  filter: none;
}
body.mxm-glassy-dark .mxm-profile-nearby-badge--distance {
  background: linear-gradient(135deg, #3b45ff, #8a6bff);
  border-color: transparent;
  color: #ffffff !important;
}
body.mxm-glassy-dark .mxm-profile-nearby-badge--distance .mxm-profile-nearby-badge-icon { color: #ffffff; }

.mxm-nearby-lastseen-flag.is-showing { color: #00723b; }
.mxm-nearby-lastseen-flag.is-hidden  { color: #c75300; }
body.mxm-glassy-dark .mxm-nearby-lastseen-flag.is-showing { color: #4caf50; }
body.mxm-glassy-dark .mxm-nearby-lastseen-flag.is-hidden  { color: #ffa726; }

.mxm-nearby-lastseen-flag-pulse {
  display: inline-block;
  width: 16px;
  height: 7px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.mxm-nearby-lastseen-flag.is-showing .mxm-nearby-lastseen-flag-pulse {
  background: #00c853;
  box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.55);
  animation: mxmNearbyLastseenFlagPulseGreen 1.8s ease-in-out infinite;
}
.mxm-nearby-lastseen-flag.is-hidden .mxm-nearby-lastseen-flag-pulse {
  background: #ff9800;
  box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.55);
  animation: mxmNearbyLastseenFlagPulseOrange 1.8s ease-in-out infinite;
}
@keyframes mxmNearbyLastseenFlagPulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.55); opacity: 1; }
  50%      { box-shadow: 0 0 0 7px rgba(0, 200, 83, 0); opacity: 0.65; }
}
@keyframes mxmNearbyLastseenFlagPulseOrange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.55); opacity: 1; }
  50%      { box-shadow: 0 0 0 7px rgba(255, 152, 0, 0); opacity: 0.65; }
}
@media (prefers-reduced-motion: reduce) {
  .mxm-nearby-lastseen-flag-pulse { animation: none !important; }
}
.mxm_nearby_page_tile_meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #2f38ff;
}
.mxm_nearby_page_tile_pin {
  display: inline-flex;
  align-items: center;
  color: #2f38ff;
}
.mxm_nearby_page_tile_distance {
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .mxm_nearby_page_tile,
  .mxm_nearby_page_tile_photo img,
  .mxm_nearby_page_tile_online::before { transition: none; animation: none; }
}

.mxm_nearby_page_footer_note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(127, 127, 127, 0.12);
  font-size: 11.5px;
  opacity: 0.55;
  text-align: center;
  line-height: 1.5;
}

/* -- Phase B: Admin Adoption Tracker ----------------------------------- */

.mxm_nearby_admin_card .mxm_nearby_admin_sub {
  font-size: 12px;
  opacity: 0.7;
  margin: 4px 0 14px;
}
.mxm_nearby_admin_grid { margin-top: 8px; }
.mxm_nearby_admin_stat {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(47, 56, 255, 0.05);
  border: 1px solid rgba(47, 56, 255, 0.12);
}
.mxm_nearby_admin_stat[data-mxm-metric="capture"] {
  background: rgba(0, 200, 83, 0.06);
  border-color: rgba(0, 200, 83, 0.2);
}
.mxm_nearby_admin_stat[data-mxm-metric="decline"] {
  background: rgba(255, 152, 0, 0.06);
  border-color: rgba(255, 152, 0, 0.2);
}
.mxm_nearby_admin_value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.mxm_nearby_admin_label {
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 4px;
  opacity: 0.85;
}
.mxm_nearby_admin_stat .mxm_nearby_admin_sub {
  font-size: 11px;
  opacity: 0.6;
  margin: 4px 0 0;
}
.mxm_nearby_admin_footnote {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(127, 127, 127, 0.12);
  font-size: 11.5px;
  opacity: 0.55;
  line-height: 1.5;
}
.mxm_nearby_admin_footnote code {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(127, 127, 127, 0.12);
}

/* Adoption-rate artifact — a small, motivating "X% adopted" pill shown in the
   home card header and the full Nearby page header. Brand-consistent with the
   #2f38ff -> #7c5cff family used across Nearby. Intentionally minor: it reads
   as a quiet progress marker, not a CTA. */
.mxm_nearby_adoption {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(47, 56, 255, 0.22);
  background: linear-gradient(135deg, rgba(47, 56, 255, 0.10), rgba(124, 92, 255, 0.08));
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}
.mxm_nearby_adoption_dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f38ff;
  box-shadow: 0 0 0 0 rgba(47, 56, 255, 0.45);
  animation: mxmNearbyAdoptPulse 2.6s ease-out infinite;
}
.mxm_nearby_adoption_pct {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #2f38ff, #7c5cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2f38ff;
}
.mxm_nearby_adoption_label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.6;
}

/* Full-page header variant — a touch larger to sit beside the 32px title. */
.mxm_nearby_adoption--page {
  padding: 4px 11px 4px 9px;
  gap: 6px;
}
.mxm_nearby_adoption--page .mxm_nearby_adoption_pct { font-size: 13.5px; }
.mxm_nearby_adoption--page .mxm_nearby_adoption_label { font-size: 12px; }
.mxm_nearby_adoption--page .mxm_nearby_adoption_dot { width: 7px; height: 7px; }

/* Settings Nearby-section variant — sits next to the title (inside an
   inline-flex title-wrap), so neutralize the auto-margin used elsewhere. */
.mxm_nearby_adoption--settings { margin-left: 0; }

@keyframes mxmNearbyAdoptPulse {
  0%   { box-shadow: 0 0 0 0 rgba(47, 56, 255, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(47, 56, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 56, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mxm_nearby_adoption_dot { animation: none; }
}

/* -- Distance visibility toggles (Settings → Privacy, under Nearby) -------- */
.mxm-nearby-dist-prefs {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(127, 127, 127, 0.14);
}
.mxm-nearby-dist-prefs-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 8px;
}
.mxm-nearby-dist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}
.mxm-nearby-dist-text { display: flex; flex-direction: column; gap: 2px; }
.mxm-nearby-dist-label { font-size: 13.5px; font-weight: 600; }
.mxm-nearby-dist-help { font-size: 11.5px; opacity: 0.62; line-height: 1.4; }

/* Switch — same look as the main Nearby toggle, slightly smaller. */
.mxm-nearby-dist-toggle {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 12px;
  background: #cfd3dc;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 160ms ease;
  margin: 0;
  flex-shrink: 0;
}
.mxm-nearby-dist-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease;
}
.mxm-nearby-dist-toggle:checked { background: #6c63ff; }
.mxm-nearby-dist-toggle:checked::after { transform: translateX(18px); }
.mxm-nearby-dist-toggle:disabled { opacity: 0.5; cursor: progress; }

/* -- Distance artifact on profile header ---------------------------------- */
.mxm-profile-distance {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mxm-profile-distance svg { color: #2f38ff; flex-shrink: 0; }

/* -- Distance artifact in post sub-header (rides the .time row) ------------ */
.mxm-post-distance { display: inline-flex; align-items: center; gap: 3px; }
.mxm-post-distance svg { color: #2f38ff; vertical-align: middle; opacity: 0.9; }
