.map-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 20px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 4px;
  border: 1px solid rgba(38,51,31,0.25);
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}
.search-box input:focus { border-color: var(--rust); outline: none; }

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(38,51,31,0.15);
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(38,51,31,0.15);
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
}
.search-results.show { display: block; }

.search-result {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(38,51,31,0.08);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--cream-dark); }
.search-result .result-sub { color: var(--muted); font-size: 0.78rem; }

.search-status {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

#addSiteBtn.secondary {
  background: transparent;
  border: 1px solid rgba(38,51,31,0.25);
  color: var(--forest);
}
#addSiteBtn.secondary:hover { background: rgba(38,51,31,0.06); }

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.map-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid rgba(38,51,31,0.15);
  border-radius: 100px;
  padding: 7px 14px 7px 10px;
  cursor: pointer;
  user-select: none;
}

.filter-chip input {
  accent-color: var(--rust);
  margin: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot.tent { background: #2f4229; }
.dot.hotel { background: #6b8f4e; }
.dot.want { background: var(--rust); }

.type-select {
  padding: 8px 12px;
  border-radius: 100px;
  border: 1px solid rgba(38,51,31,0.15);
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: inherit;
}

.map-error {
  display: none;
  max-width: 1100px;
  margin: 0 auto 16px;
  background: #f6e6e0;
  color: #8a3a22;
  border: 1px solid rgba(138,58,34,0.3);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 0.85rem;
}

#addSiteBtn {
  background: var(--rust);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
}
#addSiteBtn:hover { background: var(--rust-dark); }
#addSiteBtn.active { background: var(--forest); }

#map {
  height: 60vh;
  min-height: 420px;
  border-radius: 6px;
  border: 1px solid rgba(38,51,31,0.15);
  box-shadow: 0 8px 24px rgba(38,51,31,0.08);
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.map-hint {
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--rust-dark);
  min-height: 1.4em;
}

.map-note {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38,51,31,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.modal-backdrop.show { display: flex; }

.modal {
  background: var(--cream);
  border-radius: 6px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px 28px;
  position: relative;
}

.modal h2 {
  color: var(--forest);
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.modal .status-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 16px;
  color: #fff;
}
.status-tag.tent { background: #2f4229; }
.status-tag.hotel { background: #6b8f4e; }
.status-tag.want { background: var(--rust); }

.type-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 16px;
  color: var(--forest);
  background: rgba(38,51,31,0.08);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.modal label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--forest);
  margin: 16px 0 6px;
}

.modal input[type=text], .modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(38,51,31,0.25);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}

.modal textarea { resize: vertical; min-height: 70px; }

.radio-row { display: flex; gap: 18px; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }

.field-value {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-actions button {
  flex: 1;
  padding: 11px;
  border-radius: 3px;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.btn-save { background: var(--rust); color: #fff; }
.btn-save:hover { background: var(--rust-dark); }
.btn-cancel { background: transparent; border: 1px solid rgba(38,51,31,0.3) !important; color: var(--forest); }
.btn-delete { background: transparent; color: #a5432a; border: 1px solid rgba(165,67,42,0.4) !important; }
.btn-edit { background: var(--forest); color: #fff; }
.btn-edit:hover { background: var(--forest-light); }
