/* Parking Lot Map (2026-10-12) — satellite lot map with tappable stalls.
   Scoped to #parkingLotOverlay so nothing else on the board is restyled. */

#parkingLotOverlay .lot-box {
  width: min(1120px, 97vw);
  height: min(880px, 94vh);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

/* The scoped rules below set display on elements that also carry the
   `hidden` attribute (focus bar, tile note, edit buttons) — without this
   guard the author display beats the UA's [hidden] rule and they show. */
#parkingLotOverlay [hidden] { display: none !important; }

#parkingLotOverlay .lot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 52px 10px 16px;
  border-bottom: 1px solid var(--line, #2a2f38);
  flex-wrap: wrap;
}
#parkingLotOverlay .lot-head h1 { margin: 0 0 2px; font-size: calc(20px * var(--font-scale, 1)); }
#parkingLotOverlay .lot-sub { font-size: calc(12px * var(--font-scale, 1)); color: var(--muted, #9aa3af); max-width: 560px; line-height: 1.45; }
#parkingLotOverlay .lot-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#parkingLotOverlay .lot-search {
  min-height: 44px; min-width: 190px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line, #2a2f38); background: rgba(255,255,255,0.05); color: inherit;
  font-size: calc(14px * var(--font-scale, 1));
}
#parkingLotOverlay .lot-head-actions .btn { min-height: 44px; }
#parkingLotOverlay .lot-edit-on { background: #ffb020; border-color: #ffb020; color: #14100a; font-weight: 700; }

#parkingLotOverlay .lot-focusbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(255, 176, 32, 0.16);
  border-bottom: 1px solid #ffb020; font-size: calc(14px * var(--font-scale, 1));
}
#parkingLotOverlay .lot-focusbar .btn { min-height: 40px; }

#lotMap {
  flex: 1 1 auto;
  min-height: 300px;
  background: #14181d;
  z-index: 1;
}
#parkingLotOverlay .lot-tile-note {
  padding: 8px 16px; font-size: calc(12.5px * var(--font-scale, 1));
  background: rgba(255, 90, 90, 0.14); border-bottom: 1px solid rgba(255,90,90,0.5);
}

#parkingLotOverlay .lot-panel {
  border-top: 1px solid var(--line, #2a2f38);
  padding: 12px 16px 14px;
  min-height: 86px;
  font-size: calc(14px * var(--font-scale, 1));
  line-height: 1.5;
}
#parkingLotOverlay .lot-panel h3 { margin: 0 0 4px; font-size: calc(16px * var(--font-scale, 1)); }
#parkingLotOverlay .lot-panel .lot-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
#parkingLotOverlay .lot-panel .btn { min-height: 46px; padding: 10px 16px; }
#parkingLotOverlay .lot-free { color: #37c978; font-weight: 700; }
#parkingLotOverlay .lot-occ { color: #ffb020; font-weight: 700; }
#parkingLotOverlay .lot-unassigned { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
#parkingLotOverlay .lot-car-chip {
  min-height: 44px; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line, #2a2f38); background: rgba(255,255,255,0.06); color: inherit;
  font-size: calc(13px * var(--font-scale, 1));
}
#parkingLotOverlay .lot-car-chip:active { background: rgba(255,176,32,0.25); }
#parkingLotOverlay .lot-assign-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
#parkingLotOverlay .lot-assign-row select {
  min-height: 46px; max-width: 100%; padding: 8px; border-radius: 8px;
  border: 1px solid var(--line, #2a2f38); background: rgba(255,255,255,0.05); color: inherit;
  font-size: calc(14px * var(--font-scale, 1));
}
#parkingLotOverlay .lot-edit-fields { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
#parkingLotOverlay .lot-edit-fields input {
  min-height: 44px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line, #2a2f38); background: rgba(255,255,255,0.05); color: inherit;
  font-size: calc(14px * var(--font-scale, 1));
}
#parkingLotOverlay .lot-edit-fields label { font-size: calc(12px * var(--font-scale, 1)); color: var(--muted, #9aa3af); display: flex; flex-direction: column; gap: 4px; }

/* Stall labels rendered as Leaflet divIcons. */
.lot-pin {
  background: rgba(10, 14, 18, 0.72);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 6px;
  color: #fff;
  padding: 1px 5px;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}
.lot-pin b { display: block; font-size: 12px; letter-spacing: 0.04em; }
.lot-pin span { display: block; font-size: 9.5px; color: #ffd37a; max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
.lot-pin.free { border-color: rgba(55, 201, 120, 0.8); }
.lot-pin.free b { color: #b9f4d2; }

.lot-corner {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid #ffb020;
  transform: translate(-50%, -50%);
  cursor: nwse-resize;
  box-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

@keyframes lotFlashAnim {
  0%, 100% { stroke: #ffffff; stroke-width: 3; }
  50% { stroke: #ffb020; stroke-width: 7; }
}
.lot-flash { animation: lotFlashAnim 0.7s ease-in-out 4; }

@media (max-width: 820px) {
  #parkingLotOverlay .lot-box { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  #parkingLotOverlay .lot-search { min-width: 140px; flex: 1; }
  #lotMap { min-height: 240px; }
}
