

.map-app {
  position: relative;
  height: calc(100vh - 55px); 
  height: calc(100dvh - 55px);
  overflow: hidden;
}


.sidebar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: min(340px, 94vw);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border-right: 1px solid var(--border);
  box-shadow: var(--glass-highlight), 8px 0 34px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 20;
  min-height: 0;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.sidebar-head h1 { font-size: 1.05rem; margin: 0; }
.sidebar-controls {
  padding: 0 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}


.dropdown { position: relative; }
.dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.dropdown-btn:hover { background: rgba(255, 255, 255, 0.09); }
.dropdown-btn .fa-chevron-down { font-size: 0.7rem; color: var(--muted); transition: transform 0.15s ease; }
.dropdown.open .dropdown-btn .fa-chevron-down { transform: rotate(180deg); }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--glass-highlight), var(--shadow);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.dropdown-option:hover { background: rgba(255, 255, 255, 0.08); }
.dropdown-option.selected { background: rgba(255, 255, 255, 0.12); }
.sidebar-list { flex: 1; overflow-y: auto; padding: 10px 10px 14px; min-height: 0; }
.sidebar-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.loc-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition: background 0.1s ease;
}
.loc-item:hover { background: rgba(255, 255, 255, 0.07); }
.loc-item.active { background: rgba(255, 255, 255, 0.1); border-color: var(--border); }
.loc-item .row1 { display: flex; align-items: center; gap: 8px; }
.loc-item .nm { font-weight: 600; font-size: 0.92rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-item .row2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.loc-item .swatch { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; border: 1px solid var(--border); }
.loc-item .loc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.loc-item .loc-thumb {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: transform 0.12s ease;
}
.loc-item:hover .loc-thumb { transform: scale(1.04); }
.loc-item .loc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loc-item .loc-thumb .fa-location-dot { font-size: 1rem; }

.empty-state { color: var(--muted); text-align: center; padding: 30px 12px; font-size: 0.9rem; }


.map-wrap { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; }


#map canvas { filter: var(--map-tint, none); transition: filter 0.35s ease; }

.sidebar-toggle {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 10;
  display: none;
  padding: 0 12px;
  width: auto;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle i { margin-right: 6px; }
.sidebar-close { display: none; }

.map-toolbar {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 7px;
  box-shadow: var(--glass-highlight), var(--shadow);
  transition: right 0.22s ease;
}
.map-app.detail-open .map-toolbar { right: 396px; }
.tool {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 11px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.tool i { margin-right: 7px; width: 16px; text-align: center; }
.tool:hover { background: rgba(255, 255, 255, 0.09); }
.tool.active { background: rgba(255, 255, 255, 0.12); border-color: var(--border); color: var(--accent); }
.tool-divider { height: 1px; background: var(--border); margin: 3px 4px; }

.draw-bar {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--glass-highlight), var(--shadow);
  font-size: 0.9rem;
  max-width: 92vw;
}


.detail {
  position: absolute;
  top: 0; right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  border-left: 1px solid var(--border);
  box-shadow: var(--glass-highlight), -12px 0 40px rgba(0, 0, 0, 0.45);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.detail.open { transform: translateX(0); }
.detail-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
}
.detail-inner { padding: 20px; }
.detail-hero { margin-bottom: 14px; padding-right: 30px; }
.detail-name { font-size: 1.4rem; margin: 6px 0 10px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.detail-measure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}
.detail-measure i { color: var(--accent-2); }
.detail-section { margin-top: 16px; }
.detail-section h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 6px; }
.detail-desc { color: var(--text); }
.detail-media { display: grid; gap: 10px; }
.detail-media figure { margin: 0; }
.detail-media img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.detail-media figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }


.detail-photo {
  position: relative;
  margin: 0 0 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.35);
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 46%);
  pointer-events: none;
}
.detail-photo-zoom {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff; font-size: 0.9rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.detail-photo:hover .detail-photo-zoom { transform: scale(1.08); background: rgba(0, 0, 0, 0.7); }
.detail-photo-caption {
  position: absolute; left: 12px; bottom: 10px; z-index: 1;
  color: #fff; font-size: 0.8rem; font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  max-width: calc(100% - 24px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-meta { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.detail-actions { display: flex; gap: 8px; margin-top: 20px; }


.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row .u-info { flex: 1; min-width: 0; }
.user-row .u-name { font-weight: 600; }
.user-row .u-email { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


@media (max-width: 900px) {
  .sidebar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--glass-highlight), var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-close { display: inline-flex; }
  .detail { width: 340px; }
  .map-app.detail-open .map-toolbar { right: 14px; }
}


@media (max-width: 760px) {
  
  .map-toolbar {
    top: 10px; right: 10px;
    padding: 5px;
    gap: 3px;
    border-radius: 12px;
  }
  .tool {
    padding: 8px;
    font-size: 1rem;
    border-radius: 9px;
  }
  .tool-label { display: none; }
  .tool i { margin-right: 0; width: auto; }
  .tool-divider { margin: 2px 4px; }

  
  .detail {
    width: 100%;
    max-width: 100vw;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .detail-inner { padding: calc(16px + env(safe-area-inset-top)) 16px calc(80px + env(safe-area-inset-bottom)); }
  .detail-close {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
  }
  .detail-hero { padding-right: 44px; }

  
  .sidebar-toggle { top: 10px; left: 10px; }

  
  .draw-bar {
    bottom: calc(76px + env(safe-area-inset-bottom));
    gap: 8px;
    padding: 8px 10px;
  }

  
  .maplibregl-ctrl-bottom-left,
  .maplibregl-ctrl-bottom-right { bottom: calc(66px + env(safe-area-inset-bottom)); }
}


body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 4, 6, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  animation: lightbox-in 0.18s ease;
}
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lightbox-zoomable {
  display: inline-block;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.lightbox-zoomable img {
  max-width: 92vw;
  max-height: calc(100vh - 140px);
  display: block;
  border-radius: 8px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.75);
}
.lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
}
.lightbox-caption {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-controls { display: flex; gap: 8px; flex: 0 0 auto; }
.lightbox-controls .icon-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.lightbox-controls .icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
