/* Interactive plat map (renderer in assets/js/map-render.js). Used by the staff
   preview and, later, the public map/embed. */

.pm-map {
  --pm-bg: #f4f2ec;
  --pm-surface: #ffffff;
  --pm-text: #1f2328;
  --pm-muted: #66707c;
  --pm-border: #d9dde2;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  background: var(--pm-bg);
  border: 1px solid var(--pm-border);
  border-radius: 10px;
  overflow: hidden;
  color: var(--pm-text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.pm-stage { position: relative; flex: 1; min-height: 360px; }
.pm-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
.pm-svg.pm-panning { cursor: grabbing; }

.pm-lot { cursor: pointer; outline: none; }
.pm-lot-shape {
  fill: var(--lot);
  fill-opacity: .55;
  stroke: #3d434b;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill-opacity .12s;
}
.pm-lot:hover .pm-lot-shape, .pm-lot:focus-visible .pm-lot-shape { fill-opacity: .8; }
.pm-lot.pm-selected .pm-lot-shape { fill-opacity: .9; stroke: #111; stroke-width: 2.5; }
.pm-lot:focus-visible .pm-lot-shape { stroke: #111; stroke-width: 2.5; }
.pm-lots-inactive { pointer-events: none; }
.pm-inactive-shape { fill: #cfd3d8; fill-opacity: .7; stroke: #3d434b; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pm-lot-label { fill: #1f2328; font-weight: 600; pointer-events: none; paint-order: stroke; stroke: rgba(255, 255, 255, .7); stroke-width: .15em; }
.pm-obj { pointer-events: none; }

.pm-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.pm-zoom button {
  width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1;
  background: var(--pm-surface); color: var(--pm-text); border: 1px solid var(--pm-border); border-radius: 6px; cursor: pointer;
}

.pm-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: rgba(20, 23, 27, .9); color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 13px; white-space: nowrap;
}

.pm-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px;
  background: var(--pm-surface); border-top: 1px solid var(--pm-border); font-size: 13px;
}
.pm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pm-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.pm-panel {
  position: absolute; top: 10px; left: 10px; bottom: 50px; width: min(320px, calc(100% - 70px)); overflow: auto; z-index: 3;
  background: var(--pm-surface); border: 1px solid var(--pm-border); border-radius: 8px; padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.pm-panel h3 { margin: 0 0 6px; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 24px; }
.pm-panel p { margin: 0 0 10px; }
.pm-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; }
.pm-panel dt { color: var(--pm-muted); }
.pm-panel dd { margin: 0; }
.pm-panel .pm-close { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--pm-muted); }
.pm-status { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--c); }
.pm-images { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; margin: 0 0 10px; border-radius: 6px; }
.pm-images img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; border-radius: 6px; }
.pm-links { display: flex; flex-direction: column; gap: 4px; }
.pm-muted { color: var(--pm-muted); }

@media (max-width: 600px) {
  .pm-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 60%; border-radius: 12px 12px 0 0; }
}

/* Search / filter bar and calls to action (public map) */
.pm-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--pm-surface); border-bottom: 1px solid var(--pm-border);
}
.pm-toolbar input, .pm-toolbar select {
  font: inherit; color: var(--pm-text); background: var(--pm-surface);
  border: 1px solid var(--pm-border); border-radius: 6px; padding: 6px 9px;
}
.pm-toolbar input { flex: 1 1 180px; min-width: 0; }
.pm-count { color: var(--pm-muted); font-size: 13px; }
.pm-contact { margin-left: auto; }
.pm-cta {
  font: inherit; font-weight: 600; cursor: pointer; padding: 8px 14px; border-radius: 6px;
  border: 1px solid #2f6f4f; background: #2f6f4f; color: #fff;
}
.pm-panel .pm-cta { width: 100%; margin-top: 8px; }
.pm-lot.pm-dim { opacity: .2; }
.pm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Saved copy in use (PocketBase unreachable) */
.pm-offline { padding: 7px 12px; background: #fffaeb; color: #93370d; border-bottom: 1px solid #f5d79e; font-size: 13px; }
