/* ── NEXUS ── Minimalist Two-Tone ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Cormorant:ital,wght@0,300;0,400;1,300&display=swap');

:root {
  --ink: #0d0d0d;
  --paper: #f4f1ec;
  --ink-faint: rgba(13,13,13,0.12);
  --ink-mid: rgba(13,13,13,0.4);
  --ink-soft: rgba(13,13,13,0.06);
  --accent: #0d0d0d;
  --line: 0.5px solid rgba(13,13,13,0.2);
  --line-strong: 1px solid #0d0d0d;
  --radius: 0px;
  --mono: 'DM Mono', monospace;
  --serif: 'Cormorant', serif;
  --transition: 0.18s ease;
}

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

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 17px;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
}

/* ── SCREENS ── */
.screen { display: none; width: 100%; height: 100vh; }
.screen.active { display: flex; }

/* ── AUTH ── */
#auth-screen {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 48px;
  background: var(--paper);
  background-image: 
    linear-gradient(var(--ink-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-faint) 1px, transparent 1px);
  background-size: 48px 48px;
}

.auth-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-mid);
  font-weight: 300;
}

.auth-panel {
  width: 380px;
  border: var(--line-strong);
  background: var(--paper);
  padding: 32px;
}

.auth-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  border-bottom: var(--line);
  padding-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
  padding: 0;
  transition: color var(--transition);
}
.tab-btn.active { color: var(--ink); }
.tab-divider { color: var(--ink-faint); font-size: 12px; }

.tab-content { display: none; flex-direction: column; gap: 16px; }
.tab-content.active { display: flex; }

.notice {
  background: var(--ink-soft);
  border-left: 2px solid var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.6;
  display: flex;
  gap: 8px;
}
.notice-icon { flex-shrink: 0; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

input[type="text"], input[type="password"], textarea, select {
  background: transparent;
  border: var(--line);
  border-bottom: var(--line-strong);
  outline: none;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink);
  padding: 8px 10px;
  width: 100%;
  transition: border-color var(--transition);
  appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--ink);
  border-bottom-width: 1.5px;
}
input::placeholder, textarea::placeholder { color: var(--ink-mid); }

textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.6;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 11px 20px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--transition);
  width: 100%;
}
.btn-primary:hover { opacity: 0.8; }

.form-error { font-size: 13px; color: #a00; min-height: 14px; }
.form-status { font-size: 13px; color: var(--ink-mid); min-height: 14px; margin-top: 4px; }

/* ── APP NAV ── */
#app-screen { flex-direction: column; overflow: hidden; }

#main-nav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  height: 44px;
  border-bottom: var(--line-strong);
  background: var(--paper);
  flex-shrink: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-right: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.nav-btn {
  background: none;
  border: none;
  border-right: var(--line);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
  padding: 0 18px;
  height: 44px;
  transition: color var(--transition), background var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-btn:first-child { border-left: var(--line); }
.nav-btn.active { color: var(--ink); background: var(--ink-soft); }
.nav-btn:hover { color: var(--ink); }

.nav-btn { display: flex; align-items: center; gap: 7px; }
.notif-badge {
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 500;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.hidden { display: none !important; }

.nav-signout {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-mid);
  cursor: pointer;
  margin-left: auto;
}
.nav-signout:hover { color: var(--ink); }

/* ── VIEWS ── */
#main-content { flex: 1; overflow: hidden; position: relative; }
.view { display: none; width: 100%; height: 100%; overflow-y: auto; }
.view.active { display: flex; flex-direction: column; }

.view-header {
  padding: 32px 40px 20px;
  border-bottom: var(--line);
  flex-shrink: 0;
}
.view-header h2 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
}
.view-sub { font-size: 13px; color: var(--ink-mid); margin-top: 4px; }

/* ── MAP ── */
#view-map { flex-direction: row; overflow: hidden; }
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

#world-map {
  width: 100%;
  height: 100%;
  cursor: grab;
}
#world-map:active { cursor: grabbing; }

/* SVG map styling */
#world-map .country {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1px;
  transition: fill var(--transition);
}
#world-map .country:hover { fill: var(--ink-soft); }

#world-map .state {
  fill: var(--paper);
  stroke: var(--ink);
}

.city-dot {
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 1px;
  cursor: pointer;
  transition: r 0.15s ease;
}
.city-dot:hover { r: 6px; }

.city-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink);
  pointer-events: none;
  text-anchor: middle;
}

#map-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 10;
}
.map-hint {
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: 0.05em;
}

#zoom-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 10;
}
#zoom-controls button {
  width: 28px;
  height: 28px;
  background: var(--paper);
  border: var(--line-strong);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
#zoom-controls button:hover { background: var(--ink); color: var(--paper); }

/* ── SIDE PANEL ── */
.side-panel {
  width: 300px;
  height: 100%;
  border-left: var(--line-strong);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: var(--line-strong);
}
#city-panel-title { font-size: 15px; font-weight: 500; letter-spacing: 0.05em; }
.panel-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-mid);
}
.panel-subtext { font-size: 12px; color: var(--ink-mid); padding: 8px 20px; border-bottom: var(--line); }

#city-users-list { flex: 1; overflow-y: auto; }

.user-list-item {
  padding: 14px 20px;
  border-bottom: var(--line);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-list-item:hover { background: var(--ink-soft); }
.user-item-name { font-size: 15px; font-weight: 400; }
.user-item-meta { font-size: 12px; color: var(--ink-mid); }
.user-item-common {
  font-size: 12px;
  color: var(--ink-mid);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.common-tag {
  border: var(--line);
  padding: 1px 6px;
  font-size: 11px;
}

/* ── PROFILE ── */
#view-profile { flex-direction: column; }
.profile-layout {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 680px;
}

.profile-section { display: flex; flex-direction: column; gap: 12px; }
.profile-section h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-note { font-size: 12px; font-weight: 300; color: var(--ink-mid); letter-spacing: 0.05em; text-transform: none; }
.sec-note-full { font-size: 13px; color: var(--ink-mid); }

.info-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
  border-bottom: var(--line);
}
.info-label { font-size: 12px; color: var(--ink-mid); width: 80px; flex-shrink: 0; }
.info-val { font-size: 15px; }

.tag-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.tag-input-row input { flex: 1; }
.tag-input-row select { width: 80px; flex-shrink: 0; }

.btn-add {
  background: none;
  border: var(--line-strong);
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.btn-add:hover { background: var(--ink); color: var(--paper); }

.tags-container { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--line-strong);
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 300;
}
.tag-p1 { opacity: 0.6; }
.tag-p2 { }
.tag-p3 { background: var(--ink); color: var(--paper); }
.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: inherit;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }

.media-tag { display: flex; gap: 4px; align-items: center; }
.media-type-label {
  font-size: 11px;
  color: var(--ink-mid);
  border: var(--line);
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.slider-row { display: flex; align-items: center; gap: 16px; }
input[type="range"] {
  -webkit-appearance: none;
  background: var(--ink-faint);
  height: 1px;
  width: 200px;
  border: none;
  outline: none;
  padding: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--ink);
  border-radius: 0;
  cursor: pointer;
}
#min-common-val { font-size: 22px; font-family: var(--serif); font-weight: 300; min-width: 20px; }
.slider-label { font-size: 13px; color: var(--ink-mid); }

/* ── CONNECTIONS ── */
.connections-grid {
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.connection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: var(--line);
}
.connection-item > div:first-child { flex: 1; }
.connection-name { font-size: 16px; font-weight: 400; }
.connection-loc { font-size: 13px; color: var(--ink-mid); }
.connection-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.connection-chat-btn {
  background: none;
  border: var(--line-strong);
  padding: 5px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.connection-chat-btn:hover { background: var(--ink); color: var(--paper); }
.connection-remove-btn {
  background: none;
  border: var(--line);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-mid);
  transition: border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}
.connection-remove-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ── NOTIFICATIONS ── */
#requests-list { padding: 0 40px; }
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: var(--line);
  gap: 16px;
}
.request-info { flex: 1; }
.request-name { font-size: 16px; margin-bottom: 2px; }
.request-meta { font-size: 13px; color: var(--ink-mid); }
.request-actions { display: flex; gap: 8px; }
.btn-accept {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.btn-decline {
  background: none;
  border: var(--line-strong);
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  color: var(--ink-mid);
}
.btn-decline:hover { color: var(--ink); }

.empty-state {
  padding: 60px 40px;
  text-align: center;
  color: var(--ink-mid);
  font-size: 15px;
  font-family: var(--serif);
  font-style: italic;
}

/* ── CHAT ── */
#view-chat { flex-direction: row; padding: 0; overflow: hidden; }
#chat-layout { display: flex; width: 100%; height: 100%; }

#chat-sidebar {
  width: 220px;
  border-right: var(--line-strong);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: var(--line-strong);
}

#chat-list { flex: 1; overflow-y: auto; }
.chat-list-item {
  padding: 12px 16px;
  border-bottom: var(--line);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-list-item:hover, .chat-list-item.active { background: var(--ink-soft); }
.chat-list-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
}
.chat-unread-count {
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-weight: 500;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.chat-list-name { font-size: 14px; font-weight: 400; }
.chat-list-preview { font-size: 12px; color: var(--ink-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#chat-header-bar {
  padding: 12px 20px;
  border-bottom: var(--line-strong);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  gap: 2px;
}
.message.mine { align-self: flex-end; align-items: flex-end; }
.message.theirs { align-self: flex-start; align-items: flex-start; }

.date-divider {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 18px 0 10px;
  position: relative;
}
.date-divider::before,
.date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--line);
}
.date-divider::before { left: 0; }
.date-divider::after { right: 0; }

.message-bubble {
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 300;
}
.message.mine .message-bubble { background: var(--ink); color: var(--paper); }
.message.theirs .message-bubble { border: var(--line-strong); background: var(--paper); }

.message-time {
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.05em;
}

#chat-input-bar {
  display: flex;
  border-top: var(--line-strong);
  flex-shrink: 0;
}
#chat-input {
  flex: 1;
  border: none;
  border-right: var(--line-strong);
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 0;
}
#chat-send-btn {
  background: none;
  border: none;
  padding: 0 20px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  color: var(--ink);
}
#chat-send-btn:hover { background: var(--ink); color: var(--paper); }

/* ── MODAL ── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(13,13,13,0.4); }
.modal-box {
  position: relative;
  background: var(--paper);
  border: var(--line-strong);
  width: 440px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp 0.2s ease;
}
@keyframes fadeUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-mid);
}
.modal-header { display: flex; flex-direction: column; gap: 4px; border-bottom: var(--line); padding-bottom: 16px; }
.modal-username { font-family: var(--serif); font-size: 30px; font-weight: 300; font-style: italic; }
.modal-location { font-size: 13px; color: var(--ink-mid); }
.modal-bio { font-size: 15px; line-height: 1.7; color: var(--ink-mid); font-style: italic; overflow-wrap: break-word; word-break: break-word; }
.modal-section { display: flex; flex-direction: column; gap: 8px; }
.modal-section-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.modal-actions { padding-top: 8px; border-top: var(--line); }
.modal-actions .btn-primary { width: auto; display: inline-block; }

.media-list { display: flex; flex-direction: column; gap: 6px; }
.media-item { display: flex; gap: 10px; align-items: center; font-size: 14px; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px;
  font-size: 14px;
  letter-spacing: 0.05em;
  z-index: 9999;
  animation: fadeUp 0.2s ease;
  pointer-events: none;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-faint); }

/* ── UTIL ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--ink-mid);
  font-size: 14px;
  letter-spacing: 0.1em;
}

/* ── MAP MODE TOGGLE ── */
#map-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.map-mode-toggle {
  display: flex;
  gap: 1px;
}
.mode-btn {
  background: var(--paper);
  border: var(--line-strong);
  padding: 5px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  color: var(--ink-mid);
  transition: background var(--transition), color var(--transition);
}
.mode-btn.active {
  background: var(--ink);
  color: var(--paper);
}
.mode-btn:hover:not(.active) {
  background: var(--ink-soft);
  color: var(--ink);
}

/* Helper mode city dot */
.city-dot-helper {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2.5px;
  animation: helper-pulse 2s ease-in-out infinite;
}
@keyframes helper-pulse {
  0%, 100% { stroke-opacity: 1; stroke-width: 2.5px; }
  50% { stroke-opacity: 0.45; stroke-width: 1.5px; }
}


/* ── HELP REQUEST TAGS (profile) ── */
.help-request-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: var(--line-strong);
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 300;
}
.help-active {
  border-style: solid;
  background: var(--ink-soft);
}
.help-inactive {
  border-style: dashed;
  opacity: 0.5;
}
.tag-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: inherit;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}
.tag-toggle:hover { opacity: 1; }

/* ── HELP TAGS (city panel & modal) ── */
.help-tag {
  border-style: dashed !important;
}
.help-tag-modal {
  display: inline-flex;
  align-items: center;
  border: 1px dashed var(--ink);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 300;
  margin: 2px 3px 2px 0;
}
.user-item-help-label {
  font-size: 10px;
  color: var(--ink-mid);
  letter-spacing: 0.05em;
  margin-top: 3px;
}

/* ── HELPER PILL on user list items ── */
.user-item-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.user-helper-pill {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px dashed var(--ink);
  padding: 1px 6px;
  color: var(--ink-mid);
  white-space: nowrap;
  line-height: 1.6;
}

.request-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ═══════════════════════════════════════════
   MOBILE / RESPONSIVE
═══════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.2s;
}

/* Mobile drawer */
#mobile-nav-drawer {
  position: fixed;
  top: 44px;
  left: 0; right: 0;
  background: var(--paper);
  border-bottom: var(--line-strong);
  z-index: 200;
  display: flex;
  flex-direction: column;
}
#mobile-nav-drawer.hidden { display: none; }
.mobile-nav-btn {
  background: none;
  border: none;
  border-bottom: var(--line);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
  padding: 14px 24px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-nav-btn.active { color: var(--ink); background: var(--ink-soft); }
.mobile-nav-btn:hover { color: var(--ink); }
.mobile-signout { color: var(--ink-mid); font-size: 12px; }

/* Sidebar toggle in chat header — hidden on desktop */
#sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-mid);
  padding: 0 8px 0 0;
  line-height: 1;
}

@media (max-width: 640px) {
  /* Nav: hide links, show hamburger */
  .nav-links { display: none; }
  .nav-signout { display: none; }
  .nav-hamburger { display: flex; }
  .nav-brand { margin-right: 0; }
  #main-nav { padding: 0 16px; }

  /* Chat: sidebar slides in from left as overlay */
  #chat-layout { position: relative; flex-direction: row; }

  #chat-sidebar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 75vw;
    max-width: 280px;
    z-index: 50;
    border-right: var(--line-strong);
    transform: translateX(0);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.12);
    background: var(--paper);
  }
  #chat-sidebar.collapsed {
    transform: translateX(-100%);
    box-shadow: none;
  }

  /* Dim overlay behind sidebar */
  #chat-sidebar-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 49;
  }
  #chat-sidebar-overlay.visible { display: block; }

  #chat-main { flex: 1; min-height: 0; width: 100%; }

  #sidebar-toggle-btn { display: block; }

  /* Make map city panel full-width on mobile */
  #city-panel {
    width: 100%;
    right: 0;
    left: 0;
    bottom: 0;
    top: auto;
    max-height: 55vh;
    border-top: var(--line-strong);
    border-left: none;
  }

  /* Modal full screen on mobile */
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  /* Profile layout single column */
  .profile-layout { padding: 16px; }

  /* Connections grid single col */
  .connections-grid { grid-template-columns: 1fr !important; }
}

/* ── LOCATION AUTOCOMPLETE ── */
.location-field { position: relative; }
.location-dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 0; right: 0;
  background: var(--paper);
  border: var(--line-strong);
  border-top: none;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}
.loc-option {
  padding: 9px 14px;
  font-size: 13px;
  font-family: var(--mono);
  cursor: pointer;
  border-bottom: var(--line);
  color: var(--ink);
}
.loc-option:last-child { border-bottom: none; }
.loc-option:hover { background: var(--ink-soft); }
.loc-empty { color: var(--ink-mid); cursor: default; }
.location-selected {
  font-size: 11px;
  color: var(--ink-mid);
  margin-top: 5px;
  letter-spacing: 0.05em;
}

/* ── SUGGESTION DROPDOWNS ── */
.suggest-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: var(--line-strong);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
}
.suggest-opt {
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--mono);
  cursor: pointer;
  border-bottom: var(--line);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-opt:last-child { border-bottom: none; }
.suggest-opt:hover { background: var(--ink-soft); }
