/* Panel interaction & no-overlap rules (mobile + general) */

/* Panel must sit above the map so the toilet list is visible */
.panel {
  z-index: 40 !important;
  pointer-events: auto;
}

.panel .list {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 100px;
}

/* Collapsed still hides list intentionally */
.panel.collapsed .list {
  display: none !important;
}

.search-area {
  z-index: 14;
}

body.panel-expanded .search-area {
  display: none !important;
}

.handle {
  width: 56px;
  height: 6px;
  margin: 8px auto 2px;
  background: var(--muted);
  opacity: 0.55;
  border-radius: 999px;
  position: relative;
  touch-action: none;
  cursor: grab;
  flex-shrink: 0;
}
.handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 44px;
}
.handle:active {
  opacity: 0.9;
  cursor: grabbing;
}

.panel-actions .mini-btn {
  min-height: 36px;
  min-width: 64px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

@media (max-width: 859px) {
  .panel {
    max-height: 42vh;
    min-height: 200px;
  }
  .panel.expanded {
    max-height: min(72vh, calc(100dvh - 100px));
    min-height: 280px;
  }
  .panel.collapsed {
    max-height: 72px;
    min-height: 72px;
  }

  body.panel-expanded .fab-stack {
    bottom: calc(min(72vh, calc(100dvh - 100px)) + 12px) !important;
  }
  body.panel-mid .fab-stack {
    bottom: calc(42vh + 12px) !important;
  }
  body.panel-collapsed .fab-stack {
    bottom: calc(76px + 12px) !important;
  }

  .panel {
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  }
}

@media (min-width: 860px) {
  body.panel-expanded .search-area {
    display: block !important;
  }
}
