html, body { margin: 0; padding: 0; height: 100%; }
#map { width: 100%; height: 100vh; }

/* Legend container — anchored bottom-left */
.lu-legend-wrap {
  position: absolute;
  bottom: 36px;
  left: 10px;
  z-index: 10;
}

/* Collapsed state: small icon button */
.lu-legend-icon {
  display: none;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 18px;
  line-height: 34px;
  text-align: center;
  color: #333;
}
.lu-legend-wrap.collapsed .lu-legend-icon { display: block; }
.lu-legend-wrap.collapsed .lu-legend { display: none; }

/* Expanded legend panel */
.lu-legend {
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}
.lu-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.lu-legend-title {
  font-weight: 600;
  font-size: 13px;
}
.lu-legend-collapse {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 10px;
}
.lu-legend-collapse:hover { color: #222; }

.lu-swatch {
  display: flex;
  align-items: center;
  margin: 3px 0;
  line-height: 1.3;
}
.lu-swatch span {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  margin-right: 7px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}
.lu-attr {
  margin-top: 8px;
  font-size: 10px;
  color: #888;
  text-align: right;
}
.lu-attr a { color: #555; text-decoration: none; }

.lu-tooltip {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
