.map { width: 100%; height: 320px; border-radius: 8px; border: 1px solid var(--border); }
.city-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: stretch;
}
.city-map-panel, .city-summary { min-width: 0; }
.city-map {
  min-height: 520px;
  height: clamp(420px, 56vh, 680px);
}
.geo-source-map {
  min-height: 320px;
  height: 340px;
  margin-bottom: 1rem;
}
.geo-source-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.geo-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.geo-source-main { min-width: 0; }
.geo-source-error { color: var(--amber); overflow-wrap: anywhere; }
.geo-source-edit { grid-column: 1 / -1; margin: 0; }
.geo-source-edit-grid {
  display: grid;
  grid-template-columns: 110px 180px auto auto;
  gap: 0.5rem;
  align-items: end;
}
.geo-source-edit-grid label { margin-top: 0; }
.geo-source-new { margin-top: 1rem; }
.geo-source-new summary {
  cursor: pointer;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.detail-list { margin: 0; }
.detail-list div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}
.detail-list dt {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.city-place-list { display: flex; flex-direction: column; gap: 0.45rem; }
.neighborhood-list { display: flex; flex-direction: column; gap: 0.5rem; }
.neighborhood-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.neighborhood-thumb { align-self: stretch; min-height: 4rem; }
.neighborhood-main { min-width: 0; }
.neighborhood-desc {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.86rem;
}
.neighborhood-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.city-place-row {
  display: grid;
  grid-template-columns: 2rem 4rem minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.place-pin,
.map-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(91, 157, 255, 0.32);
}
.map-pin {
  border: 2px solid #fff;
  cursor: pointer;
}
.place-pin.is-muted {
  background: var(--border);
  color: var(--muted);
  box-shadow: none;
}
.place-thumb {
  width: 4rem;
  height: 4rem;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  background: var(--border);
  border: 1px solid var(--border);
}
.place-thumb:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.place-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.place-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel);
  font-weight: 800;
}
.place-row-main { min-width: 0; }
.place-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}
.place-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.84rem;
}
.place-row-meta span { overflow-wrap: anywhere; }
.place-row-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 0.82rem;
}
.mapped-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
}
.mapboxgl-popup-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.mapboxgl-popup-tip { border-top-color: var(--panel) !important; }
.map-popup { min-width: 180px; max-width: 260px; }
.map-popup a { font-weight: 800; }
.map-popup-meta, .map-popup-address {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.city-hero { width: 100%; max-height: 280px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }

.image-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; margin-top: 0.5rem; }
.image-sort-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.image-sort-item {
  display: grid;
  grid-template-columns: 3rem 7rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
}
.image-sort-item.dragging {
  opacity: 0.58;
  border-color: var(--accent);
}
.image-sort-item.marked-delete {
  opacity: 0.46;
}
.image-sort-item.marked-delete,
.gallery-edit-item.marked-delete {
  border-color: var(--red);
}
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 4.7rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-right: 1px solid var(--border);
}
.image-sort-preview {
  width: 7rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--border);
}
.image-sort-preview img,
.image-sort-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  color: var(--muted);
  font-size: 0.78rem;
}
.image-sort-meta {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}
.image-delete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
}
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }

.image-modal {
  position: relative;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  max-width: 94vw;
  max-height: 94vh;
  overflow: visible;
}
.image-modal::backdrop { background: rgba(0, 0, 0, 0.82); }
.image-modal img {
  display: block;
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 10px;
}
.modal-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}


.unassigned-places-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.unassigned-place-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.completeness-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.completeness-group h4 { margin: 0 0 0.5rem; }
.completeness-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.completeness-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.completeness-item-link { font-size: 0.85em; }
