/* ─── Cruush App Styles ─── */
/* Design tokens from landing page */
:root {
  --bg-deep: #06060e;
  --bg-card: #0f0f1a;
  --bg-elevated: #16162a;
  --text-primary: #f0eff4;
  --text-secondary: #9896a8;
  --accent-pink: #ff6b9d;
  --accent-purple: #c471ed;
  --accent-blue: #6a9cfc;
  --gradient-hot: linear-gradient(135deg, #ff6b9d 0%, #c471ed 50%, #6a9cfc 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ─── Map fills viewport ─── */
#map {
  width: 100%;
  height: 100vh;
  z-index: 0;
}

/* Dark Leaflet tiles override */
.leaflet-tile-pane { filter: brightness(0.7) contrast(1.15) saturate(0.7); }
.leaflet-container { background: var(--bg-deep) !important; }

/* Hide Leaflet attribution on mobile */
.leaflet-control-attribution {
  background: rgba(6,6,14,0.7) !important;
  color: var(--text-secondary) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--accent-blue) !important; }

/* ─── Top bar ─── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(6,6,14,0.95), rgba(6,6,14,0));
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }

.top-bar .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-hot);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.top-bar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ─── Buttons ─── */
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--gradient-hot);
  color: white;
  box-shadow: 0 4px 20px rgba(255,107,157,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255,107,157,0.35); }
.btn-primary:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.2); }
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.1rem;
}

/* ─── Nearby count badge ─── */
.nearby-badge {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.nearby-badge .count {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--gradient-hot);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nearby-badge .pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-pink);
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ─── Profile card popup ─── */
.profile-popup {
  min-width: 200px;
}
.profile-popup .popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.profile-popup .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.profile-popup .name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}
.profile-popup .identity-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.profile-popup .popup-quick-tags {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.profile-popup .bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.profile-popup .active-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
  opacity: 0.7;
}
.profile-popup .popup-view-btn {
  border-radius: 10px;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5) !important;
  color: var(--text-primary) !important;
}
.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}
.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 8px !important;
}

/* ─── Pulsing map markers ─── */
.map-marker {
  position: relative;
  cursor: pointer;
}
.map-marker .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(255,107,157,0.5);
  animation: marker-pulse 3s ease-in-out infinite;
}
.map-marker .ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid;
  animation: marker-ring 3s ease-out infinite;
  opacity: 0;
}

.dot-pink { background: var(--accent-pink); }
.ring-pink { border-color: var(--accent-pink); }
.dot-purple { background: var(--accent-purple); }
.ring-purple { border-color: var(--accent-purple); }
.dot-blue { background: var(--accent-blue); }
.ring-blue { border-color: var(--accent-blue); }

@keyframes marker-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}
@keyframes marker-ring {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* ─── My location marker ─── */
.my-marker .dot {
  background: white !important;
  box-shadow: 0 0 16px rgba(255,255,255,0.6);
  width: 14px;
  height: 14px;
}
.my-marker .ring {
  border-color: white !important;
  width: 36px;
  height: 36px;
}
.my-marker .ring-outer {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.06);
}

/* ─── Modal / Overlay ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.modal .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ─── Form elements ─── */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-purple);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(152,150,168,0.5);
}
.form-group textarea {
  resize: vertical;
  min-height: 72px;
}

/* ─── Identity selector ─── */
.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.identity-option {
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.identity-option:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
}
.identity-option.selected {
  background: rgba(196,113,237,0.15);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

/* ─── Status indicator ─── */
.status-bar {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.82rem;
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  opacity: 0;
  pointer-events: none;
}
.status-bar.visible {
  opacity: 1;
  pointer-events: auto;
}
.status-bar .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Sidebar profile panel ─── */
.sidebar {
  position: fixed;
  top: 0;
  right: -380px;
  width: 340px;
  height: 100vh;
  z-index: 1500;
  background: var(--bg-card);
  border-left: 1px solid rgba(255,255,255,0.06);
  padding: 24px;
  overflow-y: auto;
  transition: right 0.3s ease;
}
.sidebar.open { right: 0; }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(0,0,0,0.4);
  display: none;
}
.sidebar-backdrop.visible { display: block; }

.sidebar h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.sidebar .profile-info {
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.sidebar .profile-info .avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}
.sidebar .profile-info .name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.sidebar .profile-info .identity-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.sidebar .profile-info .bio {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Quick tags in sidebar */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.quick-tag {
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
}

.sidebar .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar .menu-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ─── Location permission prompt ─── */
.location-prompt {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.location-prompt .content {
  max-width: 400px;
}
.location-prompt .icon {
  font-size: 3rem;
  margin-bottom: 24px;
}
.location-prompt h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.location-prompt p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ─── Visibility toggle ─── */
.visibility-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
  cursor: pointer;
}
.visibility-toggle .toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 100px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.visibility-toggle .toggle-track.active {
  background: var(--accent-pink);
}
.visibility-toggle .toggle-track .toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
}
.visibility-toggle .toggle-track.active .toggle-thumb {
  left: 20px;
}
.visibility-toggle .toggle-label {
  font-size: 0.88rem;
  color: var(--text-primary);
}
.visibility-toggle .toggle-sublabel {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ─── Danger button ─── */
.btn-danger {
  background: rgba(255,60,80,0.12);
  color: #ff5c6c;
  border: 1px solid rgba(255,60,80,0.3);
}
.btn-danger:hover { background: rgba(255,60,80,0.2); border-color: rgba(255,60,80,0.5); }

/* ─── Compact modal variant ─── */
.modal.modal-compact {
  max-width: 360px;
  padding: 32px 28px;
}

/* ─── Popup action buttons ─── */
.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.popup-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.popup-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.popup-btn-block:hover { background: rgba(255,60,80,0.12); color: #ff5c6c; border-color: rgba(255,60,80,0.3); }
.popup-btn-report:hover { background: rgba(255,165,0,0.1); color: #ffb347; border-color: rgba(255,165,0,0.3); }

/* ─── Sidebar tabs ─── */
.sidebar-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 4px;
}
.sidebar-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.sidebar-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ─── Safety tab ─── */
.safety-section {
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}
.safety-header {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.safety-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Blocked users list ─── */
.blocked-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.blocked-item:last-child { border-bottom: none; }
.blocked-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.blocked-info { flex: 1; min-width: 0; }
.blocked-name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blocked-identity {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.btn-unblock {
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-unblock:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ─── Report reason list ─── */
.reason-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reason-option {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.reason-option:hover { border-color: rgba(255,255,255,0.15); color: var(--text-primary); }
.reason-option.selected {
  background: rgba(196,113,237,0.12);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

/* ─── Toast notification ─── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 3000;
  background: rgba(22,22,42,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  backdrop-filter: blur(12px);
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Auth modal ─── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.auth-error {
  background: rgba(255, 107, 157, 0.12);
  border: 1px solid rgba(255, 107, 157, 0.3);
  color: #ff6b9d;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 14px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}
.quick-tag {
  background: rgba(255,255,255,0.07);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
}

/* ─── Profile Settings Overlay ─── */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-deep);
  animation: fadeIn 0.25s ease;
  overflow-y: auto;
}
.settings-page {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  background: var(--bg-deep);
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.settings-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.settings-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.settings-section {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 24px 20px;
}
.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.section-label .hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.6;
  font-size: 0.75rem;
}
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.setting-row:last-child {
  margin-bottom: 0;
}
.setting-row > label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.setting-row > label .hint {
  font-weight: 400;
  opacity: 0.5;
  font-size: 0.75rem;
}
.setting-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.setting-input:focus {
  border-color: var(--accent-purple);
}
.setting-input::placeholder {
  color: rgba(152,150,168,0.4);
}

/* Chip grid & chips */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}
.chip.selected {
  background: rgba(196,113,237,0.15);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}
.chip.multi.selected {
  background: rgba(255,107,157,0.12);
  border-color: var(--accent-pink);
}

/* ─── Full Profile View ─── */
.profile-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
.profile-view {
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.profile-view-header {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 5;
}
.profile-view-body {
  padding: 0 28px 32px;
}
.pv-hero {
  text-align: center;
  margin-bottom: 20px;
}
.avatar-xl {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 12px;
}
.pv-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.pv-active {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
}
.pv-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 16px;
}
.pv-details {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pv-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pv-detail-row:last-child { border-bottom: none; }
.pv-detail-icon { font-size: 1rem; flex-shrink: 0; }
.pv-detail-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 80px;
}
.pv-detail-value {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
}
.pv-tag-section {
  margin-bottom: 14px;
}
.pv-tag-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.pv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pv-tag {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
}
.pv-tag.looking {
  background: rgba(255,107,157,0.12);
  color: var(--accent-pink);
  border: 1px solid rgba(255,107,157,0.2);
}
.pv-tag.tribe {
  background: rgba(196,113,237,0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(196,113,237,0.2);
}
.pv-tag.kink {
  background: rgba(106,156,252,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(106,156,252,0.2);
}

/* ─── Chat & Messaging ─── */
.chat-loading {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.inbox-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.inbox-empty-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.inbox-list {
  display: flex;
  flex-direction: column;
}
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.inbox-item:hover { background: var(--bg-elevated); }
.inbox-item.has-unread { background: rgba(255,107,157,0.04); }
.inbox-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
}
.inbox-avatar img { width: 100%; height: 100%; object-fit: cover; }
.inbox-info { flex: 1; min-width: 0; }
.inbox-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.inbox-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.inbox-time {
  font-size: 0.7rem;
  color: rgba(152,150,168,0.5);
}
.inbox-badge {
  background: var(--accent-pink);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}

/* Chat view */
.chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chat-back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.15s;
}
.chat-back-btn:hover { color: var(--text-primary); }
.chat-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-day-divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 12px 0 4px;
  opacity: 0.6;
}
.chat-bubble-wrap {
  display: flex;
}
.chat-bubble-wrap.mine { justify-content: flex-end; }
.chat-bubble-wrap.theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble.mine {
  background: var(--accent-purple);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-bubble.theirs {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 4px;
}
.chat-bubble img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
}
.chat-receipt {
  font-size: 0.65rem;
  color: rgba(152,150,168,0.5);
  text-align: right;
  margin-top: 3px;
}
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent-purple); }
.chat-input::placeholder { color: rgba(152,150,168,0.4); }
.chat-photo-btn, .chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-photo-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.chat-photo-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.chat-send-btn {
  background: var(--gradient-hot);
  color: white;
  font-weight: 700;
}
.chat-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Photo picker overlay */
.photo-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.photo-picker-sheet {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  max-height: 60vh;
  overflow-y: auto;
}
.photo-picker-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 16px;
  text-align: center;
}
.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-picker-item {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.photo-picker-item:hover { border-color: var(--accent-purple); }
.photo-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tab dot (unread indicator) */
.tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-pink);
  margin-left: 4px;
  vertical-align: middle;
  animation: badge-pulse 2s ease-in-out infinite;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .top-bar { padding: 12px 16px; }
  .top-bar .logo { font-size: 1.2rem; }
  .sidebar { width: 100%; right: -100%; }
  .nearby-badge { bottom: 20px; padding: 10px 20px; font-size: 0.82rem; }
  .modal { padding: 28px 24px; border-radius: 20px; }
  .identity-grid { grid-template-columns: repeat(3, 1fr); }

  /* Settings page mobile tweaks */
  .settings-body { padding: 16px; }
  .settings-section { padding: 20px 16px; border-radius: 16px; }
  .chip { padding: 7px 12px; font-size: 0.76rem; }

  /* Profile view mobile */
  .profile-view { max-height: 90vh; border-radius: 20px 20px 0 0; }
  .profile-view-body { padding: 0 20px 28px; }
  .pv-name { font-size: 1.2rem; }
  .avatar-xl { width: 64px; height: 64px; font-size: 1.7rem; border-radius: 18px; }
}

/* ─── Search Panel ─── */
.search-panel {
  position: fixed;
  top: 72px; /* below top bar */
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  z-index: 990;
  animation: searchPanelIn 0.2s ease;
}

@keyframes searchPanelIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.search-panel-inner {
  background: rgba(15, 15, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(196, 113, 237, 0.1);
  overflow: hidden;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-icon-label {
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-close-btn {
  flex-shrink: 0;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  font-size: 0.85rem;
  opacity: 0.6;
}
.search-close-btn:hover { opacity: 1; }

/* Identity filter chips */
.search-identity-filters {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.search-identity-filters::-webkit-scrollbar { display: none; }

.search-filter-chip {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.search-filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.search-filter-chip.active {
  background: linear-gradient(135deg, rgba(255,107,157,0.2), rgba(196,113,237,0.2));
  border-color: rgba(196, 113, 237, 0.4);
  color: var(--accent-purple);
}

/* Results list */
.search-results {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.search-hint {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.search-result-card:last-child { border-bottom: none; }
.search-result-card:hover { background: rgba(255, 255, 255, 0.04); }

.search-result-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
}
.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.search-result-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 500;
}

.search-result-tags {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.search-result-bio {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-active {
  font-size: 0.72rem;
  color: rgba(152, 150, 168, 0.5);
  margin-top: 2px;
}

.search-result-actions {
  flex-shrink: 0;
}

.search-map-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.search-map-btn:hover {
  background: rgba(255, 107, 157, 0.15);
  border-color: rgba(255, 107, 157, 0.3);
}

/* Mobile adjustments for search */
@media (max-width: 480px) {
  .search-panel {
    top: 64px;
    width: calc(100vw - 16px);
  }
  .search-results { max-height: 240px; }
}

/* ─── Advanced Filters Toggle ─── */
.search-adv-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
  transition: color 0.15s;
}
.search-adv-toggle:hover { color: var(--text-primary); }
.search-adv-toggle span:first-child { flex: 1; font-weight: 500; }

.search-adv-count {
  background: linear-gradient(135deg, rgba(255,107,157,0.3), rgba(196,113,237,0.3));
  border: 1px solid rgba(196,113,237,0.35);
  color: var(--accent-purple);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 600;
}

.search-adv-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s;
  opacity: 0.6;
}
.search-adv-arrow.open { transform: rotate(180deg); opacity: 1; }

/* ─── Advanced Filters Panel ─── */
.search-adv-filters {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  max-height: 250px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.search-adv-section {
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.search-adv-section:last-of-type { border-bottom: none; }

.search-adv-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(152, 150, 168, 0.6);
  margin-bottom: 7px;
}

.search-adv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* override chip sizing for advanced section */
.search-adv-chip {
  padding: 4px 10px;
  font-size: 0.74rem;
}

/* multi-select active states by filter key */
.search-adv-chips[data-filter="kinks"] .search-filter-chip.active {
  background: rgba(106, 156, 252, 0.2);
  border-color: rgba(106, 156, 252, 0.45);
  color: #6a9cfc;
}
.search-adv-chips[data-filter="tribes"] .search-filter-chip.active {
  background: rgba(196, 113, 237, 0.2);
  border-color: rgba(196, 113, 237, 0.45);
  color: var(--accent-purple);
}
.search-adv-chips[data-filter="looking_for"] .search-filter-chip.active {
  background: rgba(255, 107, 157, 0.2);
  border-color: rgba(255, 107, 157, 0.45);
  color: var(--accent-pink);
}

/* ─── Clear Filters Row ─── */
.search-adv-clear {
  padding: 10px 14px 12px;
  text-align: center;
}
.search-clear-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.search-clear-btn:hover {
  border-color: rgba(255,107,157,0.35);
  color: var(--accent-pink);
  background: rgba(255,107,157,0.06);
}

/* ─── Feed: Broadcast Posts ─── */
.feed-compose-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 14px;
  font-size: 0.88rem;
}

.feed-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feed-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
}
.feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-meta {
  flex: 1;
  min-width: 0;
}

.feed-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-submeta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.feed-identity-badge {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 500;
}

.feed-dist {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.feed-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.feed-time {
  font-size: 0.72rem;
  color: rgba(152, 150, 168, 0.5);
}

.feed-delete-btn {
  background: none;
  border: none;
  color: rgba(152, 150, 168, 0.4);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.feed-delete-btn:hover {
  color: var(--accent-pink);
}

.feed-content {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-location {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.feed-expires {
  font-size: 0.72rem;
  color: rgba(152, 150, 168, 0.45);
}

.feed-reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.feed-react-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  color: var(--text-primary);
}
.feed-react-btn:hover {
  background: rgba(196, 113, 237, 0.12);
  border-color: rgba(196, 113, 237, 0.3);
}
.feed-react-btn.reacted {
  background: rgba(196, 113, 237, 0.15);
  border-color: rgba(196, 113, 237, 0.4);
}
.feed-react-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.react-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Slightly tighter sidebar tabs to handle 3 items */
.sidebar-tab {
  padding: 8px 10px;
  font-size: 0.82rem;
}

/* ─── Messages button in top bar ─── */
.msg-fab-btn {
  position: relative;
  font-size: 1.15rem !important;
}
.msg-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  background: var(--accent-pink);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg-deep);
  animation: badge-pop 0.3s ease;
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ─── Dedicated Chat Panel ─── */
.chat-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: rgba(0,0,0,0.45);
  display: none;
}
.chat-panel-backdrop.visible { display: block; }

.chat-panel {
  position: fixed;
  top: 0;
  right: -440px;
  width: 400px;
  height: 100vh;
  height: 100dvh;
  z-index: 1700;
  background: var(--bg-card);
  border-left: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}
.chat-panel.open { right: 0; }

.chat-panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-panel-topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.chat-panel-close-btn {
  width: 36px !important;
  height: 36px !important;
  font-size: 1rem !important;
  opacity: 0.7;
}
.chat-panel-close-btn:hover { opacity: 1; }

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

/* ─── Inbox list ─── */
.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex: 1;
}
.inbox-empty-icon {
  font-size: 2.8rem;
  margin-bottom: 4px;
  opacity: 0.8;
}
.inbox-list {
  display: flex;
  flex-direction: column;
}
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.inbox-item:hover { background: rgba(255,255,255,0.04); }
.inbox-item.has-unread { background: rgba(255,107,157,0.04); }
.inbox-item.has-unread:hover { background: rgba(255,107,157,0.08); }
.inbox-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}
.inbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inbox-info {
  flex: 1;
  min-width: 0;
}
.inbox-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-item.has-unread .inbox-name {
  color: white;
}
.inbox-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.inbox-item.has-unread .inbox-preview {
  color: rgba(240,239,244,0.75);
}
.inbox-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.inbox-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.inbox-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 100px;
  background: var(--gradient-hot);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ─── Chat view ─── */
.chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 0; /* force flex sizing */
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-back-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-back-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}
.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-header-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overscroll-behavior: contain;
}
.chat-day-divider {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 10px 0 4px;
  letter-spacing: 0.3px;
}
.chat-loading {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 32px 20px;
}
.chat-bubble-wrap {
  display: flex;
  margin: 1px 0;
}
.chat-bubble-wrap.mine {
  justify-content: flex-end;
}
.chat-bubble-wrap.theirs {
  justify-content: flex-start;
}
.chat-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-bubble.mine {
  background: var(--gradient-hot);
  color: white;
  border-bottom-right-radius: 5px;
}
.chat-bubble.theirs {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 5px;
}
.chat-bubble img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  display: block;
  cursor: zoom-in;
  object-fit: cover;
}
.chat-receipt {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 3px;
  margin-right: 2px;
  opacity: 0.75;
}
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-card);
  flex-shrink: 0;
}
.chat-photo-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.chat-photo-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.chat-input {
  flex: 1;
  min-height: 38px;
  max-height: 100px;
  padding: 9px 13px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  resize: none;
  outline: none;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: rgba(196,113,237,0.4); }
.chat-input::placeholder { color: rgba(152,150,168,0.5); }
.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--gradient-hot);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(255,107,157,0.3);
}
.chat-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}
.chat-send-btn:not(:disabled):hover {
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(255,107,157,0.45);
}

/* ─── Photo picker ─── */
.photo-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.photo-picker-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  animation: slideUp 0.25s ease;
}
.photo-picker-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
  color: var(--text-primary);
}
.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-picker-thumb {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s;
}
.photo-picker-thumb:hover { opacity: 0.85; }
.photo-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-picker-album-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 0.8rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

/* ─── Bottom navigation bar (mobile only) ─── */
.bottom-nav {
  display: none; /* hidden until .visible class added by JS */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(9,9,18,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.07);
  align-items: stretch;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.bottom-nav.visible {
  display: flex !important;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  padding: 10px 4px 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bottom-nav-item:hover { color: var(--text-primary); }
.bottom-nav-item.active { color: white; }
.bottom-nav-item.active .bottom-nav-icon {
  filter: drop-shadow(0 0 8px rgba(255,107,157,0.6));
}
.bottom-nav-icon {
  font-size: 1.4rem;
  line-height: 1;
  position: relative;
  display: inline-block;
}
.bottom-nav-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1;
}
.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  border-radius: 100px;
  background: var(--accent-pink);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(9,9,18,0.97);
}

/* ─── Mobile adjustments ─── */
@media (max-width: 768px) {
  /* Bottom nav visible on mobile */
  .bottom-nav { display: none; } /* hidden until .visible added */

  /* Nearby badge above bottom nav */
  .nearby-badge {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* Toast above bottom nav */
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Chat panel full-screen on mobile */
  .chat-panel {
    width: 100%;
    right: -100%;
    border-left: none;
  }

  /* Sidebar full-width on mobile (already exists but keep) */
  .sidebar {
    width: 100%;
    right: -100%;
  }

  /* Map fills above bottom nav */
  #map {
    height: calc(100vh - 0px); /* map fills full height */
  }
}

@media (max-width: 480px) {
  /* Tighter top bar on small screens */
  .top-bar { padding: 10px 14px; }

  /* Profile button in top bar slightly smaller */
  .msg-fab-btn { width: 38px !important; height: 38px !important; }
}

/* ─── Tab dot (minimal indicator, fallback) ─── */
.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-pink);
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  animation: badge-pop 0.3s ease;
}

/* ─── Photo Gallery Grid (Profile Settings) ─── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.photo-thumb.primary {
  border-color: var(--accent-pink);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-badges {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.badge-primary {
  background: var(--accent-pink);
  color: #fff;
  font-size: 0.65rem;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-album {
  font-size: 0.65rem;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  padding: 1px 4px;
}

.photo-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  opacity: 0;
  transition: opacity 0.2s;
}
.photo-thumb:hover .photo-actions,
.photo-thumb:active .photo-actions {
  opacity: 1;
}

/* Always show actions on touch devices */
@media (hover: none) {
  .photo-actions { opacity: 1; }
}

.photo-action-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.15s;
}
.photo-action-btn:hover {
  background: rgba(255,255,255,0.3);
}
.photo-action-btn.delete:hover {
  background: rgba(255,50,50,0.4);
}

.photo-upload-btn {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px dashed rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  gap: 2px;
}
.photo-upload-btn:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(196,113,237,0.05);
}
.photo-upload-btn small {
  font-size: 0.7rem;
}

/* Photo picker overlay (chat photo sharing) */
.photo-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.photo-picker-sheet {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  overflow-y: auto;
}
.photo-picker-title {
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}
.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-picker-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.photo-picker-thumb:hover {
  border-color: var(--accent-pink);
}
.photo-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-picker-album-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.65rem;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  padding: 1px 4px;
}

/* Profile popup photo grid */
.popup-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.popup-photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}
.popup-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.private-photos-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
}
.private-photos-note button {
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  margin-left: 6px;
}
