/* map.css */
body.mbody {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  font-family: var(--font-main);
  overflow: hidden;
}

.map-page {
  position: relative;
  flex: 1;
  padding-bottom: var(--bottom-nav-height);
}

/* MAP */
#map,
.leaflet-container {
  width: 100%;
  height: 100%;
}

#map {
  position: relative;
  z-index: 1;
}

/* SEARCH — survives refresh, clears zoom */
.map-search {
  position: absolute;
  top: var(--space-md);
  left: calc(var(--space-md) + 56px);
  right: var(--space-md);
  z-index: 4;
  pointer-events: auto;
}

.map-search input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 14px;
}

/* OFFLINE OVERLAY — persistent, CSS-driven */
.map-offline {
  position: absolute;
  inset: 0;
  background: rgba(245, 246, 248, 0.96);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.map-offline p {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.map-offline span {
  font-size: 13px;
  color: var(--text-muted);
}

/* AGENT CARD */
.agent-map-card {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bottom-nav-height);
  padding: var(--space-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: calc(var(--z-nav) + 1);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.agent-card-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-right: 36px;
}

.agent-card-header h3 {
  font-size: 18px;
  color: var(--text-main);
  flex: 1;
}

/* STATUS */
.agent-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.agent-card-status.open {
  background: rgba(27, 143, 58, 0.12);
  color: var(--color-success);
}

.agent-card-status.closed {
  background: rgba(180, 38, 38, 0.12);
  color: var(--color-danger);
}

.agent-card-body {
  display: grid;
  gap: 6px;
}

.agent-card-body p {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-muted);
}

/* Emphasise cash truth */
.agent-card-body p:first-child {
  font-weight: 600;
  color: var(--text-main);
}

/* Time feels secondary */
.agent-card-body p:nth-child(2) {
  font-size: 12px;
  opacity: 0.85;
}

/* Networks as soft chips */
.agent-card-body p:last-child {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

#locateMeBtn {
  position: fixed;
  right: 16px;
  bottom: 96px;
  /* above bottom nav */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
}

#locateMeBtn::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px solid #1a73e8;
}

#locateMeBtn::after {
  content: "";
  position: absolute;
  inset: 20px;
  background: #1a73e8;
  border-radius: 50%;
}

#locateMeBtn:active {
  transform: scale(0.95);
}


/* BOTTOM NAV */
.bottom-nav {
  border-radius: 0;
  box-shadow: none;
}

.bottom-nav.flat {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: none;
}

[hidden] {
  display: none !important;
}

/* Locate button reacts to card */
#locateMeBtn {
  transition: bottom 0.25s ease;
}

.agent-map-card.measuring {
  visibility: hidden;
  display: block;
}

/* FIX: Leaflet marker i

(user location blue pin) */
.leaflet-container img,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  max-width: none !important;
  max-height: none !important;
  box-sizing: content-box !important;
}

/* Force user location marker to be visible */
.leaflet-userPane-pane .leaflet-marker-icon {
  visibility: visible !important;
  display: block !important;
}