.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
/* Cleanup R8: the Sources details/avatar pair wraps to one column as soon as
   two ~26rem panels stop fitting, instead of overflowing until 720px. */
.source-panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 720px) {
  .grid-2, .grid-3, .gate-tools, .city-layout, .geo-source-row, .geo-source-edit-grid { grid-template-columns: 1fr; }
  .workflow-main-grid,
  .workflow-main-grid.has-gate { grid-template-columns: 1fr; }
  .signal-row { grid-template-columns: 1fr; gap: 0.15rem; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-actions { align-items: stretch; flex-direction: column; }
  .page-head, .panel-head { flex-direction: column; }
  .image-sort-item { grid-template-columns: 1fr; align-items: stretch; }
  .drag-handle { min-height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
  .image-sort-preview { width: 100%; }
  .city-map { min-height: 360px; height: 420px; }
  .neighborhood-row { grid-template-columns: 4rem minmax(0, 1fr); }
  .neighborhood-row .btn { grid-column: 2; justify-self: start; }
  .city-place-row { grid-template-columns: 2rem 4rem minmax(0, 1fr); }
  .place-row-main { grid-column: 3; }
  .place-row-status, .city-place-row .btn { grid-column: 3; justify-self: start; }
}

.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.review { border-top: 1px solid var(--border); padding: 0.85rem 0; }
.review:first-child { border-top: 0; padding-top: 0.25rem; }
.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.review-meta { display: flex; gap: 0.6rem; align-items: center; }
.review-actions {
  flex: none;
  align-items: center;
}
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-logo {
  width: 18px; height: 18px; border-radius: 3px; object-fit: contain;
  vertical-align: text-bottom; margin-right: 0.25rem;
}
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem; font-weight: 600;
}
.avatar-logo-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.62rem; font-weight: 700;
}
.review blockquote {
  margin: 0.5rem 0 0.4rem;
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
}
.review-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; display: block; cursor: zoom-in; }
.gallery-editor { margin-top: 0.75rem; }
.gallery-edit-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.gallery-edit-item {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: hidden;
  cursor: grab;
}
.gallery-edit-item.dragging {
  opacity: 0.6;
  border-color: var(--accent);
}
.gallery-edit-item.marked-delete {
  opacity: 0.48;
}
.gallery-edit-item img {
  height: 150px;
  border-radius: 0;
  cursor: grab;
}
.gallery-edit-topline {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  right: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: flex-start;
  pointer-events: none;
}
.gallery-edit-topline .badge,
.drag-chip {
  background: rgba(16, 20, 28, 0.88);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.drag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.gallery-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem;
}
.gallery-delete-toggle {
  white-space: nowrap;
}
.gallery-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}
