.gm-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 0 1.5rem;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gm-inner {
  --gm-bg: var(--panel, #050814);
  --gm-border: var(--line, #1f2937);
  --gm-text: var(--text, #e5e7eb);

  position: relative;
  width: 100%;
  max-width: 1200px;
  background: var(--gm-bg);
  border-radius: 12px;
  border: 1px solid var(--gm-border);
  padding: 8px;
  box-sizing: border-box;
  color: var(--gm-text);
}

.gm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
  opacity: 0.9;
}

.gm-title {
  font-weight: 500;
}

.gm-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gm-sidebar {
  width: 20rem;
  max-width: 40%;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 75vh;
}

.gm-search {
  margin-bottom: 2px;
}

.gm-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: var(--gm-text);
  font-size: 11px;
}

.gm-legend-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gm-legend-button {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--gm-text);
}

.gm-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-group {
  border-top: 1px solid rgba(55, 65, 81, 0.9);
  padding-top: 4px;
}

.gm-group:first-of-type {
  border-top: none;
}

.gm-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
}

.gm-group-header-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gm-group-label {
  font-weight: 500;
  font-size: 11px;
}

.gm-group-count {
  font-size: 10px;
  opacity: 0.8;
}

.gm-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.gm-cat {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding-left: 14px;
}

.gm-cat input[type="checkbox"] {
  margin: 0;
  width: 10px;
  height: 10px;
}

/* Legend icon/dot */
.gm-cat-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #9ca3af;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.gm-cat-label {
  white-space: nowrap;
}

.gm-cat-count {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.8;
}

.gm-map {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 75vh;
  border-radius: 8px;
  overflow: hidden;
}

/* Zone selector (top-right) */
.gm-zone-switcher {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 2px 6px;
  font-size: 11px;
}

.gm-zone-switcher select {
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 11px;
  outline: none;
}

/* Mouse coordinates (bottom-left) */
.gm-coords {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 2px 8px;
  font-size: 10px;
  pointer-events: none;
  color: #e5e7eb;
  min-width: 90px;
  text-align: left;
}

.leaflet-container {
  background: #262626;
}

.gm-error {
  font-size: 12px;
  color: #f97373;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .gm-body {
    flex-direction: column;
  }
  .gm-sidebar {
    width: 100%;
    max-width: 100%;
    max-height: 200px;
  }
}
