* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
}

body { display: flex; }

#sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  background: #fff;
}

#sidebar header { padding: 16px; border-bottom: 1px solid #e5e7eb; }
#sidebar h1 { font-size: 18px; margin: 0 0 4px; }

.hint { color: #6b7280; margin: 0 0 12px; }
#empty { padding: 16px; }

#search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
}

#list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }

#list li {
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}
#list li:hover, #list li.active { background: #eff6ff; }
#list .title { font-weight: 600; }
#list .desc {
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#map { flex: 1; height: 100%; }

/* Попапы */
.place-form { display: flex; flex-direction: column; gap: 6px; width: 240px; }
.place-form input, .place-form textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font: inherit;
}
.place-form textarea { min-height: 80px; resize: vertical; }

.place-view { max-width: 260px; }
.place-view h3 { margin: 0 0 6px; font-size: 15px; }
.place-view p { margin: 0 0 8px; white-space: pre-wrap; }
.place-view .coords { color: #9ca3af; font-size: 12px; }

.actions { display: flex; gap: 6px; margin-top: 4px; }
.actions button {
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.actions button.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.actions button.danger { color: #dc2626; }
.actions button.danger.confirm { background: #dc2626; border-color: #dc2626; color: #fff; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 1000;
}
#toast.show { opacity: .9; }

@media (max-width: 700px) {
  body { flex-direction: column-reverse; }
  #sidebar { width: 100%; height: 40%; border-right: 0; border-top: 1px solid #e5e7eb; }
  #map { height: 60%; }
}
